From 9aee6674bb1ffca1057de2c14b5ae79d6d4b875a Mon Sep 17 00:00:00 2001 From: Foxies Date: Thu, 22 Oct 2020 02:00:57 +0200 Subject: [PATCH 001/443] FLSUN Delta QQS-Pro pins (#19793) --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 366 ++++++++++++++++++ .../share/PlatformIO/scripts/add_nanolib.py | 2 + platformio.ini | 15 + 5 files changed, 386 insertions(+) create mode 100644 Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h create mode 100644 buildroot/share/PlatformIO/scripts/add_nanolib.py diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 1854e42ec27e..e11590334299 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -325,6 +325,7 @@ #define BOARD_CREALITY_V427 4036 // Creality v4.2.7 (STM32F103RE) #define BOARD_TRIGORILLA_PRO 4037 // Trigorilla Pro (STM32F103ZET6) #define BOARD_FLY_MINI 4038 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4039 // FLSUN HiSpeedV1 (STM32F103VET6) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index f43214f7beca..3a380def74f5 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -581,6 +581,8 @@ #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro #elif MB(FLY_MINI) #include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI +#elif MB(FLSUN_HISPEED) + #include "stm32f1/pins_FLSUN_HISPEED.h" // STM32F1 env:flsun_hispeed // // ARM Cortex-M4F diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h new file mode 100644 index 000000000000..7f3ab036540a --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -0,0 +1,366 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * FLSUN HiSpeed V1 (STM32F103VET6) board pin assignments + * FLSun Hispeed (clone MKS_Robin_miniV2) board. + * + * MKS Robin Mini USB uses UART3 (PB10-TX, PB11-RX) + * #define SERIAL_PORT_2 3 + */ + +#if NOT_TARGET(__STM32F1__, STM32F1xx) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "FLSUN HiSpeedV1 supports 1 hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "FLSun HiSpeedV1" +#define BOARD_WEBSITE_URL "github.com/Foxies-CSTL" + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// EEPROM +// +#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 // 2KB +#endif + +// SPI +// Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. +// +#define ENABLE_SPI2 + +// SPI Flash +#define HAS_SPI_FLASH 1 +#define SPI_FLASH_SIZE 0x1000000 // 16MB + +#if HAS_SPI_FLASH + // SPI 2 + #define W25QXX_CS_PIN PB12 // SPI2_NSS / Flash chip-select + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif + +// +// Servos +// +//#define SERVO0_PIN PA8 // use IO0 to enable BLTOUCH support/remove Mks_Wifi + +// +// Limit Switches +// +#define X_STOP_PIN PA15 // -X +#define Y_STOP_PIN PA12 // -Y +#define Z_MIN_PIN PA11 // -Z +#define Z_MAX_PIN PC4 // +Z + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN MT_DET_1_PIN +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PE4 // X_EN +#define X_STEP_PIN PE3 // X_STEP +#define X_DIR_PIN PE2 // X_DIR + +#define Y_ENABLE_PIN PE1 // Y_EN +#define Y_STEP_PIN PE0 // Y_STEP +#define Y_DIR_PIN PB9 // Y_DIR + +#define Z_ENABLE_PIN PB8 // Z_EN +#define Z_STEP_PIN PB5 // Z_STEP +#define Z_DIR_PIN PB4 // Z_DIR + +#define E0_ENABLE_PIN PB3 // E0_EN +#define E0_STEP_PIN PD6 // E0_STEP +#define E0_DIR_PIN PD3 // E0_DIR + +// +// Drivers +// +#if HAS_TMC220x + + #if ENABLED(HARDWARE_SERIAL) /* TMC2209 */ + #define X_SLAVE_ADDRESS 3 // | | : + #define Y_SLAVE_ADDRESS 2 // : | : + #define Z_SLAVE_ADDRESS 1 // | : : + //#define E0_SLAVE_ADDRESS 0 // : : : + + #define X_SERIAL_TX_PIN PA9 // TXD1 + #define X_SERIAL_RX_PIN PA9 // TXD1 + + #define Y_SERIAL_TX_PIN PA9 // TXD1 + #define Y_SERIAL_RX_PIN PA9 // TXD1 + + #define Z_SERIAL_TX_PIN PA9 // TXD1 + #define Z_SERIAL_RX_PIN PA9 // TXD1 + + #elif ENABLED(SOFTWARE_SERIAL) /* TMC220x */ + /** + * TMC2208 stepper UART-configurable by PDN_UART pin + * Software serial + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + + #define X_SERIAL_TX_PIN PA10 // RXD1 + #define X_SERIAL_RX_PIN PA10 // RXD1 + + #define Y_SERIAL_TX_PIN PA9 // TXD1 + #define Y_SERIAL_RX_PIN PA9 // TXD1 + + #define Z_SERIAL_TX_PIN PC7 // IO1 + #define Z_SERIAL_RX_PIN PC7 // IO1 + + #endif + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#else + + // Motor current PWM pins + #define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY + #define MOTOR_CURRENT_PWM_Z_PIN PA7 // VREF4 CONTROL Z + #define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp + #ifndef DEFAULT_PWM_MOTOR_CURRENT + #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } + #endif + + /** + * src: MKS Robin_Mini V2 + * __ESP(M1)__ -J1- + * GND| 15 | | 08 |+3v3 (22)=>RXD1(PA10) // + * | 16 | | 07 |MOSI (21)=>TXD1(PA9) // active low, probably OK to leave floating + * IO2| 17 | | 06 |MISO (19)=>IO1(PC7) // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * IO0| 18 | | 05 |CLK (18)=>IO0(PA8) // must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * IO1| 19 | | 03 |EN (03)=>WIFI_EN() // Must be high for module to run + * | nc | | nc | (01)=>WIFI_CTRL(PA5) + * RX| 21 | | nc | + * TX| 22 | | 01 |RST + *  ̄ ̄ AE ̄ ̄ + * + */ + #ifdef ESP_WIFI + #define WIFI_IO0_PIN PA8 // PC13 MKS ESP WIFI IO0 PIN + #define WIFI_IO1_PIN PC7 // MKS ESP WIFI IO1 PIN + #define WIFI_RESET_PIN PA5 // MKS ESP WIFI RESET PIN + #endif +#endif + +// +// EXTRUDER +// +#if AXIS_DRIVER_TYPE(E0,TMC2208)||AXIS_DRIVER_TYPE(E0,TMC2209) + #define E0_SLAVE_ADDRESS 0 + + #define E0_SERIAL_TX_PIN PA8 // IO0 + #define E0_SERIAL_RX_PIN PA8 // IO0 + #define TMC_BAUD_RATE 19200 +#else + // Motor current PWM pins + #define MOTOR_CURRENT_PWM_E_PIN PB0 // VREF1 CONTROL E + #define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp + #ifndef DEFAULT_PWM_MOTOR_CURRENT + #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } + #endif +#endif + +// +// Temperature Sensors(THM) +// +#define TEMP_0_PIN PC1 // TEMP_E0 +#define TEMP_BED_PIN PC0 // TEMP_BED + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC3 // HEATER_E0 +#define HEATER_BED_PIN PA0 // HEATER_BED-WKUP + +#define FAN_PIN PB1 // E_FAN +//#define CONTROLLER_FAN_PIN PD6 // BOARD FAN + +// +// Misc. Functions +// +//#define POWER_LOSS_PIN PA1 // PW_SO +#if ENABLED(BACKUP_POWER_SUPPLY) + #define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC +#endif + +// +// Power Supply Control +// +#if ENABLED(PSU_CONTROL) + #define KILL_PIN PA2 // PW_DET + #define KILL_PIN_INVERTING true // + //#define PS_ON_PIN PA3 // PW_CN /PW_OFF +#endif + +#define MT_DET_1_PIN PA4 // MT_DET +#define MT_DET_2_PIN PE6 // FALA_CRTL +#define MT_DET_PIN_INVERTING false + +// +// LED / NEOPixel +// +//#define LED_PIN PB2 // BOOT1 + +#if ENABLED(NEOPIXEL_LED) + #define LED_PWM PA8 + #ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1/TX/RX PIN + #endif +#endif + +//Others test. +//#define SERVO0_PIN PA5 // WIFI CRTL +//#define GPIO_CLEAR PA8 // IO0 +//#define GPIO_SET PA5 + +// +// SD Card +// +#define SDIO_SUPPORT +#define SDIO_CLOCK 4500000 // 4.5 MHz /* 18 MHz (18000000) or 4.5MHz (450000) */ +//#define SDIO_CLOCK 18000000 // 18 MHz (18000000) +#if ENABLED(SDIO_SUPPORT) + #define SCK_PIN PB13 // SPI2 + #define MISO_PIN PB14 // SPI2 + #define MOSI_PIN PB15 // SPI2 + #define SD_DETECT_PIN PD12 // SD_CD +#endif + +// +// LCD / Controller +// +#ifndef BEEPER_PIN + #define BEEPER_PIN PC5 +#endif + +/** + * Note: MKS Robin TFT screens use various TFT controllers + * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240) + * ILI9488 is not supported + * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp + * + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. + * + * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu + * because Marlin uses the reset as a failsafe to revive a glitchy LCD. + */ + +// MKS Robin TFT v2.0 with ILI9341 +// Read display identification information (0xD3 on ILI9341) +//#define XPT2046_X_CALIBRATION 12013 +//#define XPT2046_Y_CALIBRATION -8711 +//#define XPT2046_X_OFFSET -32 +//#define XPT2046_Y_OFFSET 256 + +// MKS Robin TFT v1.1 with ILI9328 +//#define XPT2046_X_CALIBRATION -11792 +//#define XPT2046_Y_CALIBRATION 8947 +//#define XPT2046_X_OFFSET 342 +//#define XPT2046_Y_OFFSET -19 + +// MKS Robin TFT v1.1 with R61505 +//#define XPT2046_X_CALIBRATION 12489 +//#define XPT2046_Y_CALIBRATION 9210 +//#define XPT2046_X_OFFSET -52 +//#define XPT2046_Y_OFFSET -17 + +// QQS-Pro uses MKS Robin TFT v2.0 + +// Shared FSMC Configs +#if HAS_FSMC_TFT + #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h + #define DOGLCD_SCK -1 + + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define TFT_RESET_PIN PC6 // FSMC_RST + #define TFT_BACKLIGHT_PIN PD13 + + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT + #define FSMC_DMA_DEV DMA2 + #define FSMC_DMA_CHANNEL DMA_CH5 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 +#endif + +// XPT2046 Touch Screen calibration +#if EITHER(TFT_LVGL_UI_FSMC, TFT_COLOR_UI) + #define TFT_BUFFER_SIZE 14400 + + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION 12218 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION -8814 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET -35 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET 256 + #endif + +#elif ENABLED(TFT_CLASSIC_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION 12149 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION -8746 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET -35 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET 256 + #endif + + #define TFT_MARLINUI_COLOR 0xFFFF // White + #define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + #define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +#if NEED_TOUCH_PINS + #define TOUCH_CS_PIN PC2 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI +#endif diff --git a/buildroot/share/PlatformIO/scripts/add_nanolib.py b/buildroot/share/PlatformIO/scripts/add_nanolib.py new file mode 100644 index 000000000000..102b4b9bb0e1 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/add_nanolib.py @@ -0,0 +1,2 @@ +Import("env") +env.Append(LINKFLAGS=["--specs=nano.specs"]) diff --git a/platformio.ini b/platformio.ini index 8416b93a27ef..326dca172ff5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1133,6 +1133,21 @@ debug_tool = jlink upload_protocol = jlink monitor_speed = 115200 +# +# FLSUN QQ (STM32F103VET6) +# +[env:flsun_hispeed] +platform = ${common_stm32f1.platform} +extends = common_stm32f1 +board = genericSTM32F103VE +platform_packages = tool-stm32duino +extra_scripts = ${common.extra_scripts} + buildroot/share/PlatformIO/scripts/mks_robin_mini.py + buildroot/share/PlatformIO/scripts/add_nanolib.py +build_flags = ${common_stm32f1.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 +lib_deps = SoftwareSerialM + #Adafruit NeoPixel=https://github.com/Foxies-CSTL/Robin-NeoPixel-Lib/archive/master.zip + # # STM32F401VE # 'STEVAL-3DP001V1' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html From ec596315bd292d6ced44a543502fe80036456dd7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 22 Oct 2020 00:16:17 +0000 Subject: [PATCH 002/443] [cron] Bump distribution date (2020-10-22) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a4c9aebbb030..9c3407074f23 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-21" + #define STRING_DISTRIBUTION_DATE "2020-10-22" #endif /** From 4fccb92e072463bd6147b2ce22352b79337cb53c Mon Sep 17 00:00:00 2001 From: ManuelMcLure Date: Thu, 22 Oct 2020 04:27:33 -0700 Subject: [PATCH 003/443] Configure TMC interpolation per driver (#19828) --- Marlin/Configuration_adv.h | 27 +++++++++++++-- Marlin/src/feature/tmc_util.cpp | 13 ++++++- Marlin/src/inc/Conditionals_post.h | 48 ++++++++++++++++++++++++++ Marlin/src/module/stepper/trinamic.cpp | 30 ++++++++-------- 4 files changed, 99 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fc77345b9b90..31661a582e5e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2261,14 +2261,20 @@ #if HAS_TRINAMIC_CONFIG #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current - #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + /** + * Interpolate microsteps to 256 + * Override for each driver with _INTERPOLATE settings below + */ + #define INTERPOLATE true #if AXIS_IS_TMC(X) #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing - #define X_MICROSTEPS 16 // 0..256 + #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 - #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... + //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis #endif #if AXIS_IS_TMC(X2) @@ -2277,6 +2283,7 @@ #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 #define X2_CHAIN_POS -1 + //#define X2_INTERPOLATE true #endif #if AXIS_IS_TMC(Y) @@ -2285,6 +2292,7 @@ #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 #define Y_CHAIN_POS -1 + //#define Y_INTERPOLATE true #endif #if AXIS_IS_TMC(Y2) @@ -2293,6 +2301,7 @@ #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 #define Y2_CHAIN_POS -1 + //#define Y2_INTERPOLATE true #endif #if AXIS_IS_TMC(Z) @@ -2301,6 +2310,7 @@ #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 #define Z_CHAIN_POS -1 + //#define Z_INTERPOLATE true #endif #if AXIS_IS_TMC(Z2) @@ -2309,6 +2319,7 @@ #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 #define Z2_CHAIN_POS -1 + //#define Z2_INTERPOLATE true #endif #if AXIS_IS_TMC(Z3) @@ -2317,6 +2328,7 @@ #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 #define Z3_CHAIN_POS -1 + //#define Z3_INTERPOLATE true #endif #if AXIS_IS_TMC(Z4) @@ -2325,6 +2337,7 @@ #define Z4_MICROSTEPS 16 #define Z4_RSENSE 0.11 #define Z4_CHAIN_POS -1 + //#define Z4_INTERPOLATE true #endif #if AXIS_IS_TMC(E0) @@ -2332,6 +2345,7 @@ #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 #define E0_CHAIN_POS -1 + //#define E0_INTERPOLATE true #endif #if AXIS_IS_TMC(E1) @@ -2339,6 +2353,7 @@ #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 #define E1_CHAIN_POS -1 + //#define E1_INTERPOLATE true #endif #if AXIS_IS_TMC(E2) @@ -2346,6 +2361,7 @@ #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 #define E2_CHAIN_POS -1 + //#define E2_INTERPOLATE true #endif #if AXIS_IS_TMC(E3) @@ -2353,6 +2369,7 @@ #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 #define E3_CHAIN_POS -1 + //#define E3_INTERPOLATE true #endif #if AXIS_IS_TMC(E4) @@ -2360,6 +2377,7 @@ #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 #define E4_CHAIN_POS -1 + //#define E4_INTERPOLATE true #endif #if AXIS_IS_TMC(E5) @@ -2367,6 +2385,7 @@ #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 #define E5_CHAIN_POS -1 + //#define E5_INTERPOLATE true #endif #if AXIS_IS_TMC(E6) @@ -2374,6 +2393,7 @@ #define E6_MICROSTEPS 16 #define E6_RSENSE 0.11 #define E6_CHAIN_POS -1 + //#define E6_INTERPOLATE true #endif #if AXIS_IS_TMC(E7) @@ -2381,6 +2401,7 @@ #define E7_MICROSTEPS 16 #define E7_RSENSE 0.11 #define E7_CHAIN_POS -1 + //#define E7_INTERPOLATE true #endif /** diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 781253079ed5..d27177326bc6 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -497,7 +497,8 @@ TMC_HEND, TMC_HSTRT, TMC_SGT, - TMC_MSCNT + TMC_MSCNT, + TMC_INTERPOLATE }; enum TMC_drv_status_enum : char { TMC_DRV_CODES, @@ -553,6 +554,7 @@ case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break; case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break; case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; + case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; default: break; } } @@ -588,6 +590,7 @@ SERIAL_ECHOPGM("/256"); } break; + case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; default: break; } } @@ -603,6 +606,7 @@ case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break; case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break; case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break; + case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; default: break; } } @@ -644,6 +648,12 @@ #if HAS_DRIVER(TMC2660) static void _tmc_parse_drv_status(TMC2660Stepper, const TMC_drv_status_enum) { } + static void _tmc_status(TMC2660Stepper &st, const TMC_debug_enum i) { + switch (i) { + case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break; + default: break; + } + } #endif template @@ -902,6 +912,7 @@ #endif TMC_REPORT("stealthChop", TMC_STEALTHCHOP); TMC_REPORT("msteps\t", TMC_MICROSTEPS); + TMC_REPORT("interp\t", TMC_INTERPOLATE); TMC_REPORT("tstep\t", TMC_TSTEP); TMC_REPORT("PWM thresh.", TMC_TPWMTHRS); TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3587d82cdab7..bb717ba097ef 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1608,6 +1608,54 @@ #define Y_SPI_SENSORLESS Y_SENSORLESS #define Z_SPI_SENSORLESS Z_SENSORLESS #endif + #ifndef X_INTERPOLATE + #define X_INTERPOLATE INTERPOLATE + #endif + #ifndef X2_INTERPOLATE + #define X2_INTERPOLATE INTERPOLATE + #endif + #ifndef Y_INTERPOLATE + #define Y_INTERPOLATE INTERPOLATE + #endif + #ifndef Y2_INTERPOLATE + #define Y2_INTERPOLATE INTERPOLATE + #endif + #ifndef Z_INTERPOLATE + #define Z_INTERPOLATE INTERPOLATE + #endif + #ifndef Z2_INTERPOLATE + #define Z2_INTERPOLATE INTERPOLATE + #endif + #ifndef Z3_INTERPOLATE + #define Z3_INTERPOLATE INTERPOLATE + #endif + #ifndef Z4_INTERPOLATE + #define Z4_INTERPOLATE INTERPOLATE + #endif + #ifndef E0_INTERPOLATE + #define E0_INTERPOLATE INTERPOLATE + #endif + #ifndef E1_INTERPOLATE + #define E1_INTERPOLATE INTERPOLATE + #endif + #ifndef E2_INTERPOLATE + #define E2_INTERPOLATE INTERPOLATE + #endif + #ifndef E3_INTERPOLATE + #define E3_INTERPOLATE INTERPOLATE + #endif + #ifndef E4_INTERPOLATE + #define E4_INTERPOLATE INTERPOLATE + #endif + #ifndef E5_INTERPOLATE + #define E5_INTERPOLATE INTERPOLATE + #endif + #ifndef E6_INTERPOLATE + #define E6_INTERPOLATE INTERPOLATE + #endif + #ifndef E7_INTERPOLATE + #define E7_INTERPOLATE INTERPOLATE + #endif #endif #if (HAS_E_DRIVER(TMC2660) \ diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index ad11046f62f6..c33581d132fe 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -36,7 +36,7 @@ #include enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; -#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST) +#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST, ST##_INTERPOLATE) // IC = TMC model number // ST = Stepper object letter @@ -131,13 +131,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { st.begin(); CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); @@ -166,13 +166,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { st.begin(); CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); @@ -484,7 +484,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2208) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -496,7 +496,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; TMC2208_n::CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; // blank_time = 24 chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); @@ -526,7 +526,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2209) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -538,7 +538,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; TMC2208_n::CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; // blank_time = 24 chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); @@ -568,7 +568,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC2660) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init, const bool interpolate) { st.begin(); TMC2660_n::CHOPCONF_t chopconf{0}; @@ -582,7 +582,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; st.rms_current(mA); st.microsteps(microsteps); TERN_(SQUARE_WAVE_STEPPING, st.dedge(true)); - st.intpol(INTERPOLATE); + st.intpol(interpolate); st.diss2g(true); // Disable short to ground protection. Too many false readings? TERN_(TMC_DEBUG, st.rdsel(0b01)); } @@ -590,13 +590,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC5130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { st.begin(); CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); @@ -625,13 +625,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; #if HAS_DRIVER(TMC5160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { st.begin(); CHOPCONF_t chopconf{0}; chopconf.tbl = 0b01; chopconf.toff = chop_init.toff; - chopconf.intpol = INTERPOLATE; + chopconf.intpol = interpolate; chopconf.hend = chop_init.hend + 3; chopconf.hstrt = chop_init.hstrt - 1; TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); From f83bbce3a3f98bb91871270435cb8ceed6dc34ff Mon Sep 17 00:00:00 2001 From: George Fu Date: Thu, 22 Oct 2020 19:29:29 +0800 Subject: [PATCH 004/443] Fix TMC serial port for FYSETC AIO_II (#19842) --- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index d2c587beb85a..bab6182e4fde 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -93,10 +93,10 @@ // // Hardware serial with switch // - #define X_HARDWARE_SERIAL MSerial1 - #define Y_HARDWARE_SERIAL MSerial1 - #define Z_HARDWARE_SERIAL MSerial1 - #define E0_HARDWARE_SERIAL MSerial1 + #define X_HARDWARE_SERIAL MSerial2 + #define Y_HARDWARE_SERIAL MSerial2 + #define Z_HARDWARE_SERIAL MSerial2 + #define E0_HARDWARE_SERIAL MSerial2 // The 4xTMC2209 module doesn't have a serial multiplexer and // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0 @@ -106,6 +106,9 @@ #define SERIAL_MUL_PIN2 PB12 #endif + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 + #endif // From 1ed853f5d6c5fa99a9ae9e535d94a59733bc945d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 23 Oct 2020 00:16:15 +0000 Subject: [PATCH 005/443] [cron] Bump distribution date (2020-10-23) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9c3407074f23..17d70a7c253e 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-22" + #define STRING_DISTRIBUTION_DATE "2020-10-23" #endif /** From 4533a197d59ffcaccc4d476f06df7754b11b9b0c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 22 Oct 2020 20:22:17 -0500 Subject: [PATCH 006/443] Slim down MKS UI code (#19843) --- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 37 +- .../lib/mks_ui/draw_acceleration_settings.cpp | 173 +++----- .../lib/mks_ui/draw_advance_settings.cpp | 134 ++----- .../draw_auto_level_offset_settings.cpp | 62 +-- .../extui/lib/mks_ui/draw_baby_stepping.cpp | 141 ++----- .../extui/lib/mks_ui/draw_change_speed.cpp | 109 ++--- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 105 +++-- .../extui/lib/mks_ui/draw_eeprom_settings.cpp | 49 +-- .../lib/mks_ui/draw_encoder_settings.cpp | 38 +- .../extui/lib/mks_ui/draw_error_message.cpp | 12 +- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 138 ++----- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 83 +--- .../extui/lib/mks_ui/draw_filament_change.cpp | 74 +--- .../lib/mks_ui/draw_filament_settings.cpp | 119 ++---- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 93 +---- .../draw_homing_sensitivity_settings.cpp | 82 +--- .../extui/lib/mks_ui/draw_jerk_settings.cpp | 81 +--- .../lcd/extui/lib/mks_ui/draw_language.cpp | 131 ++----- .../extui/lib/mks_ui/draw_level_settings.cpp | 57 +-- .../extui/lib/mks_ui/draw_machine_para.cpp | 79 +--- .../lib/mks_ui/draw_machine_settings.cpp | 56 +-- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 81 +--- .../mks_ui/draw_manual_level_pos_settings.cpp | 163 +++----- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 110 ++---- .../extui/lib/mks_ui/draw_motor_settings.cpp | 83 +--- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 124 ++---- .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 37 +- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 192 ++------- .../extui/lib/mks_ui/draw_pause_position.cpp | 65 +-- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 107 ++--- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 83 +--- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 151 +++---- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 102 ++--- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 134 +------ .../extui/lib/mks_ui/draw_step_settings.cpp | 108 ++--- .../lib/mks_ui/draw_tmc_current_settings.cpp | 100 ++--- .../mks_ui/draw_tmc_step_mode_settings.cpp | 371 +++++------------- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 96 +---- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 99 +++++ Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 42 ++ Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 73 ++-- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 66 +--- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 135 ++----- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 17 +- 44 files changed, 1198 insertions(+), 3194 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 68d1993b6f56..48a2cb136202 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -53,7 +53,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_about(void) { - lv_obj_t *buttonBack, *label_Back; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; @@ -66,51 +65,31 @@ void lv_draw_about(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonBack = lv_imgbtn_create(scr, NULL); - - #if 1 - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_A_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif + lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - // Create a label on the image button - label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } - //fw_version = lv_label_create(scr, NULL); - //lv_obj_set_style(fw_version, &tft_style_label_rel); - //lv_label_set_text(fw_version, SHORT_BUILD_VERSION); + //fw_version = lv_label_create(scr, SHORT_BUILD_VERSION); //lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER, 0, -60); - fw_type = lv_label_create(scr, NULL); - lv_obj_set_style(fw_type, &tft_style_label_rel); - lv_label_set_text(fw_type, "Firmware: Marlin " SHORT_BUILD_VERSION); + fw_type = lv_label_create(scr, "Firmware: Marlin " SHORT_BUILD_VERSION); lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER, 0, -20); - board = lv_label_create(scr, NULL); - lv_obj_set_style(board, &tft_style_label_rel); - lv_label_set_text(board, "Board: " BOARD_INFO_NAME); + board = lv_label_create(scr, "Board: " BOARD_INFO_NAME); lv_obj_align(board, NULL, LV_ALIGN_CENTER, 0, -60); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp index e362e5bff1c2..95bba3b549a1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp @@ -161,14 +161,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_acceleration_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelPrintText = NULL, *buttonPrintValue = NULL, *labelPrintValue = NULL; - lv_obj_t *labelRetraText = NULL, *buttonRetraValue = NULL, *labelRetraValue = NULL; - lv_obj_t *labelTravelText = NULL, *buttonTravelValue = NULL, *labelTravelValue = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t *buttonPrintValue = NULL, *labelPrintValue = NULL; + lv_obj_t *buttonRetraValue = NULL, *labelRetraValue = NULL; + lv_obj_t *buttonTravelValue = NULL, *labelTravelValue = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ACCELERATION_UI) { disp_state_stack._disp_index++; @@ -182,83 +182,45 @@ void lv_draw_acceleration_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.AccelerationConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AccelerationConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelPrintText = lv_label_create(scr, NULL); - lv_obj_set_style(labelPrintText, &tft_style_label_rel); - lv_obj_set_pos(labelPrintText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelPrintText, machine_menu.PrintAcceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.PrintAcceleration); - buttonPrintValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonPrintValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonPrintValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonPrintValue, event_handler, ID_ACCE_PRINT, NULL, 0); - lv_btn_set_style(buttonPrintValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonPrintValue, LV_BTN_STYLE_PR, &style_para_value); - labelPrintValue = lv_label_create(buttonPrintValue, NULL); + buttonPrintValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_PRINT); + labelPrintValue = lv_label_create_empty(buttonPrintValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelRetraText = lv_label_create(scr, NULL); - lv_obj_set_style(labelRetraText, &tft_style_label_rel); - lv_obj_set_pos(labelRetraText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelRetraText, machine_menu.RetractAcceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.RetractAcceleration); - buttonRetraValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonRetraValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonRetraValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonRetraValue, event_handler, ID_ACCE_RETRA, NULL, 0); - lv_btn_set_style(buttonRetraValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonRetraValue, LV_BTN_STYLE_PR, &style_para_value); - labelRetraValue = lv_label_create(buttonRetraValue, NULL); + buttonRetraValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_RETRA); + labelRetraValue = lv_label_create_empty(buttonRetraValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelTravelText = lv_label_create(scr, NULL); - lv_obj_set_style(labelTravelText, &tft_style_label_rel); - lv_obj_set_pos(labelTravelText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelTravelText, machine_menu.TravelAcceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.TravelAcceleration); - buttonTravelValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonTravelValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonTravelValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonTravelValue, event_handler, ID_ACCE_TRAVEL, NULL, 0); - lv_btn_set_style(buttonTravelValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonTravelValue, LV_BTN_STYLE_PR, &style_para_value); - labelTravelValue = lv_label_create(buttonTravelValue, NULL); + buttonTravelValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_TRAVEL); + labelTravelValue = lv_label_create_empty(buttonTravelValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelXText, machine_menu.X_Acceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.X_Acceleration); - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_ACCE_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_X); + labelXValue = lv_label_create_empty(buttonXValue); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_ACCE_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_ACCE_DOWN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -271,81 +233,43 @@ void lv_draw_acceleration_settings(void) { #endif } else { - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelYText, machine_menu.Y_Acceleration); - - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_ACCE_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.Y_Acceleration); + + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_Y); + labelYValue = lv_label_create_empty(buttonYValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelZText, machine_menu.Z_Acceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Z_Acceleration); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_ACCE_Y, NULL, 0); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_ACCE_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_Z); + labelZValue = lv_label_create_empty(buttonZValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelE0Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE0Text, &tft_style_label_rel); - lv_obj_set_pos(labelE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelE0Text, machine_menu.E0_Acceleration); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.E0_Acceleration); - buttonE0Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE0Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_ACCE_Y, NULL, 0); - lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_ACCE_E0, NULL, 0); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_PR, &style_para_value); - labelE0Value = lv_label_create(buttonE0Value, NULL); + buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_E0); + labelE0Value = lv_label_create_empty(buttonE0Value); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelE1Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE1Text, &tft_style_label_rel); - lv_obj_set_pos(labelE1Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelE1Text, machine_menu.E1_Acceleration); - - buttonE1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_ACCE_Y, NULL, 0); - lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_ACCE_E1, NULL, 0); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_PR, &style_para_value); - labelE1Value = lv_label_create(buttonE1Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E1_Acceleration); + buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_E1); + labelE1Value = lv_label_create_empty(buttonE1Value); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_ACCE_UP, NULL, 0); - //lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - //lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - //lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); - //lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_ACCE_UP); + //lv_imgbtn_set_src_both(buttonTurnPage, "F:/bmp_back70x40.bin"); + //lv_imgbtn_use_label_style(buttonTurnPage); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -360,22 +284,15 @@ void lv_draw_acceleration_settings(void) { //lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); //lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); - //labelTurnPage = lv_label_create(buttonTurnPage, NULL); + //labelTurnPage = lv_label_create_empty(buttonTurnPage); lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); - - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_ACCE_RETURN, NULL, 0); - //lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - //lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - //lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - //lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); + + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_ACCE_RETURN); + //lv_imgbtn_set_src_both(buttonBack, "F:/bmp_back70x40.bin"); + //lv_imgbtn_use_label_style(buttonBack); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp index f81fe6c72855..99de179a9c2c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -133,14 +133,14 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_advance_settings(void) { lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonPausePos, *labelPausePos, *buttonPausePosNarrow; - lv_obj_t *buttonFilamentSettings, *labelFilamentSettings, *buttonFilamentSettingsNarrow; + lv_obj_t *buttonPausePos, *labelPausePos; + lv_obj_t *buttonFilamentSettings, *labelFilamentSettings; lv_obj_t * line1,* line2; #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_t *buttonWifiSet,*labelWifiSet,*buttonWifiSetNarrow; + lv_obj_t *buttonWifiSet, *labelWifiSet, *buttonWifiSetNarrow; #endif #if HAS_ROTARY_ENCODER - lv_obj_t *buttonEcoder,*labelEcoder,*buttonEcoderNarrow; + lv_obj_t *buttonEncoder, *labelEncoder, *buttonEncoderNarrow; #endif if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ADVANCED_UI) { @@ -155,10 +155,7 @@ void lv_draw_advance_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.AdvancedConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AdvancedConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -167,22 +164,14 @@ void lv_draw_advance_settings(void) { lv_obj_set_size(buttonPausePos, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0); - lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonPausePos, LV_BTN_STYLE_PR, &tft_style_label_pre); + lv_btn_use_label_style(buttonPausePos); lv_btn_set_layout(buttonPausePos, LV_LAYOUT_OFF); - labelPausePos = lv_label_create(buttonPausePos, NULL); + labelPausePos = lv_label_create_empty(buttonPausePos); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonPausePos); #endif - buttonPausePosNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonPausePosNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonPausePosNarrow, event_handler, ID_PAUSE_POS_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonPausePosNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonPausePosNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonPausePosNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPausePosNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonPausePosNarrow, LV_LAYOUT_OFF); + (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_PAUSE_POS_ARROW); line1 = lv_line_create(lv_scr_act(), NULL); lv_ex_line(line1, line_points[0]); @@ -191,22 +180,14 @@ void lv_draw_advance_settings(void) { lv_obj_set_pos(buttonFilamentSettings, PARA_UI_POS_X, PARA_UI_POS_Y*2); lv_obj_set_size(buttonFilamentSettings, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); lv_obj_set_event_cb_mks(buttonFilamentSettings, event_handler, ID_FILAMENT_SETTINGS, NULL, 0); - lv_btn_set_style(buttonFilamentSettings, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonFilamentSettings, LV_BTN_STYLE_PR, &tft_style_label_pre); + lv_btn_use_label_style(buttonFilamentSettings); lv_btn_set_layout(buttonFilamentSettings, LV_LAYOUT_OFF); - labelFilamentSettings = lv_label_create(buttonFilamentSettings, NULL); + labelFilamentSettings = lv_label_create_empty(buttonFilamentSettings); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonFilamentSettings); #endif - buttonFilamentSettingsNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonFilamentSettingsNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y*2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonFilamentSettingsNarrow, event_handler, ID_FILAMENT_SETTINGS_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonFilamentSettingsNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonFilamentSettingsNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonFilamentSettingsNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFilamentSettingsNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonFilamentSettingsNarrow, LV_LAYOUT_OFF); + (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y*2 + PARA_UI_ARROW_V, event_handler, ID_FILAMENT_SETTINGS_ARROW); line2 = lv_line_create(lv_scr_act(), NULL); lv_ex_line(line2, line_points[1]); @@ -216,91 +197,58 @@ void lv_draw_advance_settings(void) { buttonWifiSet = lv_btn_create(scr, NULL); /*Add a button the current screen*/ lv_obj_set_pos(buttonWifiSet, PARA_UI_POS_X,PARA_UI_POS_Y*3); lv_obj_set_size(buttonWifiSet, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonWifiSet, event_handler,ID_WIFI_PARA,NULL,0); - lv_btn_set_style(buttonWifiSet, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonWifiSet, LV_BTN_STYLE_PR, &tft_style_label_pre); + lv_obj_set_event_cb_mks(buttonWifiSet, event_handler,ID_WIFI_PARA,NULL, 0); + lv_btn_use_label_style(buttonWifiSet); lv_btn_set_layout(buttonWifiSet, LV_LAYOUT_OFF); - labelWifiSet = lv_label_create(buttonWifiSet, NULL); + labelWifiSet = lv_label_create_empty(buttonWifiSet); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonWifiSet); #endif - buttonWifiSetNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonWifiSetNarrow,PARA_UI_POS_X+PARA_UI_SIZE_X,PARA_UI_POS_Y*3+PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonWifiSetNarrow, event_handler,ID_WIFI_PARA_ARROW, NULL,0); - lv_imgbtn_set_src(buttonWifiSetNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonWifiSetNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonWifiSetNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonWifiSetNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonWifiSetNarrow, LV_LAYOUT_OFF); + buttonWifiSetNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_WIFI_PARA_ARROW); lv_obj_t * line3 = lv_line_create(scr, NULL); lv_ex_line(line3,line_points[2]); #if HAS_ROTARY_ENCODER - buttonEcoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonEcoder, PARA_UI_POS_X,PARA_UI_POS_Y*4); - lv_obj_set_size(buttonEcoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonEcoder, event_handler,ID_ENCODER_SETTINGS,NULL,0); - lv_btn_set_style(buttonEcoder, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonEcoder, LV_BTN_STYLE_PR, &tft_style_label_pre); - lv_btn_set_layout(buttonEcoder, LV_LAYOUT_OFF); - labelEcoder = lv_label_create(buttonEcoder, NULL); - - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEcoder); - - buttonEcoderNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonEcoderNarrow,PARA_UI_POS_X+PARA_UI_SIZE_X,PARA_UI_POS_Y*4+PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonEcoderNarrow, event_handler,ID_ENCODER_SETTINGS_ARROW, NULL,0); - lv_imgbtn_set_src(buttonEcoderNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonEcoderNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonEcoderNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonEcoderNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonEcoderNarrow, LV_LAYOUT_OFF); + buttonEncoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonEncoder, PARA_UI_POS_X,PARA_UI_POS_Y*4); + lv_obj_set_size(buttonEncoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); + lv_obj_set_event_cb_mks(buttonEncoder, event_handler,ID_ENCODER_SETTINGS,NULL, 0); + lv_btn_use_label_style(buttonEncoder); + lv_btn_set_layout(buttonEncoder, LV_LAYOUT_OFF); + labelEncoder = lv_label_create_empty(buttonEncoder); + + if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEncoder); + + buttonEncoderNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 4 + PARA_UI_ARROW_V, event_handler, ID_ENCODER_SETTINGS_ARROW); lv_obj_t * line4 = lv_line_create(scr, NULL); lv_ex_line(line4,line_points[3]); #endif #elif HAS_ROTARY_ENCODER - buttonEcoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonEcoder, PARA_UI_POS_X,PARA_UI_POS_Y*3); - lv_obj_set_size(buttonEcoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonEcoder, event_handler,ID_ENCODER_SETTINGS,NULL,0); - lv_btn_set_style(buttonEcoder, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonEcoder, LV_BTN_STYLE_PR, &tft_style_label_pre); - lv_btn_set_layout(buttonEcoder, LV_LAYOUT_OFF); - labelEcoder = lv_label_create(buttonEcoder, NULL); - - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEcoder); - - buttonEcoderNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonEcoderNarrow,PARA_UI_POS_X+PARA_UI_SIZE_X,PARA_UI_POS_Y*3+PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonEcoderNarrow, event_handler,ID_ENCODER_SETTINGS_ARROW, NULL,0); - lv_imgbtn_set_src(buttonEcoderNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonEcoderNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonEcoderNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonEcoderNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonEcoderNarrow, LV_LAYOUT_OFF); + buttonEncoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ + lv_obj_set_pos(buttonEncoder, PARA_UI_POS_X,PARA_UI_POS_Y*3); + lv_obj_set_size(buttonEncoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); + lv_obj_set_event_cb_mks(buttonEncoder, event_handler,ID_ENCODER_SETTINGS,NULL, 0); + lv_btn_use_label_style(buttonEncoder); + lv_btn_set_layout(buttonEncoder, LV_LAYOUT_OFF); + labelEncoder = lv_label_create_empty(buttonEncoder); + + if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEncoder); + + buttonEncoderNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_ENCODER_SETTINGS_ARROW); lv_obj_t * line3 = lv_line_create(scr, NULL); lv_ex_line(line3,line_points[2]); #endif - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_ADVANCE_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ADVANCE_RETURN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); @@ -317,8 +265,8 @@ void lv_draw_advance_settings(void) { lv_obj_align(labelWifiSet, buttonWifiSet, LV_ALIGN_IN_LEFT_MID,0, 0); #endif #if HAS_ROTARY_ENCODER - lv_label_set_text(labelEcoder, machine_menu.EncoderSettings); - lv_obj_align(labelEcoder, buttonEcoder, LV_ALIGN_IN_LEFT_MID,0, 0); + lv_label_set_text(labelEncoder, machine_menu.EncoderSettings); + lv_obj_align(labelEncoder, buttonEncoder, LV_ALIGN_IN_LEFT_MID,0, 0); #endif } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp index be2015ed9eb6..87632a27c90a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp @@ -83,9 +83,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_auto_level_offset_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NOZZLE_PROBE_OFFSET_UI) { disp_state_stack._disp_index++; @@ -99,68 +99,36 @@ void lv_draw_auto_level_offset_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.OffsetConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.OffsetConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.Xoffset); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.Xoffset); - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_OFFSET_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_X); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.Yoffset); + lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Yoffset); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_OFFSET_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_Y); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.Zoffset); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Zoffset); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_OFFSET_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_Z); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_OFFSET_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_OFFSET_RETURN); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp index 68910602746f..adf69719cdc5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp @@ -30,6 +30,10 @@ #include "../../../../gcode/gcode.h" #include "../../../../inc/MarlinConfig.h" +#if ENABLED(EEPROM_SETTINGS) + #include "../../../../module/settings.h" +#endif + #if HAS_BED_PROBE #include "../../../../module/probe.h" #endif @@ -59,7 +63,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 X%.3f"),babystep_dist); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -70,7 +73,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 X%.3f"),((float)0 - babystep_dist)); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -81,7 +83,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 Y%.3f"), babystep_dist); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -92,7 +93,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 Y%.3f"),((float)0 - babystep_dist)); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -103,7 +103,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -114,7 +113,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { // nothing to do } else if (event == LV_EVENT_RELEASED) { - ZERO(baby_buf); sprintf_P(baby_buf, PSTR("M290 Z%.3f"),((float)0 - babystep_dist)); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; @@ -141,7 +139,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { if (has_adjust_z == 1) { - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); has_adjust_z = 0; } clear_cur_ui(); @@ -152,8 +150,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_baby_stepping(void) { - lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD, *buttonZI, *buttonZD, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != BABY_STEP_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = BABY_STEP_UI; @@ -166,98 +162,29 @@ void lv_draw_baby_stepping(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonXI = lv_imgbtn_create(scr, NULL); - buttonXD = lv_imgbtn_create(scr, NULL); - buttonYI = lv_imgbtn_create(scr, NULL); - buttonYD = lv_imgbtn_create(scr, NULL); - buttonZI = lv_imgbtn_create(scr, NULL); - buttonZD = lv_imgbtn_create(scr, NULL); - buttonV = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonXI, event_handler, ID_BABY_STEP_X_P, NULL, 0); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, "F:/bmp_xAdd.bin"); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, "F:/bmp_xAdd.bin"); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if 1 - lv_obj_set_event_cb_mks(buttonXD, event_handler, ID_BABY_STEP_X_N, NULL, 0); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, "F:/bmp_xDec.bin"); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, "F:/bmp_xDec.bin"); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonYI, event_handler, ID_BABY_STEP_Y_P, NULL, 0); - lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, "F:/bmp_yAdd.bin"); - lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, "F:/bmp_yAdd.bin"); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonYD, event_handler, ID_BABY_STEP_Y_N, NULL, 0); - lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, "F:/bmp_yDec.bin"); - lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, "F:/bmp_yDec.bin"); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonZI, event_handler, ID_BABY_STEP_Z_P, NULL, 0); - lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, "F:/bmp_zAdd.bin"); - lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, "F:/bmp_zAdd.bin"); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonZD, event_handler, ID_BABY_STEP_Z_N, NULL, 0); - lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, "F:/bmp_zDec.bin"); - lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, "F:/bmp_zDec.bin"); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonV, event_handler, ID_BABY_STEP_DIST, NULL, 0); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_BABY_STEP_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - #endif // if 1 - lv_obj_set_pos(buttonXI, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonYI, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonZI, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonV, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonXD, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonYD, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonZD, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + lv_obj_t *buttonXI = lv_imgbtn_create(scr, "F:/bmp_xAdd.bin", INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P); + lv_obj_t *buttonXD = lv_imgbtn_create(scr, "F:/bmp_xDec.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N); + lv_obj_t *buttonYI = lv_imgbtn_create(scr, "F:/bmp_yAdd.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P); + lv_obj_t *buttonYD = lv_imgbtn_create(scr, "F:/bmp_yDec.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Y_N); + lv_obj_t *buttonZI = lv_imgbtn_create(scr, "F:/bmp_zAdd.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABY_STEP_Z_P); + lv_obj_t *buttonZD = lv_imgbtn_create(scr, "F:/bmp_zDec.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Z_N); + buttonV = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABY_STEP_DIST); + lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelXI = lv_label_create(buttonXI, NULL); - lv_obj_t *labelXD = lv_label_create(buttonXD, NULL); - lv_obj_t *labelYI = lv_label_create(buttonYI, NULL); - lv_obj_t *labelYD = lv_label_create(buttonYD, NULL); - lv_obj_t *labelZI = lv_label_create(buttonZI, NULL); - lv_obj_t *labelZD = lv_label_create(buttonZD, NULL); - labelV = lv_label_create(buttonV, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelXI = lv_label_create_empty(buttonXI); + lv_obj_t *labelXD = lv_label_create_empty(buttonXD); + lv_obj_t *labelYI = lv_label_create_empty(buttonYI); + lv_obj_t *labelYD = lv_label_create_empty(buttonYD); + lv_obj_t *labelZI = lv_label_create_empty(buttonZI); + lv_obj_t *labelZD = lv_label_create_empty(buttonZD); + labelV = lv_label_create_empty(buttonV); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelXI, move_menu.x_add); @@ -297,27 +224,19 @@ void lv_draw_baby_stepping(void) { disp_baby_step_dist(); - zOffsetText = lv_label_create(scr, NULL); - lv_obj_set_style(zOffsetText, &tft_style_label_rel); - lv_obj_set_pos(zOffsetText, 290, TITLE_YPOS); + zOffsetText = lv_label_create(scr, 290, TITLE_YPOS, NULL); disp_z_offset_value(); } void disp_baby_step_dist() { // char buf[30] = {0}; + if ((int)(100 * babystep_dist) == 1) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_baby_move0_01.bin"); + else if ((int)(100 * babystep_dist) == 5) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_baby_move0_05.bin"); + else if ((int)(100 * babystep_dist) == 10) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_baby_move0_1.bin"); - if ((int)(100 * babystep_dist) == 1) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_baby_move0_01.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_baby_move0_01.bin"); - } - else if ((int)(100 * babystep_dist) == 5) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_baby_move0_05.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_baby_move0_05.bin"); - } - else if ((int)(100 * babystep_dist) == 10) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_baby_move0_1.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_baby_move0_1.bin"); - } if (gCfgItems.multiple_language) { if ((int)(100 * babystep_dist) == 1) { lv_label_set_text(labelV, move_menu.step_001mm); @@ -336,8 +255,6 @@ void disp_baby_step_dist() { void disp_z_offset_value() { char buf[20]; - - ZERO(buf); sprintf_P(buf, PSTR("offset Z: %.3f"), (double)TERN(HAS_BED_PROBE, probe.offset.z, 0)); lv_label_set_text(zOffsetText, buf); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index f9399b8a458c..848b625559f8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -168,75 +168,25 @@ void lv_draw_change_speed(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create an Image button - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttonMov = lv_imgbtn_create(scr, NULL); - buttonExt = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_C_ADD, NULL, 0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, "F:/bmp_Add.bin"); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, "F:/bmp_Add.bin"); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_C_DEC, NULL, 0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, "F:/bmp_Dec.bin"); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, "F:/bmp_Dec.bin"); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonMov, event_handler, ID_C_MOVE, NULL, 0); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMov, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonExt, event_handler, ID_C_EXT, NULL, 0); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonExt, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_C_STEP, NULL, 0); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_C_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonMov, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonExt, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonStep, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_C_ADD); + buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_C_DEC); + buttonMov = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_MOVE); + buttonExt = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_EXT); + buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_STEP); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMov, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonExt, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t *labelDec = lv_label_create(buttonDec, NULL); - labelMov = lv_label_create(buttonMov, NULL); - labelExt = lv_label_create(buttonExt, NULL); - labelStep = lv_label_create(buttonStep, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); + lv_obj_t *labelDec = lv_label_create_empty(buttonDec); + labelMov = lv_label_create_empty(buttonMov); + labelExt = lv_label_create_empty(buttonExt); + labelStep = lv_label_create_empty(buttonStep); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, speed_menu.add); @@ -262,24 +212,19 @@ void lv_draw_change_speed(void) { disp_speed_type(); disp_speed_step(); - printSpeedText = lv_label_create(scr, NULL); + printSpeedText = lv_label_create_empty(scr); lv_obj_set_style(printSpeedText, &tft_style_label_rel); disp_print_speed(); } void disp_speed_step() { - if (uiCfg.stepPrintSpeed == 1) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step1_percent.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step1_percent.bin"); - } - else if (uiCfg.stepPrintSpeed == 5) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step5_percent.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step5_percent.bin"); - } - else if (uiCfg.stepPrintSpeed == 10) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step10_percent.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_percent.bin"); - } + if (uiCfg.stepPrintSpeed == 1) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_percent.bin"); + else if (uiCfg.stepPrintSpeed == 5) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_percent.bin"); + else if (uiCfg.stepPrintSpeed == 10) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_percent.bin"); + if (gCfgItems.multiple_language) { if (uiCfg.stepPrintSpeed == 1) { lv_label_set_text(labelStep, speed_menu.step_1percent); @@ -320,17 +265,13 @@ void disp_print_speed() { void disp_speed_type() { switch (speedType) { case 1: - lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, "F:/bmp_mov_changeSpeed.bin"); - lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, "F:/bmp_mov_changeSpeed.bin"); - lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, "F:/bmp_extruct_sel.bin"); - lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, "F:/bmp_extruct_sel.bin"); + lv_imgbtn_set_src_both(buttonMov, "F:/bmp_mov_changeSpeed.bin"); + lv_imgbtn_set_src_both(buttonExt, "F:/bmp_extruct_sel.bin"); break; default: - lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_REL, "F:/bmp_mov_sel.bin"); - lv_imgbtn_set_src(buttonMov, LV_BTN_STATE_PR, "F:/bmp_mov_sel.bin"); - lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_REL, "F:/bmp_speed_extruct.bin"); - lv_imgbtn_set_src(buttonExt, LV_BTN_STATE_PR, "F:/bmp_speed_extruct.bin"); + lv_imgbtn_set_src_both(buttonMov, "F:/bmp_mov_sel.bin"); + lv_imgbtn_set_src_both(buttonExt, "F:/bmp_speed_extruct.bin"); break; } lv_obj_refresh_ext_draw_pad(buttonExt); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 489d8466ce49..07e0665ce461 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -43,6 +43,10 @@ #include "../../../../gcode/gcode.h" #include "../../../../inc/MarlinConfig.h" +#if ENABLED(EEPROM_SETTINGS) + #include "../../../../module/settings.h" +#endif + #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif @@ -155,17 +159,17 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { } #endif else if (uiCfg.dialogType == DIALOG_STORE_EEPROM_TIPS) { - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); clear_cur_ui(); draw_return_ui(); } else if (uiCfg.dialogType == DIALOG_READ_EEPROM_TIPS) { - gcode.process_subcommands_now_P(PSTR("M501")); + TERN_(EEPROM_SETTINGS, (void)settings.load()); clear_cur_ui(); draw_return_ui(); } else if (uiCfg.dialogType == DIALOG_REVERT_EEPROM_TIPS) { - gcode.process_subcommands_now_P(PSTR("M502")); + TERN_(EEPROM_SETTINGS, (void)settings.reset()); clear_cur_ui(); draw_return_ui(); } @@ -199,7 +203,7 @@ static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; #endif } - else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) + else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT) || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) @@ -244,19 +248,14 @@ void lv_draw_dialog(uint8_t type) { scr = lv_obj_create(NULL, NULL); - lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - static lv_style_t style_btn_rel; // A variable to store the released style lv_style_copy(&style_btn_rel, &lv_style_plain); // Initialize from a built-in style style_btn_rel.body.border.color = lv_color_hex3(0x269); @@ -278,17 +277,21 @@ void lv_draw_dialog(uint8_t type) { style_btn_pr.text.color = lv_color_hex3(0xBCD); style_btn_pr.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); - lv_obj_t *labelDialog = lv_label_create(scr, NULL); - lv_obj_set_style(labelDialog, &tft_style_label_rel); + // Set button styles for Released and Pressed + auto lv_btn_use_button_style = [&](lv_obj_t *btn) { + lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); + lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); + }; + + lv_obj_t *labelDialog = lv_label_create_empty(scr); if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { btnOk = lv_btn_create(scr, NULL); // Add a button the current screen lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style - lv_obj_t *labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_btn_use_button_style(btnOk); + lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING @@ -299,9 +302,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style - lv_obj_t *labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_btn_use_button_style(btnOk); + lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PAUSING @@ -319,9 +321,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnCancel, 100, 50); lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } else if (uiCfg.dialogType == DIALOG_TRANSFER_NO_DEVICE) { @@ -329,9 +330,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnCancel, 100, 50); lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } #if ENABLED(USE_WIFI_FUNCTION) @@ -341,9 +341,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnCancel, 100, 50); lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } else if (upload_result == 3) { @@ -351,9 +350,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnOk, 100, 50); lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelOk = lv_label_create(btnOk, NULL); + lv_btn_use_button_style(btnOk); + lv_obj_t *labelOk = lv_label_create_empty(btnOk); lv_label_set_text(labelOk, print_file_dialog_menu.confirm); } } @@ -365,25 +363,22 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnCancel, 100, 50); lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); - tempText1 = lv_label_create(scr, NULL); - lv_obj_set_style(tempText1, &tft_style_label_rel); + tempText1 = lv_label_create_empty(scr); filament_sprayer_temp(); } else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED ) { btnOk = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); + lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); lv_obj_set_size(btnOk, 100, 50); lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelOk = lv_label_create(btnOk, NULL); + lv_btn_use_button_style(btnOk); + lv_obj_t *labelOk = lv_label_create_empty(btnOk); lv_label_set_text(labelOk, print_file_dialog_menu.confirm); } else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING @@ -393,9 +388,8 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); lv_obj_set_size(btnCancel, 100, 50); lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); filament_bar = lv_bar_create(scr, NULL); @@ -410,17 +404,15 @@ void lv_draw_dialog(uint8_t type) { lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); // Set its position lv_obj_set_size(btnOk, 100, 50); // Set its size lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_set_style(btnOk, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style - lv_btn_set_style(btnOk, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style - lv_obj_t *labelOk = lv_label_create(btnOk, NULL); // Add a label to the button + lv_btn_use_button_style(btnOk); + lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button btnCancel = lv_btn_create(scr, NULL); // Add a button the current screen lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); // Set its position lv_obj_set_size(btnCancel, 100, 50); // Set its size lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_set_style(btnCancel, LV_BTN_STYLE_REL, &style_btn_rel); // Set the button's released style - lv_btn_set_style(btnCancel, LV_BTN_STYLE_PR, &style_btn_pr); // Set the button's pressed style - lv_obj_t *labelCancel = lv_label_create(btnCancel, NULL); // Add a label to the button + lv_btn_use_button_style(btnCancel); + lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); // Add a label to the button if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text @@ -435,10 +427,7 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - lv_obj_t *labelFile = lv_label_create(scr, NULL); - lv_obj_set_style(labelFile, &tft_style_label_rel); - - lv_label_set_text(labelFile, list_file.long_name[sel_id]); + lv_obj_t *labelFile = lv_label_create(scr, list_file.long_name[sel_id]); lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); } else if (uiCfg.dialogType == DIALOG_TYPE_STOP) { @@ -558,7 +547,6 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelDialog, buf); lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); - } } #endif //USE_WIFI_FUNCTION @@ -634,10 +622,8 @@ void filament_dialog_handle() { planner.synchronize(); uiCfg.filament_loading_time_flg = 1; uiCfg.filament_loading_time_cnt = 0; - ZERO(public_buf_m); - sprintf_P(public_buf_m,PSTR("T%d\nG91\nG1 E%d F%d\nG90"),uiCfg.curSprayerChoose,gCfgItems.filamentchange_load_length,gCfgItems.filamentchange_load_speed); - queue.inject_P(PSTR(public_buf_m)); - //gcode.process_subcommands_now_P(PSTR(public_buf_m)); + sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E%d F%d\nG90"), uiCfg.curSprayerChoose, gCfgItems.filamentchange_load_length, gCfgItems.filamentchange_load_speed); + queue.inject(public_buf_m); } if (uiCfg.filament_heat_completed_unload == 1) { uiCfg.filament_heat_completed_unload = 0; @@ -646,9 +632,8 @@ void filament_dialog_handle() { planner.synchronize(); uiCfg.filament_unloading_time_flg = 1; uiCfg.filament_unloading_time_cnt = 0; - ZERO(public_buf_m); - sprintf_P(public_buf_m,PSTR("T%d\nG91\nG1 E-%d F%d\nG90"),uiCfg.curSprayerChoose,gCfgItems.filamentchange_unload_length,gCfgItems.filamentchange_unload_speed); - queue.inject_P(PSTR(public_buf_m)); + sprintf_P(public_buf_m, PSTR("T%d\nG91\nG1 E-%d F%d\nG90"), uiCfg.curSprayerChoose, gCfgItems.filamentchange_unload_length, gCfgItems.filamentchange_unload_speed); + queue.inject(public_buf_m); } if (((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius - gCfgItems.filament_limit_temper)) <= 1) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp index 08fdb007fc21..59e04e74028d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp @@ -111,9 +111,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_eeprom_settings(void) { lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonStore,*labelStore,*buttonStoreNarrow; + lv_obj_t *buttonStore, *labelStore; //lv_obj_t *buttonRead,*labelRead,*buttonReadNarrow; - lv_obj_t *buttonRevert, *labelRevert, *buttonRevertNarrow; + lv_obj_t *buttonRevert, *labelRevert; lv_obj_t * line1, * line2; //* line3; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EEPROM_SETTINGS_UI) { disp_state_stack._disp_index++; @@ -127,10 +127,7 @@ void lv_draw_eeprom_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -139,19 +136,11 @@ void lv_draw_eeprom_settings(void) { lv_obj_set_size(buttonRevert, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMotor, event_handler); lv_obj_set_event_cb_mks(buttonRevert, event_handler, ID_EEPROM_REVERT, NULL, 0); - lv_btn_set_style(buttonRevert, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonRevert, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonRevert); lv_btn_set_layout(buttonRevert, LV_LAYOUT_OFF); - labelRevert = lv_label_create(buttonRevert, NULL); /*Add a label to the button*/ + labelRevert = lv_label_create_empty(buttonRevert); /*Add a label to the button*/ - buttonRevertNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonRevertNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonRevertNarrow, event_handler, ID_EEPROM_REVERT_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonRevertNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonRevertNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonRevertNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonRevertNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonRevertNarrow, LV_LAYOUT_OFF); + (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_EEPROM_REVERT_ARROW); //line3 = lv_line_create(scr, NULL); //lv_ex_line(line3,line_points[2]); @@ -163,33 +152,17 @@ void lv_draw_eeprom_settings(void) { lv_obj_set_size(buttonStore, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMotor, event_handler); lv_obj_set_event_cb_mks(buttonStore, event_handler, ID_EEPROM_STORE, NULL, 0); - lv_btn_set_style(buttonStore, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonStore, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonStore); lv_btn_set_layout(buttonStore, LV_LAYOUT_OFF); - labelStore = lv_label_create(buttonStore, NULL); /*Add a label to the button*/ + labelStore = lv_label_create_empty(buttonStore); /*Add a label to the button*/ - buttonStoreNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonStoreNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonStoreNarrow, event_handler, ID_EEPROM_STORE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonStoreNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonStoreNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonStoreNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStoreNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonStoreNarrow, LV_LAYOUT_OFF); + (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_EEPROM_STORE_ARROW); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_EEPROM_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp index 1476fe0a74d2..096e72878a0e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp @@ -55,8 +55,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { gCfgItems.encoder_enable ^= true; - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); + lv_imgbtn_set_src_both(buttonEncoderState, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); lv_label_set_text(labelEncoderState, machine_menu.enable); update_spi_flash(); } @@ -82,43 +81,20 @@ void lv_draw_encoder_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.EncoderConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.EncoderConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelEncoderTips = lv_label_create(scr, NULL); - lv_obj_set_style(labelEncoderTips, &tft_style_label_rel); - lv_obj_set_pos(labelEncoderTips, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelEncoderTips, machine_menu.EncoderConfText); + labelEncoderTips = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.EncoderConfText); - buttonEncoderState = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonEncoderState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); - - lv_obj_set_event_cb_mks(buttonEncoderState, event_handler, ID_ENCODER_STATE, NULL, 0); - - lv_imgbtn_set_style(buttonEncoderState, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonEncoderState, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonEncoderState, LV_LAYOUT_OFF); - labelEncoderState = lv_label_create(buttonEncoderState, NULL); + buttonEncoderState = lv_imgbtn_create(scr, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_ENCODER_STATE); + labelEncoderState = lv_label_create_empty(buttonEncoderState); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_ENCODER_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN); + label_Back = lv_label_create_empty(buttonBack); lv_label_set_text(labelEncoderState, gCfgItems.encoder_enable ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 2a20fe39f425..435b91e1d818 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -56,20 +56,14 @@ void lv_draw_error_message(PGM_P const msg) { lv_refr_now(lv_refr_get_disp_refreshing()); if (msg) { - message = lv_label_create(scr, NULL); - lv_obj_set_style(message, &tft_style_label_rel); - lv_label_set_text(message, msg); + message = lv_label_create(scr, msg); lv_obj_align(message, NULL, LV_ALIGN_CENTER, 0, -50); } - kill_message = lv_label_create(scr, NULL); - lv_obj_set_style(kill_message, &tft_style_label_rel); - lv_label_set_text(kill_message, "PRINTER HALTED"); + kill_message = lv_label_create(scr, "PRINTER HALTED"); lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER, 0, -10); - reset_tips = lv_label_create(scr, NULL); - lv_obj_set_style(reset_tips, &tft_style_label_rel); - lv_label_set_text(reset_tips, "Please Reset"); + reset_tips = lv_label_create(scr, "Please Reset"); lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER, 0, 30); lv_task_handler(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 4bd320b64074..6402040898bd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -34,14 +34,14 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" -static lv_obj_t * scr; -extern lv_group_t* g; -static lv_obj_t * buttoType, *buttonStep, *buttonSpeed; +static lv_obj_t *scr; +extern lv_group_t *g; +static lv_obj_t *buttonType, *buttonStep, *buttonSpeed; static lv_obj_t *labelType; static lv_obj_t *labelStep; static lv_obj_t *labelSpeed; -static lv_obj_t * tempText; -static lv_obj_t * ExtruText; +static lv_obj_t *tempText; +static lv_obj_t *ExtruText; #define ID_E_ADD 1 #define ID_E_DEC 2 @@ -165,75 +165,27 @@ void lv_draw_extrusion(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttoType = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonSpeed = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_E_ADD, NULL, 0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, "F:/bmp_in.bin"); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, "F:/bmp_in.bin"); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonAdd = lv_imgbtn_create(scr, "F:/bmp_in.bin", INTERVAL_V, titleHeight, event_handler, ID_E_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_E_DEC, NULL, 0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, "F:/bmp_out.bin"); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, "F:/bmp_out.bin"); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttoType, event_handler, ID_E_TYPE, NULL, 0); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_E_STEP, NULL, 0); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_E_SPEED, NULL, 0); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_E_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonSpeed, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonDec = lv_imgbtn_create(scr, "F:/bmp_out.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_E_DEC); + buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_TYPE); + buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_STEP); + buttonSpeed = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_SPEED); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t *labelDec = lv_label_create(buttonDec, NULL); - labelType = lv_label_create(buttoType, NULL); - labelStep = lv_label_create(buttonStep, NULL); - labelSpeed = lv_label_create(buttonSpeed, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); + lv_obj_t *labelDec = lv_label_create_empty(buttonDec); + labelType = lv_label_create_empty(buttonType); + labelStep = lv_label_create_empty(buttonStep); + labelSpeed = lv_label_create_empty(buttonSpeed); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, extrude_menu.in); @@ -250,7 +202,7 @@ void lv_draw_extrusion(void) { if (gCfgItems.encoder_enable) { lv_group_add_obj(g, buttonAdd); lv_group_add_obj(g, buttonDec); - lv_group_add_obj(g, buttoType); + lv_group_add_obj(g, buttonType); lv_group_add_obj(g, buttonStep); lv_group_add_obj(g, buttonSpeed); lv_group_add_obj(g, buttonBack); @@ -261,47 +213,39 @@ void lv_draw_extrusion(void) { disp_ext_step(); disp_ext_speed(); - tempText = lv_label_create(scr, NULL); + tempText = lv_label_create_empty(scr); lv_obj_set_style(tempText, &tft_style_label_rel); disp_hotend_temp(); - ExtruText = lv_label_create(scr, NULL); + ExtruText = lv_label_create_empty(scr); lv_obj_set_style(ExtruText, &tft_style_label_rel); disp_extru_amount(); } void disp_ext_type() { if (uiCfg.curSprayerChoose == 1) { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, extrude_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } else { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, extrude_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } void disp_ext_speed() { - if (uiCfg.extruSpeed == 20) { - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, "F:/bmp_speed_high.bin"); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed_high.bin"); - } - else if (uiCfg.extruSpeed == 1) { - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, "F:/bmp_speed_slow.bin"); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed_slow.bin"); - } - else { - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, "F:/bmp_speed_normal.bin"); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed_normal.bin"); - } + if (uiCfg.extruSpeed == 20) + lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_high.bin"); + else if (uiCfg.extruSpeed == 1) + lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_slow.bin"); + else + lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_normal.bin"); if (gCfgItems.multiple_language) { if (uiCfg.extruSpeed == 20) { @@ -323,7 +267,7 @@ void disp_hotend_temp() { char buf[20] = {0}; public_buf_l[0] = '\0'; strcat(public_buf_l, extrude_menu.temper_text); - sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); strcat(public_buf_l, buf); lv_label_set_text(tempText, public_buf_l); lv_obj_align(tempText, NULL, LV_ALIGN_CENTER, 0, -50); @@ -364,18 +308,12 @@ void disp_extru_amount() { } void disp_ext_step() { - if (uiCfg.extruStep == 1) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step1_mm.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step1_mm.bin"); - } - else if (uiCfg.extruStep == 5) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step5_mm.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step5_mm.bin"); - } - else if (uiCfg.extruStep == 10) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step10_mm.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_mm.bin"); - } + if (uiCfg.extruStep == 1) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_mm.bin"); + else if (uiCfg.extruStep == 5) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_mm.bin"); + else if (uiCfg.extruStep == 10) + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_mm.bin"); if (gCfgItems.multiple_language) { if (uiCfg.extruStep == 1) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 5d7bb335dc98..6024d58203a3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -132,82 +132,27 @@ void lv_draw_fan(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttonHigh = lv_imgbtn_create(scr, NULL); - buttonMid = lv_imgbtn_create(scr, NULL); - buttonOff = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_F_ADD, NULL, 0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, "F:/bmp_Add.bin"); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, "F:/bmp_Add.bin"); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_F_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_F_DEC, NULL, 0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, "F:/bmp_Dec.bin"); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, "F:/bmp_Dec.bin"); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonHigh, event_handler,ID_F_HIGH, NULL,0); - lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_REL, "F:/bmp_speed255.bin"); - lv_imgbtn_set_src(buttonHigh, LV_BTN_STATE_PR, "F:/bmp_speed255.bin"); - lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHigh, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonMid, event_handler,ID_F_MID, NULL,0); - lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_REL, "F:/bmp_speed127.bin"); - lv_imgbtn_set_src(buttonMid, LV_BTN_STATE_PR, "F:/bmp_speed127.bin"); - lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMid, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonOff, event_handler,ID_F_OFF, NULL,0); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, "F:/bmp_speed0.bin"); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, "F:/bmp_speed0.bin"); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_F_RETURN, NULL,0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - #endif - - lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonHigh, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonMid, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_F_DEC); + buttonHigh = lv_imgbtn_create(scr, "F:/bmp_speed255.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_HIGH); + buttonMid = lv_imgbtn_create(scr, "F:/bmp_speed127.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_MID); + buttonOff = lv_imgbtn_create(scr, "F:/bmp_speed0.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_OFF); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHigh, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMid, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t *labelDec = lv_label_create(buttonDec, NULL); - lv_obj_t *labelHigh = lv_label_create(buttonHigh, NULL); - lv_obj_t *labelMid = lv_label_create(buttonMid, NULL); - lv_obj_t *labelOff = lv_label_create(buttonOff, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); + lv_obj_t *labelDec = lv_label_create_empty(buttonDec); + lv_obj_t *labelHigh = lv_label_create_empty(buttonHigh); + lv_obj_t *labelMid = lv_label_create_empty(buttonMid); + lv_obj_t *labelOff = lv_label_create_empty(buttonOff); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, fan_menu.add); @@ -239,7 +184,7 @@ void lv_draw_fan(void) { } #endif - fanText = lv_label_create(scr, NULL); + fanText = lv_label_create_empty(scr); lv_obj_set_style(fanText, &tft_style_label_rel); disp_fan_value(); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index 4c9060c6a286..be6defda187c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -32,11 +32,11 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t *buttoType; +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *buttonType; static lv_obj_t *labelType; -static lv_obj_t * tempText1; +static lv_obj_t *tempText1; #define ID_FILAMNT_IN 1 #define ID_FILAMNT_OUT 2 @@ -144,57 +144,23 @@ void lv_draw_filament_change(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonIn = lv_imgbtn_create(scr, NULL); - buttonOut = lv_imgbtn_create(scr, NULL); - buttoType = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonIn, event_handler, ID_FILAMNT_IN, NULL, 0); - lv_imgbtn_set_src(buttonIn, LV_BTN_STATE_REL, "F:/bmp_in.bin"); - lv_imgbtn_set_src(buttonIn, LV_BTN_STATE_PR, "F:/bmp_in.bin"); - lv_imgbtn_set_style(buttonIn, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonIn, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonIn = lv_imgbtn_create(scr, "F:/bmp_in.bin", INTERVAL_V, titleHeight, event_handler, ID_FILAMNT_IN); lv_obj_clear_protect(buttonIn, LV_PROTECT_FOLLOW); - lv_obj_set_event_cb_mks(buttonOut, event_handler, ID_FILAMNT_OUT, NULL, 0); - lv_imgbtn_set_src(buttonOut, LV_BTN_STATE_REL, "F:/bmp_out.bin"); - lv_imgbtn_set_src(buttonOut, LV_BTN_STATE_PR, "F:/bmp_out.bin"); - lv_imgbtn_set_style(buttonOut, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOut, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttoType, event_handler, ID_FILAMNT_TYPE, NULL, 0); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_FILAMNT_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonIn, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonOut, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonOut = lv_imgbtn_create(scr, "F:/bmp_out.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_FILAMNT_OUT); + buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_TYPE); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonIn, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOut, LV_LAYOUT_OFF); - lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelIn = lv_label_create(buttonIn, NULL); - lv_obj_t *labelOut = lv_label_create(buttonOut, NULL); - labelType = lv_label_create(buttoType, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelIn = lv_label_create_empty(buttonIn); + lv_obj_t *labelOut = lv_label_create_empty(buttonOut); + labelType = lv_label_create_empty(buttonType); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelIn, filament_menu.in); @@ -211,33 +177,31 @@ void lv_draw_filament_change(void) { if (gCfgItems.encoder_enable) { lv_group_add_obj(g, buttonIn); lv_group_add_obj(g, buttonOut); - lv_group_add_obj(g, buttoType); + lv_group_add_obj(g, buttonType); lv_group_add_obj(g, buttonBack); } #endif disp_filament_type(); - tempText1 = lv_label_create(scr, NULL); + tempText1 = lv_label_create_empty(scr); lv_obj_set_style(tempText1, &tft_style_label_rel); disp_filament_temp(); } void disp_filament_type() { if (uiCfg.curSprayerChoose == 1) { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } else { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp index 377c44edb768..2a096eafac3b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp @@ -127,12 +127,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_filament_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelInLengthText = NULL, *buttonInLengthValue = NULL, *labelInLengthValue = NULL; - lv_obj_t *labelInSpeedText = NULL, *buttonInSpeedValue = NULL, *labelInSpeedValue = NULL; - lv_obj_t *labelOutLengthText = NULL, *buttonOutLengthValue = NULL, *labelOutLengthValue = NULL; - lv_obj_t *labelOutSpeedText = NULL, *buttonOutSpeedValue = NULL, *labelOutSpeedValue = NULL; - lv_obj_t *labelTemperText = NULL, *buttonTemperValue = NULL, *labelTemperValue = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + lv_obj_t *buttonInLengthValue = NULL, *labelInLengthValue = NULL; + lv_obj_t *buttonInSpeedValue = NULL, *labelInSpeedValue = NULL; + lv_obj_t *buttonOutLengthValue = NULL, *labelOutLengthValue = NULL; + lv_obj_t *buttonOutSpeedValue = NULL, *labelOutSpeedValue = NULL; + lv_obj_t *buttonTemperValue = NULL, *labelTemperValue = NULL; + lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FILAMENT_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = FILAMENT_SETTINGS_UI; @@ -145,82 +145,44 @@ void lv_draw_filament_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.FilamentConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.FilamentConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelInLengthText = lv_label_create(scr, NULL); - lv_obj_set_style(labelInLengthText, &tft_style_label_rel); - lv_obj_set_pos(labelInLengthText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelInLengthText, machine_menu.InLength); - - buttonInLengthValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonInLengthValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonInLengthValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonInLengthValue, event_handler, ID_FILAMENT_SET_IN_LENGTH, NULL, 0); - lv_btn_set_style(buttonInLengthValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonInLengthValue, LV_BTN_STYLE_PR, &style_para_value); - labelInLengthValue = lv_label_create(buttonInLengthValue, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.InLength); + + buttonInLengthValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_IN_LENGTH); + labelInLengthValue = lv_label_create_empty(buttonInLengthValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelInSpeedText = lv_label_create(scr, NULL); - lv_obj_set_style(labelInSpeedText, &tft_style_label_rel); - lv_obj_set_pos(labelInSpeedText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelInSpeedText, machine_menu.InSpeed); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.InSpeed); - buttonInSpeedValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonInSpeedValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonInSpeedValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonInSpeedValue, event_handler, ID_FILAMENT_SET_IN_SPEED, NULL, 0); - lv_btn_set_style(buttonInSpeedValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonInSpeedValue, LV_BTN_STYLE_PR, &style_para_value); - labelInSpeedValue = lv_label_create(buttonInSpeedValue, NULL); + buttonInSpeedValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_IN_SPEED); + labelInSpeedValue = lv_label_create_empty(buttonInSpeedValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelOutLengthText = lv_label_create(scr, NULL); - lv_obj_set_style(labelOutLengthText, &tft_style_label_rel); - lv_obj_set_pos(labelOutLengthText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 6); - lv_label_set_text(labelOutLengthText, machine_menu.OutLength); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 6, machine_menu.OutLength); - buttonOutLengthValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonOutLengthValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonOutLengthValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonOutLengthValue, event_handler, ID_FILAMENT_SET_OUT_LENGTH, NULL, 0); - lv_btn_set_style(buttonOutLengthValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonOutLengthValue, LV_BTN_STYLE_PR, &style_para_value); - labelOutLengthValue = lv_label_create(buttonOutLengthValue, NULL); + buttonOutLengthValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_OUT_LENGTH); + labelOutLengthValue = lv_label_create_empty(buttonOutLengthValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelOutSpeedText = lv_label_create(scr, NULL); - lv_obj_set_style(labelOutSpeedText, &tft_style_label_rel); - lv_obj_set_pos(labelOutSpeedText, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelOutSpeedText, machine_menu.OutSpeed); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.OutSpeed); - buttonOutSpeedValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonOutSpeedValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonOutSpeedValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonOutSpeedValue, event_handler, ID_FILAMENT_SET_OUT_SPEED, NULL, 0); - lv_btn_set_style(buttonOutSpeedValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonOutSpeedValue, LV_BTN_STYLE_PR, &style_para_value); - labelOutSpeedValue = lv_label_create(buttonOutSpeedValue, NULL); + buttonOutSpeedValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_OUT_SPEED); + labelOutSpeedValue = lv_label_create_empty(buttonOutSpeedValue); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FILAMENT_SET_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_FILAMENT_SET_DOWN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -233,26 +195,15 @@ void lv_draw_filament_settings(void) { #endif } else { - labelTemperText = lv_label_create(scr, NULL); - lv_obj_set_style(labelTemperText, &tft_style_label_rel); - lv_obj_set_pos(labelTemperText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelTemperText, machine_menu.FilamentTemperature); - - buttonTemperValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonTemperValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonTemperValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonTemperValue, event_handler, ID_FILAMENT_SET_TEMP, NULL, 0); - lv_btn_set_style(buttonTemperValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonTemperValue, LV_BTN_STYLE_PR, &style_para_value); - labelTemperValue = lv_label_create(buttonTemperValue, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.FilamentTemperature); + + buttonTemperValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_TEMP); + labelTemperValue = lv_label_create_empty(buttonTemperValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FILAMENT_SET_UP, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create_back(scr, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_UP); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -262,17 +213,10 @@ void lv_draw_filament_settings(void) { #endif } - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_FILAMENT_SET_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_RETURN); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); @@ -280,22 +224,18 @@ void lv_draw_filament_settings(void) { if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length); lv_label_set_text(labelInLengthValue, public_buf_l); lv_obj_align(labelInLengthValue, buttonInLengthValue, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_speed); lv_label_set_text(labelInSpeedValue, public_buf_l); lv_obj_align(labelInSpeedValue, buttonInSpeedValue, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_length); lv_label_set_text(labelOutLengthValue, public_buf_l); lv_obj_align(labelOutLengthValue, buttonOutLengthValue, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_speed); lv_label_set_text(labelOutSpeedValue, public_buf_l); lv_obj_align(labelOutSpeedValue, buttonOutSpeedValue, LV_ALIGN_CENTER, 0, 0); @@ -304,7 +244,6 @@ void lv_draw_filament_settings(void) { lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); } else { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filament_limit_temper); lv_label_set_text(labelTemperValue, public_buf_l); lv_obj_align(labelTemperValue, buttonTemperValue, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index c7264f2765ba..4e22c134ac24 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -120,92 +120,29 @@ void lv_draw_home(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons //buttonWifi = lv_imgbtn_create(scr, NULL); - buttonHomeAll = lv_imgbtn_create(scr, NULL); - buttonHomeX = lv_imgbtn_create(scr, NULL); //buttonContinue = lv_imgbtn_create(scr, NULL); - buttonHomeY = lv_imgbtn_create(scr, NULL); - buttonHomeZ = lv_imgbtn_create(scr, NULL); - buttonOffAll = lv_imgbtn_create(scr, NULL); - buttonOffXY = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - #if 1 - lv_obj_set_event_cb_mks(buttonHomeAll, event_handler,ID_H_ALL, NULL,0); - lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_REL, "F:/bmp_zeroAll.bin"); - lv_imgbtn_set_src(buttonHomeAll, LV_BTN_STATE_PR, "F:/bmp_zeroAll.bin"); - lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHomeAll, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonHomeX, event_handler, ID_H_X, NULL, 0); - lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_REL, "F:/bmp_zeroX.bin"); - lv_imgbtn_set_src(buttonHomeX, LV_BTN_STATE_PR, "F:/bmp_zeroX.bin"); - lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHomeX, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonHomeY, event_handler, ID_H_Y, NULL, 0); - lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_REL, "F:/bmp_zeroY.bin"); - lv_imgbtn_set_src(buttonHomeY, LV_BTN_STATE_PR, "F:/bmp_zeroY.bin"); - lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHomeY, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonHomeZ, event_handler, ID_H_Z, NULL, 0); - lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_REL, "F:/bmp_zeroZ.bin"); - lv_imgbtn_set_src(buttonHomeZ, LV_BTN_STATE_PR, "F:/bmp_zeroZ.bin"); - lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHomeZ, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonOffAll, event_handler,ID_H_OFF_ALL, NULL,0); - lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_REL, "F:/bmp_function1.bin"); - lv_imgbtn_set_src(buttonOffAll, LV_BTN_STATE_PR, "F:/bmp_function1.bin"); - lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOffAll, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonOffXY, event_handler,ID_H_OFF_XY, NULL,0); - lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_REL, "F:/bmp_function1.bin"); - lv_imgbtn_set_src(buttonOffXY, LV_BTN_STATE_PR, "F:/bmp_function1.bin"); - lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOffXY, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_H_RETURN, NULL,0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonHomeAll, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonHomeX, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonHomeY, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonHomeZ, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonOffAll, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonOffXY, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonHomeAll = lv_imgbtn_create(scr, "F:/bmp_zeroAll.bin", INTERVAL_V, titleHeight, event_handler, ID_H_ALL); + buttonHomeX = lv_imgbtn_create(scr, "F:/bmp_zeroX.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_H_X); + buttonHomeY = lv_imgbtn_create(scr, "F:/bmp_zeroY.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_H_Y); + buttonHomeZ = lv_imgbtn_create(scr, "F:/bmp_zeroZ.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_H_Z); + buttonOffAll = lv_imgbtn_create(scr, "F:/bmp_function1.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_ALL); + buttonOffXY = lv_imgbtn_create(scr, "F:/bmp_function1.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_XY); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonHomeAll, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeX, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeY, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHomeZ, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOffAll, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOffXY, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelHomeAll = lv_label_create(buttonHomeAll, NULL); - lv_obj_t *labelHomeX = lv_label_create(buttonHomeX, NULL); - lv_obj_t *labelHomeY = lv_label_create(buttonHomeY, NULL); - lv_obj_t *labelHomeZ = lv_label_create(buttonHomeZ, NULL); - lv_obj_t *labelOffAll = lv_label_create(buttonOffAll, NULL); - lv_obj_t *labelOffXY = lv_label_create(buttonOffXY, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelHomeAll = lv_label_create_empty(buttonHomeAll); + lv_obj_t *labelHomeX = lv_label_create_empty(buttonHomeX); + lv_obj_t *labelHomeY = lv_label_create_empty(buttonHomeY); + lv_obj_t *labelHomeZ = lv_label_create_empty(buttonHomeZ); + lv_obj_t *labelOffAll = lv_label_create_empty(buttonOffAll); + lv_obj_t *labelOffXY = lv_label_create_empty(buttonOffXY); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelHomeAll, home_menu.home_all); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp index d819aa01f640..67025f92c58c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp @@ -98,13 +98,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_homing_sensitivity_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; #if Z2_SENSORLESS - lv_obj_t *labelZ2Text = NULL, *buttonZ2Value = NULL, *labelZ2Value = NULL; - lv_obj_t * line4 = NULL; + lv_obj_t *buttonZ2Value = NULL, *labelZ2Value = NULL; + lv_obj_t *line4 = NULL; #endif if (disp_state_stack._disp_state[disp_state_stack._disp_index] != HOMING_SENSITIVITY_UI) { disp_state_stack._disp_index++; @@ -118,25 +118,14 @@ void lv_draw_homing_sensitivity_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.HomingSensitivityConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.HomingSensitivityConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.X_Sensitivity); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Sensitivity); - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_SENSITIVITY_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_X); + labelXValue = lv_label_create_empty(buttonXValue); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonXValue); @@ -145,18 +134,10 @@ void lv_draw_homing_sensitivity_settings(void) { line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.Y_Sensitivity); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Sensitivity); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_SENSITIVITY_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Y); + labelYValue = lv_label_create_empty(buttonYValue); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonYValue); @@ -165,18 +146,10 @@ void lv_draw_homing_sensitivity_settings(void) { line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.Z_Sensitivity); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Sensitivity); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_SENSITIVITY_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Z); + labelZValue = lv_label_create_empty(buttonZValue); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable == true) lv_group_add_obj(g, buttonZValue); @@ -186,18 +159,10 @@ void lv_draw_homing_sensitivity_settings(void) { lv_ex_line(line3, line_points[2]); #if Z2_SENSORLESS - labelZ2Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelZ2Text, &tft_style_label_rel); - lv_obj_set_pos(labelZ2Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelZ2Text, machine_menu.Z2_Sensitivity); - - buttonZ2Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZ2Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonZ2Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZ2Value, event_handler, ID_SENSITIVITY_Z2, NULL, 0); - lv_btn_set_style(buttonZ2Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZ2Value, LV_BTN_STYLE_PR, &style_para_value); - labelZ2Value = lv_label_create(buttonZ2Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.Z2_Sensitivity); + + buttonZ2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Z2); + labelZ2Value = lv_label_create_empty(buttonZ2Value); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZ2Value); @@ -207,13 +172,8 @@ void lv_draw_homing_sensitivity_settings(void) { lv_ex_line(line4, line_points[3]); #endif - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_SENSITIVITY_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_RETURN); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp index 65649b793e58..45d94020e261 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp @@ -94,11 +94,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_jerk_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *labelEText = NULL, *buttonEValue = NULL, *labelEValue = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonEValue = NULL, *labelEValue = NULL; + lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != JERK_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = JERK_UI; @@ -111,85 +111,44 @@ void lv_draw_jerk_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.JerkConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.JerkConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.X_Jerk); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Jerk); - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_JERK_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_X); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.Y_Jerk); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Jerk); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_JERK_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_Y); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.Z_Jerk); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Jerk); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_JERK_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_Z); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelEText = lv_label_create(scr, NULL); - lv_obj_set_style(labelEText, &tft_style_label_rel); - lv_obj_set_pos(labelEText, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelEText, machine_menu.E_Jerk); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E_Jerk); - buttonEValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonEValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonEValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonEValue, event_handler, ID_JERK_E, NULL, 0); - lv_btn_set_style(buttonEValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonEValue, LV_BTN_STYLE_PR, &style_para_value); - labelEValue = lv_label_create(buttonEValue, NULL); + buttonEValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_E); + labelEValue = lv_label_create_empty(buttonEValue); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_JERK_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_JERK_RETURN); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable == true) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 4cd2cab72fd8..b5c2da09aa33 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -62,8 +62,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, "F:/bmp_simplified_cn_sel.bin"); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, "F:/bmp_simplified_cn_sel.bin"); + lv_imgbtn_set_src_both(buttonCN, "F:/bmp_simplified_cn_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonCN); gCfgItems.language = LANG_SIMPLE_CHINESE; update_spi_flash(); @@ -76,8 +75,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, "F:/bmp_traditional_cn_sel.bin"); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, "F:/bmp_traditional_cn_sel.bin"); + lv_imgbtn_set_src_both(buttonT_CN, "F:/bmp_traditional_cn_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonT_CN); gCfgItems.language = LANG_COMPLEX_CHINESE; update_spi_flash(); @@ -90,8 +88,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, "F:/bmp_english_sel.bin"); - lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, "F:/bmp_english_sel.bin"); + lv_imgbtn_set_src_both(buttonEN, "F:/bmp_english_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonEN); gCfgItems.language = LANG_ENGLISH; update_spi_flash(); @@ -104,8 +101,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, "F:/bmp_russian_sel.bin"); - lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, "F:/bmp_russian_sel.bin"); + lv_imgbtn_set_src_both(buttonRU, "F:/bmp_russian_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonRU); gCfgItems.language = LANG_RUSSIAN; update_spi_flash(); @@ -118,8 +114,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, "F:/bmp_spanish_sel.bin"); - lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, "F:/bmp_spanish_sel.bin"); + lv_imgbtn_set_src_both(buttonES, "F:/bmp_spanish_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonES); gCfgItems.language = LANG_SPANISH; update_spi_flash(); @@ -132,8 +127,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, "F:/bmp_french_sel.bin"); - lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, "F:/bmp_french_sel.bin"); + lv_imgbtn_set_src_both(buttonFR, "F:/bmp_french_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonFR); gCfgItems.language = LANG_FRENCH; update_spi_flash(); @@ -146,8 +140,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, "F:/bmp_italy_sel.bin"); - lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, "F:/bmp_italy_sel.bin"); + lv_imgbtn_set_src_both(buttonIT, "F:/bmp_italy_sel.bin"); lv_obj_refresh_ext_draw_pad(buttonIT); gCfgItems.language = LANG_ITALY; update_spi_flash(); @@ -159,7 +152,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - buttonCN = NULL; buttonT_CN = NULL; buttonEN = NULL; @@ -231,8 +223,7 @@ static void disp_language(uint8_t language, uint8_t state) { strcat_P(public_buf_l, PSTR(".bin")); lv_obj_set_event_cb_mks(obj, event_handler, id, NULL, 0); - lv_imgbtn_set_src(obj, LV_BTN_STATE_REL, public_buf_l); - lv_imgbtn_set_src(obj, LV_BTN_STATE_PR, public_buf_l); + lv_imgbtn_set_src_both(obj, public_buf_l); if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); } @@ -253,102 +244,30 @@ void lv_draw_language(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonCN = lv_imgbtn_create(scr, NULL); - buttonT_CN = lv_imgbtn_create(scr, NULL); - buttonEN = lv_imgbtn_create(scr, NULL); - buttonRU = lv_imgbtn_create(scr, NULL); - buttonES = lv_imgbtn_create(scr, NULL); - buttonFR = lv_imgbtn_create(scr, NULL); - buttonIT = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonCN, event_handler, ID_CN, NULL, 0); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_REL, "F:/bmp_simplified_cn.bin"); - lv_imgbtn_set_src(buttonCN, LV_BTN_STATE_PR, "F:/bmp_simplified_cn.bin"); - lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonCN, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonCN = lv_imgbtn_create(scr, "F:/bmp_simplified_cn.bin", INTERVAL_V, titleHeight, event_handler, ID_CN); lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); - - #if 1 - lv_obj_set_event_cb_mks(buttonT_CN, event_handler, ID_T_CN, NULL, 0); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_REL, "F:/bmp_traditional_cn.bin"); - lv_imgbtn_set_src(buttonT_CN, LV_BTN_STATE_PR, "F:/bmp_traditional_cn.bin"); - lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonT_CN, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonEN, event_handler, ID_EN, NULL, 0); - lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_REL, "F:/bmp_english.bin"); - lv_imgbtn_set_src(buttonEN, LV_BTN_STATE_PR, "F:/bmp_english.bin"); - lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonEN, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonRU, event_handler, ID_RU, NULL, 0); - lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_REL, "F:/bmp_russian.bin"); - lv_imgbtn_set_src(buttonRU, LV_BTN_STATE_PR, "F:/bmp_russian.bin"); - lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonRU, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonES, event_handler, ID_ES, NULL, 0); - lv_imgbtn_set_src(buttonES, LV_BTN_STATE_REL, "F:/bmp_spanish.bin"); - lv_imgbtn_set_src(buttonES, LV_BTN_STATE_PR, "F:/bmp_spanish.bin"); - lv_imgbtn_set_style(buttonES, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonES, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonFR, event_handler, ID_FR, NULL, 0); - lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_REL, "F:/bmp_french.bin"); - lv_imgbtn_set_src(buttonFR, LV_BTN_STATE_PR, "F:/bmp_french.bin"); - lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFR, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonIT, event_handler, ID_IT, NULL, 0); - lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_REL, "F:/bmp_italy.bin"); - lv_imgbtn_set_src(buttonIT, LV_BTN_STATE_PR, "F:/bmp_italy.bin"); - lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonIT, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_L_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - #endif // if 1 - - lv_obj_set_pos(buttonCN, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonT_CN, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonEN, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonRU, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonES, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonFR, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonIT, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonT_CN = lv_imgbtn_create(scr, "F:/bmp_traditional_cn.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_CN); + buttonEN = lv_imgbtn_create(scr, "F:/bmp_english.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_EN); + buttonRU = lv_imgbtn_create(scr, "F:/bmp_russian.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_RU); + buttonES = lv_imgbtn_create(scr, "F:/bmp_spanish.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_ES); + buttonFR = lv_imgbtn_create(scr, "F:/bmp_french.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FR); + buttonIT = lv_imgbtn_create(scr, "F:/bmp_italy.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_IT); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_L_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonCN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonT_CN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonEN, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonRU, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonES, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFR, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonIT, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *label_CN = lv_label_create(buttonCN, NULL); - lv_obj_t *label_T_CN = lv_label_create(buttonT_CN, NULL); - lv_obj_t *label_EN = lv_label_create(buttonEN, NULL); - lv_obj_t *label_RU = lv_label_create(buttonRU, NULL); - lv_obj_t *label_ES = lv_label_create(buttonES, NULL); - lv_obj_t *label_FR = lv_label_create(buttonFR, NULL); - lv_obj_t *label_IT = lv_label_create(buttonIT, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *label_CN = lv_label_create_empty(buttonCN); + lv_obj_t *label_T_CN = lv_label_create_empty(buttonT_CN); + lv_obj_t *label_EN = lv_label_create_empty(buttonEN); + lv_obj_t *label_RU = lv_label_create_empty(buttonRU); + lv_obj_t *label_ES = lv_label_create_empty(buttonES); + lv_obj_t *label_FR = lv_label_create_empty(buttonFR); + lv_obj_t *label_IT = lv_label_create_empty(buttonIT); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); disp_language(gCfgItems.language, SELECTED); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp index 2f4fe327fd09..d742f79e5971 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp @@ -133,10 +133,7 @@ void lv_draw_level_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.LevelingParaConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -145,22 +142,15 @@ void lv_draw_level_settings(void) { lv_obj_set_pos(buttonPosition, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ lv_obj_set_size(buttonPosition, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ lv_obj_set_event_cb_mks(buttonPosition, event_handler, ID_LEVEL_POSITION, NULL, 0); - lv_btn_set_style(buttonPosition, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonPosition, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonPosition); lv_btn_set_layout(buttonPosition, LV_LAYOUT_OFF); - labelPosition = lv_label_create(buttonPosition, NULL); /*Add a label to the button*/ + labelPosition = lv_label_create_empty(buttonPosition); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonPosition); #endif - buttonPositionNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonPositionNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonPositionNarrow, event_handler, ID_LEVEL_POSITION_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonPositionNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonPositionNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonPositionNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPositionNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonPositionNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_LEVEL_POSITION_ARROW); lv_btn_set_layout(buttonPositionNarrow, LV_LAYOUT_OFF); line1 = lv_line_create(scr, NULL); @@ -170,22 +160,15 @@ void lv_draw_level_settings(void) { lv_obj_set_pos(buttonCommand, PARA_UI_POS_X, PARA_UI_POS_Y * 2); lv_obj_set_size(buttonCommand, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); lv_obj_set_event_cb_mks(buttonCommand, event_handler, ID_LEVEL_COMMAND, NULL, 0); - lv_btn_set_style(buttonCommand, LV_BTN_STYLE_REL, &tft_style_label_rel); - lv_btn_set_style(buttonCommand, LV_BTN_STYLE_PR, &tft_style_label_pre); + lv_btn_use_label_style(buttonCommand); lv_btn_set_layout(buttonCommand, LV_LAYOUT_OFF); - labelCommand = lv_label_create(buttonCommand, NULL); + labelCommand = lv_label_create_empty(buttonCommand); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonCommand); #endif - buttonCommandNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonCommandNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonCommandNarrow, event_handler, ID_LEVEL_COMMAND_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonCommandNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonCommandNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonCommandNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonCommandNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonCommandNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_LEVEL_COMMAND_ARROW); lv_btn_set_layout(buttonCommandNarrow, LV_LAYOUT_OFF); line2 = lv_line_create(scr, NULL); @@ -193,26 +176,15 @@ void lv_draw_level_settings(void) { #if HAS_BED_PROBE - buttonZoffset = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonZoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ - lv_obj_set_size(buttonZoffset, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb_mks(buttonZoffset, event_handler, ID_LEVEL_ZOFFSET, NULL, 0); - lv_btn_set_style(buttonZoffset, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonZoffset, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + buttonZoffset = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_LEVEL_ZOFFSET); lv_btn_set_layout(buttonZoffset, LV_LAYOUT_OFF); - labelZoffset = lv_label_create(buttonZoffset, NULL); /*Add a label to the button*/ + labelZoffset = lv_label_create_empty(buttonZoffset); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZoffset); #endif - buttonZoffsetNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonZoffsetNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonZoffsetNarrow, event_handler, ID_LEVEL_ZOFFSET_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonZoffsetNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonZoffsetNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonZoffsetNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZoffsetNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonZoffsetNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_LEVEL_ZOFFSET_ARROW); lv_btn_set_layout(buttonZoffsetNarrow, LV_LAYOUT_OFF); line3 = lv_line_create(scr, NULL); @@ -220,19 +192,14 @@ void lv_draw_level_settings(void) { #endif // HAS_BED_PROBE - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_LEVEL_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_LEVEL_RETURN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp index b79e84e8cb98..2309822e863e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp @@ -146,10 +146,7 @@ void lv_draw_machine_para(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -158,19 +155,11 @@ void lv_draw_machine_para(void) { lv_obj_set_size(buttonMachine, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0); - lv_btn_set_style(buttonMachine, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonMachine, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonMachine); lv_btn_set_layout(buttonMachine, LV_LAYOUT_OFF); - labelMachine = lv_label_create(buttonMachine, NULL); /*Add a label to the button*/ + labelMachine = lv_label_create_empty(buttonMachine); /*Add a label to the button*/ - buttonMachineNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonMachineNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonMachineNarrow, event_handler, ID_PARA_MACHINE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonMachineNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonMachineNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonMachineNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMachineNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonMachineNarrow, LV_LAYOUT_OFF); + buttonMachineNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_PARA_MACHINE_ARROW); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); @@ -180,41 +169,21 @@ void lv_draw_machine_para(void) { lv_obj_set_size(buttonMotor, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMotor, event_handler); lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0); - lv_btn_set_style(buttonMotor, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonMotor, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonMotor); lv_btn_set_layout(buttonMotor, LV_LAYOUT_OFF); - labelMotor = lv_label_create(buttonMotor, NULL); /*Add a label to the button*/ + labelMotor = lv_label_create_empty(buttonMotor); /*Add a label to the button*/ - buttonMotorNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonMotorNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonMotorNarrow, event_handler, ID_PARA_MOTOR_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonMotorNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonMotorNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonMotorNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMotorNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonMotorNarrow, LV_LAYOUT_OFF); + buttonMotorNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_PARA_MOTOR_ARROW); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - buttonLevel = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonLevel, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ - lv_obj_set_size(buttonLevel, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + buttonLevel = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_PARA_LEVEL); //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonLevel, event_handler, ID_PARA_LEVEL, NULL, 0); - lv_btn_set_style(buttonLevel, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonLevel, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); - labelLevel = lv_label_create(buttonLevel, NULL); /*Add a label to the button*/ + labelLevel = lv_label_create_empty(buttonLevel); /*Add a label to the button*/ - buttonLevelNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonLevelNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonLevelNarrow, event_handler, ID_PARA_LEVEL_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonLevelNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonLevelNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonLevelNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonLevelNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonLevelNarrow, LV_LAYOUT_OFF); + buttonLevelNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_PARA_LEVEL_ARROW); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); @@ -224,33 +193,18 @@ void lv_draw_machine_para(void) { lv_obj_set_size(buttonAdvance, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMotor, event_handler); lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0); - lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonAdvance, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonAdvance); lv_btn_set_layout(buttonAdvance, LV_LAYOUT_OFF); - labelAdvance = lv_label_create(buttonAdvance, NULL); /*Add a label to the button*/ - - buttonAdvanceNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonAdvanceNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 4 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonAdvanceNarrow, event_handler, ID_PARA_ADVANCE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonAdvanceNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonAdvanceNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonAdvanceNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAdvanceNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); + labelAdvance = lv_label_create_empty(buttonAdvance); /*Add a label to the button*/ + + buttonAdvanceNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 4 + PARA_UI_ARROW_V, event_handler, ID_PARA_ADVANCE_ARROW); lv_btn_set_layout(buttonAdvanceNarrow, LV_LAYOUT_OFF); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_PARA_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_PARA_RETURN); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); @@ -277,7 +231,6 @@ void lv_draw_machine_para(void) { lv_group_add_obj(g, buttonBack); } #endif - } void lv_clear_machine_para() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp index 930d2639bb05..ae83b7efbc40 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp @@ -132,10 +132,7 @@ void lv_draw_machine_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.MachineConfigTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MachineConfigTitle); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -144,19 +141,11 @@ void lv_draw_machine_settings(void) { lv_obj_set_size(buttonAcceleration, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0); - lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_REL, &tft_style_label_rel); // Set the button's released style - lv_btn_set_style(buttonAcceleration, LV_BTN_STYLE_PR, &tft_style_label_pre); // Set the button's pressed style + lv_btn_use_label_style(buttonAcceleration); lv_btn_set_layout(buttonAcceleration, LV_LAYOUT_OFF); - labelAcceleration = lv_label_create(buttonAcceleration, NULL); // Add a label to the button + labelAcceleration = lv_label_create_empty(buttonAcceleration); // Add a label to the button - buttonAccelerationNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonAccelerationNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonAccelerationNarrow, event_handler, ID_MACHINE_ACCELERATION_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonAccelerationNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonAccelerationNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonAccelerationNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAccelerationNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonAccelerationNarrow, LV_LAYOUT_OFF); + buttonAccelerationNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_MACHINE_ACCELERATION_ARROW); line1 = lv_line_create(lv_scr_act(), NULL); lv_ex_line(line1, line_points[0]); @@ -166,19 +155,11 @@ void lv_draw_machine_settings(void) { lv_obj_set_size(buttonMaxFeedrate, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0); - lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_REL, &tft_style_label_rel); // Set the button's released style - lv_btn_set_style(buttonMaxFeedrate, LV_BTN_STYLE_PR, &tft_style_label_pre); // Set the button's pressed style + lv_btn_use_label_style(buttonMaxFeedrate); lv_btn_set_layout(buttonMaxFeedrate, LV_LAYOUT_OFF); - labelMaxFeedrate = lv_label_create(buttonMaxFeedrate, NULL); // Add a label to the button + labelMaxFeedrate = lv_label_create_empty(buttonMaxFeedrate); // Add a label to the button - buttonMaxFeedrateNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonMaxFeedrateNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonMaxFeedrateNarrow, event_handler, ID_MACHINE_FEEDRATE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonMaxFeedrateNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonMaxFeedrateNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonMaxFeedrateNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMaxFeedrateNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonMaxFeedrateNarrow, LV_LAYOUT_OFF); + buttonMaxFeedrateNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_MACHINE_FEEDRATE_ARROW); line2 = lv_line_create(lv_scr_act(), NULL); lv_ex_line(line2, line_points[1]); @@ -189,34 +170,21 @@ void lv_draw_machine_settings(void) { lv_obj_set_size(buttonJerk, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size //lv_obj_set_event_cb(buttonMotor, event_handler); lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0); - lv_btn_set_style(buttonJerk, LV_BTN_STYLE_REL, &tft_style_label_rel); // Set the button's released style - lv_btn_set_style(buttonJerk, LV_BTN_STYLE_PR, &tft_style_label_pre); // Set the button's pressed style + lv_btn_use_label_style(buttonJerk); lv_btn_set_layout(buttonJerk, LV_LAYOUT_OFF); - labelJerk = lv_label_create(buttonJerk, NULL); // Add a label to the button + labelJerk = lv_label_create_empty(buttonJerk); // Add a label to the button - buttonJerkNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonJerkNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonJerkNarrow, event_handler, ID_MACHINE_JERK_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonJerkNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonJerkNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonJerkNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonJerkNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonJerkNarrow, LV_LAYOUT_OFF); + buttonJerkNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_MACHINE_JERK_ARROW); line3 = lv_line_create(lv_scr_act(), NULL); lv_ex_line(line3, line_points[2]); #endif - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MACHINE_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_MACHINE_RETURN); lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index f1040ba214a6..8c0575d34324 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -178,81 +178,26 @@ void lv_draw_manualLevel(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonPoint1 = lv_imgbtn_create(scr, NULL); - buttonPoint2 = lv_imgbtn_create(scr, NULL); - buttonPoint3 = lv_imgbtn_create(scr, NULL); - buttonPoint4 = lv_imgbtn_create(scr, NULL); - buttonPoint5 = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonPoint1, event_handler, ID_M_POINT1, NULL, 0); - lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_REL, "F:/bmp_leveling1.bin"); - lv_imgbtn_set_src(buttonPoint1, LV_BTN_STATE_PR, "F:/bmp_leveling1.bin"); - lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPoint1, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonPoint1 = lv_imgbtn_create(scr, "F:/bmp_leveling1.bin", INTERVAL_V, titleHeight, event_handler, ID_M_POINT1); lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); - - #if 1 - lv_obj_set_event_cb_mks(buttonPoint2, event_handler, ID_M_POINT2, NULL, 0); - lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_REL, "F:/bmp_leveling2.bin"); - lv_imgbtn_set_src(buttonPoint2, LV_BTN_STATE_PR, "F:/bmp_leveling2.bin"); - lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPoint2, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonPoint3, event_handler, ID_M_POINT3, NULL, 0); - lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_REL, "F:/bmp_leveling3.bin"); - lv_imgbtn_set_src(buttonPoint3, LV_BTN_STATE_PR, "F:/bmp_leveling3.bin"); - lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPoint3, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonPoint4, event_handler, ID_M_POINT4, NULL, 0); - lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_REL, "F:/bmp_leveling4.bin"); - lv_imgbtn_set_src(buttonPoint4, LV_BTN_STATE_PR, "F:/bmp_leveling4.bin"); - lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPoint4, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonPoint5, event_handler, ID_M_POINT5, NULL, 0); - lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_REL, "F:/bmp_leveling5.bin"); - lv_imgbtn_set_src(buttonPoint5, LV_BTN_STATE_PR, "F:/bmp_leveling5.bin"); - lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPoint5, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonPoint1, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonPoint2, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonPoint3, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonPoint4, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonPoint5, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonPoint2 = lv_imgbtn_create(scr, "F:/bmp_leveling2.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_POINT2); + buttonPoint3 = lv_imgbtn_create(scr, "F:/bmp_leveling3.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_POINT3); + buttonPoint4 = lv_imgbtn_create(scr, "F:/bmp_leveling4.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_POINT4); + buttonPoint5 = lv_imgbtn_create(scr, "F:/bmp_leveling5.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_POINT5); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_MANUAL_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonPoint1, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint2, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint3, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint4, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPoint5, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *label_Point1 = lv_label_create(buttonPoint1, NULL); - lv_obj_t *label_Point2 = lv_label_create(buttonPoint2, NULL); - lv_obj_t *label_Point3 = lv_label_create(buttonPoint3, NULL); - lv_obj_t *label_Point4 = lv_label_create(buttonPoint4, NULL); - lv_obj_t *label_Point5 = lv_label_create(buttonPoint5, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *label_Point1 = lv_label_create_empty(buttonPoint1); + lv_obj_t *label_Point2 = lv_label_create_empty(buttonPoint2); + lv_obj_t *label_Point3 = lv_label_create_empty(buttonPoint3); + lv_obj_t *label_Point4 = lv_label_create_empty(buttonPoint4); + lv_obj_t *label_Point5 = lv_label_create_empty(buttonPoint5); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(label_Point1, leveling_menu.position1); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp index c27718b31dd7..3f51bc1a743b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp @@ -183,15 +183,15 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_manual_level_pos_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelPoint1Text = NULL, *buttonX1Value = NULL, *labelX1Value = NULL; + lv_obj_t *buttonX1Value = NULL, *labelX1Value = NULL; lv_obj_t *buttonY1Value = NULL, *labelY1Value = NULL; - lv_obj_t *labelPoint2Text = NULL, *buttonX2Value = NULL, *labelX2Value = NULL; + lv_obj_t *buttonX2Value = NULL, *labelX2Value = NULL; lv_obj_t *buttonY2Value = NULL, *labelY2Value = NULL; - lv_obj_t *labelPoint3Text = NULL, *buttonX3Value = NULL, *labelX3Value = NULL; + lv_obj_t *buttonX3Value = NULL, *labelX3Value = NULL; lv_obj_t *buttonY3Value = NULL, *labelY3Value = NULL; - lv_obj_t *labelPoint4Text = NULL, *buttonX4Value = NULL, *labelX4Value = NULL; + lv_obj_t *buttonX4Value = NULL, *labelX4Value = NULL; lv_obj_t *buttonY4Value = NULL, *labelY4Value = NULL; - lv_obj_t *labelPoint5Text = NULL, *buttonX5Value = NULL, *labelX5Value = NULL; + lv_obj_t *buttonX5Value = NULL, *labelX5Value = NULL; lv_obj_t *buttonY5Value = NULL, *labelY5Value = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MANUAL_LEVELING_POSIGION_UI) { @@ -206,114 +206,58 @@ void lv_draw_manual_level_pos_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.LevelingParaConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelPoint1Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelPoint1Text, &tft_style_label_rel); - lv_obj_set_pos(labelPoint1Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelPoint1Text, leveling_menu.position1); - - buttonX1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonX1Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonX1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonX1Value, event_handler, ID_MANUAL_POS_X1, NULL, 0); - lv_btn_set_style(buttonX1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonX1Value, LV_BTN_STYLE_PR, &style_para_value); - labelX1Value = lv_label_create(buttonX1Value, NULL); - - buttonY1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonY1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonY1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonY1Value, event_handler, ID_MANUAL_POS_Y1, NULL, 0); - lv_btn_set_style(buttonY1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonY1Value, LV_BTN_STYLE_PR, &style_para_value); - labelY1Value = lv_label_create(buttonY1Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, leveling_menu.position1); + + buttonX1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X1); + labelX1Value = lv_label_create_empty(buttonX1Value); + + buttonY1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y1); + labelY1Value = lv_label_create_empty(buttonY1Value); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelPoint2Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelPoint2Text, &tft_style_label_rel); - lv_obj_set_pos(labelPoint2Text, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelPoint2Text, leveling_menu.position2); - - buttonX2Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonX2Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonX2Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonX2Value, event_handler, ID_MANUAL_POS_X2, NULL, 0); - lv_btn_set_style(buttonX2Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonX2Value, LV_BTN_STYLE_PR, &style_para_value); - labelX2Value = lv_label_create(buttonX2Value, NULL); - - buttonY2Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonY2Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonY2Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonY2Value, event_handler, ID_MANUAL_POS_Y2, NULL, 0); - lv_btn_set_style(buttonY2Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonY2Value, LV_BTN_STYLE_PR, &style_para_value); - labelY2Value = lv_label_create(buttonY2Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, leveling_menu.position2); + + buttonX2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X2); + labelX2Value = lv_label_create_empty(buttonX2Value); + + buttonY2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y2); + labelY2Value = lv_label_create_empty(buttonY2Value); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelPoint3Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelPoint3Text, &tft_style_label_rel); - lv_obj_set_pos(labelPoint3Text, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelPoint3Text, leveling_menu.position3); - - buttonX3Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonX3Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonX3Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonX3Value, event_handler, ID_MANUAL_POS_X3, NULL, 0); - lv_btn_set_style(buttonX3Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonX3Value, LV_BTN_STYLE_PR, &style_para_value); - labelX3Value = lv_label_create(buttonX3Value, NULL); - - buttonY3Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonY3Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonY3Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonY3Value, event_handler, ID_MANUAL_POS_Y3, NULL, 0); - lv_btn_set_style(buttonY3Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonY3Value, LV_BTN_STYLE_PR, &style_para_value); - labelY3Value = lv_label_create(buttonY3Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, leveling_menu.position3); + + buttonX3Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X3); + labelX3Value = lv_label_create_empty(buttonX3Value); + + buttonY3Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y3); + labelY3Value = lv_label_create_empty(buttonY3Value); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelPoint4Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelPoint4Text, &tft_style_label_rel); - lv_obj_set_pos(labelPoint4Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelPoint4Text, leveling_menu.position4); - - buttonX4Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonX4Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonX4Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonX4Value, event_handler, ID_MANUAL_POS_X4, NULL, 0); - lv_btn_set_style(buttonX4Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonX4Value, LV_BTN_STYLE_PR, &style_para_value); - labelX4Value = lv_label_create(buttonX4Value, NULL); - - buttonY4Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonY4Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonY4Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonY4Value, event_handler, ID_MANUAL_POS_Y4, NULL, 0); - lv_btn_set_style(buttonY4Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonY4Value, LV_BTN_STYLE_PR, &style_para_value); - labelY4Value = lv_label_create(buttonY4Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, leveling_menu.position4); + + buttonX4Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X4); + labelX4Value = lv_label_create_empty(buttonX4Value); + + buttonY4Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y4); + labelY4Value = lv_label_create_empty(buttonY4Value); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -330,34 +274,20 @@ void lv_draw_manual_level_pos_settings(void) { #endif } else { - labelPoint5Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelPoint5Text, &tft_style_label_rel); - lv_obj_set_pos(labelPoint5Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelPoint5Text, leveling_menu.position5); - - buttonX5Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonX5Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonX5Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonX5Value, event_handler, ID_MANUAL_POS_X5, NULL, 0); - lv_btn_set_style(buttonX5Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonX5Value, LV_BTN_STYLE_PR, &style_para_value); - labelX5Value = lv_label_create(buttonX5Value, NULL); - - buttonY5Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonY5Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2); - lv_obj_set_size(buttonY5Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonY5Value, event_handler, ID_MANUAL_POS_Y5, NULL, 0); - lv_btn_set_style(buttonY5Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonY5Value, LV_BTN_STYLE_PR, &style_para_value); - labelY5Value = lv_label_create(buttonY5Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, leveling_menu.position5); + + buttonX5Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X5); + labelX5Value = lv_label_create_empty(buttonX5Value); + + buttonY5Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y5); + labelY5Value = lv_label_create_empty(buttonY5Value); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_UP, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -370,15 +300,14 @@ void lv_draw_manual_level_pos_settings(void) { lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); buttonBack = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_POS_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonBack, &style_para_back); lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp index 6b43b8257bb7..ff01ceaa6e01 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -128,12 +128,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_max_feedrate_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MAXFEEDRATE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MAXFEEDRATE_UI; @@ -146,86 +146,50 @@ void lv_draw_max_feedrate_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.MaxFeedRateConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MaxFeedRateConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.XMaxFeedRate); - - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_FEED_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.XMaxFeedRate); + + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_X); lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); - labelXValue = lv_label_create(buttonXValue, NULL); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.YMaxFeedRate); - - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_FEED_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.YMaxFeedRate); + + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_Y); lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); - labelYValue = lv_label_create(buttonYValue, NULL); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.ZMaxFeedRate); - - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_FEED_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.ZMaxFeedRate); + + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_Z); lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); - labelZValue = lv_label_create(buttonZValue, NULL); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelE0Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE0Text, &tft_style_label_rel); - lv_obj_set_pos(labelE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelE0Text, machine_menu.E0MaxFeedRate); - - buttonE0Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE0Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_FEED_E0, NULL, 0); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_PR, &style_para_value); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0MaxFeedRate); + + buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_E0); lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); - labelE0Value = lv_label_create(buttonE0Value, NULL); + labelE0Value = lv_label_create_empty(buttonE0Value); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -238,19 +202,11 @@ void lv_draw_max_feedrate_settings(void) { #endif } else { - labelE1Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE1Text, &tft_style_label_rel); - lv_obj_set_pos(labelE1Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelE1Text, machine_menu.E1MaxFeedRate); - - buttonE1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_FEED_E1, NULL, 0); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_PR, &style_para_value); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1MaxFeedRate); + + buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_E1); lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); - labelE1Value = lv_label_create(buttonE1Value, NULL); + labelE1Value = lv_label_create_empty(buttonE1Value); line1 = lv_line_create(scr, NULL); @@ -258,8 +214,7 @@ void lv_draw_max_feedrate_settings(void) { buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_UP, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -271,15 +226,14 @@ void lv_draw_max_feedrate_settings(void) { lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); buttonBack = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_FEED_RETURN, NULL, 0); lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - label_Back = lv_label_create(buttonBack, NULL); + lv_btn_set_style_both(buttonBack, &style_para_back); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp index 1766abf0617b..c54318a1b2be 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -169,10 +169,7 @@ void lv_draw_motor_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.MotorConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MotorConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -181,50 +178,29 @@ void lv_draw_motor_settings(void) { lv_obj_set_size(buttonSteps, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0); - lv_btn_set_style(buttonSteps, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonSteps, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonSteps); lv_btn_set_layout(buttonSteps, LV_LAYOUT_OFF); - labelSteps = lv_label_create(buttonSteps, NULL); /*Add a label to the button*/ + labelSteps = lv_label_create_empty(buttonSteps); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonSteps); #endif - buttonStepsNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonStepsNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonStepsNarrow, event_handler, ID_MOTOR_STEPS_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonStepsNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonStepsNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonStepsNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStepsNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonStepsNarrow, LV_LAYOUT_OFF); + buttonStepsNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_MOTOR_STEPS_ARROW); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); #if USE_SENSORLESS - buttonSensitivity = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonSensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ - lv_obj_set_size(buttonSensitivity, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + buttonSensitivity = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_HOME_SENSE); //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonSensitivity, event_handler, ID_HOME_SENSE, NULL, 0); - lv_btn_set_style(buttonSensitivity, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonSensitivity, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonSensitivity, LV_LAYOUT_OFF); - labelSensitivity = lv_label_create(buttonSensitivity, NULL); /*Add a label to the button*/ + labelSensitivity = lv_label_create_empty(buttonSensitivity); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonSensitivity); #endif - buttonSensitivityNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonSensitivityNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonSensitivityNarrow, event_handler, ID_HOME_SENSE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonSensitivityNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonSensitivityNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonSensitivityNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonSensitivityNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonSensitivityNarrow, LV_LAYOUT_OFF); + buttonSensitivityNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_HOME_SENSE_ARROW); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); @@ -237,22 +213,15 @@ void lv_draw_motor_settings(void) { lv_obj_set_size(buttonTMCcurrent, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ //lv_obj_set_event_cb(buttonMachine, event_handler); lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0); - lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonTMCcurrent, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_btn_use_label_style(buttonTMCcurrent); lv_btn_set_layout(buttonTMCcurrent, LV_LAYOUT_OFF); - labelTMCcurrent = lv_label_create(buttonTMCcurrent, NULL); /*Add a label to the button*/ + labelTMCcurrent = lv_label_create_empty(buttonTMCcurrent); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTMCcurrent); #endif - buttonTMCcurrentNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonTMCcurrentNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 3, PARA_UI_POS_Y * 2) + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonTMCcurrentNarrow, event_handler, ID_MOTOR_TMC_CURRENT_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonTMCcurrentNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonTMCcurrentNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonTMCcurrentNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonTMCcurrentNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonTMCcurrentNarrow, LV_LAYOUT_OFF); + buttonTMCcurrentNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 3, PARA_UI_POS_Y * 2) + PARA_UI_ARROW_V, event_handler, ID_MOTOR_TMC_CURRENT_ARROW); + #if USE_SENSORLESS line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); @@ -262,27 +231,14 @@ void lv_draw_motor_settings(void) { #endif #if HAS_STEALTHCHOP - buttonStepMode = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonStepMode, PARA_UI_POS_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3)); - lv_obj_set_size(buttonStepMode, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb_mks(buttonStepMode, event_handler, ID_MOTOR_STEP_MODE, NULL, 0); - lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonStepMode, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonStepMode, LV_LAYOUT_OFF); - labelStepMode = lv_label_create(buttonStepMode, NULL); /*Add a label to the button*/ + buttonStepMode = lv_btn_create(scr, NULL, PARA_UI_POS_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3), PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_MOTOR_STEP_MODE); + labelStepMode = lv_label_create_empty(buttonStepMode); /*Add a label to the button*/ #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonStepMode); #endif - buttonStepModeNarrow = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonStepModeNarrow, PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3) + PARA_UI_ARROW_V); - lv_obj_set_event_cb_mks(buttonStepModeNarrow, event_handler, ID_MOTOR_STEP_MODE_ARROW, NULL, 0); - lv_imgbtn_set_src(buttonStepModeNarrow, LV_BTN_STATE_REL, "F:/bmp_arrow.bin"); - lv_imgbtn_set_src(buttonStepModeNarrow, LV_BTN_STATE_PR, "F:/bmp_arrow.bin"); - lv_imgbtn_set_style(buttonStepModeNarrow, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStepModeNarrow, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonStepModeNarrow, LV_LAYOUT_OFF); + buttonStepModeNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3) + PARA_UI_ARROW_V, event_handler, ID_MOTOR_STEP_MODE_ARROW); #if USE_SENSORLESS line4 = lv_line_create(scr, NULL); @@ -296,15 +252,8 @@ void lv_draw_motor_settings(void) { #endif // HAS_TRINAMIC_CONFIG - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MOTOR_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_MOTOR_RETURN); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 8e8302d7071b..3dde4ad5a052 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -174,100 +174,33 @@ void lv_draw_move_motor(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonXI = lv_imgbtn_create(scr, NULL); - buttonXD = lv_imgbtn_create(scr, NULL); - buttonYI = lv_imgbtn_create(scr, NULL); - buttonYD = lv_imgbtn_create(scr, NULL); - buttonZI = lv_imgbtn_create(scr, NULL); - buttonZD = lv_imgbtn_create(scr, NULL); - buttonV = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonXI, event_handler, ID_M_X_P, NULL, 0); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_REL, "F:/bmp_xAdd.bin"); - lv_imgbtn_set_src(buttonXI, LV_BTN_STATE_PR, "F:/bmp_xAdd.bin"); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonXI, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonXI = lv_imgbtn_create(scr, "F:/bmp_xAdd.bin", INTERVAL_V, titleHeight, event_handler, ID_M_X_P); lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); + buttonXD = lv_imgbtn_create(scr, "F:/bmp_xDec.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_X_N); + buttonYI = lv_imgbtn_create(scr, "F:/bmp_yAdd.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_Y_P); + buttonYD = lv_imgbtn_create(scr, "F:/bmp_yDec.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Y_N); + buttonZI = lv_imgbtn_create(scr, "F:/bmp_zAdd.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_Z_P); + buttonZD = lv_imgbtn_create(scr, "F:/bmp_zDec.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N); - #if 1 - lv_obj_set_event_cb_mks(buttonXD, event_handler, ID_M_X_N, NULL, 0); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_REL, "F:/bmp_xDec.bin"); - lv_imgbtn_set_src(buttonXD, LV_BTN_STATE_PR, "F:/bmp_xDec.bin"); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonXD, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonYI, event_handler, ID_M_Y_P, NULL, 0); - lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_REL, "F:/bmp_yAdd.bin"); - lv_imgbtn_set_src(buttonYI, LV_BTN_STATE_PR, "F:/bmp_yAdd.bin"); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonYI, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonYD, event_handler, ID_M_Y_N, NULL, 0); - lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_REL, "F:/bmp_yDec.bin"); - lv_imgbtn_set_src(buttonYD, LV_BTN_STATE_PR, "F:/bmp_yDec.bin"); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonYD, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonZI, event_handler, ID_M_Z_P, NULL, 0); - lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_REL, "F:/bmp_zAdd.bin"); - lv_imgbtn_set_src(buttonZI, LV_BTN_STATE_PR, "F:/bmp_zAdd.bin"); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZI, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonZD, event_handler, ID_M_Z_N, NULL, 0); - lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_REL, "F:/bmp_zDec.bin"); - lv_imgbtn_set_src(buttonZD, LV_BTN_STATE_PR, "F:/bmp_zDec.bin"); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZD, LV_BTN_STATE_REL, &tft_style_label_rel); - - //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); - lv_obj_set_event_cb_mks(buttonV, event_handler, ID_M_STEP, NULL, 0); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonV, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_M_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif // if 1 - - lv_obj_set_pos(buttonXI, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonYI, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonZI, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonV, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonXD, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonYD, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonZD, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonV = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP); + //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); + + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonXI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonXD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonYD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZI, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonZD, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonV, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelXI = lv_label_create(buttonXI, NULL); - lv_obj_t *labelXD = lv_label_create(buttonXD, NULL); - lv_obj_t *labelYI = lv_label_create(buttonYI, NULL); - lv_obj_t *labelYD = lv_label_create(buttonYD, NULL); - lv_obj_t *labelZI = lv_label_create(buttonZI, NULL); - lv_obj_t *labelZD = lv_label_create(buttonZD, NULL); - labelV = lv_label_create(buttonV, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelXI = lv_label_create_empty(buttonXI); + lv_obj_t *labelXD = lv_label_create_empty(buttonXD); + lv_obj_t *labelYI = lv_label_create_empty(buttonYI); + lv_obj_t *labelYD = lv_label_create_empty(buttonYD); + lv_obj_t *labelZI = lv_label_create_empty(buttonZI); + lv_obj_t *labelZD = lv_label_create_empty(buttonZD); + labelV = lv_label_create_empty(buttonV); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelXI, move_menu.x_add); @@ -310,18 +243,13 @@ void lv_draw_move_motor(void) { void disp_move_dist() { // char buf[30] = {0}; - if ((int)(10 * uiCfg.move_dist) == 1) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_step_move0_1.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_step_move0_1.bin"); - } - else if ((int)(10 * uiCfg.move_dist) == 10) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_step_move1.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_step_move1.bin"); - } - else if ((int)(10 * uiCfg.move_dist) == 100) { - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_step_move10.bin"); - lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_step_move10.bin"); - } + if ((int)(10 * uiCfg.move_dist) == 1) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move0_1.bin"); + else if ((int)(10 * uiCfg.move_dist) == 10) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move1.bin"); + else if ((int)(10 * uiCfg.move_dist) == 100) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move10.bin"); + if (gCfgItems.multiple_language) { if ((int)(10 * uiCfg.move_dist) == 1) { lv_label_set_text(labelV, move_menu.step_01mm); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp index 585c2fa75eb2..01d6e9a2d5c9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -765,10 +765,7 @@ void lv_draw_number_key(void) { lv_scr_load(scr); lv_obj_clean(scr); - //lv_obj_t * title = lv_label_create(scr, NULL); - //lv_obj_set_style(title, &tft_style_label_rel); - //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - //lv_label_set_text(title, creat_title_text()); + //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -779,7 +776,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(buttonValue, LV_BTN_STYLE_REL, &style_num_text); /*Set the button's released style*/ lv_btn_set_style(buttonValue, LV_BTN_STYLE_PR, &style_num_text); /*Set the button's pressed style*/ //lv_btn_set_layout(buttonValue, LV_LAYOUT_OFF); - labelValue = lv_label_create(buttonValue, NULL); /*Add a label to the button*/ + labelValue = lv_label_create_empty(buttonValue); /*Add a label to the button*/ NumberKey_1 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ lv_obj_set_pos(NumberKey_1, 92, 90); /*Set its position*/ @@ -788,7 +785,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_1, LV_LAYOUT_OFF); - labelKey_1 = lv_label_create(NumberKey_1, NULL); /*Add a label to the button*/ + labelKey_1 = lv_label_create_empty(NumberKey_1); /*Add a label to the button*/ lv_label_set_text(labelKey_1, machine_menu.key_1); lv_obj_align(labelKey_1, NumberKey_1, LV_ALIGN_CENTER, 0, 0); @@ -799,7 +796,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_2, LV_LAYOUT_OFF); - labelKey_2 = lv_label_create(NumberKey_2, NULL); /*Add a label to the button*/ + labelKey_2 = lv_label_create_empty(NumberKey_2); /*Add a label to the button*/ lv_label_set_text(labelKey_2, machine_menu.key_2); lv_obj_align(labelKey_2, NumberKey_2, LV_ALIGN_CENTER, 0, 0); @@ -810,7 +807,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_3, LV_LAYOUT_OFF); - labelKey_3 = lv_label_create(NumberKey_3, NULL); /*Add a label to the button*/ + labelKey_3 = lv_label_create_empty(NumberKey_3); /*Add a label to the button*/ lv_label_set_text(labelKey_3, machine_menu.key_3); lv_obj_align(labelKey_3, NumberKey_3, LV_ALIGN_CENTER, 0, 0); @@ -821,7 +818,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_4, LV_LAYOUT_OFF); - labelKey_4 = lv_label_create(NumberKey_4, NULL); /*Add a label to the button*/ + labelKey_4 = lv_label_create_empty(NumberKey_4); /*Add a label to the button*/ lv_label_set_text(labelKey_4, machine_menu.key_4); lv_obj_align(labelKey_4, NumberKey_4, LV_ALIGN_CENTER, 0, 0); @@ -832,7 +829,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_5, LV_LAYOUT_OFF); - labelKey_5 = lv_label_create(NumberKey_5, NULL); /*Add a label to the button*/ + labelKey_5 = lv_label_create_empty(NumberKey_5); /*Add a label to the button*/ lv_label_set_text(labelKey_5, machine_menu.key_5); lv_obj_align(labelKey_5, NumberKey_5, LV_ALIGN_CENTER, 0, 0); @@ -843,7 +840,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_6, LV_LAYOUT_OFF); - labelKey_6 = lv_label_create(NumberKey_6, NULL); /*Add a label to the button*/ + labelKey_6 = lv_label_create_empty(NumberKey_6); /*Add a label to the button*/ lv_label_set_text(labelKey_6, machine_menu.key_6); lv_obj_align(labelKey_6, NumberKey_6, LV_ALIGN_CENTER, 0, 0); @@ -854,7 +851,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_7, LV_LAYOUT_OFF); - labelKey_7 = lv_label_create(NumberKey_7, NULL); /*Add a label to the button*/ + labelKey_7 = lv_label_create_empty(NumberKey_7); /*Add a label to the button*/ lv_label_set_text(labelKey_7, machine_menu.key_7); lv_obj_align(labelKey_7, NumberKey_7, LV_ALIGN_CENTER, 0, 0); @@ -865,7 +862,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_8, LV_LAYOUT_OFF); - labelKey_8 = lv_label_create(NumberKey_8, NULL); /*Add a label to the button*/ + labelKey_8 = lv_label_create_empty(NumberKey_8); /*Add a label to the button*/ lv_label_set_text(labelKey_8, machine_menu.key_8); lv_obj_align(labelKey_8, NumberKey_8, LV_ALIGN_CENTER, 0, 0); @@ -876,7 +873,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_9, LV_LAYOUT_OFF); - labelKey_9 = lv_label_create(NumberKey_9, NULL); /*Add a label to the button*/ + labelKey_9 = lv_label_create_empty(NumberKey_9); /*Add a label to the button*/ lv_label_set_text(labelKey_9, machine_menu.key_9); lv_obj_align(labelKey_9, NumberKey_9, LV_ALIGN_CENTER, 0, 0); @@ -887,7 +884,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(NumberKey_0, LV_LAYOUT_OFF); - labelKey_0 = lv_label_create(NumberKey_0, NULL); /*Add a label to the button*/ + labelKey_0 = lv_label_create_empty(NumberKey_0); /*Add a label to the button*/ lv_label_set_text(labelKey_0, machine_menu.key_0); lv_obj_align(labelKey_0, NumberKey_0, LV_ALIGN_CENTER, 0, 0); @@ -898,7 +895,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(KeyBack, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(KeyBack, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(KeyBack, LV_LAYOUT_OFF); - labelKeyBack = lv_label_create(KeyBack, NULL); /*Add a label to the button*/ + labelKeyBack = lv_label_create_empty(KeyBack); /*Add a label to the button*/ lv_label_set_text(labelKeyBack, machine_menu.key_back); lv_obj_align(labelKeyBack, KeyBack, LV_ALIGN_CENTER, 0, 0); @@ -909,7 +906,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(KeyReset, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(KeyReset, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(KeyReset, LV_LAYOUT_OFF); - labelKeyReset = lv_label_create(KeyReset, NULL); /*Add a label to the button*/ + labelKeyReset = lv_label_create_empty(KeyReset); /*Add a label to the button*/ lv_label_set_text(labelKeyReset, machine_menu.key_reset); lv_obj_align(labelKeyReset, KeyReset, LV_ALIGN_CENTER, 0, 0); @@ -920,7 +917,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(KeyConfirm, LV_LAYOUT_OFF); - labelKeyConfirm = lv_label_create(KeyConfirm, NULL); /*Add a label to the button*/ + labelKeyConfirm = lv_label_create_empty(KeyConfirm); /*Add a label to the button*/ lv_label_set_text(labelKeyConfirm, machine_menu.key_confirm); lv_obj_align(labelKeyConfirm, KeyConfirm, LV_ALIGN_CENTER, 0, 0); @@ -931,7 +928,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(KeyPoint, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(KeyPoint, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(KeyPoint, LV_LAYOUT_OFF); - labelKeyPoint = lv_label_create(KeyPoint, NULL); /*Add a label to the button*/ + labelKeyPoint = lv_label_create_empty(KeyPoint); /*Add a label to the button*/ lv_label_set_text(labelKeyPoint, machine_menu.key_point); lv_obj_align(labelKeyPoint, KeyPoint, LV_ALIGN_CENTER, 0, 0); @@ -942,7 +939,7 @@ void lv_draw_number_key(void) { lv_btn_set_style(Minus, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ lv_btn_set_style(Minus, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ //lv_btn_set_layout(Minus, LV_LAYOUT_OFF); - labelMinus = lv_label_create(Minus, NULL); /*Add a label to the button*/ + labelMinus = lv_label_create_empty(Minus); /*Add a label to the button*/ lv_label_set_text(labelMinus, machine_menu.negative); lv_obj_align(labelMinus, Minus, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index 6ee5ac88c016..dc8bb5714905 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -137,14 +137,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { else if (event == LV_EVENT_RELEASED) { if (gCfgItems.finish_power_off) { gCfgItems.finish_power_off = false; - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_manual_off.bin"); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_manual_off.bin"); + lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_manual_off.bin"); lv_label_set_text(label_PowerOff, printing_more_menu.manual); } else { gCfgItems.finish_power_off = true; - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin"); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin"); + lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_auto_off.bin"); lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); } lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); @@ -185,179 +183,71 @@ void lv_draw_operation(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonPreHeat = lv_imgbtn_create(scr, NULL); - buttonFilament = lv_imgbtn_create(scr, NULL); - buttonFan = lv_imgbtn_create(scr, NULL); - buttonPowerOff = lv_imgbtn_create(scr, NULL); - if (uiCfg.print_state != WORKING) { - buttonExtrusion = lv_imgbtn_create(scr, NULL); - buttonMove = lv_imgbtn_create(scr, NULL); - } - else { - buttonSpeed = lv_imgbtn_create(scr, NULL); - buttonBabyStep = lv_imgbtn_create(scr, NULL); - } - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_O_PRE_HEAT, NULL, 0); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, "F:/bmp_temp.bin"); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, "F:/bmp_temp.bin"); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonFilament, event_handler, ID_O_FILAMENT, NULL, 0); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, "F:/bmp_filamentchange.bin"); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, "F:/bmp_filamentchange.bin"); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if 1 - lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_O_FAN, NULL, 0); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, "F:/bmp_fan.bin"); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, "F:/bmp_fan.bin"); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_temp.bin", INTERVAL_V, titleHeight, event_handler, ID_O_PRE_HEAT); + buttonFilament = lv_imgbtn_create(scr, "F:/bmp_filamentchange.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_O_FILAMENT); + buttonFan = lv_imgbtn_create(scr, "F:/bmp_fan.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_O_FAN); + buttonPowerOff = lv_imgbtn_create(scr, gCfgItems.finish_power_off ? "F:/bmp_auto_off.bin" : "F:/bmp_manual_off.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_O_POWER_OFF); - if (gCfgItems.finish_power_off) { - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin"); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin"); - } - else { - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_manual_off.bin"); - lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_manual_off.bin"); + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) { + lv_group_add_obj(g, buttonPreHeat); + lv_group_add_obj(g, buttonFilament); + lv_group_add_obj(g, buttonFan); + lv_group_add_obj(g, buttonPowerOff); } - lv_obj_set_event_cb_mks(buttonPowerOff, event_handler, ID_O_POWER_OFF, NULL, 0); - lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPowerOff, LV_BTN_STATE_REL, &tft_style_label_rel); + #endif + if (uiCfg.print_state != WORKING) { + buttonExtrusion = lv_imgbtn_create(scr, "F:/bmp_extrude_opr.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_O_EXTRUCT); + buttonMove = lv_imgbtn_create(scr, "F:/bmp_move_opr.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_O_MOV); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonPreHeat); - lv_group_add_obj(g, buttonFilament); - lv_group_add_obj(g, buttonFan); - lv_group_add_obj(g, buttonPowerOff); + lv_group_add_obj(g, buttonExtrusion); + lv_group_add_obj(g, buttonMove); } #endif + } + else { + buttonSpeed = lv_imgbtn_create(scr, "F:/bmp_speed.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_O_SPEED); + buttonBabyStep = lv_imgbtn_create(scr, "F:/bmp_mov.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_O_BABY_STEP); + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) { + lv_group_add_obj(g, buttonSpeed); + lv_group_add_obj(g, buttonBabyStep); + } + #endif + } - if (uiCfg.print_state != WORKING) { - lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_O_EXTRUCT, NULL, 0); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, "F:/bmp_extrude_opr.bin"); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, "F:/bmp_extrude_opr.bin"); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_O_MOV, NULL, 0); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, "F:/bmp_move_opr.bin"); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, "F:/bmp_move_opr.bin"); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonExtrusion); - lv_group_add_obj(g, buttonMove); - } - #endif - } - else { - lv_obj_set_event_cb_mks(buttonSpeed, event_handler, ID_O_SPEED, NULL, 0); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_REL, "F:/bmp_speed.bin"); - lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed.bin"); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonSpeed, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBabyStep, event_handler, ID_O_BABY_STEP, NULL, 0); - lv_imgbtn_set_src(buttonBabyStep, LV_BTN_STATE_REL, "F:/bmp_mov.bin"); - lv_imgbtn_set_src(buttonBabyStep, LV_BTN_STATE_PR, "F:/bmp_mov.bin"); - lv_imgbtn_set_style(buttonBabyStep, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBabyStep, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonSpeed); - lv_group_add_obj(g, buttonBabyStep); - } - #endif - } - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_O_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif // if 1 + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_O_RETURN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonFilament, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonFan, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonPowerOff, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - - if (uiCfg.print_state != WORKING) { - /* - lv_obj_set_pos(buttonFilament,INTERVAL_V,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - } else { - */ - lv_obj_set_pos(buttonExtrusion, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonMove, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - } - else { - lv_obj_set_pos(buttonSpeed, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBabyStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - } - - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - // Create labels on the image buttons - lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPowerOff, LV_LAYOUT_OFF); - - if (uiCfg.print_state != WORKING) { - /* - lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); - } else { - */ - lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); - } - else { - lv_btn_set_layout(buttonSpeed, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBabyStep, LV_LAYOUT_OFF); - } - - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - labelPreHeat = lv_label_create(buttonPreHeat, NULL); - label_Filament = lv_label_create(buttonFilament, NULL); - label_Fan = lv_label_create(buttonFan, NULL); - label_PowerOff = lv_label_create(buttonPowerOff, NULL); + labelPreHeat = lv_label_create_empty(buttonPreHeat); + label_Filament = lv_label_create_empty(buttonFilament); + label_Fan = lv_label_create_empty(buttonFan); + label_PowerOff = lv_label_create_empty(buttonPowerOff); if (uiCfg.print_state != WORKING) { /* - label_Filament = lv_label_create(buttonFilament, NULL); + label_Filament = lv_label_create_empty(buttonFilament); } else { */ - labelExtrusion = lv_label_create(buttonExtrusion, NULL); - label_Move = lv_label_create(buttonMove, NULL); + labelExtrusion = lv_label_create_empty(buttonExtrusion); + label_Move = lv_label_create_empty(buttonMove); } else { - label_Speed = lv_label_create(buttonSpeed, NULL); - label_BabyStep = lv_label_create(buttonBabyStep, NULL); + label_Speed = lv_label_create_empty(buttonSpeed); + label_BabyStep = lv_label_create_empty(buttonBabyStep); } - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelPreHeat, operation_menu.temp); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp index d1c3a4a795b3..c7d2de2e1be9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -83,9 +83,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_pause_position(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PAUSE_POS_UI) { @@ -100,81 +100,46 @@ void lv_draw_pause_position(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.PausePosText); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.PausePosText); lv_refr_now(lv_refr_get_disp_refreshing()); - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.xPos); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.xPos); - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_PAUSE_X, NULL, 0); - labelXValue = lv_label_create(buttonXValue, NULL); + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_X); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.yPos); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.yPos); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_PAUSE_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_Y); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.zPos); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.zPos); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_PAUSE_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_Z); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_PAUSE_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); - label_Back = lv_label_create(buttonBack, NULL); + buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_PAUSE_RETURN); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); lv_label_set_text(labelXValue, public_buf_l); lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosY); lv_label_set_text(labelYValue, public_buf_l); lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosZ); lv_label_set_text(labelZValue, public_buf_l); lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index b08c9bd94711..966d85b6de95 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -35,7 +35,7 @@ static lv_obj_t * scr; extern lv_group_t* g; -static lv_obj_t *buttoType, *buttonStep; +static lv_obj_t *buttonType, *buttonStep; static lv_obj_t *labelType; static lv_obj_t *labelStep; static lv_obj_t * tempText1; @@ -203,77 +203,26 @@ void lv_draw_preHeat(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonAdd = lv_imgbtn_create(scr, NULL); - buttonDec = lv_imgbtn_create(scr, NULL); - buttoType = lv_imgbtn_create(scr, NULL); - buttonStep = lv_imgbtn_create(scr, NULL); - buttonOff = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonAdd, event_handler, ID_P_ADD, NULL, 0); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_REL, "F:/bmp_Add.bin"); - lv_imgbtn_set_src(buttonAdd, LV_BTN_STATE_PR, "F:/bmp_Add.bin"); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAdd, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_P_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - - #if 1 - lv_obj_set_event_cb_mks(buttonDec, event_handler, ID_P_DEC, NULL, 0); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_REL, "F:/bmp_Dec.bin"); - lv_imgbtn_set_src(buttonDec, LV_BTN_STATE_PR, "F:/bmp_Dec.bin"); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonDec, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttoType, event_handler, ID_P_TYPE, NULL, 0); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttoType, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonStep, event_handler, ID_P_STEP, NULL, 0); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStep, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonOff, event_handler, ID_P_OFF, NULL, 0); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_REL, "F:/bmp_speed0.bin"); - lv_imgbtn_set_src(buttonOff, LV_BTN_STATE_PR, "F:/bmp_speed0.bin"); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOff, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonAdd, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonDec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttoType, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonStep, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonOff, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_DEC); + buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_TYPE); + buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_STEP); + buttonOff = lv_imgbtn_create(scr, "F:/bmp_speed0.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_OFF); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonAdd, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonDec, LV_LAYOUT_OFF); - lv_btn_set_layout(buttoType, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStep, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelAdd = lv_label_create(buttonAdd, NULL); - lv_obj_t *labelDec = lv_label_create(buttonDec, NULL); - labelType = lv_label_create(buttoType, NULL); - labelStep = lv_label_create(buttonStep, NULL); - lv_obj_t *labelOff = lv_label_create(buttonOff, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); + lv_obj_t *labelDec = lv_label_create_empty(buttonDec); + labelType = lv_label_create_empty(buttonType); + labelStep = lv_label_create_empty(buttonStep); + lv_obj_t *labelOff = lv_label_create_empty(buttonOff); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelAdd, preheat_menu.add); @@ -292,7 +241,7 @@ void lv_draw_preHeat(void) { if (gCfgItems.encoder_enable) { lv_group_add_obj(g, buttonAdd); lv_group_add_obj(g, buttonDec); - lv_group_add_obj(g, buttoType); + lv_group_add_obj(g, buttonType); lv_group_add_obj(g, buttonStep); lv_group_add_obj(g, buttonOff); lv_group_add_obj(g, buttonBack); @@ -302,7 +251,7 @@ void lv_draw_preHeat(void) { disp_temp_type(); disp_step_heat(); - tempText1 = lv_label_create(scr, NULL); + tempText1 = lv_label_create_empty(scr); lv_obj_set_style(tempText1, &tft_style_label_rel); disp_desire_temp(); } @@ -310,29 +259,26 @@ void lv_draw_preHeat(void) { void disp_temp_type() { if (uiCfg.curTempType == 0) { if (uiCfg.curSprayerChoose == 1) { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext2); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } else { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.ext1); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } else { - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_bed.bin"); - lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_bed.bin"); + lv_imgbtn_set_src_both(buttonType, "F:/bmp_bed.bin"); if (gCfgItems.multiple_language) { lv_label_set_text(labelType, preheat_menu.hotbed); - lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } } @@ -363,16 +309,13 @@ void disp_desire_temp() { void disp_step_heat() { if (uiCfg.stepHeat == 1) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step1_degree.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step1_degree.bin"); + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_degree.bin"); } else if (uiCfg.stepHeat == 5) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step5_degree.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step5_degree.bin"); + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_degree.bin"); } else if (uiCfg.stepHeat == 10) { - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step10_degree.bin"); - lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_degree.bin"); + lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_degree.bin"); } if (gCfgItems.multiple_language) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index d92943a37c52..8db84c51592a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -266,9 +266,9 @@ void lv_draw_print_file(void) { #endif disp_gcode_icon(file_count); - //lv_obj_t *labelPageUp = lv_label_create(buttonPageUp, NULL); - //lv_obj_t *labelPageDown = lv_label_create(buttonPageDown, NULL); - //lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + //lv_obj_t *labelPageUp = lv_label_create_empty(buttonPageUp); + //lv_obj_t *labelPageDown = lv_label_create_empty(buttonPageDown); + //lv_obj_t *label_Back = lv_label_create_empty(buttonBack); /* if (gCfgItems.multiple_language) { @@ -295,47 +295,16 @@ void disp_gcode_icon(uint8_t file_num) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonPageUp = lv_imgbtn_create(scr, NULL); - buttonPageDown = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonPageUp, event_handler, ID_P_UP, NULL, 0); - lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_REL, "F:/bmp_pageUp.bin"); - lv_imgbtn_set_src(buttonPageUp, LV_BTN_STATE_PR, "F:/bmp_pageUp.bin"); - lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPageUp, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if 1 - lv_obj_set_event_cb_mks(buttonPageDown, event_handler, ID_P_DOWN, NULL, 0); - lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_REL, "F:/bmp_pageDown.bin"); - lv_imgbtn_set_src(buttonPageDown, LV_BTN_STATE_PR, "F:/bmp_pageDown.bin"); - lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPageDown, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_P_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_pos(buttonPageUp, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonPageDown, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H); - lv_obj_set_pos(buttonBack, OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL * 2 + INTERVAL_H * 2); + buttonPageUp = lv_imgbtn_create(scr, "F:/bmp_pageUp.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_UP); + buttonPageDown = lv_imgbtn_create(scr, "F:/bmp_pageDown.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H, event_handler, ID_P_DOWN); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL * 2 + INTERVAL_H * 2, event_handler, ID_P_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonPageUp, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPageDown, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - for (i = 0; i < FILE_BTN_CNT; i++) { /* if (seq) { @@ -352,8 +321,7 @@ void disp_gcode_icon(uint8_t file_num) { #ifdef TFT35 buttonGcode[i] = lv_imgbtn_create(scr, NULL); - lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonGcode[i], LV_BTN_STATE_REL, &tft_style_label_rel); + lv_imgbtn_use_label_style(buttonGcode[i]); lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); @@ -362,16 +330,13 @@ void disp_gcode_icon(uint8_t file_num) { if (list_file.IsFolder[i] == 1) { lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, "F:/bmp_dir.bin"); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, "F:/bmp_dir.bin"); + lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); else lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); - labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); + labelPageUp[i] = lv_label_create(buttonGcode[i], public_buf_m); lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); } else { @@ -385,20 +350,16 @@ void disp_gcode_icon(uint8_t file_num) { char *temp = strstr(test_public_buf_l,".GCO"); if (temp) { strcpy(temp,".bin"); } lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, test_public_buf_l); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, test_public_buf_l); + lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l); if (i < 3) { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_label_pre); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); - //lv_obj_set_style(buttonText[i], &tft_style_label_pre); - //lv_obj_set_style(buttonText[i], &tft_style_label_rel); + lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL, 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -407,33 +368,25 @@ void disp_gcode_icon(uint8_t file_num) { buttonText[i] = lv_btn_create(scr, NULL); //lv_obj_set_event_cb(buttonText[i], event_handler); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_PR, &tft_style_label_pre); - lv_btn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); - - //lv_imgbtn_set_style(buttonText[i], LV_BTN_STATE_REL, &tft_style_label_rel); + lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL,0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL, 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } - labelPageUp[i] = lv_label_create(buttonText[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); + labelPageUp[i] = lv_label_create(buttonText[i], public_buf_m); lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); } else { lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_REL, "F:/bmp_file.bin"); - lv_imgbtn_set_src(buttonGcode[i], LV_BTN_STATE_PR, "F:/bmp_file.bin"); + lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); else lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1), BTN_Y_PIXEL + INTERVAL_H + titleHeight); - labelPageUp[i] = lv_label_create(buttonGcode[i], NULL); - lv_obj_set_style(labelPageUp[i], &tft_style_label_rel); - lv_label_set_text(labelPageUp[i], public_buf_m); + labelPageUp[i] = lv_label_create(buttonGcode[i], public_buf_m); lv_obj_align(labelPageUp[i], buttonGcode[i], LV_ALIGN_IN_BOTTOM_MID, 0, -5); } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 6481061800be..312ce69d0c6b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -46,13 +46,14 @@ #include "../../../marlinui.h" #endif -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t *labelExt1, * labelFan, * labelZpos, * labelTime; -TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2;) -static lv_obj_t *labelPause, * labelStop, * labelOperat; -static lv_obj_t * bar1, *bar1ValueText; -static lv_obj_t * buttonPause, *buttonOperat, *buttonStop; +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *labelExt1, *labelFan, *labelZpos, *labelTime; +static lv_obj_t *labelPause, *labelStop, *labelOperat; +static lv_obj_t *bar1, *bar1ValueText; +static lv_obj_t *buttonPause, *buttonOperat, *buttonStop; + +TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2); #if HAS_HEATED_BED static lv_obj_t* labelBed; @@ -83,23 +84,20 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { stop_print_time(); uiCfg.print_state = PAUSING; #endif - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, "F:/bmp_resume.bin"); - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, "F:/bmp_resume.bin"); + lv_imgbtn_set_src_both(buttonPause, "F:/bmp_resume.bin"); lv_label_set_text(labelPause, printing_menu.resume); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); } else if (uiCfg.print_state == PAUSED) { uiCfg.print_state = RESUMING; - lv_imgbtn_set_src(obj, LV_BTN_STATE_REL, "F:/bmp_pause.bin"); - lv_imgbtn_set_src(obj, LV_BTN_STATE_PR, "F:/bmp_pause.bin"); + lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); lv_label_set_text(labelPause, printing_menu.pause); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); } #if ENABLED(POWER_LOSS_RECOVERY) else if (uiCfg.print_state == REPRINTING) { uiCfg.print_state = REPRINTED; - lv_imgbtn_set_src(obj, LV_BTN_STATE_REL, "F:/bmp_pause.bin"); - lv_imgbtn_set_src(obj, LV_BTN_STATE_PR, "F:/bmp_pause.bin"); + lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); lv_label_set_text(labelPause, printing_menu.pause); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); // recovery.resume(); @@ -152,69 +150,42 @@ void lv_draw_printing(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons lv_obj_t *buttonExt1 = lv_img_create(scr, NULL); + lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin"); + lv_obj_set_pos(buttonExt1, 205, 136); + #if HAS_MULTI_EXTRUDER lv_obj_t *buttonExt2 = lv_img_create(scr, NULL); + lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin"); + lv_obj_set_pos(buttonExt2, 350, 136); #endif + #if HAS_HEATED_BED lv_obj_t *buttonBedstate = lv_img_create(scr, NULL); + lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin"); + lv_obj_set_pos(buttonBedstate, 205, 186); #endif - lv_obj_t *buttonFanstate = lv_img_create(scr, NULL); - lv_obj_t *buttonTime = lv_img_create(scr, NULL); - lv_obj_t *buttonZpos = lv_img_create(scr, NULL); - buttonPause = lv_imgbtn_create(scr, NULL); - buttonStop = lv_imgbtn_create(scr, NULL); - buttonOperat = lv_imgbtn_create(scr, NULL); - lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin"); - #if 1 - #if HAS_MULTI_EXTRUDER - lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin"); - #endif - #if HAS_HEATED_BED - lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin"); - #endif - - lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin"); - - lv_img_set_src(buttonTime, "F:/bmp_time_state.bin"); - - lv_img_set_src(buttonZpos, "F:/bmp_zpos_state.bin"); - - if (uiCfg.print_state == WORKING) { - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, "F:/bmp_pause.bin"); - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, "F:/bmp_pause.bin"); - } - else { - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_REL, "F:/bmp_resume.bin"); - lv_imgbtn_set_src(buttonPause, LV_BTN_STATE_PR, "F:/bmp_resume.bin"); - } - - lv_obj_set_event_cb_mks(buttonPause, event_handler, ID_PAUSE, NULL, 0); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPause, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_t *buttonFanstate = lv_img_create(scr, NULL); + lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin"); + lv_obj_set_pos(buttonFanstate, 350, 186); - lv_obj_set_event_cb_mks(buttonStop, event_handler, ID_STOP, NULL, 0); - lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_REL, "F:/bmp_stop.bin"); - lv_imgbtn_set_src(buttonStop, LV_BTN_STATE_PR, "F:/bmp_stop.bin"); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonStop, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_t *buttonTime = lv_img_create(scr, NULL); + lv_img_set_src(buttonTime, "F:/bmp_time_state.bin"); + lv_obj_set_pos(buttonTime, 205, 86); - lv_obj_set_event_cb_mks(buttonOperat, event_handler, ID_OPTION, NULL, 0); - lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_REL, "F:/bmp_operate.bin"); - lv_imgbtn_set_src(buttonOperat, LV_BTN_STATE_PR, "F:/bmp_operate.bin"); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonOperat, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_t *buttonZpos = lv_img_create(scr, NULL); + lv_img_set_src(buttonZpos, "F:/bmp_zpos_state.bin"); + lv_obj_set_pos(buttonZpos, 350, 86); - #endif // if 1 + buttonPause = lv_imgbtn_create(scr, uiCfg.print_state == WORKING ? "F:/bmp_pause.bin" : "F:/bmp_resume.bin", 5, 240, event_handler, ID_PAUSE); + buttonStop = lv_imgbtn_create(scr, "F:/bmp_stop.bin", 165, 240, event_handler, ID_STOP); + buttonOperat = lv_imgbtn_create(scr, "F:/bmp_operate.bin", 325, 240, event_handler, ID_OPTION); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -224,71 +195,37 @@ void lv_draw_printing(void) { } #endif - lv_obj_set_pos(buttonExt1, 205, 136); - - #if HAS_MULTI_EXTRUDER - lv_obj_set_pos(buttonExt2, 350, 136); - #endif - - #if HAS_HEATED_BED - lv_obj_set_pos(buttonBedstate, 205, 186); - #endif - - lv_obj_set_pos(buttonFanstate, 350, 186); - lv_obj_set_pos(buttonTime, 205, 86); - lv_obj_set_pos(buttonZpos, 350, 86); - lv_obj_set_pos(buttonPause, 5, 240); - lv_obj_set_pos(buttonStop, 165, 240); - lv_obj_set_pos(buttonOperat, 325, 240); - // Create labels on the image buttons //lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); //#if HAS_MULTI_EXTRUDER - //lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); + // lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); //#endif //#if HAS_HEATED_BED - //lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); + // lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); //#endif //lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); //lv_btn_set_layout(buttonTime, LV_LAYOUT_OFF); //lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonPause, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonStop, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonOperat, LV_LAYOUT_OFF); - labelExt1 = lv_label_create(scr, NULL); - lv_obj_set_style(labelExt1, &tft_style_label_rel); - lv_obj_set_pos(labelExt1, 250, 146); + labelExt1 = lv_label_create(scr, 250, 146, NULL); #if HAS_MULTI_EXTRUDER - labelExt2 = lv_label_create(scr, NULL); - lv_obj_set_style(labelExt2, &tft_style_label_rel); - lv_obj_set_pos(labelExt2, 395, 146); + labelExt2 = lv_label_create(scr, 395, 146, NULL); #endif #if HAS_HEATED_BED - labelBed = lv_label_create(scr, NULL); - lv_obj_set_style(labelBed, &tft_style_label_rel); - lv_obj_set_pos(labelBed, 250, 196); + labelBed = lv_label_create(scr, 250, 196, NULL); #endif - labelFan = lv_label_create(scr, NULL); - lv_obj_set_style(labelFan, &tft_style_label_rel); - lv_obj_set_pos(labelFan, 395, 196); - - labelTime = lv_label_create(scr, NULL); - lv_obj_set_style(labelTime, &tft_style_label_rel); - lv_obj_set_pos(labelTime, 250, 96); - - labelZpos = lv_label_create(scr, NULL); - lv_obj_set_style(labelZpos, &tft_style_label_rel); - lv_obj_set_pos(labelZpos, 395, 96); + labelFan = lv_label_create(scr, 395, 196, NULL); + labelTime = lv_label_create(scr, 250, 96, NULL); + labelZpos = lv_label_create(scr, 395, 96, NULL); - labelPause = lv_label_create(buttonPause, NULL); - labelStop = lv_label_create(buttonStop, NULL); - labelOperat = lv_label_create(buttonOperat, NULL); + labelPause = lv_label_create_empty(buttonPause); + labelStop = lv_label_create_empty(buttonStop); + labelOperat = lv_label_create_empty(buttonOperat); if (gCfgItems.multiple_language) { lv_label_set_text(labelPause, uiCfg.print_state == WORKING ? printing_menu.pause : printing_menu.resume); @@ -307,7 +244,7 @@ void lv_draw_printing(void) { lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); lv_bar_set_anim_time(bar1, 1000); lv_bar_set_value(bar1, 0, LV_ANIM_ON); - bar1ValueText = lv_label_create(bar1, NULL); + bar1ValueText = lv_label_create_empty(bar1); lv_label_set_text(bar1ValueText,"0%"); lv_obj_align(bar1ValueText, bar1, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 276e8fb55175..765570ca3bd5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -41,7 +41,7 @@ #include -//static lv_obj_t *buttonPrint,*buttonTool,*buttonSet; +//static lv_obj_t *buttonPrint, *buttonTool, *buttonSet; extern lv_group_t* g; static lv_obj_t * scr; #if ENABLED(MKS_TEST) @@ -112,8 +112,8 @@ void disp_det_error() { lv_obj_t *e1, *e2, *e3, *bed; void mks_disp_test() { char buf[30] = {0}; - //lv_obj_t *label_tool2 = lv_label_create(scr, NULL); - //lv_obj_set_pos(label_tool,20,50); + //lv_obj_t *label_tool2 = lv_label_create_empty(scr); + //lv_obj_set_pos(label_tool, 20, 50); ZERO(buf); sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius); lv_label_set_text(e1, buf); @@ -148,82 +148,71 @@ void lv_draw_ready_print(void) { lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); - //lv_obj_set_hidden(scr,true); + //lv_obj_set_hidden(scr, true); lv_refr_now(lv_refr_get_disp_refreshing()); if (mks_test_flag == 0x1E) { - //lv_obj_t * title = lv_label_create(scr, NULL); - //lv_obj_set_style(title, &tft_style_label_rel); - //lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - //lv_label_set_text(title, creat_title_text()); + //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); // Create image buttons //buttonPrint = lv_imgbtn_create(scr, NULL); - buttonTool = lv_imgbtn_create(scr, NULL); - //buttonSet = lv_imgbtn_create(scr, NULL); - - #if 1 - lv_obj_set_event_cb_mks(buttonTool, event_handler, ID_TOOL, NULL, 0); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, "F:/bmp_tool.bin"); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, "F:/bmp_tool.bin"); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif + buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL); lv_obj_set_pos(buttonTool, 360, 180); - //lv_obj_set_pos(buttonSet,180,90); - //lv_obj_set_pos(buttonPrint,340,90); - //lv_obj_set_pos(buttonTool,SIMPLE_FIRST_PAGE_GRAP+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonSet,BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonPrint,BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1,(TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //buttonSet = lv_imgbtn_create(scr, NULL); + //lv_obj_set_pos(buttonSet, 180, 90); + //lv_obj_set_pos(buttonPrint, 340, 90); + + //lv_obj_set_pos(buttonTool, SIMPLE_FIRST_PAGE_GRAP+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonSet, BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); + //lv_obj_set_pos(buttonPrint, BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); // Create labels on the image buttons //lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); //lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); - //lv_obj_t *label_print = lv_label_create(buttonPrint, NULL); - //lv_obj_t *label_set = lv_label_create(buttonSet, NULL); - lv_obj_t *label_tool = lv_label_create(buttonTool, NULL); + //lv_obj_t *label_print = lv_label_create_empty(buttonPrint); + //lv_obj_t *label_set = lv_label_create_empty(buttonSet); + lv_obj_t *label_tool = lv_label_create_empty(buttonTool); if (gCfgItems.multiple_language) { //lv_label_set_text(label_print, main_menu.print); - //lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + //lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); //lv_label_set_text(label_set, main_menu.set); - //lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + //lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - //lv_label_set_style(label_tool,LV_BTN_STATE_PR,&tft_style_label_pre); - //lv_label_set_style(label_tool,LV_BTN_STATE_REL,&tft_style_label_rel); + //lv_label_set_style(label_tool, LV_BTN_STATE_PR, &tft_style_label_pre); + //lv_label_set_style(label_tool, LV_BTN_STATE_REL, &tft_style_label_rel); lv_label_set_text(label_tool, main_menu.tool); lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } #if 1 - e1 = lv_label_create(scr, NULL); + e1 = lv_label_create_empty(scr); lv_obj_set_pos(e1, 20, 20); sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[0].celsius); lv_label_set_text(e1, buf); #if HAS_MULTI_HOTEND - e2 = lv_label_create(scr, NULL); + e2 = lv_label_create_empty(scr); lv_obj_set_pos(e2, 20, 45); sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[1].celsius); lv_label_set_text(e2, buf); #endif - //e3 = lv_label_create(scr, NULL); - //lv_obj_set_pos(e3,20,70); + //e3 = lv_label_create_empty(scr); + //lv_obj_set_pos(e3, 20, 70); //sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[2].celsius); //lv_label_set_text(e3, buf); #if HAS_HEATED_BED - bed = lv_label_create(scr, NULL); + bed = lv_label_create_empty(scr); lv_obj_set_pos(bed, 20, 95); sprintf_P(buf, PSTR("bed: %d"), (int)thermalManager.temp_bed.celsius); lv_label_set_text(bed, buf); #endif - limit_info = lv_label_create(scr, NULL); + limit_info = lv_label_create_empty(scr); lv_style_copy(&limit_style, &lv_style_scr); limit_style.body.main_color.full = 0X0000; @@ -234,7 +223,7 @@ void lv_draw_ready_print(void) { lv_obj_set_pos(limit_info, 20, 120); lv_label_set_text(limit_info, " "); - det_info = lv_label_create(scr, NULL); + det_info = lv_label_create_empty(scr); lv_style_copy(&det_style, &lv_style_scr); det_style.body.main_color.full = 0X0000; @@ -249,35 +238,14 @@ void lv_draw_ready_print(void) { } else { // Create an Image button - buttonTool = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonTool, 20, 90); - lv_obj_set_event_cb_mks(buttonTool, event_handler, ID_TOOL, NULL, 0); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_REL, "F:/bmp_tool.bin"); - lv_imgbtn_set_src(buttonTool, LV_BTN_STATE_PR, "F:/bmp_tool.bin"); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonTool, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_t *label_tool = lv_label_create(buttonTool, NULL); - lv_btn_set_layout(buttonTool, LV_LAYOUT_OFF); - - buttonSet = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonSet, 180, 90); - lv_obj_set_event_cb_mks(buttonSet, event_handler, ID_SET, NULL, 0); - lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_REL, "F:/bmp_set.bin"); - lv_imgbtn_set_src(buttonSet, LV_BTN_STATE_PR, "F:/bmp_set.bin"); - lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonSet, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_t *label_set = lv_label_create(buttonSet, NULL); - lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); - - buttonPrint = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonPrint, 340, 90); - lv_obj_set_event_cb_mks(buttonPrint, event_handler, ID_PRINT, NULL, 0); - lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_REL, "F:/bmp_printing.bin"); - lv_imgbtn_set_src(buttonPrint, LV_BTN_STATE_PR, "F:/bmp_printing.bin"); - lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPrint, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_t *label_print = lv_label_create(buttonPrint, NULL); - lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); + buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", 20, 90, event_handler, ID_TOOL); + lv_obj_t *label_tool = lv_label_create_empty(buttonTool); + + buttonSet = lv_imgbtn_create(scr, "F:/bmp_set.bin", 180, 90, event_handler, ID_SET); + lv_obj_t *label_set = lv_label_create_empty(buttonSet); + + buttonPrint = lv_imgbtn_create(scr, "F:/bmp_printing.bin", 340, 90, event_handler, ID_PRINT); + lv_obj_t *label_print = lv_label_create_empty(buttonPrint); if (gCfgItems.multiple_language) { lv_label_set_text(label_print, main_menu.print); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index d23fe4018230..e4896866cf28 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -194,89 +194,25 @@ void lv_draw_set(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonEepromSet = lv_imgbtn_create(scr, NULL); - //buttonWifi = lv_imgbtn_create(scr, NULL); - buttonFan = lv_imgbtn_create(scr, NULL); - buttonAbout = lv_imgbtn_create(scr, NULL); - //buttonContinue = lv_imgbtn_create(scr, NULL); - buMotorOff = lv_imgbtn_create(scr, NULL); - buttonMachinePara = lv_imgbtn_create(scr, NULL); + buttonEepromSet = lv_imgbtn_create(scr, "F:/bmp_eeprom_settings.bin", INTERVAL_V, titleHeight, event_handler, ID_S_EEPROM_SET); + //buttonWifi = lv_imgbtn_create(scr, NULL); + buttonFan = lv_imgbtn_create(scr, "F:/bmp_fan.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_S_FAN); + buttonAbout = lv_imgbtn_create(scr, "F:/bmp_about.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_S_ABOUT); + //buttonContinue = lv_imgbtn_create(scr, NULL); + buMotorOff = lv_imgbtn_create(scr, ENABLED(HAS_SUICIDE) ? "F:/bmp_manual_off.bin" : "F:/bmp_function1.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_S_MOTOR_OFF); + buttonMachinePara = lv_imgbtn_create(scr, "F:/bmp_machine_para.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_MACHINE_PARA); #if HAS_LANG_SELECT_SCREEN - buttonLanguage = lv_imgbtn_create(scr, NULL); + buttonLanguage = lv_imgbtn_create(scr, "F:/bmp_language.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE); #endif #if ENABLED(USE_WIFI_FUNCTION) - buttonWifi = lv_imgbtn_create(scr, NULL); + buttonWifi = lv_imgbtn_create(scr, "F:/bmp_wifi.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI); #endif - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonEepromSet, event_handler, ID_S_EEPROM_SET, NULL, 0); - lv_imgbtn_set_src(buttonEepromSet, LV_BTN_STATE_REL, "F:/bmp_eeprom_settings.bin"); - lv_imgbtn_set_src(buttonEepromSet, LV_BTN_STATE_PR, "F:/bmp_eeprom_settings.bin"); - lv_imgbtn_set_style(buttonEepromSet, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonEepromSet, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if 1 - lv_obj_set_event_cb_mks(buttonFan, event_handler, ID_S_FAN, NULL, 0); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_REL, "F:/bmp_fan.bin"); - lv_imgbtn_set_src(buttonFan, LV_BTN_STATE_PR, "F:/bmp_fan.bin"); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonAbout, event_handler, ID_S_ABOUT, NULL, 0); - lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_REL, "F:/bmp_about.bin"); - lv_imgbtn_set_src(buttonAbout, LV_BTN_STATE_PR, "F:/bmp_about.bin"); - lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonAbout, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buMotorOff, event_handler, ID_S_MOTOR_OFF, NULL, 0); - - #if HAS_SUICIDE - lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, "F:/bmp_manual_off.bin"); - lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, "F:/bmp_manual_off.bin"); - #else - lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_REL, "F:/bmp_function1.bin"); - lv_imgbtn_set_src(buMotorOff, LV_BTN_STATE_PR, "F:/bmp_function1.bin"); - #endif - lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buMotorOff, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonMachinePara, event_handler, ID_S_MACHINE_PARA, NULL, 0); - lv_imgbtn_set_src(buttonMachinePara, LV_BTN_STATE_REL, "F:/bmp_machine_para.bin"); - lv_imgbtn_set_src(buttonMachinePara, LV_BTN_STATE_PR, "F:/bmp_machine_para.bin"); - lv_imgbtn_set_style(buttonMachinePara, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMachinePara, LV_BTN_STATE_REL, &tft_style_label_rel); - - #if HAS_LANG_SELECT_SCREEN - lv_obj_set_event_cb_mks(buttonLanguage, event_handler, ID_S_LANGUAGE, NULL, 0); - lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_REL, "F:/bmp_language.bin"); - lv_imgbtn_set_src(buttonLanguage, LV_BTN_STATE_PR, "F:/bmp_language.bin"); - lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonLanguage, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_set_event_cb_mks(buttonWifi, event_handler,ID_S_WIFI,NULL,0); - lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_REL, "F:/bmp_wifi.bin"); - lv_imgbtn_set_src(buttonWifi, LV_BTN_STATE_PR, "F:/bmp_wifi.bin"); - lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonWifi, LV_BTN_STATE_REL, &tft_style_label_rel); - #endif - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_S_RETURN,NULL , 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - #endif // if 1 + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN); /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); @@ -287,51 +223,23 @@ void lv_draw_set(void) { lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonEepromSet, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonFan, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonAbout, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buMotorOff, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - - lv_obj_set_pos(buttonMachinePara, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - #if HAS_LANG_SELECT_SCREEN - lv_obj_set_pos(buttonLanguage, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - #endif - #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_set_pos(buttonWifi,BTN_X_PIXEL*2+INTERVAL_V*3,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - #endif - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); /// Create labels on the buttons - //lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonEepromSet, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFan, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonAbout, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonContinue, LV_LAYOUT_OFF); - lv_btn_set_layout(buMotorOff, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMachinePara, LV_LAYOUT_OFF); - #if HAS_LANG_SELECT_SCREEN - lv_btn_set_layout(buttonLanguage, LV_LAYOUT_OFF); - #endif - #if ENABLED(USE_WIFI_FUNCTION) - lv_btn_set_layout(buttonWifi, LV_LAYOUT_OFF); - #endif - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - //lv_obj_t *labelWifi= lv_label_create(buttonWifi, NULL); - lv_obj_t *label_EepromSet = lv_label_create(buttonEepromSet, NULL); - lv_obj_t *labelFan = lv_label_create(buttonFan, NULL); - lv_obj_t *label_About = lv_label_create(buttonAbout, NULL); - //lv_obj_t *label_Continue = lv_label_create(buttonContinue, NULL); - lv_obj_t *label_MotorOff = lv_label_create(buMotorOff, NULL); - lv_obj_t *label_MachinePara = lv_label_create(buttonMachinePara, NULL); + //lv_obj_t *labelWifi= lv_label_create_empty(buttonWifi); + lv_obj_t *label_EepromSet = lv_label_create_empty(buttonEepromSet); + lv_obj_t *labelFan = lv_label_create_empty(buttonFan); + lv_obj_t *label_About = lv_label_create_empty(buttonAbout); + //lv_obj_t *label_Continue = lv_label_create_empty(buttonContinue); + lv_obj_t *label_MotorOff = lv_label_create_empty(buMotorOff); + lv_obj_t *label_MachinePara = lv_label_create_empty(buttonMachinePara); #if HAS_LANG_SELECT_SCREEN - lv_obj_t *label_Language = lv_label_create(buttonLanguage, NULL); + lv_obj_t *label_Language = lv_label_create_empty(buttonLanguage); #endif #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_t *label_Wifi = lv_label_create(buttonWifi, NULL); + lv_obj_t *label_Wifi = lv_label_create_empty(buttonWifi); #endif - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp index ff45fba46199..9f093891460d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -128,12 +128,12 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_step_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; + lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != STEPS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = STEPS_UI; @@ -146,82 +146,44 @@ void lv_draw_step_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.StepsConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.StepsConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.X_Steps); - - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_STEP_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Steps); + + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_X); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.Y_Steps); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Steps); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_STEP_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_Y); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.Z_Steps); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Steps); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_STEP_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_Z); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelE0Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE0Text, &tft_style_label_rel); - lv_obj_set_pos(labelE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelE0Text, machine_menu.E0_Steps); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0_Steps); - buttonE0Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE0Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_STEP_E0, NULL, 0); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_PR, &style_para_value); - labelE0Value = lv_label_create(buttonE0Value, NULL); + buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_E0); + labelE0Value = lv_label_create_empty(buttonE0Value); line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_STEP_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create(scr, event_handler, ID_STEP_DOWN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -234,26 +196,15 @@ void lv_draw_step_settings(void) { #endif } else { - labelE1Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE1Text, &tft_style_label_rel); - lv_obj_set_pos(labelE1Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelE1Text, machine_menu.E1_Steps); - - buttonE1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_STEP_E1, NULL, 0); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_PR, &style_para_value); - labelE1Value = lv_label_create(buttonE1Value, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1_Steps); + + buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_E1); + labelE1Value = lv_label_create_empty(buttonE1Value); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_STEP_UP, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + buttonTurnPage = lv_btn_create(scr, event_handler, ID_STEP_UP); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -265,15 +216,14 @@ void lv_draw_step_settings(void) { lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); buttonBack = lv_btn_create(scr, NULL); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonBack, &style_para_back); lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_STEP_RETURN, NULL, 0); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp index b19048f1c09d..a05cc257a8e2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -143,10 +143,10 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { void lv_draw_tmc_current_settings(void) { lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelXText = NULL, *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *labelYText = NULL, *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *labelZText = NULL, *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *labelE0Text = NULL, *buttonE0Value = NULL, *labelE0Value = NULL; + lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; + lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; + lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; + lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; //#if AXIS_IS_TMC(E1) @@ -167,74 +167,39 @@ void lv_draw_tmc_current_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.TmcCurrentConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcCurrentConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - labelXText = lv_label_create(scr, NULL); - lv_obj_set_style(labelXText, &tft_style_label_rel); - lv_obj_set_pos(labelXText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelXText, machine_menu.X_Current); - - buttonXValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonXValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonXValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonXValue, event_handler, ID_TMC_CURRENT_X, NULL, 0); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonXValue, LV_BTN_STYLE_PR, &style_para_value); - labelXValue = lv_label_create(buttonXValue, NULL); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Current); + + buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_X); + labelXValue = lv_label_create_empty(buttonXValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - labelYText = lv_label_create(scr, NULL); - lv_obj_set_style(labelYText, &tft_style_label_rel); - lv_obj_set_pos(labelYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); - lv_label_set_text(labelYText, machine_menu.Y_Current); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Current); - buttonYValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonYValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonYValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonYValue, event_handler, ID_TMC_CURRENT_Y, NULL, 0); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonYValue, LV_BTN_STYLE_PR, &style_para_value); - labelYValue = lv_label_create(buttonYValue, NULL); + buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_Y); + labelYValue = lv_label_create_empty(buttonYValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - labelZText = lv_label_create(scr, NULL); - lv_obj_set_style(labelZText, &tft_style_label_rel); - lv_obj_set_pos(labelZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); - lv_label_set_text(labelZText, machine_menu.Z_Current); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Current); - buttonZValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonZValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonZValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonZValue, event_handler, ID_TMC_CURRENT_Z, NULL, 0); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonZValue, LV_BTN_STYLE_PR, &style_para_value); - labelZValue = lv_label_create(buttonZValue, NULL); + buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_Z); + labelZValue = lv_label_create_empty(buttonZValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - labelE0Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE0Text, &tft_style_label_rel); - lv_obj_set_pos(labelE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelE0Text, machine_menu.E0_Current); + (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0_Current); - buttonE0Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE0Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE0Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE0Value, event_handler, ID_TMC_CURRENT_E0, NULL, 0); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE0Value, LV_BTN_STYLE_PR, &style_para_value); - labelE0Value = lv_label_create(buttonE0Value, NULL); + buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_E0); + labelE0Value = lv_label_create_empty(buttonE0Value); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -251,8 +216,7 @@ void lv_draw_tmc_current_settings(void) { //#if AXIS_IS_TMC(E1) buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_DOWN, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTurnPage); @@ -261,26 +225,17 @@ void lv_draw_tmc_current_settings(void) { } else { //#if AXIS_IS_TMC(E1) - labelE1Text = lv_label_create(scr, NULL); - lv_obj_set_style(labelE1Text, &tft_style_label_rel); - lv_obj_set_pos(labelE1Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelE1Text, machine_menu.E1_Current); - - buttonE1Value = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonE1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_size(buttonE1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonE1Value, event_handler, ID_TMC_CURRENT_E1, NULL, 0); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonE1Value, LV_BTN_STYLE_PR, &style_para_value); - labelE1Value = lv_label_create(buttonE1Value, NULL); + labelE1Text = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1_Current); + + buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_E1); + labelE1Value = lv_label_create_empty(buttonE1Value); line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); buttonTurnPage = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_UP, NULL, 0); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonTurnPage, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -293,13 +248,12 @@ void lv_draw_tmc_current_settings(void) { //#if AXIS_IS_TMC(E1) lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); //#endif buttonBack = lv_btn_create(scr, NULL); lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_TMC_CURRENT_RETURN, NULL, 0); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back); - lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back); + lv_btn_set_style_both(buttonBack, &style_para_back); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); @@ -307,7 +261,7 @@ void lv_draw_tmc_current_settings(void) { lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 04087f632e1f..8be03297f544 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -28,9 +28,12 @@ #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" -#include "../../../../gcode/gcode.h" #include "../../../../inc/MarlinConfig.h" +#if ENABLED(EEPROM_SETTINGS) + #include "../../../../module/settings.h" +#endif + extern lv_group_t * g; static lv_obj_t * scr; @@ -69,24 +72,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (stepperX.stored.stealthChop_enabled) { - stepperX.stored.stealthChop_enabled = false; - stepperX.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelXState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - // gcode.process_subcommands_now_P(PSTR("M500")); + if (stepperX.toggle_stepping_mode()) { + lv_imgbtn_set_src_both(buttonXState, "F:/bmp_enable.bin"); + lv_label_set_text(labelXState, machine_menu.enable); } else { - stepperX.stored.stealthChop_enabled = true; - stepperX.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelXState, machine_menu.enable); - // gcode.process_subcommands_now_P(PSTR("M500")); + lv_imgbtn_set_src_both(buttonXState, "F:/bmp_disable.bin"); + lv_label_set_text(labelXState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); } - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); } break; #endif // if AXIS_HAS_STEALTHCHOP(X) @@ -97,22 +92,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (stepperY.stored.stealthChop_enabled) { - stepperY.stored.stealthChop_enabled = false; - stepperY.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelYState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + if (stepperY.toggle_stepping_mode()) { + lv_imgbtn_set_src_both(buttonYState, "F:/bmp_enable.bin"); + lv_label_set_text(labelYState, machine_menu.enable); } else { - stepperY.stored.stealthChop_enabled = true; - stepperY.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelYState, machine_menu.enable); + lv_imgbtn_set_src_both(buttonYState, "F:/bmp_disable.bin"); + lv_label_set_text(labelYState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); } - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); } break; #endif // if AXIS_HAS_STEALTHCHOP(Y) @@ -123,22 +112,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (stepperZ.stored.stealthChop_enabled) { - stepperZ.stored.stealthChop_enabled = false; - stepperZ.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelZState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + if (stepperZ.toggle_stepping_mode()) { + lv_imgbtn_set_src_both(buttonZState, "F:/bmp_enable.bin"); + lv_label_set_text(labelZState, machine_menu.enable); } else { - stepperZ.stored.stealthChop_enabled = true; - stepperZ.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelZState, machine_menu.enable); + lv_imgbtn_set_src_both(buttonZState, "F:/bmp_disable.bin"); + lv_label_set_text(labelZState, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); } - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); } break; #endif // if AXIS_HAS_STEALTHCHOP(Z) @@ -149,22 +132,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (stepperE0.stored.stealthChop_enabled) { - stepperE0.stored.stealthChop_enabled = false; - stepperE0.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelE0State, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + if (stepperE0.toggle_stepping_mode()) { + lv_imgbtn_set_src_both(buttonE0State, "F:/bmp_enable.bin"); + lv_label_set_text(labelE0State, machine_menu.enable); } else { - stepperE0.stored.stealthChop_enabled = true; - stepperE0.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelE0State, machine_menu.enable); + lv_imgbtn_set_src_both(buttonE0State, "F:/bmp_disable.bin"); + lv_label_set_text(labelE0State, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); } - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); } break; #endif // if AXIS_HAS_STEALTHCHOP(E0) @@ -175,22 +152,16 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (stepperE1.stored.stealthChop_enabled) { - stepperE1.stored.stealthChop_enabled = false; - stepperE1.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - lv_label_set_text(labelE1State, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); + if (stepperE1.toggle_stepping_mode()) { + lv_imgbtn_set_src_both(buttonE1State, "F:/bmp_enable.bin"); + lv_label_set_text(labelE1State, machine_menu.enable); } else { - stepperE1.stored.stealthChop_enabled = true; - stepperE1.refresh_stepping_mode(); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - lv_label_set_text(labelE1State, machine_menu.enable); + lv_imgbtn_set_src_both(buttonE1State, "F:/bmp_disable.bin"); + lv_label_set_text(labelE1State, machine_menu.disable); + //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); } - gcode.process_subcommands_now_P(PSTR("M500")); + TERN_(EEPROM_SETTINGS, (void)settings.save()); } break; #endif // if AXIS_HAS_STEALTHCHOP(E1) @@ -255,44 +226,33 @@ void lv_draw_tmc_step_mode_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, machine_menu.TmcStepModeConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcStepModeConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); + bool stealth_X = false, stealth_Y = false, stealth_Z = false, stealth_E0 = false, stealth_E1 = false; + #if AXIS_HAS_STEALTHCHOP(X) + stealth_X = stepperX.get_stealthChop_status(); + #endif + #if AXIS_HAS_STEALTHCHOP(Y) + stealth_Y = stepperY.get_stealthChop_status(); + #endif + #if AXIS_HAS_STEALTHCHOP(Z) + stealth_Z = stepperZ.get_stealthChop_status(); + #endif + #if AXIS_HAS_STEALTHCHOP(E0) + stealth_E0 = stepperE0.get_stealthChop_status(); + #endif + #if AXIS_HAS_STEALTHCHOP(E1) + stealth_E1 = stepperE1.get_stealthChop_status(); + #endif + if (uiCfg.para_ui_page != 1) { - buttonXText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonXText, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonXText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb(buttonXText, event_handler); - lv_btn_set_style(buttonXText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonXText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonXText, LV_LAYOUT_OFF); - labelXText = lv_label_create(buttonXText, NULL); /*Add a label to the button*/ - - buttonXState = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonXState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); - #if AXIS_HAS_STEALTHCHOP(X) - if (stepperX.get_stealthChop_status()) { - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - #else - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonXState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - #endif - lv_obj_set_event_cb_mks(buttonXState, event_handler, ID_TMC_MODE_X, NULL, 0); + buttonXText = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); + labelXText = lv_label_create_empty(buttonXText); /*Add a label to the button*/ - lv_imgbtn_set_style(buttonXState, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonXState, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonXState, LV_LAYOUT_OFF); - labelXState = lv_label_create(buttonXState, NULL); + buttonXState = lv_imgbtn_create(scr, stealth_X ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_X); + labelXState = lv_label_create_empty(buttonXState); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonXState); #endif @@ -300,36 +260,11 @@ void lv_draw_tmc_step_mode_settings(void) { line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - buttonYText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonYText, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ - lv_obj_set_size(buttonYText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb(buttonYText, event_handler); - lv_btn_set_style(buttonYText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonYText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonYText, LV_LAYOUT_OFF); - labelYText = lv_label_create(buttonYText, NULL); /*Add a label to the button*/ - - buttonYState = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonYState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_STATE_V); - #if AXIS_HAS_STEALTHCHOP(Y) - if (stepperY.get_stealthChop_status()) { - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - #else - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonYState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - #endif - lv_obj_set_event_cb_mks(buttonYState, event_handler, ID_TMC_MODE_Y, NULL, 0); + buttonYText = lv_btn_create(scr, NULL, PARA_UI_POS_X, PARA_UI_POS_Y * 2, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); + labelYText = lv_label_create_empty(buttonYText); /*Add a label to the button*/ - lv_imgbtn_set_style(buttonYState, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonYState, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonYState, LV_LAYOUT_OFF); - labelYState = lv_label_create(buttonYState, NULL); + buttonYState = lv_imgbtn_create(scr, stealth_Y ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_Y); + labelYState = lv_label_create_empty(buttonYState); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonYState); #endif @@ -337,35 +272,11 @@ void lv_draw_tmc_step_mode_settings(void) { line2 = lv_line_create(scr, NULL); lv_ex_line(line2, line_points[1]); - buttonZText = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonZText, PARA_UI_POS_X, PARA_UI_POS_Y * 3); /*Set its position*/ - lv_obj_set_size(buttonZText, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb(buttonZText, event_handler); - lv_btn_set_style(buttonZText, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonZText, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonZText, LV_LAYOUT_OFF); - labelZText = lv_label_create(buttonZText, NULL); /*Add a label to the button*/ - - buttonZState = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonZState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_STATE_V); - #if AXIS_HAS_STEALTHCHOP(Z) - if (stepperZ.get_stealthChop_status()) { - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - #else - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonZState, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - #endif - lv_obj_set_event_cb_mks(buttonZState, event_handler, ID_TMC_MODE_Z, NULL, 0); - lv_imgbtn_set_style(buttonZState, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonZState, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonZState, LV_LAYOUT_OFF); - labelZState = lv_label_create(buttonZState, NULL); + buttonZText = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); + labelZText = lv_label_create_empty(buttonZText); /*Add a label to the button*/ + + buttonZState = lv_imgbtn_create(scr, stealth_Z ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_Z); + labelZState = lv_label_create_empty(buttonZState); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZState); #endif @@ -373,52 +284,20 @@ void lv_draw_tmc_step_mode_settings(void) { line3 = lv_line_create(scr, NULL); lv_ex_line(line3, line_points[2]); - buttonE0Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonE0Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ - lv_obj_set_size(buttonE0Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb(buttonE0Text, event_handler); - lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonE0Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonE0Text, LV_LAYOUT_OFF); - labelE0Text = lv_label_create(buttonE0Text, NULL); /*Add a label to the button*/ - - buttonE0State = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonE0State, PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V); - #if AXIS_HAS_STEALTHCHOP(E0) - if (stepperE0.get_stealthChop_status()) { - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - #else - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE0State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - #endif - - lv_obj_set_event_cb_mks(buttonE0State, event_handler, ID_TMC_MODE_E0, NULL, 0); + buttonE0Text = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); + labelE0Text = lv_label_create_empty(buttonE0Text); /*Add a label to the button*/ - lv_imgbtn_set_style(buttonE0State, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonE0State, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonE0State, LV_LAYOUT_OFF); - labelE0State = lv_label_create(buttonE0State, NULL); + buttonE0State = lv_imgbtn_create(scr, stealth_E0 ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_E0); + labelE0State = lv_label_create_empty(buttonE0State); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonE0State); #endif - line4 = lv_line_create(scr, NULL); lv_ex_line(line4, line_points[3]); //#if AXIS_HAS_STEALTHCHOP(E1) - buttonTurnPage = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_MODE_DOWN, NULL, 0); - lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonTurnPage = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_TMC_MODE_DOWN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTurnPage); #endif @@ -426,35 +305,11 @@ void lv_draw_tmc_step_mode_settings(void) { } else { //#if AXIS_HAS_STEALTHCHOP(E1) - buttonE1Text = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonE1Text, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonE1Text, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb(buttonE1Text, event_handler); - lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonE1Text, LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ - lv_btn_set_layout(buttonE1Text, LV_LAYOUT_OFF); - labelE1Text = lv_label_create(buttonE1Text, NULL); /*Add a label to the button*/ - - buttonE1State = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonE1State, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V); - #if AXIS_HAS_STEALTHCHOP(E1) - if (stepperE1.get_stealthChop_status()) { - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - #else - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonE1State, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - #endif - lv_obj_set_event_cb_mks(buttonE1State, event_handler, ID_TMC_MODE_E1, NULL, 0); - lv_imgbtn_set_style(buttonE1State, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonE1State, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonE1State, LV_LAYOUT_OFF); - labelE1State = lv_label_create(buttonE1State, NULL); + buttonE1Text = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); + labelE1Text = lv_label_create_empty(buttonE1Text); /*Add a label to the button*/ + + buttonE1State = lv_imgbtn_create(scr, stealth_E1 ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_E1); + labelE1State = lv_label_create_empty(buttonE1State); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonE1State); #endif @@ -462,33 +317,20 @@ void lv_draw_tmc_step_mode_settings(void) { line1 = lv_line_create(scr, NULL); lv_ex_line(line1, line_points[0]); - buttonTurnPage = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_MODE_UP, NULL, 0); - lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonTurnPage, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonTurnPage, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonTurnPage = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_TMC_MODE_UP); //#endif } //#if AXIS_HAS_STEALTHCHOP(E1) lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); - labelTurnPage = lv_label_create(buttonTurnPage, NULL); + labelTurnPage = lv_label_create_empty(buttonTurnPage); //#endif - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_TMC_MODE_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_MODE_RETURN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { if (uiCfg.para_ui_page != 1) { @@ -504,44 +346,16 @@ void lv_draw_tmc_step_mode_settings(void) { lv_label_set_text(labelE0Text, machine_menu.E0_StepMode); lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); - #if AXIS_HAS_STEALTHCHOP(X) - if (stepperX.get_stealthChop_status()) - lv_label_set_text(labelXState, machine_menu.enable); - else - lv_label_set_text(labelXState, machine_menu.disable); - #else - lv_label_set_text(labelXState, machine_menu.disable); - #endif + lv_label_set_text(labelXState, stealth_X ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelXState, buttonXState, LV_ALIGN_CENTER, 0, 0); - #if AXIS_HAS_STEALTHCHOP(Y) - if (stepperY.get_stealthChop_status()) - lv_label_set_text(labelYState, machine_menu.enable); - else - lv_label_set_text(labelYState, machine_menu.disable); - #else - lv_label_set_text(labelYState, machine_menu.disable); - #endif + lv_label_set_text(labelYState, stealth_Y ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelYState, buttonYState, LV_ALIGN_CENTER, 0, 0); - #if AXIS_HAS_STEALTHCHOP(Z) - if (stepperZ.get_stealthChop_status()) - lv_label_set_text(labelZState, machine_menu.enable); - else - lv_label_set_text(labelZState, machine_menu.disable); - #else - lv_label_set_text(labelZState, machine_menu.disable); - #endif + lv_label_set_text(labelZState, stealth_Z ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelZState, buttonZState, LV_ALIGN_CENTER, 0, 0); - #if AXIS_HAS_STEALTHCHOP(E0) - if (stepperE0.get_stealthChop_status()) - lv_label_set_text(labelE0State, machine_menu.enable); - else - lv_label_set_text(labelE0State, machine_menu.disable); - #else - lv_label_set_text(labelE0State, machine_menu.disable); - #endif + lv_label_set_text(labelE0State, stealth_E0 ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelE0State, buttonE0State, LV_ALIGN_CENTER, 0, 0); //#if AXIS_HAS_STEALTHCHOP(E1) @@ -553,14 +367,7 @@ void lv_draw_tmc_step_mode_settings(void) { //#if AXIS_HAS_STEALTHCHOP(E1) lv_label_set_text(labelE1Text, machine_menu.E1_StepMode); lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); - #if AXIS_HAS_STEALTHCHOP(E1) - if (stepperE1.get_stealthChop_status()) - lv_label_set_text(labelE1State, machine_menu.enable); - else - lv_label_set_text(labelE1State, machine_menu.disable); - #else - lv_label_set_text(labelE1State, machine_menu.disable); - #endif + lv_label_set_text(labelE1State, stealth_E1 ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelE1State, buttonE1State, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(labelTurnPage, machine_menu.previous); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index b6ef6e64da02..8f310729788f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -149,92 +149,30 @@ void lv_draw_tool(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonPreHeat = lv_imgbtn_create(scr, NULL); - buttonExtrusion = lv_imgbtn_create(scr, NULL); - buttonMove = lv_imgbtn_create(scr, NULL); - buttonHome = lv_imgbtn_create(scr, NULL); - buttonLevel = lv_imgbtn_create(scr, NULL); - buttonFilament = lv_imgbtn_create(scr, NULL); - //buttonMore = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonPreHeat, event_handler, ID_T_PRE_HEAT, NULL, 0); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_REL, "F:/bmp_preHeat.bin"); - lv_imgbtn_set_src(buttonPreHeat, LV_BTN_STATE_PR, "F:/bmp_preHeat.bin"); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonPreHeat, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonExtrusion, event_handler, ID_T_EXTRUCT, NULL, 0); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_REL, "F:/bmp_extruct.bin"); - lv_imgbtn_set_src(buttonExtrusion, LV_BTN_STATE_PR, "F:/bmp_extruct.bin"); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonExtrusion, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonMove, event_handler, ID_T_MOV, NULL, 0); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_REL, "F:/bmp_mov.bin"); - lv_imgbtn_set_src(buttonMove, LV_BTN_STATE_PR, "F:/bmp_mov.bin"); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonMove, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonHome, event_handler, ID_T_HOME, NULL, 0); - lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_REL, "F:/bmp_zero.bin"); - lv_imgbtn_set_src(buttonHome, LV_BTN_STATE_PR, "F:/bmp_zero.bin"); - lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonHome, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonLevel, event_handler, ID_T_LEVELING, NULL, 0); - lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_REL, "F:/bmp_leveling.bin"); - lv_imgbtn_set_src(buttonLevel, LV_BTN_STATE_PR, "F:/bmp_leveling.bin"); - lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonLevel, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonFilament, event_handler,ID_T_FILAMENT,NULL,0); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_REL, "F:/bmp_filamentchange.bin"); - lv_imgbtn_set_src(buttonFilament, LV_BTN_STATE_PR, "F:/bmp_filamentchange.bin"); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonFilament, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_T_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonPreHeat, INTERVAL_V, titleHeight); - lv_obj_set_pos(buttonExtrusion, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight); - lv_obj_set_pos(buttonMove, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight); - lv_obj_set_pos(buttonHome, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight); - lv_obj_set_pos(buttonLevel, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight); - lv_obj_set_pos(buttonFilament,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); + buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_preHeat.bin", INTERVAL_V, titleHeight, event_handler, ID_T_PRE_HEAT); + buttonExtrusion = lv_imgbtn_create(scr, "F:/bmp_extruct.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_EXTRUCT); + buttonMove = lv_imgbtn_create(scr, "F:/bmp_mov.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_T_MOV); + buttonHome = lv_imgbtn_create(scr, "F:/bmp_zero.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME); + buttonLevel = lv_imgbtn_create(scr, "F:/bmp_leveling.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING); + buttonFilament = lv_imgbtn_create(scr, "F:/bmp_filamentchange.bin",BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT); + //buttonMore = lv_imgbtn_createx(scr, NULL); //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_RETURN); // Create labels on the image buttons - lv_btn_set_layout(buttonPreHeat, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonExtrusion, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonMove, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonHome, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonFilament, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonMore, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - lv_obj_t *labelPreHeat = lv_label_create(buttonPreHeat, NULL); - lv_obj_t *labelExtrusion = lv_label_create(buttonExtrusion, NULL); - lv_obj_t *label_Move = lv_label_create(buttonMove, NULL); - lv_obj_t *label_Home = lv_label_create(buttonHome, NULL); - lv_obj_t *label_Level = lv_label_create(buttonLevel, NULL); - lv_obj_t *label_Filament = lv_label_create(buttonFilament, NULL); - //lv_obj_t *label_More = lv_label_create(buttonMore, NULL); - lv_obj_t *label_Back = lv_label_create(buttonBack, NULL); + lv_obj_t *labelPreHeat = lv_label_create_empty(buttonPreHeat); + lv_obj_t *labelExtrusion = lv_label_create_empty(buttonExtrusion); + lv_obj_t *label_Move = lv_label_create_empty(buttonMove); + lv_obj_t *label_Home = lv_label_create_empty(buttonHome); + lv_obj_t *label_Level = lv_label_create_empty(buttonLevel); + lv_obj_t *label_Filament = lv_label_create_empty(buttonFilament); + //lv_obj_t *label_More = lv_label_create_empty(buttonMore); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { lv_label_set_text(labelPreHeat, tool_menu.preheat); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 1f21136668d3..ef2330528550 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1577,6 +1577,105 @@ void draw_return_ui() { } } +// Set the same image for both Released and Pressed +void lv_imgbtn_set_src_both(lv_obj_t *imgbtn, const void *src) { + lv_imgbtn_set_src(imgbtn, LV_BTN_STATE_REL, src); + lv_imgbtn_set_src(imgbtn, LV_BTN_STATE_PR, src); +} + +// Use label style for the image button +void lv_imgbtn_use_label_style(lv_obj_t *imgbtn) { + lv_imgbtn_set_style(imgbtn, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_imgbtn_set_style(imgbtn, LV_BTN_STATE_PR, &tft_style_label_pre); +} + +// Use label style for the image button +void lv_btn_use_label_style(lv_obj_t *btn) { + lv_btn_set_style(btn, LV_BTN_STYLE_REL, &tft_style_label_rel); + lv_btn_set_style(btn, LV_BTN_STYLE_PR, &tft_style_label_pre); +} + +// Use a single style for both Released and Pressed +void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style) { + lv_btn_set_style(btn, LV_BTN_STYLE_REL, style); + lv_btn_set_style(btn, LV_BTN_STYLE_PR, style); +} + +// Create an empty label +lv_obj_t* lv_label_create_empty(lv_obj_t *par) { + return lv_label_create(par, (lv_obj_t*)NULL); +} + +// Create a label with style and text +lv_obj_t* lv_label_create(lv_obj_t *par, const char *text) { + lv_obj_t *label = lv_label_create_empty(par); + if (text) lv_label_set_text(label, text); + return label; +} + +// Create a label with style, position, and text +lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char *text) { + lv_obj_t *label = lv_label_create(par, text); + lv_obj_set_pos(label, x, y); + return label; +} + +// Create a button with callback, ID, and Style. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id, lv_style_t *style) { + lv_obj_t *btn = lv_btn_create(par, NULL); + if (id) + lv_obj_set_event_cb_mks(btn, cb, id, NULL, 0); + else + lv_obj_set_event_cb(btn, cb); + lv_btn_set_style_both(btn, style); + return btn; +} + +// Create a button with callback and ID. Style set to style_para_value. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id) { + return lv_btn_create(par, cb, id, &style_para_value); +} + +// Create a button with position, size, callback, and ID. Style set to style_para_value. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id) { + lv_obj_t *btn = lv_btn_create(par, cb, id); + lv_obj_set_pos(btn, x, y); + lv_obj_set_size(btn, w, h); + return btn; +} + +// Create a button with callback and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id) { + return lv_btn_create(par, cb, id, &style_para_back); +} +// Create a button with position, size, callback, and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id) { + lv_obj_t *btn = lv_btn_create_back(par, cb, id); + lv_obj_set_pos(btn, x, y); + lv_obj_set_size(btn, w, h); + return btn; +} + +// Create an image button with image, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id) { + lv_obj_t *btn = lv_imgbtn_create(par, NULL); + if (img) lv_imgbtn_set_src_both(btn, img); + if (id) + lv_obj_set_event_cb_mks(btn, cb, id, NULL, 0); + else + lv_obj_set_event_cb(btn, cb); + lv_imgbtn_use_label_style(btn); + lv_btn_set_layout(btn, LV_LAYOUT_OFF); + return btn; +} + +// Create an image button with image, position, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id) { + lv_obj_t *btn = lv_imgbtn_create(par, img, cb, id); + lv_obj_set_pos(btn, x, y); + return btn; +} + #if ENABLED(SDSUPPORT) void sd_detection() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 00faedac4ed5..5ad0bd87b561 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -164,6 +164,48 @@ #endif // ifdef TFT35 +// Set the same image for both Released and Pressed +void lv_imgbtn_set_src_both(lv_obj_t *imgbtn, const void *src); + +// Set label styles for Released and Pressed +void lv_imgbtn_use_label_style(lv_obj_t *imgbtn); + +// Set label styles for Released and Pressed +void lv_btn_use_label_style(lv_obj_t *btn); + +// Set the same style for both Released and Pressed +void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style); + +// Create an empty label +lv_obj_t* lv_label_create_empty(lv_obj_t *par); + +// Create a label with style and text +lv_obj_t* lv_label_create(lv_obj_t *par, const char *text); + +// Create a label with style, position, and text +lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char *text); + +// Create a button with callback, ID, and Style. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id, lv_style_t *style); + +// Create a button with callback and ID. Style set to style_para_value. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id); + +// Create a button with position, size, callback, and ID. Style set to style_para_value. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id); + +// Create a button with callback and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id); + +// Create a button with position, size, callback, and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id); + +// Create an image button with image, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id); + +// Create an image button with image, position, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id); + #ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index ce158ef7fb80..78cf35fd0707 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -70,9 +70,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_wifi(void) { - lv_obj_t *buttonBack=NULL,*label_Back=NULL; - lv_obj_t *buttonCloud=NULL,*label_Cloud=NULL; - lv_obj_t *buttonReconnect=NULL,*label_Reconnect=NULL; + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + lv_obj_t *buttonCloud = NULL, *label_Cloud = NULL; + lv_obj_t *buttonReconnect = NULL, *label_Reconnect=NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_UI; @@ -85,78 +85,63 @@ void lv_draw_wifi(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonBack = lv_imgbtn_create(scr, NULL); - if (gCfgItems.wifi_mode_sel == STA_MODEL) { - //buttonCloud = lv_imgbtn_create(scr, NULL); - buttonReconnect = lv_imgbtn_create(scr, NULL); - } + buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_RETURN); - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_W_RETURN, NULL,0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_return.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_return.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + if (gCfgItems.wifi_mode_sel == STA_MODEL) { + //buttonCloud = lv_imgbtn_create(scr, NULL); + buttonReconnect = lv_imgbtn_create(scr, NULL); + } if (gCfgItems.wifi_mode_sel == STA_MODEL) { - lv_obj_set_event_cb_mks(buttonReconnect, event_handler,ID_W_RECONNECT, NULL,0); - lv_imgbtn_set_src(buttonReconnect, LV_BTN_STATE_REL, "F:/bmp_wifi.bin"); - lv_imgbtn_set_src(buttonReconnect, LV_BTN_STATE_PR, "F:/bmp_wifi.bin"); - lv_imgbtn_set_style(buttonReconnect, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonReconnect, LV_BTN_STATE_REL, &tft_style_label_rel); + lv_obj_set_event_cb_mks(buttonReconnect, event_handler,ID_W_RECONNECT, NULL, 0); + lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin"); + lv_imgbtn_use_label_style(buttonReconnect); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonReconnect); #endif - lv_obj_set_pos(buttonReconnect,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); + lv_obj_set_pos(buttonReconnect, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); lv_btn_set_layout(buttonReconnect, LV_LAYOUT_OFF); } - label_Back = lv_label_create(buttonBack, NULL); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.wifi_mode_sel == STA_MODEL) { - //label_Cloud = lv_label_create(buttonCloud, NULL); - label_Reconnect = lv_label_create(buttonReconnect, NULL); + //label_Cloud = lv_label_create_empty(buttonCloud); + label_Reconnect = lv_label_create_empty(buttonReconnect); } if (gCfgItems.multiple_language) { lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); if (gCfgItems.wifi_mode_sel == STA_MODEL) { //lv_label_set_text(label_Cloud, common_menu.text_back); - //lv_obj_align(label_Cloud, buttonCloud, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + //lv_obj_align(label_Cloud, buttonCloud, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(label_Reconnect, wifi_menu.reconnect); - lv_obj_align(label_Reconnect, buttonReconnect, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); + lv_obj_align(label_Reconnect, buttonReconnect, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } } - wifi_ip_text = lv_label_create(scr, NULL); + wifi_ip_text = lv_label_create_empty(scr); lv_obj_set_style(wifi_ip_text, &tft_style_label_rel); - - wifi_name_text = lv_label_create(scr, NULL); + wifi_name_text = lv_label_create_empty(scr); lv_obj_set_style(wifi_name_text, &tft_style_label_rel); - - wifi_key_text = lv_label_create(scr, NULL); + wifi_key_text = lv_label_create_empty(scr); lv_obj_set_style(wifi_key_text, &tft_style_label_rel); - - wifi_state_text = lv_label_create(scr, NULL); + wifi_state_text = lv_label_create_empty(scr); lv_obj_set_style(wifi_state_text, &tft_style_label_rel); disp_wifi_state(); @@ -167,20 +152,20 @@ void disp_wifi_state() { strcpy(public_buf_m,wifi_menu.ip); strcat(public_buf_m,ipPara.ip_addr); lv_label_set_text(wifi_ip_text, public_buf_m); - lv_obj_align(wifi_ip_text, NULL, LV_ALIGN_CENTER,0, -100); + lv_obj_align(wifi_ip_text, NULL, LV_ALIGN_CENTER, 0, -100); memset(public_buf_m, 0, sizeof(public_buf_m)); strcpy(public_buf_m,wifi_menu.wifi); strcat(public_buf_m,wifiPara.ap_name); lv_label_set_text(wifi_name_text, public_buf_m); - lv_obj_align(wifi_name_text, NULL, LV_ALIGN_CENTER,0, -70); + lv_obj_align(wifi_name_text, NULL, LV_ALIGN_CENTER, 0, -70); if (wifiPara.mode == AP_MODEL) { memset(public_buf_m, 0, sizeof(public_buf_m)); strcpy(public_buf_m,wifi_menu.key); strcat(public_buf_m,wifiPara.keyCode); lv_label_set_text(wifi_key_text, public_buf_m); - lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER,0, -40); + lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER, 0, -40); memset(public_buf_m, 0, sizeof(public_buf_m)); strcpy(public_buf_m,wifi_menu.state_ap); @@ -191,7 +176,7 @@ void disp_wifi_state() { else strcat(public_buf_m,wifi_menu.exception); lv_label_set_text(wifi_state_text, public_buf_m); - lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER,0, -10); + lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER, 0, -10); } else { ZERO(public_buf_m); @@ -203,10 +188,10 @@ void disp_wifi_state() { else strcat(public_buf_m, wifi_menu.exception); lv_label_set_text(wifi_state_text, public_buf_m); - lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER,0, -40); + lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER, 0, -40); lv_label_set_text(wifi_key_text, ""); - lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER,0, -10); + lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER, 0, -10); } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index 26801948683f..b52dbc5e598b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -42,8 +42,8 @@ list_menu_def list_menu; extern lv_group_t * g; static lv_obj_t * scr; static lv_obj_t *buttonWifiN[NUMBER_OF_PAGE]; -static lv_obj_t *lableWifiText[NUMBER_OF_PAGE]; -static lv_obj_t *lablePageText; +static lv_obj_t *labelWifiText[NUMBER_OF_PAGE]; +static lv_obj_t *labelPageText; #define ID_WL_RETURN 11 #define ID_WL_DOWN 12 @@ -116,43 +116,21 @@ void lv_draw_wifi_list(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, creat_title_text()); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonDown = lv_imgbtn_create(scr, NULL); - buttonBack = lv_imgbtn_create(scr, NULL); - - lv_obj_set_event_cb_mks(buttonDown, event_handler,ID_WL_DOWN,NULL,0); - lv_imgbtn_set_src(buttonDown, LV_BTN_STATE_REL, "F:/bmp_pageDown.bin"); - lv_imgbtn_set_src(buttonDown, LV_BTN_STATE_PR, "F:/bmp_pageDown.bin"); - lv_imgbtn_set_style(buttonDown, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonDown, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_WL_RETURN,NULL,0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - - lv_obj_set_pos(buttonDown,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL+INTERVAL_H); - lv_obj_set_pos(buttonBack,OTHER_BTN_XPIEL*3+INTERVAL_V*4,titleHeight+OTHER_BTN_YPIEL*2+INTERVAL_H*2); - - lv_btn_set_layout(buttonDown, LV_LAYOUT_OFF); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); + buttonDown = lv_imgbtn_create(scr, "F:/bmp_pageDown.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H, event_handler, ID_WL_DOWN); + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + (OTHER_BTN_YPIEL + INTERVAL_H) * 2, event_handler, ID_WL_RETURN); for (uint8_t i = 0; i < NUMBER_OF_PAGE; i++) { buttonWifiN[i] = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonWifiN[i], 0,NAME_BTN_Y*i+10+titleHeight); /*Set its position*/ - lv_obj_set_size(buttonWifiN[i], NAME_BTN_X,NAME_BTN_Y); /*Set its size*/ - lv_obj_set_event_cb_mks(buttonWifiN[i], event_handler,(i+1),NULL,0); - lv_btn_set_style(buttonWifiN[i], LV_BTN_STYLE_REL, &tft_style_label_rel); /*Set the button's released style*/ - lv_btn_set_style(buttonWifiN[i], LV_BTN_STYLE_PR, &tft_style_label_pre); /*Set the button's pressed style*/ + lv_obj_set_pos(buttonWifiN[i], 0, NAME_BTN_Y*i+10+titleHeight); /*Set its position*/ + lv_obj_set_size(buttonWifiN[i], NAME_BTN_X, NAME_BTN_Y); /*Set its size*/ + lv_obj_set_event_cb_mks(buttonWifiN[i], event_handler, (i+1), NULL, 0); + lv_btn_use_label_style(buttonWifiN[i]); lv_btn_set_layout(buttonWifiN[i], LV_LAYOUT_OFF); - lableWifiText[i] = lv_label_create(buttonWifiN[i], NULL); + labelWifiText[i] = lv_label_create_empty(buttonWifiN[i]); #if HAS_ROTARY_ENCODER uint8_t j = 0; if (gCfgItems.encoder_enable) { @@ -162,8 +140,8 @@ void lv_draw_wifi_list(void) { #endif } - lablePageText = lv_label_create(scr, NULL); - lv_obj_set_style(lablePageText, &tft_style_label_rel); + labelPageText = lv_label_create_empty(scr); + lv_obj_set_style(labelPageText, &tft_style_label_rel); wifi_list.nameIndex = 0; wifi_list.currentWifipage = 1; @@ -187,27 +165,23 @@ void disp_wifi_list(void) { uint8_t i, j; sprintf((char *)tmpStr, list_menu.file_pages, wifi_list.currentWifipage, wifi_list.getPage); - lv_label_set_text(lablePageText, (const char *)tmpStr); - lv_obj_align(lablePageText, NULL, LV_ALIGN_CENTER, 50, -100); + lv_label_set_text(labelPageText, (const char *)tmpStr); + lv_obj_align(labelPageText, NULL, LV_ALIGN_CENTER, 50, -100); for (i = 0; i < NUMBER_OF_PAGE; i++) { memset(tmpStr, 0, sizeof(tmpStr)); j = wifi_list.nameIndex + i; if (j >= wifi_list.getNameNum) { - lv_label_set_text(lableWifiText[i], (const char *)tmpStr); - lv_obj_align(lableWifiText[i], buttonWifiN[i], LV_ALIGN_IN_LEFT_MID, 20, 0); + lv_label_set_text(labelWifiText[i], (const char *)tmpStr); + lv_obj_align(labelWifiText[i], buttonWifiN[i], LV_ALIGN_IN_LEFT_MID, 20, 0); } else { - lv_label_set_text(lableWifiText[i], (char const *)wifi_list.wifiName[j]); - lv_obj_align(lableWifiText[i], buttonWifiN[i], LV_ALIGN_IN_LEFT_MID, 20, 0); + lv_label_set_text(labelWifiText[i], (char const *)wifi_list.wifiName[j]); + lv_obj_align(labelWifiText[i], buttonWifiN[i], LV_ALIGN_IN_LEFT_MID, 20, 0); - if (wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[j]) == 0) { - lv_btn_set_style(buttonWifiN[i], LV_BTN_STYLE_REL, &style_sel_text); - } - else { - lv_btn_set_style(buttonWifiN[i], LV_BTN_STYLE_REL, &tft_style_label_rel); - } + const bool btext = (wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[j]) == 0); + lv_btn_set_style(buttonWifiN[i], LV_BTN_STYLE_REL, btext ? &style_sel_text : &tft_style_label_rel); } } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp index 81a5f5c3be36..0902135835b8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp @@ -59,13 +59,13 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { if (gCfgItems.wifi_mode_sel == AP_MODEL) { gCfgItems.wifi_mode_sel = STA_MODEL; lv_label_set_text(labelModelValue, WIFI_STA_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); update_spi_flash(); } else { gCfgItems.wifi_mode_sel = AP_MODEL; lv_label_set_text(labelModelValue, WIFI_AP_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); update_spi_flash(); } } @@ -85,7 +85,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - keyboard_value=wifiPassWord; + keyboard_value = wifiPassWord; lv_clear_wifi_settings(); lv_draw_keyboard(); } @@ -95,19 +95,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.cloud_enable) { - gCfgItems.cloud_enable = false; - lv_obj_set_event_cb_mks(obj, event_handler,ID_WIFI_CLOUD,"bmp_disable.bin",0); - lv_label_set_text(labelCloudValue, machine_menu.disable); - update_spi_flash(); - } - else { - gCfgItems.cloud_enable = true; - lv_obj_set_event_cb_mks(obj, event_handler,ID_WIFI_CLOUD,"bmp_enable.bin",0); - lv_label_set_text(labelCloudValue, machine_menu.enable); + if (gCfgItems.cloud_enable) { + gCfgItems.cloud_enable = false; + lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_disable.bin", 0); + lv_label_set_text(labelCloudValue, machine_menu.disable); + } + else { + gCfgItems.cloud_enable = true; + lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_enable.bin", 0); + lv_label_set_text(labelCloudValue, machine_menu.enable); + } update_spi_flash(); } - } break; case ID_WIFI_CONFIG: if (event == LV_EVENT_CLICKED) { @@ -140,113 +139,61 @@ void lv_draw_wifi_settings(void) { lv_scr_load(scr); lv_obj_clean(scr); - lv_obj_t * title = lv_label_create(scr, NULL); - lv_obj_set_style(title, &tft_style_label_rel); - lv_obj_set_pos(title,TITLE_XPOS,TITLE_YPOS); - lv_label_set_text(title, machine_menu.WifiConfTitle); + (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.WifiConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelModelText = lv_label_create(scr, NULL); - lv_obj_set_style(labelModelText, &tft_style_label_rel); - lv_obj_set_pos(labelModelText, PARA_UI_POS_X, PARA_UI_POS_Y + 10); - lv_label_set_text(labelModelText, machine_menu.wifiMode); + labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); buttonModelValue = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonModelValue,PARA_UI_VALUE_POS_X,PARA_UI_POS_Y+PARA_UI_VALUE_V); - lv_obj_set_event_cb_mks(buttonModelValue, event_handler,ID_WIFI_MODEL, NULL,0); - lv_imgbtn_set_src(buttonModelValue, LV_BTN_STATE_REL, "F:/bmp_blank_sel.bin"); - lv_imgbtn_set_src(buttonModelValue, LV_BTN_STATE_PR, "F:/bmp_blank_sel.bin"); - lv_imgbtn_set_style(buttonModelValue, LV_BTN_STATE_PR, &style_para_value_pre); - lv_imgbtn_set_style(buttonModelValue, LV_BTN_STATE_REL, &style_para_value_pre); + lv_imgbtn_set_src_both(buttonModelValue, "F:/bmp_blank_sel.bin"); + lv_obj_set_pos(buttonModelValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); + lv_obj_set_event_cb_mks(buttonModelValue, event_handler, ID_WIFI_MODEL, NULL, 0); + lv_btn_set_style_both(buttonModelValue, &style_para_value_pre); lv_btn_set_layout(buttonModelValue, LV_LAYOUT_OFF); - labelModelValue = lv_label_create(buttonModelValue, NULL); + labelModelValue = lv_label_create_empty(buttonModelValue); line1 = lv_line_create(scr, NULL); lv_ex_line(line1,line_points[0]); - labelNameText = lv_label_create(scr, NULL); - lv_obj_set_style(labelNameText, &tft_style_label_rel); - lv_obj_set_pos(labelNameText, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10); + labelNameText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, NULL); - buttonNameValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonNameValue,PARA_UI_VALUE_POS_X,PARA_UI_POS_Y*2+PARA_UI_VALUE_V); - lv_obj_set_size(buttonNameValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonNameValue, event_handler,ID_WIFI_NAME, NULL,0); - lv_btn_set_style(buttonNameValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonNameValue, LV_BTN_STYLE_PR, &style_para_value); - labelNameValue = lv_label_create(buttonNameValue, NULL); + buttonNameValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_NAME); + labelNameValue = lv_label_create_empty(buttonNameValue); line2 = lv_line_create(scr, NULL); lv_ex_line(line2,line_points[1]); - labelPassWordText = lv_label_create(scr, NULL); - lv_obj_set_style(labelPassWordText, &tft_style_label_rel); - lv_obj_set_pos(labelPassWordText, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10); + labelPassWordText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, NULL); - buttonPassWordValue = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonPassWordValue,PARA_UI_VALUE_POS_X,PARA_UI_POS_Y*3+PARA_UI_VALUE_V); - lv_obj_set_size(buttonPassWordValue, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonPassWordValue, event_handler,ID_WIFI_PASSWORD, NULL,0); - lv_btn_set_style(buttonPassWordValue, LV_BTN_STYLE_REL, &style_para_value); - lv_btn_set_style(buttonPassWordValue, LV_BTN_STYLE_PR, &style_para_value); - labelPassWordValue = lv_label_create(buttonPassWordValue, NULL); + buttonPassWordValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_PASSWORD); + labelPassWordValue = lv_label_create_empty(buttonPassWordValue); line3 = lv_line_create(scr, NULL); lv_ex_line(line3,line_points[2]); - labelCloudText = lv_label_create(scr, NULL); - lv_obj_set_style(labelCloudText, &tft_style_label_rel); - lv_obj_set_pos(labelCloudText, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10); - lv_label_set_text(labelCloudText, machine_menu.wifiCloud); + labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud); - buttonCloudValue = lv_imgbtn_create(scr, NULL); - lv_obj_set_pos(buttonCloudValue,PARA_UI_STATE_POS_X,PARA_UI_POS_Y*4+PARA_UI_STATE_V); - if (gCfgItems.cloud_enable) { - lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_REL, "F:/bmp_enable.bin"); - lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_PR, "F:/bmp_enable.bin"); - } - else { - lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_REL, "F:/bmp_disable.bin"); - lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_PR, "F:/bmp_disable.bin"); - } - lv_obj_set_event_cb_mks(buttonCloudValue, event_handler,ID_WIFI_CLOUD, NULL,0); - lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_btn_set_layout(buttonCloudValue, LV_LAYOUT_OFF); - labelCloudValue = lv_label_create(buttonCloudValue, NULL); + buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD); + labelCloudValue = lv_label_create_empty(buttonCloudValue); line4 = lv_line_create(scr, NULL); lv_ex_line(line4,line_points[3]); - buttonConfig = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonConfig, event_handler,ID_WIFI_CONFIG, NULL,0); - lv_imgbtn_set_src(buttonConfig, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonConfig, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonConfig, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonConfig, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_set_pos(buttonConfig, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_btn_set_layout(buttonConfig, LV_LAYOUT_OFF); - labelConfig = lv_label_create(buttonConfig, NULL); - - buttonBack = lv_imgbtn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_WIFI_RETURN, NULL, 0); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, "F:/bmp_back70x40.bin"); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_label_pre); - lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_REL, &tft_style_label_rel); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create(buttonBack, NULL); + buttonConfig = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_WIFI_CONFIG); + labelConfig = lv_label_create_empty(buttonConfig); + + buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_WIFI_RETURN); + label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { if (gCfgItems.wifi_mode_sel == AP_MODEL) { lv_label_set_text(labelModelValue, WIFI_AP_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); } else { lv_label_set_text(labelModelValue, WIFI_STA_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); } memset(public_buf_m,0,sizeof(public_buf_m)); strcat(public_buf_m,machine_menu.wifiName); @@ -254,7 +201,7 @@ void lv_draw_wifi_settings(void) { lv_label_set_text(labelNameText,public_buf_m); lv_label_set_text(labelNameValue,machine_menu.wifiEdit); - lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER, 0, 0); memset(public_buf_m,0,sizeof(public_buf_m)); strcat(public_buf_m,machine_menu.wifiPassWord); @@ -262,16 +209,16 @@ void lv_draw_wifi_settings(void) { lv_label_set_text(labelPassWordText,public_buf_m); lv_label_set_text(labelPassWordValue,machine_menu.wifiEdit); - lv_obj_align(labelPassWordValue, buttonPassWordValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelPassWordValue, buttonPassWordValue, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(labelCloudValue, gCfgItems.cloud_enable ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelCloudValue, buttonCloudValue, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelCloudValue, buttonCloudValue, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(labelConfig,machine_menu.wifiConfig); - lv_obj_align(labelConfig, buttonConfig, LV_ALIGN_CENTER,0, 0); + lv_obj_align(labelConfig, buttonConfig, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER,0, 0); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); } #if HAS_ROTARY_ENCODER diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp index 059656bbb5f8..86ac5dffac23 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp @@ -52,28 +52,23 @@ void lv_draw_wifi_tips(void) { lv_obj_clean(scr); lv_refr_now(lv_refr_get_disp_refreshing()); - text_tips = lv_label_create(scr, NULL); - lv_obj_set_style(text_tips, &tft_style_label_rel); - - wifi_name = lv_label_create(scr, NULL); - lv_obj_set_style(wifi_name, &tft_style_label_rel); + wifi_name = lv_label_create(scr, (const char *)wifi_list.wifiName[wifi_list.nameIndex]); + lv_obj_align(wifi_name, NULL, LV_ALIGN_CENTER, 0, -20); + text_tips = lv_label_create_empty(scr); if (wifi_tips_type == TIPS_TYPE_JOINING) { lv_label_set_text(text_tips, tips_menu.joining); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER,0, -60); + lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); } else if (wifi_tips_type == TIPS_TYPE_TAILED_JOIN) { lv_label_set_text(text_tips, tips_menu.failedJoin); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER,0, -60); + lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); } else if (wifi_tips_type == TIPS_TYPE_WIFI_CONECTED) { lv_label_set_text(text_tips, tips_menu.wifiConected); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER,0, -60); + lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); } - lv_label_set_text(wifi_name, (const char *)wifi_list.wifiName[wifi_list.nameIndex]); - lv_obj_align(wifi_name, NULL, LV_ALIGN_CENTER,0, -20); - tips_disp.timer = TIPS_TIMER_START; tips_disp.timer_count = 0; } From c7f7f2403d3123d360badd4353cb385b38c16095 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Fri, 23 Oct 2020 03:46:48 +0200 Subject: [PATCH 007/443] Fix Chopper Timing extra axis defaults (#19850) --- Marlin/src/module/stepper/trinamic.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 7ae2a276db22..9f7445e4fda5 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -144,7 +144,7 @@ void reset_trinamic_drivers(); #if HAS_X2_ENABLE && AXIS_IS_TMC(X2) extern TMC_CLASS(X2, X) stepperX2; #ifndef CHOPPER_TIMING_X2 - #define CHOPPER_TIMING_X2 CHOPPER_TIMING_E + #define CHOPPER_TIMING_X2 CHOPPER_TIMING_X #endif static constexpr chopper_timing_t chopper_timing_X2 = CHOPPER_TIMING_X2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) @@ -161,7 +161,7 @@ void reset_trinamic_drivers(); #if HAS_Y2_ENABLE && AXIS_IS_TMC(Y2) extern TMC_CLASS(Y2, Y) stepperY2; #ifndef CHOPPER_TIMING_Y2 - #define CHOPPER_TIMING_Y2 CHOPPER_TIMING_E + #define CHOPPER_TIMING_Y2 CHOPPER_TIMING_Y #endif static constexpr chopper_timing_t chopper_timing_Y2 = CHOPPER_TIMING_Y2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) @@ -178,7 +178,7 @@ void reset_trinamic_drivers(); #if HAS_Z2_ENABLE && AXIS_IS_TMC(Z2) extern TMC_CLASS(Z2, Z) stepperZ2; #ifndef CHOPPER_TIMING_Z2 - #define CHOPPER_TIMING_Z2 CHOPPER_TIMING_E + #define CHOPPER_TIMING_Z2 CHOPPER_TIMING_Z #endif static constexpr chopper_timing_t chopper_timing_Z2 = CHOPPER_TIMING_Z2; #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) @@ -195,7 +195,7 @@ void reset_trinamic_drivers(); #if HAS_Z3_ENABLE && AXIS_IS_TMC(Z3) extern TMC_CLASS(Z3, Z) stepperZ3; #ifndef CHOPPER_TIMING_Z3 - #define CHOPPER_TIMING_Z3 CHOPPER_TIMING_E + #define CHOPPER_TIMING_Z3 CHOPPER_TIMING_Z #endif static constexpr chopper_timing_t chopper_timing_Z3 = CHOPPER_TIMING_Z3; #if ENABLED(SOFTWARE_DRIVER_ENABLE) @@ -212,7 +212,7 @@ void reset_trinamic_drivers(); #if HAS_Z4_ENABLE && AXIS_IS_TMC(Z4) extern TMC_CLASS(Z4, Z) stepperZ4; #ifndef CHOPPER_TIMING_Z4 - #define CHOPPER_TIMING_Z4 CHOPPER_TIMING_E + #define CHOPPER_TIMING_Z4 CHOPPER_TIMING_Z #endif static constexpr chopper_timing_t chopper_timing_Z4 = CHOPPER_TIMING_Z4; #if ENABLED(SOFTWARE_DRIVER_ENABLE) From c75e98dc846d9662a7f4a234a6a73215a48e9833 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 22 Oct 2020 20:54:11 -0500 Subject: [PATCH 008/443] Shorten a method name --- Marlin/src/feature/tmc_util.h | 12 ++-- Marlin/src/gcode/feature/trinamic/M569.cpp | 2 +- .../mks_ui/draw_tmc_step_mode_settings.cpp | 10 +-- Marlin/src/module/settings.cpp | 64 +++++++++---------- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 187cfda48334..abde3423076f 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -104,8 +104,8 @@ class TMCMarlin : public TMC, public TMCStorage { #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return this->en_pwm_mode(); } - inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; } + inline bool get_stealthChop() { return this->en_pwm_mode(); } + inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } #endif #if ENABLED(HYBRID_THRESHOLD) @@ -171,8 +171,8 @@ class TMCMarlin : public TMC220 #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; } + inline bool get_stealthChop() { return !this->en_spreadCycle(); } + inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } #endif #if ENABLED(HYBRID_THRESHOLD) @@ -217,8 +217,8 @@ class TMCMarlin : public TMC220 #if HAS_STEALTHCHOP inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop_status() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop_status() { return this->stored.stealthChop_enabled; } + inline bool get_stealthChop() { return !this->en_spreadCycle(); } + inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } #endif #if ENABLED(HYBRID_THRESHOLD) diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index e72d03e76728..6b379f119051 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -32,7 +32,7 @@ template void tmc_say_stealth_status(TMC &st) { st.printLabel(); SERIAL_ECHOPGM(" driver mode:\t"); - serialprintPGM(st.get_stealthChop_status() ? PSTR("stealthChop") : PSTR("spreadCycle")); + serialprintPGM(st.get_stealthChop() ? PSTR("stealthChop") : PSTR("spreadCycle")); SERIAL_EOL(); } template diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 8be03297f544..2140af079318 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -232,19 +232,19 @@ void lv_draw_tmc_step_mode_settings(void) { bool stealth_X = false, stealth_Y = false, stealth_Z = false, stealth_E0 = false, stealth_E1 = false; #if AXIS_HAS_STEALTHCHOP(X) - stealth_X = stepperX.get_stealthChop_status(); + stealth_X = stepperX.get_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Y) - stealth_Y = stepperY.get_stealthChop_status(); + stealth_Y = stepperY.get_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Z) - stealth_Z = stepperZ.get_stealthChop_status(); + stealth_Z = stepperZ.get_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(E0) - stealth_E0 = stepperE0.get_stealthChop_status(); + stealth_E0 = stepperE0.get_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(E1) - stealth_E1 = stepperE1.get_stealthChop_status(); + stealth_E1 = stepperE1.get_stealthChop(); #endif if (uiCfg.para_ui_page != 1) { diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 9ed78efd6384..972d3758480a 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1214,60 +1214,60 @@ void MarlinSettings::postprocess() { #if HAS_STEALTHCHOP #if AXIS_HAS_STEALTHCHOP(X) - tmc_stealth_enabled.X = stepperX.get_stored_stealthChop_status(); + tmc_stealth_enabled.X = stepperX.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Y) - tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop_status(); + tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Z) - tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop_status(); + tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(X2) - tmc_stealth_enabled.X2 = stepperX2.get_stored_stealthChop_status(); + tmc_stealth_enabled.X2 = stepperX2.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Y2) - tmc_stealth_enabled.Y2 = stepperY2.get_stored_stealthChop_status(); + tmc_stealth_enabled.Y2 = stepperY2.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Z2) - tmc_stealth_enabled.Z2 = stepperZ2.get_stored_stealthChop_status(); + tmc_stealth_enabled.Z2 = stepperZ2.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Z3) - tmc_stealth_enabled.Z3 = stepperZ3.get_stored_stealthChop_status(); + tmc_stealth_enabled.Z3 = stepperZ3.get_stored_stealthChop(); #endif #if AXIS_HAS_STEALTHCHOP(Z4) - tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop_status(); + tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS #if AXIS_HAS_STEALTHCHOP(E0) - tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop_status(); + tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 1 #if AXIS_HAS_STEALTHCHOP(E1) - tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop_status(); + tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 2 #if AXIS_HAS_STEALTHCHOP(E2) - tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop_status(); + tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 3 #if AXIS_HAS_STEALTHCHOP(E3) - tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop_status(); + tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 4 #if AXIS_HAS_STEALTHCHOP(E4) - tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop_status(); + tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 5 #if AXIS_HAS_STEALTHCHOP(E5) - tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop_status(); + tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 6 #if AXIS_HAS_STEALTHCHOP(E6) - tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop_status(); + tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop(); #endif #if MAX_EXTRUDERS > 7 #if AXIS_HAS_STEALTHCHOP(E7) - tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop_status(); + tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop(); #endif #endif // MAX_EXTRUDERS > 7 #endif // MAX_EXTRUDERS > 6 @@ -3671,17 +3671,17 @@ void MarlinSettings::reset() { #if HAS_STEALTHCHOP CONFIG_ECHO_HEADING("Driver stepping mode:"); #if AXIS_HAS_STEALTHCHOP(X) - const bool chop_x = stepperX.get_stored_stealthChop_status(); + const bool chop_x = stepperX.get_stored_stealthChop(); #else constexpr bool chop_x = false; #endif #if AXIS_HAS_STEALTHCHOP(Y) - const bool chop_y = stepperY.get_stored_stealthChop_status(); + const bool chop_y = stepperY.get_stored_stealthChop(); #else constexpr bool chop_y = false; #endif #if AXIS_HAS_STEALTHCHOP(Z) - const bool chop_z = stepperZ.get_stored_stealthChop_status(); + const bool chop_z = stepperZ.get_stored_stealthChop(); #else constexpr bool chop_z = false; #endif @@ -3695,17 +3695,17 @@ void MarlinSettings::reset() { } #if AXIS_HAS_STEALTHCHOP(X2) - const bool chop_x2 = stepperX2.get_stored_stealthChop_status(); + const bool chop_x2 = stepperX2.get_stored_stealthChop(); #else constexpr bool chop_x2 = false; #endif #if AXIS_HAS_STEALTHCHOP(Y2) - const bool chop_y2 = stepperY2.get_stored_stealthChop_status(); + const bool chop_y2 = stepperY2.get_stored_stealthChop(); #else constexpr bool chop_y2 = false; #endif #if AXIS_HAS_STEALTHCHOP(Z2) - const bool chop_z2 = stepperZ2.get_stored_stealthChop_status(); + const bool chop_z2 = stepperZ2.get_stored_stealthChop(); #else constexpr bool chop_z2 = false; #endif @@ -3719,36 +3719,36 @@ void MarlinSettings::reset() { } #if AXIS_HAS_STEALTHCHOP(Z3) - if (stepperZ3.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("I2 Z"), true); } + if (stepperZ3.get_stored_stealthChop()) { say_M569(forReplay, PSTR("I2 Z"), true); } #endif #if AXIS_HAS_STEALTHCHOP(Z4) - if (stepperZ4.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("I3 Z"), true); } + if (stepperZ4.get_stored_stealthChop()) { say_M569(forReplay, PSTR("I3 Z"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E0) - if (stepperE0.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T0 E"), true); } + if (stepperE0.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T0 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E1) - if (stepperE1.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T1 E"), true); } + if (stepperE1.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T1 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E2) - if (stepperE2.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T2 E"), true); } + if (stepperE2.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T2 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E3) - if (stepperE3.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T3 E"), true); } + if (stepperE3.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T3 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E4) - if (stepperE4.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T4 E"), true); } + if (stepperE4.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T4 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E5) - if (stepperE5.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T5 E"), true); } + if (stepperE5.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T5 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E6) - if (stepperE6.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T6 E"), true); } + if (stepperE6.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T6 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E7) - if (stepperE7.get_stored_stealthChop_status()) { say_M569(forReplay, PSTR("T7 E"), true); } + if (stepperE7.get_stored_stealthChop()) { say_M569(forReplay, PSTR("T7 E"), true); } #endif #endif // HAS_STEALTHCHOP From 0ffee29a11eeaa488bc3f64c773e86c5944ec286 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 22 Oct 2020 22:31:48 -0500 Subject: [PATCH 009/443] Case light brightness cleanup (#19856) Co-authored-by: Chris --- Marlin/src/feature/caselight.cpp | 41 ++++++++++++--------- Marlin/src/feature/caselight.h | 8 +++- Marlin/src/gcode/feature/caselight/M355.cpp | 19 +++++++--- Marlin/src/gcode/host/M115.cpp | 6 ++- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu_led.cpp | 2 +- Marlin/src/module/settings.cpp | 15 ++++---- 7 files changed, 58 insertions(+), 35 deletions(-) diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index 8a128bb12def..0eba102a04b2 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -28,7 +28,14 @@ CaseLight caselight; -uint8_t CaseLight::brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; +#if CASELIGHT_USES_BRIGHTNESS && !defined(CASE_LIGHT_DEFAULT_BRIGHTNESS) + #define CASE_LIGHT_DEFAULT_BRIGHTNESS 0 // For use on PWM pin as non-PWM just sets a default +#endif + +#if CASELIGHT_USES_BRIGHTNESS + uint8_t CaseLight::brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS; +#endif + bool CaseLight::on = CASE_LIGHT_DEFAULT_ON; #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) @@ -46,21 +53,21 @@ bool CaseLight::on = CASE_LIGHT_DEFAULT_ON; #endif void CaseLight::update(const bool sflag) { - /** - * The brightness_sav (and sflag) is needed because ARM chips ignore - * a "WRITE(CASE_LIGHT_PIN,x)" command to the pins that are directly - * controlled by the PWM module. In order to turn them off the brightness - * level needs to be set to OFF. Since we can't use the PWM register to - * save the last brightness level we need a variable to save it. - */ - static uint8_t brightness_sav; // Save brightness info for restore on "M355 S1" - - if (on || !sflag) - brightness_sav = brightness; // Save brightness except for M355 S0 - if (sflag && on) - brightness = brightness_sav; // Restore last brightness for M355 S1 - - #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) || DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS + /** + * The brightness_sav (and sflag) is needed because ARM chips ignore + * a "WRITE(CASE_LIGHT_PIN,x)" command to the pins that are directly + * controlled by the PWM module. In order to turn them off the brightness + * level needs to be set to OFF. Since we can't use the PWM register to + * save the last brightness level we need a variable to save it. + */ + static uint8_t brightness_sav; // Save brightness info for restore on "M355 S1" + + if (on || !sflag) + brightness_sav = brightness; // Save brightness except for M355 S0 + if (sflag && on) + brightness = brightness_sav; // Restore last brightness for M355 S1 + const uint8_t i = on ? brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i; #endif @@ -73,7 +80,7 @@ void CaseLight::update(const bool sflag) { #else // !CASE_LIGHT_USE_NEOPIXEL - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS if (PWM_PIN(CASE_LIGHT_PIN)) analogWrite(pin_t(CASE_LIGHT_PIN), ( #if CASE_LIGHT_MAX_PWM == 255 diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index 9d1e76da26ba..2198c85f2a8e 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -27,9 +27,15 @@ #include "leds/leds.h" #endif +#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) || ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASELIGHT_USES_BRIGHTNESS 1 +#endif + class CaseLight { public: - static uint8_t brightness; + #if CASELIGHT_USES_BRIGHTNESS + static uint8_t brightness; + #endif static bool on; static void update(const bool sflag); diff --git a/Marlin/src/gcode/feature/caselight/M355.cpp b/Marlin/src/gcode/feature/caselight/M355.cpp index bb6b57f666e3..12ae5cff1ddc 100644 --- a/Marlin/src/gcode/feature/caselight/M355.cpp +++ b/Marlin/src/gcode/feature/caselight/M355.cpp @@ -41,10 +41,12 @@ */ void GcodeSuite::M355() { bool didset = false; - if (parser.seenval('P')) { - didset = true; - caselight.brightness = parser.value_byte(); - } + #if CASELIGHT_USES_BRIGHTNESS + if (parser.seenval('P')) { + didset = true; + caselight.brightness = parser.value_byte(); + } + #endif const bool sflag = parser.seenval('S'); if (sflag) { didset = true; @@ -58,8 +60,13 @@ void GcodeSuite::M355() { if (!caselight.on) SERIAL_ECHOLNPGM(STR_OFF); else { - if (!PWM_PIN(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM(STR_ON); - else SERIAL_ECHOLN(int(caselight.brightness)); + #if CASELIGHT_USES_BRIGHTNESS + if (PWM_PIN(CASE_LIGHT_PIN)) { + SERIAL_ECHOLN(int(caselight.brightness)); + return; + } + #endif + SERIAL_ECHOLNPGM(STR_ON); } } diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 53c5163bbaf6..529b1dd6d012 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -27,6 +27,10 @@ #include "../../module/motion.h" #endif +#if ENABLED(CASE_LIGHT_ENABLE) + #include "../../feature/caselight.h" +#endif + #if ENABLED(EXTENDED_CAPABILITIES_REPORT) static void cap_line(PGM_P const name, bool ena=false) { SERIAL_ECHOPGM("Cap:"); @@ -102,7 +106,7 @@ void GcodeSuite::M115() { // TOGGLE_LIGHTS (M355) cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE)); - cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, PWM_PIN(CASE_LIGHT_PIN))); + cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, TERN0(CASELIGHT_USES_BRIGHTNESS, TERN(CASE_LIGHT_USE_NEOPIXEL, true, PWM_PIN(CASE_LIGHT_PIN))))); // EMERGENCY_PARSER (M108, M112, M410, M876) cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER)); diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 8151828a0837..33b5d5458eda 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -610,7 +610,7 @@ namespace ExtUI { caselight.update_enabled(); } - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS float getCaseLightBrightness_percent() { return ui8_to_percent(caselight.brightness); } void setCaseLightBrightness_percent(const float value) { caselight.brightness = map(constrain(value, 0, 100), 0, 100, 0, 255); diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index 386a4d799aa2..d9540592d054 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -105,7 +105,7 @@ #if ENABLED(CASE_LIGHT_MENU) #include "../../feature/caselight.h" - #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS void menu_case_light() { START_MENU(); BACK_ITEM(MSG_CONFIGURATION); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 972d3758480a..d01486a80dac 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -137,9 +137,8 @@ void M710_report(const bool forReplay); #endif -#if ENABLED(CASE_LIGHT_ENABLE) && DISABLED(CASE_LIGHT_NO_BRIGHTNESS) +#if ENABLED(CASE_LIGHT_ENABLE) #include "../feature/caselight.h" - #define HAS_CASE_LIGHT_BRIGHTNESS 1 #endif #if ENABLED(PASSWORD_FEATURE) @@ -422,9 +421,9 @@ typedef struct SettingsDataStruct { #endif // - // HAS_CASE_LIGHT_BRIGHTNESS + // CASELIGHT_USES_BRIGHTNESS // - #if HAS_CASE_LIGHT_BRIGHTNESS + #if CASELIGHT_USES_BRIGHTNESS uint8_t caselight_brightness; // M355 P #endif @@ -503,7 +502,7 @@ void MarlinSettings::postprocess() { TERN_(HAS_LINEAR_E_JERK, planner.recalculate_max_e_jerk()); - TERN_(HAS_CASE_LIGHT_BRIGHTNESS, caselight.update_brightness()); + TERN_(CASELIGHT_USES_BRIGHTNESS, caselight.update_brightness()); // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm // and init stepper.count[], planner.position[] with current_position @@ -1385,7 +1384,7 @@ void MarlinSettings::postprocess() { // // Case Light Brightness // - #if HAS_CASE_LIGHT_BRIGHTNESS + #if CASELIGHT_USES_BRIGHTNESS EEPROM_WRITE(caselight.brightness); #endif @@ -2259,7 +2258,7 @@ void MarlinSettings::postprocess() { // // Case Light Brightness // - #if HAS_CASE_LIGHT_BRIGHTNESS + #if CASELIGHT_USES_BRIGHTNESS _FIELD_TEST(caselight_brightness); EEPROM_READ(caselight.brightness); #endif @@ -2597,7 +2596,7 @@ void MarlinSettings::reset() { // // Case Light Brightness // - TERN_(HAS_CASE_LIGHT_BRIGHTNESS, caselight.brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS); + TERN_(CASELIGHT_USES_BRIGHTNESS, caselight.brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS); // // TOUCH_SCREEN_CALIBRATION From 0967c87a8f3978d721625823d76fbc4dc32c069f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 23 Oct 2020 14:52:59 -0500 Subject: [PATCH 010/443] Pins post-process header (#19860) --- Marlin/src/HAL/ESP32/timers.h | 6 - Marlin/src/pins/pins.h | 853 +--------------------------- Marlin/src/pins/pins_postprocess.h | 877 +++++++++++++++++++++++++++++ 3 files changed, 881 insertions(+), 855 deletions(-) create mode 100644 Marlin/src/pins/pins_postprocess.h diff --git a/Marlin/src/HAL/ESP32/timers.h b/Marlin/src/HAL/ESP32/timers.h index d722670f33cf..7d35186b1cda 100644 --- a/Marlin/src/HAL/ESP32/timers.h +++ b/Marlin/src/HAL/ESP32/timers.h @@ -24,15 +24,9 @@ #include #include -// Includes needed to get I2S_STEPPER_STREAM. Note that pins.h -// is included in case this header is being included early. -#include "../../inc/MarlinConfig.h" -#include "../../pins/pins.h" - // ------------------------ // Defines // ------------------------ -// #define FORCE_INLINE __attribute__((always_inline)) inline typedef uint64_t hal_timer_t; diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 3a380def74f5..9ea35371a404 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -21,9 +21,9 @@ */ #pragma once -#include "../core/boards.h" - /** + * File: pins/pins.h + * * Include pins definitions * * Pins numbering schemes: @@ -783,852 +783,7 @@ #endif -// Define certain undefined pins -#ifndef X_MS1_PIN - #define X_MS1_PIN -1 -#endif -#ifndef X_MS2_PIN - #define X_MS2_PIN -1 -#endif -#ifndef X_MS3_PIN - #define X_MS3_PIN -1 -#endif -#ifndef Y_MS1_PIN - #define Y_MS1_PIN -1 -#endif -#ifndef Y_MS2_PIN - #define Y_MS2_PIN -1 -#endif -#ifndef Y_MS3_PIN - #define Y_MS3_PIN -1 -#endif -#ifndef Z_MS1_PIN - #define Z_MS1_PIN -1 -#endif -#ifndef Z_MS2_PIN - #define Z_MS2_PIN -1 -#endif -#ifndef Z_MS3_PIN - #define Z_MS3_PIN -1 -#endif -#ifndef E0_MS1_PIN - #define E0_MS1_PIN -1 -#endif -#ifndef E0_MS2_PIN - #define E0_MS2_PIN -1 -#endif -#ifndef E0_MS3_PIN - #define E0_MS3_PIN -1 -#endif -#ifndef E1_MS1_PIN - #define E1_MS1_PIN -1 -#endif -#ifndef E1_MS2_PIN - #define E1_MS2_PIN -1 -#endif -#ifndef E1_MS3_PIN - #define E1_MS3_PIN -1 -#endif -#ifndef E2_MS1_PIN - #define E2_MS1_PIN -1 -#endif -#ifndef E2_MS2_PIN - #define E2_MS2_PIN -1 -#endif -#ifndef E2_MS3_PIN - #define E2_MS3_PIN -1 -#endif -#ifndef E3_MS1_PIN - #define E3_MS1_PIN -1 -#endif -#ifndef E3_MS2_PIN - #define E3_MS2_PIN -1 -#endif -#ifndef E3_MS3_PIN - #define E3_MS3_PIN -1 -#endif -#ifndef E4_MS1_PIN - #define E4_MS1_PIN -1 -#endif -#ifndef E4_MS2_PIN - #define E4_MS2_PIN -1 -#endif -#ifndef E4_MS3_PIN - #define E4_MS3_PIN -1 -#endif -#ifndef E5_MS1_PIN - #define E5_MS1_PIN -1 -#endif -#ifndef E5_MS2_PIN - #define E5_MS2_PIN -1 -#endif -#ifndef E5_MS3_PIN - #define E5_MS3_PIN -1 -#endif -#ifndef E6_MS1_PIN - #define E6_MS1_PIN -1 -#endif -#ifndef E6_MS2_PIN - #define E6_MS2_PIN -1 -#endif -#ifndef E6_MS3_PIN - #define E6_MS3_PIN -1 -#endif -#ifndef E7_MS1_PIN - #define E7_MS1_PIN -1 -#endif -#ifndef E7_MS2_PIN - #define E7_MS2_PIN -1 -#endif -#ifndef E7_MS3_PIN - #define E7_MS3_PIN -1 -#endif - -#ifndef E0_STEP_PIN - #define E0_STEP_PIN -1 -#endif -#ifndef E0_DIR_PIN - #define E0_DIR_PIN -1 -#endif -#ifndef E0_ENABLE_PIN - #define E0_ENABLE_PIN -1 -#endif -#ifndef E1_STEP_PIN - #define E1_STEP_PIN -1 -#endif -#ifndef E1_DIR_PIN - #define E1_DIR_PIN -1 -#endif -#ifndef E1_ENABLE_PIN - #define E1_ENABLE_PIN -1 -#endif -#ifndef E2_STEP_PIN - #define E2_STEP_PIN -1 -#endif -#ifndef E2_DIR_PIN - #define E2_DIR_PIN -1 -#endif -#ifndef E2_ENABLE_PIN - #define E2_ENABLE_PIN -1 -#endif -#ifndef E3_STEP_PIN - #define E3_STEP_PIN -1 -#endif -#ifndef E3_DIR_PIN - #define E3_DIR_PIN -1 -#endif -#ifndef E3_ENABLE_PIN - #define E3_ENABLE_PIN -1 -#endif -#ifndef E4_STEP_PIN - #define E4_STEP_PIN -1 -#endif -#ifndef E4_DIR_PIN - #define E4_DIR_PIN -1 -#endif -#ifndef E4_ENABLE_PIN - #define E4_ENABLE_PIN -1 -#endif -#ifndef E5_STEP_PIN - #define E5_STEP_PIN -1 -#endif -#ifndef E5_DIR_PIN - #define E5_DIR_PIN -1 -#endif -#ifndef E5_ENABLE_PIN - #define E5_ENABLE_PIN -1 -#endif -#ifndef E6_STEP_PIN - #define E6_STEP_PIN -1 -#endif -#ifndef E6_DIR_PIN - #define E6_DIR_PIN -1 -#endif -#ifndef E6_ENABLE_PIN - #define E6_ENABLE_PIN -1 -#endif -#ifndef E7_STEP_PIN - #define E7_STEP_PIN -1 -#endif -#ifndef E7_DIR_PIN - #define E7_DIR_PIN -1 -#endif -#ifndef E7_ENABLE_PIN - #define E7_ENABLE_PIN -1 -#endif - // -// Destroy unused CS pins +// Post-process pins according to configured settings // -#if !AXIS_HAS_SPI(X) - #undef X_CS_PIN -#endif -#if !AXIS_HAS_SPI(Y) - #undef Y_CS_PIN -#endif -#if !AXIS_HAS_SPI(Z) - #undef Z_CS_PIN -#endif -#if E_STEPPERS && !AXIS_HAS_SPI(E0) - #undef E0_CS_PIN -#endif -#if E_STEPPERS > 1 && !AXIS_HAS_SPI(E1) - #undef E1_CS_PIN -#endif -#if E_STEPPERS > 2 && !AXIS_HAS_SPI(E2) - #undef E2_CS_PIN -#endif -#if E_STEPPERS > 3 && !AXIS_HAS_SPI(E3) - #undef E3_CS_PIN -#endif -#if E_STEPPERS > 4 && !AXIS_HAS_SPI(E4) - #undef E4_CS_PIN -#endif -#if E_STEPPERS > 5 && !AXIS_HAS_SPI(E5) - #undef E5_CS_PIN -#endif -#if E_STEPPERS > 6 && !AXIS_HAS_SPI(E6) - #undef E6_CS_PIN -#endif -#if E_STEPPERS > 7 && !AXIS_HAS_SPI(E7) - #undef E7_CS_PIN -#endif - -#ifndef X_CS_PIN - #define X_CS_PIN -1 -#endif -#ifndef Y_CS_PIN - #define Y_CS_PIN -1 -#endif -#ifndef Z_CS_PIN - #define Z_CS_PIN -1 -#endif -#ifndef E0_CS_PIN - #define E0_CS_PIN -1 -#endif -#ifndef E1_CS_PIN - #define E1_CS_PIN -1 -#endif -#ifndef E2_CS_PIN - #define E2_CS_PIN -1 -#endif -#ifndef E3_CS_PIN - #define E3_CS_PIN -1 -#endif -#ifndef E4_CS_PIN - #define E4_CS_PIN -1 -#endif -#ifndef E5_CS_PIN - #define E5_CS_PIN -1 -#endif -#ifndef E6_CS_PIN - #define E6_CS_PIN -1 -#endif -#ifndef E7_CS_PIN - #define E7_CS_PIN -1 -#endif - -#ifndef FAN_PIN - #define FAN_PIN -1 -#endif -#define FAN0_PIN FAN_PIN -#ifndef FAN1_PIN - #define FAN1_PIN -1 -#endif -#ifndef FAN2_PIN - #define FAN2_PIN -1 -#endif -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN -1 -#endif - -#ifndef FANMUX0_PIN - #define FANMUX0_PIN -1 -#endif -#ifndef FANMUX1_PIN - #define FANMUX1_PIN -1 -#endif -#ifndef FANMUX2_PIN - #define FANMUX2_PIN -1 -#endif - -#ifndef HEATER_0_PIN - #define HEATER_0_PIN -1 -#endif -#ifndef HEATER_1_PIN - #define HEATER_1_PIN -1 -#endif -#ifndef HEATER_2_PIN - #define HEATER_2_PIN -1 -#endif -#ifndef HEATER_3_PIN - #define HEATER_3_PIN -1 -#endif -#ifndef HEATER_4_PIN - #define HEATER_4_PIN -1 -#endif -#ifndef HEATER_5_PIN - #define HEATER_5_PIN -1 -#endif -#ifndef HEATER_6_PIN - #define HEATER_6_PIN -1 -#endif -#ifndef HEATER_7_PIN - #define HEATER_7_PIN -1 -#endif -#ifndef HEATER_BED_PIN - #define HEATER_BED_PIN -1 -#endif - -#ifndef TEMP_0_PIN - #define TEMP_0_PIN -1 -#endif -#ifndef TEMP_1_PIN - #define TEMP_1_PIN -1 -#endif -#ifndef TEMP_2_PIN - #define TEMP_2_PIN -1 -#endif -#ifndef TEMP_3_PIN - #define TEMP_3_PIN -1 -#endif -#ifndef TEMP_4_PIN - #define TEMP_4_PIN -1 -#endif -#ifndef TEMP_5_PIN - #define TEMP_5_PIN -1 -#endif -#ifndef TEMP_6_PIN - #define TEMP_6_PIN -1 -#endif -#ifndef TEMP_7_PIN - #define TEMP_7_PIN -1 -#endif -#ifndef TEMP_BED_PIN - #define TEMP_BED_PIN -1 -#endif - -#ifndef SD_DETECT_PIN - #define SD_DETECT_PIN -1 -#endif -#ifndef SDPOWER_PIN - #define SDPOWER_PIN -1 -#endif -#ifndef SDSS - #define SDSS -1 -#endif -#ifndef LED_PIN - #define LED_PIN -1 -#endif -#if DISABLED(PSU_CONTROL) || !defined(PS_ON_PIN) - #undef PS_ON_PIN - #define PS_ON_PIN -1 -#endif -#ifndef KILL_PIN - #define KILL_PIN -1 -#endif -#ifndef SUICIDE_PIN - #define SUICIDE_PIN -1 -#endif -#ifndef SUICIDE_PIN_INVERTING - #define SUICIDE_PIN_INVERTING false -#endif - -#ifndef NUM_SERVO_PLUGS - #define NUM_SERVO_PLUGS 4 -#endif - -// -// Assign endstop pins for boards with only 3 connectors -// -#ifdef X_STOP_PIN - #if X_HOME_DIR < 0 - #define X_MIN_PIN X_STOP_PIN - #ifndef X_MAX_PIN - #define X_MAX_PIN -1 - #endif - #else - #define X_MAX_PIN X_STOP_PIN - #ifndef X_MIN_PIN - #define X_MIN_PIN -1 - #endif - #endif -#elif X_HOME_DIR < 0 - #define X_STOP_PIN X_MIN_PIN -#else - #define X_STOP_PIN X_MAX_PIN -#endif - -#ifdef Y_STOP_PIN - #if Y_HOME_DIR < 0 - #define Y_MIN_PIN Y_STOP_PIN - #ifndef Y_MAX_PIN - #define Y_MAX_PIN -1 - #endif - #else - #define Y_MAX_PIN Y_STOP_PIN - #ifndef Y_MIN_PIN - #define Y_MIN_PIN -1 - #endif - #endif -#elif Y_HOME_DIR < 0 - #define Y_STOP_PIN Y_MIN_PIN -#else - #define Y_STOP_PIN Y_MAX_PIN -#endif - -#ifdef Z_STOP_PIN - #if Z_HOME_DIR < 0 - #define Z_MIN_PIN Z_STOP_PIN - #ifndef Z_MAX_PIN - #define Z_MAX_PIN -1 - #endif - #else - #define Z_MAX_PIN Z_STOP_PIN - #ifndef Z_MIN_PIN - #define Z_MIN_PIN -1 - #endif - #endif -#elif Z_HOME_DIR < 0 - #define Z_STOP_PIN Z_MIN_PIN -#else - #define Z_STOP_PIN Z_MAX_PIN -#endif - -// -// Disable unused endstop / probe pins -// -#if !HAS_CUSTOM_PROBE_PIN - #undef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN -1 -#endif - -#if DISABLED(USE_XMAX_PLUG) - #undef X_MAX_PIN - #define X_MAX_PIN -1 -#endif - -#if DISABLED(USE_YMAX_PLUG) - #undef Y_MAX_PIN - #define Y_MAX_PIN -1 -#endif - -#if DISABLED(USE_ZMAX_PLUG) - #undef Z_MAX_PIN - #define Z_MAX_PIN -1 -#endif - -#if DISABLED(USE_XMIN_PLUG) - #undef X_MIN_PIN - #define X_MIN_PIN -1 -#endif - -#if DISABLED(USE_YMIN_PLUG) - #undef Y_MIN_PIN - #define Y_MIN_PIN -1 -#endif - -#if DISABLED(USE_ZMIN_PLUG) - #undef Z_MIN_PIN - #define Z_MIN_PIN -1 -#endif - -#if HAS_FILAMENT_SENSOR - #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN -#else - #undef FIL_RUNOUT_PIN - #undef FIL_RUNOUT1_PIN -#endif - -#ifndef LCD_PINS_D4 - #define LCD_PINS_D4 -1 -#endif - -#if HAS_MARLINUI_HD44780 || TOUCH_UI_ULTIPANEL - #ifndef LCD_PINS_D5 - #define LCD_PINS_D5 -1 - #endif - #ifndef LCD_PINS_D6 - #define LCD_PINS_D6 -1 - #endif - #ifndef LCD_PINS_D7 - #define LCD_PINS_D7 -1 - #endif -#endif - -/** - * Auto-Assignment for Dual X, Dual Y, Multi-Z Steppers - * - * By default X2 is assigned to the next open E plug - * on the board, then in order, Y2, Z2, Z3. These can be - * overridden in Configuration.h or Configuration_adv.h. - */ - -#define __PEXI(p,q) PIN_EXISTS(E##p##_##q) -#define _PEXI(p,q) __PEXI(p,q) -#define __EPIN(p,q) E##p##_##q##_PIN -#define _EPIN(p,q) __EPIN(p,q) -#define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN) - -// The X2 axis, if any, should be the next open extruder port -#define X2_E_INDEX E_STEPPERS - -#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) - #ifndef X2_STEP_PIN - #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) - #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR) - #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE) - #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) - #error "No E stepper plug left for X2!" - #endif - #endif - #ifndef X2_MS1_PIN - #define X2_MS1_PIN _EPIN(X2_E_INDEX, MS1) - #endif - #ifndef X2_MS2_PIN - #define X2_MS2_PIN _EPIN(X2_E_INDEX, MS2) - #endif - #ifndef X2_MS3_PIN - #define X2_MS3_PIN _EPIN(X2_E_INDEX, MS3) - #endif - #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN) - #define X2_CS_PIN _EPIN(X2_E_INDEX, CS) - #endif - #if AXIS_HAS_UART(X2) - #ifndef X2_SERIAL_TX_PIN - #define X2_SERIAL_TX_PIN _EPIN(X2_E_INDEX, SERIAL_TX) - #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN _EPIN(X2_E_INDEX, SERIAL_RX) - #endif - #endif - - // - // Auto-assign pins for stallGuard sensorless homing - // - #if defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG) - #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG) - #if DIAG_REMAPPED(X2, X_MIN) // If already remapped in the pins file... - #define X2_USE_ENDSTOP _XMIN_ - #elif DIAG_REMAPPED(X2, Y_MIN) - #define X2_USE_ENDSTOP _YMIN_ - #elif DIAG_REMAPPED(X2, Z_MIN) - #define X2_USE_ENDSTOP _ZMIN_ - #elif DIAG_REMAPPED(X2, X_MAX) - #define X2_USE_ENDSTOP _XMAX_ - #elif DIAG_REMAPPED(X2, Y_MAX) - #define X2_USE_ENDSTOP _YMAX_ - #elif DIAG_REMAPPED(X2, Z_MAX) - #define X2_USE_ENDSTOP _ZMAX_ - #else // Otherwise use the driver DIAG_PIN directly - #define _X2_USE_ENDSTOP(P) _E##P##_DIAG_ - #define X2_USE_ENDSTOP _X2_USE_ENDSTOP(X2_E_INDEX) - #endif - #undef X2_DIAG_PIN - #endif - - #define Y2_E_INDEX INCREMENT(X2_E_INDEX) -#else - #define Y2_E_INDEX X2_E_INDEX -#endif - -#ifndef X2_CS_PIN - #define X2_CS_PIN -1 -#endif -#ifndef X2_MS1_PIN - #define X2_MS1_PIN -1 -#endif -#ifndef X2_MS2_PIN - #define X2_MS2_PIN -1 -#endif -#ifndef X2_MS3_PIN - #define X2_MS3_PIN -1 -#endif - -// The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #ifndef Y2_STEP_PIN - #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) - #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) - #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) - #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP) - #error "No E stepper plug left for Y2!" - #endif - #endif - #ifndef Y2_MS1_PIN - #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1) - #endif - #ifndef Y2_MS2_PIN - #define Y2_MS2_PIN _EPIN(Y2_E_INDEX, MS2) - #endif - #ifndef Y2_MS3_PIN - #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3) - #endif - #if AXIS_HAS_SPI(Y2) && !defined(Y2_CS_PIN) - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif - #if AXIS_HAS_UART(Y2) - #ifndef Y2_SERIAL_TX_PIN - #define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX) - #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) - #endif - #endif - #if defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG) - #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG) - #if DIAG_REMAPPED(Y2, X_MIN) - #define Y2_USE_ENDSTOP _XMIN_ - #elif DIAG_REMAPPED(Y2, Y_MIN) - #define Y2_USE_ENDSTOP _YMIN_ - #elif DIAG_REMAPPED(Y2, Z_MIN) - #define Y2_USE_ENDSTOP _ZMIN_ - #elif DIAG_REMAPPED(Y2, X_MAX) - #define Y2_USE_ENDSTOP _XMAX_ - #elif DIAG_REMAPPED(Y2, Y_MAX) - #define Y2_USE_ENDSTOP _YMAX_ - #elif DIAG_REMAPPED(Y2, Z_MAX) - #define Y2_USE_ENDSTOP _ZMAX_ - #else - #define _Y2_USE_ENDSTOP(P) _E##P##_DIAG_ - #define Y2_USE_ENDSTOP _Y2_USE_ENDSTOP(Y2_E_INDEX) - #endif - #undef Y2_DIAG_PIN - #endif - #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) -#else - #define Z2_E_INDEX Y2_E_INDEX -#endif - -#ifndef Y2_CS_PIN - #define Y2_CS_PIN -1 -#endif -#ifndef Y2_MS1_PIN - #define Y2_MS1_PIN -1 -#endif -#ifndef Y2_MS2_PIN - #define Y2_MS2_PIN -1 -#endif -#ifndef Y2_MS3_PIN - #define Y2_MS3_PIN -1 -#endif - -// The Z2 axis, if any, should be the next open extruder port -#if NUM_Z_STEPPER_DRIVERS >= 2 - #ifndef Z2_STEP_PIN - #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) - #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) - #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) - #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP) - #error "No E stepper plug left for Z2!" - #endif - #endif - #ifndef Z2_MS1_PIN - #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1) - #endif - #ifndef Z2_MS2_PIN - #define Z2_MS2_PIN _EPIN(Z2_E_INDEX, MS2) - #endif - #ifndef Z2_MS3_PIN - #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3) - #endif - #if AXIS_HAS_SPI(Z2) && !defined(Z2_CS_PIN) - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif - #if AXIS_HAS_UART(Z2) - #ifndef Z2_SERIAL_TX_PIN - #define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX) - #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) - #endif - #endif - #if defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG) - #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG) - #if DIAG_REMAPPED(Z2, X_MIN) - #define Z2_USE_ENDSTOP _XMIN_ - #elif DIAG_REMAPPED(Z2, Y_MIN) - #define Z2_USE_ENDSTOP _YMIN_ - #elif DIAG_REMAPPED(Z2, Z_MIN) - #define Z2_USE_ENDSTOP _ZMIN_ - #elif DIAG_REMAPPED(Z2, X_MAX) - #define Z2_USE_ENDSTOP _XMAX_ - #elif DIAG_REMAPPED(Z2, Y_MAX) - #define Z2_USE_ENDSTOP _YMAX_ - #elif DIAG_REMAPPED(Z2, Z_MAX) - #define Z2_USE_ENDSTOP _ZMAX_ - #else - #define _Z2_USE_ENDSTOP(P) _E##P##_DIAG_ - #define Z2_USE_ENDSTOP _Z2_USE_ENDSTOP(Z2_E_INDEX) - #endif - #undef Z2_DIAG_PIN - #endif - #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) -#else - #define Z3_E_INDEX Z2_E_INDEX -#endif - -#ifndef Z2_CS_PIN - #define Z2_CS_PIN -1 -#endif -#ifndef Z2_MS1_PIN - #define Z2_MS1_PIN -1 -#endif -#ifndef Z2_MS2_PIN - #define Z2_MS2_PIN -1 -#endif -#ifndef Z2_MS3_PIN - #define Z2_MS3_PIN -1 -#endif - -#if NUM_Z_STEPPER_DRIVERS >= 3 - #ifndef Z3_STEP_PIN - #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) - #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) - #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) - #if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP) - #error "No E stepper plug left for Z3!" - #endif - #endif - #if AXIS_HAS_SPI(Z3) - #ifndef Z3_CS_PIN - #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) - #endif - #endif - #ifndef Z3_MS1_PIN - #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1) - #endif - #ifndef Z3_MS2_PIN - #define Z3_MS2_PIN _EPIN(Z3_E_INDEX, MS2) - #endif - #ifndef Z3_MS3_PIN - #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3) - #endif - #if AXIS_HAS_UART(Z3) - #ifndef Z3_SERIAL_TX_PIN - #define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX) - #endif - #ifndef Z3_SERIAL_RX_PIN - #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) - #endif - #endif - #if defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG) - #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG) - #if DIAG_REMAPPED(Z3, X_MIN) - #define Z3_USE_ENDSTOP _XMIN_ - #elif DIAG_REMAPPED(Z3, Y_MIN) - #define Z3_USE_ENDSTOP _YMIN_ - #elif DIAG_REMAPPED(Z3, Z_MIN) - #define Z3_USE_ENDSTOP _ZMIN_ - #elif DIAG_REMAPPED(Z3, X_MAX) - #define Z3_USE_ENDSTOP _XMAX_ - #elif DIAG_REMAPPED(Z3, Y_MAX) - #define Z3_USE_ENDSTOP _YMAX_ - #elif DIAG_REMAPPED(Z3, Z_MAX) - #define Z3_USE_ENDSTOP _ZMAX_ - #else - #define _Z3_USE_ENDSTOP(P) _E##P##_DIAG_ - #define Z3_USE_ENDSTOP _Z3_USE_ENDSTOP(Z3_E_INDEX) - #endif - #undef Z3_DIAG_PIN - #endif - #define Z4_E_INDEX INCREMENT(Z3_E_INDEX) -#endif - -#ifndef Z3_CS_PIN - #define Z3_CS_PIN -1 -#endif -#ifndef Z3_MS1_PIN - #define Z3_MS1_PIN -1 -#endif -#ifndef Z3_MS2_PIN - #define Z3_MS2_PIN -1 -#endif -#ifndef Z3_MS3_PIN - #define Z3_MS3_PIN -1 -#endif - -#if NUM_Z_STEPPER_DRIVERS >= 4 - #ifndef Z4_STEP_PIN - #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) - #define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR) - #define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE) - #if Z4_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z4_STEP) - #error "No E stepper plug left for Z4!" - #endif - #endif - #if AXIS_HAS_SPI(Z4) - #ifndef Z4_CS_PIN - #define Z4_CS_PIN _EPIN(Z4_E_INDEX, CS) - #endif - #endif - #ifndef Z4_MS1_PIN - #define Z4_MS1_PIN _EPIN(Z4_E_INDEX, MS1) - #endif - #ifndef Z4_MS2_PIN - #define Z4_MS2_PIN _EPIN(Z4_E_INDEX, MS2) - #endif - #ifndef Z4_MS3_PIN - #define Z4_MS3_PIN _EPIN(Z4_E_INDEX, MS3) - #endif - #if AXIS_HAS_UART(Z4) - #ifndef Z4_SERIAL_TX_PIN - #define Z4_SERIAL_TX_PIN _EPIN(Z4_E_INDEX, SERIAL_TX) - #endif - #ifndef Z4_SERIAL_RX_PIN - #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX) - #endif - #endif - #if defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG) - #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG) - #if DIAG_REMAPPED(Z4, X_MIN) - #define Z4_USE_ENDSTOP _XMIN_ - #elif DIAG_REMAPPED(Z4, Y_MIN) - #define Z4_USE_ENDSTOP _YMIN_ - #elif DIAG_REMAPPED(Z4, Z_MIN) - #define Z4_USE_ENDSTOP _ZMIN_ - #elif DIAG_REMAPPED(Z4, X_MAX) - #define Z4_USE_ENDSTOP _XMAX_ - #elif DIAG_REMAPPED(Z4, Y_MAX) - #define Z4_USE_ENDSTOP _YMAX_ - #elif DIAG_REMAPPED(Z4, Z_MAX) - #define Z4_USE_ENDSTOP _ZMAX_ - #else - #define _Z4_USE_ENDSTOP(P) _E##P##_DIAG_ - #define Z4_USE_ENDSTOP _Z4_USE_ENDSTOP(Z4_E_INDEX) - #endif - #undef Z4_DIAG_PIN - #endif -#endif - -#ifndef Z4_CS_PIN - #define Z4_CS_PIN -1 -#endif -#ifndef Z4_MS1_PIN - #define Z4_MS1_PIN -1 -#endif -#ifndef Z4_MS2_PIN - #define Z4_MS2_PIN -1 -#endif -#ifndef Z4_MS3_PIN - #define Z4_MS3_PIN -1 -#endif - -#if HAS_MARLINUI_U8GLIB - #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1) - #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 - #endif - #if !defined(ST7920_DELAY_2) && defined(BOARD_ST7920_DELAY_2) - #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 - #endif - #if !defined(ST7920_DELAY_3) && defined(BOARD_ST7920_DELAY_3) - #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 - #endif -#else - #undef ST7920_DELAY_1 - #undef ST7920_DELAY_2 - #undef ST7920_DELAY_3 -#endif - -#undef HAS_FREE_AUX2_PINS -#undef DIAG_REMAPPED +#include "pins_postprocess.h" diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h new file mode 100644 index 000000000000..fdf9f095cbcc --- /dev/null +++ b/Marlin/src/pins/pins_postprocess.h @@ -0,0 +1,877 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// File: pins/pins_postprocess.h +// Post-process pins according to configured settings +// + +// Define certain undefined pins +#ifndef X_MS1_PIN + #define X_MS1_PIN -1 +#endif +#ifndef X_MS2_PIN + #define X_MS2_PIN -1 +#endif +#ifndef X_MS3_PIN + #define X_MS3_PIN -1 +#endif +#ifndef Y_MS1_PIN + #define Y_MS1_PIN -1 +#endif +#ifndef Y_MS2_PIN + #define Y_MS2_PIN -1 +#endif +#ifndef Y_MS3_PIN + #define Y_MS3_PIN -1 +#endif +#ifndef Z_MS1_PIN + #define Z_MS1_PIN -1 +#endif +#ifndef Z_MS2_PIN + #define Z_MS2_PIN -1 +#endif +#ifndef Z_MS3_PIN + #define Z_MS3_PIN -1 +#endif +#ifndef E0_MS1_PIN + #define E0_MS1_PIN -1 +#endif +#ifndef E0_MS2_PIN + #define E0_MS2_PIN -1 +#endif +#ifndef E0_MS3_PIN + #define E0_MS3_PIN -1 +#endif +#ifndef E1_MS1_PIN + #define E1_MS1_PIN -1 +#endif +#ifndef E1_MS2_PIN + #define E1_MS2_PIN -1 +#endif +#ifndef E1_MS3_PIN + #define E1_MS3_PIN -1 +#endif +#ifndef E2_MS1_PIN + #define E2_MS1_PIN -1 +#endif +#ifndef E2_MS2_PIN + #define E2_MS2_PIN -1 +#endif +#ifndef E2_MS3_PIN + #define E2_MS3_PIN -1 +#endif +#ifndef E3_MS1_PIN + #define E3_MS1_PIN -1 +#endif +#ifndef E3_MS2_PIN + #define E3_MS2_PIN -1 +#endif +#ifndef E3_MS3_PIN + #define E3_MS3_PIN -1 +#endif +#ifndef E4_MS1_PIN + #define E4_MS1_PIN -1 +#endif +#ifndef E4_MS2_PIN + #define E4_MS2_PIN -1 +#endif +#ifndef E4_MS3_PIN + #define E4_MS3_PIN -1 +#endif +#ifndef E5_MS1_PIN + #define E5_MS1_PIN -1 +#endif +#ifndef E5_MS2_PIN + #define E5_MS2_PIN -1 +#endif +#ifndef E5_MS3_PIN + #define E5_MS3_PIN -1 +#endif +#ifndef E6_MS1_PIN + #define E6_MS1_PIN -1 +#endif +#ifndef E6_MS2_PIN + #define E6_MS2_PIN -1 +#endif +#ifndef E6_MS3_PIN + #define E6_MS3_PIN -1 +#endif +#ifndef E7_MS1_PIN + #define E7_MS1_PIN -1 +#endif +#ifndef E7_MS2_PIN + #define E7_MS2_PIN -1 +#endif +#ifndef E7_MS3_PIN + #define E7_MS3_PIN -1 +#endif + +#ifndef E0_STEP_PIN + #define E0_STEP_PIN -1 +#endif +#ifndef E0_DIR_PIN + #define E0_DIR_PIN -1 +#endif +#ifndef E0_ENABLE_PIN + #define E0_ENABLE_PIN -1 +#endif +#ifndef E1_STEP_PIN + #define E1_STEP_PIN -1 +#endif +#ifndef E1_DIR_PIN + #define E1_DIR_PIN -1 +#endif +#ifndef E1_ENABLE_PIN + #define E1_ENABLE_PIN -1 +#endif +#ifndef E2_STEP_PIN + #define E2_STEP_PIN -1 +#endif +#ifndef E2_DIR_PIN + #define E2_DIR_PIN -1 +#endif +#ifndef E2_ENABLE_PIN + #define E2_ENABLE_PIN -1 +#endif +#ifndef E3_STEP_PIN + #define E3_STEP_PIN -1 +#endif +#ifndef E3_DIR_PIN + #define E3_DIR_PIN -1 +#endif +#ifndef E3_ENABLE_PIN + #define E3_ENABLE_PIN -1 +#endif +#ifndef E4_STEP_PIN + #define E4_STEP_PIN -1 +#endif +#ifndef E4_DIR_PIN + #define E4_DIR_PIN -1 +#endif +#ifndef E4_ENABLE_PIN + #define E4_ENABLE_PIN -1 +#endif +#ifndef E5_STEP_PIN + #define E5_STEP_PIN -1 +#endif +#ifndef E5_DIR_PIN + #define E5_DIR_PIN -1 +#endif +#ifndef E5_ENABLE_PIN + #define E5_ENABLE_PIN -1 +#endif +#ifndef E6_STEP_PIN + #define E6_STEP_PIN -1 +#endif +#ifndef E6_DIR_PIN + #define E6_DIR_PIN -1 +#endif +#ifndef E6_ENABLE_PIN + #define E6_ENABLE_PIN -1 +#endif +#ifndef E7_STEP_PIN + #define E7_STEP_PIN -1 +#endif +#ifndef E7_DIR_PIN + #define E7_DIR_PIN -1 +#endif +#ifndef E7_ENABLE_PIN + #define E7_ENABLE_PIN -1 +#endif + +// +// Destroy unused CS pins +// +#if !AXIS_HAS_SPI(X) + #undef X_CS_PIN +#endif +#if !AXIS_HAS_SPI(Y) + #undef Y_CS_PIN +#endif +#if !AXIS_HAS_SPI(Z) + #undef Z_CS_PIN +#endif +#if E_STEPPERS && !AXIS_HAS_SPI(E0) + #undef E0_CS_PIN +#endif +#if E_STEPPERS > 1 && !AXIS_HAS_SPI(E1) + #undef E1_CS_PIN +#endif +#if E_STEPPERS > 2 && !AXIS_HAS_SPI(E2) + #undef E2_CS_PIN +#endif +#if E_STEPPERS > 3 && !AXIS_HAS_SPI(E3) + #undef E3_CS_PIN +#endif +#if E_STEPPERS > 4 && !AXIS_HAS_SPI(E4) + #undef E4_CS_PIN +#endif +#if E_STEPPERS > 5 && !AXIS_HAS_SPI(E5) + #undef E5_CS_PIN +#endif +#if E_STEPPERS > 6 && !AXIS_HAS_SPI(E6) + #undef E6_CS_PIN +#endif +#if E_STEPPERS > 7 && !AXIS_HAS_SPI(E7) + #undef E7_CS_PIN +#endif + +#ifndef X_CS_PIN + #define X_CS_PIN -1 +#endif +#ifndef Y_CS_PIN + #define Y_CS_PIN -1 +#endif +#ifndef Z_CS_PIN + #define Z_CS_PIN -1 +#endif +#ifndef E0_CS_PIN + #define E0_CS_PIN -1 +#endif +#ifndef E1_CS_PIN + #define E1_CS_PIN -1 +#endif +#ifndef E2_CS_PIN + #define E2_CS_PIN -1 +#endif +#ifndef E3_CS_PIN + #define E3_CS_PIN -1 +#endif +#ifndef E4_CS_PIN + #define E4_CS_PIN -1 +#endif +#ifndef E5_CS_PIN + #define E5_CS_PIN -1 +#endif +#ifndef E6_CS_PIN + #define E6_CS_PIN -1 +#endif +#ifndef E7_CS_PIN + #define E7_CS_PIN -1 +#endif + +#ifndef FAN_PIN + #define FAN_PIN -1 +#endif +#define FAN0_PIN FAN_PIN +#ifndef FAN1_PIN + #define FAN1_PIN -1 +#endif +#ifndef FAN2_PIN + #define FAN2_PIN -1 +#endif +#ifndef CONTROLLER_FAN_PIN + #define CONTROLLER_FAN_PIN -1 +#endif + +#ifndef FANMUX0_PIN + #define FANMUX0_PIN -1 +#endif +#ifndef FANMUX1_PIN + #define FANMUX1_PIN -1 +#endif +#ifndef FANMUX2_PIN + #define FANMUX2_PIN -1 +#endif + +#ifndef HEATER_0_PIN + #define HEATER_0_PIN -1 +#endif +#ifndef HEATER_1_PIN + #define HEATER_1_PIN -1 +#endif +#ifndef HEATER_2_PIN + #define HEATER_2_PIN -1 +#endif +#ifndef HEATER_3_PIN + #define HEATER_3_PIN -1 +#endif +#ifndef HEATER_4_PIN + #define HEATER_4_PIN -1 +#endif +#ifndef HEATER_5_PIN + #define HEATER_5_PIN -1 +#endif +#ifndef HEATER_6_PIN + #define HEATER_6_PIN -1 +#endif +#ifndef HEATER_7_PIN + #define HEATER_7_PIN -1 +#endif +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN -1 +#endif + +#ifndef TEMP_0_PIN + #define TEMP_0_PIN -1 +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN -1 +#endif +#ifndef TEMP_2_PIN + #define TEMP_2_PIN -1 +#endif +#ifndef TEMP_3_PIN + #define TEMP_3_PIN -1 +#endif +#ifndef TEMP_4_PIN + #define TEMP_4_PIN -1 +#endif +#ifndef TEMP_5_PIN + #define TEMP_5_PIN -1 +#endif +#ifndef TEMP_6_PIN + #define TEMP_6_PIN -1 +#endif +#ifndef TEMP_7_PIN + #define TEMP_7_PIN -1 +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN -1 +#endif + +#ifndef SD_DETECT_PIN + #define SD_DETECT_PIN -1 +#endif +#ifndef SDPOWER_PIN + #define SDPOWER_PIN -1 +#endif +#ifndef SDSS + #define SDSS -1 +#endif +#ifndef LED_PIN + #define LED_PIN -1 +#endif +#if DISABLED(PSU_CONTROL) || !defined(PS_ON_PIN) + #undef PS_ON_PIN + #define PS_ON_PIN -1 +#endif +#ifndef KILL_PIN + #define KILL_PIN -1 +#endif +#ifndef SUICIDE_PIN + #define SUICIDE_PIN -1 +#endif +#ifndef SUICIDE_PIN_INVERTING + #define SUICIDE_PIN_INVERTING false +#endif + +#ifndef NUM_SERVO_PLUGS + #define NUM_SERVO_PLUGS 4 +#endif + +// +// Assign endstop pins for boards with only 3 connectors +// +#ifdef X_STOP_PIN + #if X_HOME_DIR < 0 + #define X_MIN_PIN X_STOP_PIN + #ifndef X_MAX_PIN + #define X_MAX_PIN -1 + #endif + #else + #define X_MAX_PIN X_STOP_PIN + #ifndef X_MIN_PIN + #define X_MIN_PIN -1 + #endif + #endif +#elif X_HOME_DIR < 0 + #define X_STOP_PIN X_MIN_PIN +#else + #define X_STOP_PIN X_MAX_PIN +#endif + +#ifdef Y_STOP_PIN + #if Y_HOME_DIR < 0 + #define Y_MIN_PIN Y_STOP_PIN + #ifndef Y_MAX_PIN + #define Y_MAX_PIN -1 + #endif + #else + #define Y_MAX_PIN Y_STOP_PIN + #ifndef Y_MIN_PIN + #define Y_MIN_PIN -1 + #endif + #endif +#elif Y_HOME_DIR < 0 + #define Y_STOP_PIN Y_MIN_PIN +#else + #define Y_STOP_PIN Y_MAX_PIN +#endif + +#ifdef Z_STOP_PIN + #if Z_HOME_DIR < 0 + #define Z_MIN_PIN Z_STOP_PIN + #ifndef Z_MAX_PIN + #define Z_MAX_PIN -1 + #endif + #else + #define Z_MAX_PIN Z_STOP_PIN + #ifndef Z_MIN_PIN + #define Z_MIN_PIN -1 + #endif + #endif +#elif Z_HOME_DIR < 0 + #define Z_STOP_PIN Z_MIN_PIN +#else + #define Z_STOP_PIN Z_MAX_PIN +#endif + +// +// Disable unused endstop / probe pins +// +#if !HAS_CUSTOM_PROBE_PIN + #undef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN -1 +#endif + +#if DISABLED(USE_XMAX_PLUG) + #undef X_MAX_PIN + #define X_MAX_PIN -1 +#endif + +#if DISABLED(USE_YMAX_PLUG) + #undef Y_MAX_PIN + #define Y_MAX_PIN -1 +#endif + +#if DISABLED(USE_ZMAX_PLUG) + #undef Z_MAX_PIN + #define Z_MAX_PIN -1 +#endif + +#if DISABLED(USE_XMIN_PLUG) + #undef X_MIN_PIN + #define X_MIN_PIN -1 +#endif + +#if DISABLED(USE_YMIN_PLUG) + #undef Y_MIN_PIN + #define Y_MIN_PIN -1 +#endif + +#if DISABLED(USE_ZMIN_PLUG) + #undef Z_MIN_PIN + #define Z_MIN_PIN -1 +#endif + +#if HAS_FILAMENT_SENSOR + #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN +#else + #undef FIL_RUNOUT_PIN + #undef FIL_RUNOUT1_PIN +#endif + +#ifndef LCD_PINS_D4 + #define LCD_PINS_D4 -1 +#endif + +#if HAS_MARLINUI_HD44780 || TOUCH_UI_ULTIPANEL + #ifndef LCD_PINS_D5 + #define LCD_PINS_D5 -1 + #endif + #ifndef LCD_PINS_D6 + #define LCD_PINS_D6 -1 + #endif + #ifndef LCD_PINS_D7 + #define LCD_PINS_D7 -1 + #endif +#endif + +/** + * Auto-Assignment for Dual X, Dual Y, Multi-Z Steppers + * + * By default X2 is assigned to the next open E plug + * on the board, then in order, Y2, Z2, Z3. These can be + * overridden in Configuration.h or Configuration_adv.h. + */ + +#define __PEXI(p,q) PIN_EXISTS(E##p##_##q) +#define _PEXI(p,q) __PEXI(p,q) +#define __EPIN(p,q) E##p##_##q##_PIN +#define _EPIN(p,q) __EPIN(p,q) +#define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN) + +// The X2 axis, if any, should be the next open extruder port +#define X2_E_INDEX E_STEPPERS + +#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) + #ifndef X2_STEP_PIN + #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) + #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR) + #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE) + #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) + #error "No E stepper plug left for X2!" + #endif + #endif + #ifndef X2_MS1_PIN + #define X2_MS1_PIN _EPIN(X2_E_INDEX, MS1) + #endif + #ifndef X2_MS2_PIN + #define X2_MS2_PIN _EPIN(X2_E_INDEX, MS2) + #endif + #ifndef X2_MS3_PIN + #define X2_MS3_PIN _EPIN(X2_E_INDEX, MS3) + #endif + #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN) + #define X2_CS_PIN _EPIN(X2_E_INDEX, CS) + #endif + #if AXIS_HAS_UART(X2) + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN _EPIN(X2_E_INDEX, SERIAL_TX) + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN _EPIN(X2_E_INDEX, SERIAL_RX) + #endif + #endif + + // + // Auto-assign pins for stallGuard sensorless homing + // + #if defined(X2_STALL_SENSITIVITY) && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG) + #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG) + #if DIAG_REMAPPED(X2, X_MIN) // If already remapped in the pins file... + #define X2_USE_ENDSTOP _XMIN_ + #elif DIAG_REMAPPED(X2, Y_MIN) + #define X2_USE_ENDSTOP _YMIN_ + #elif DIAG_REMAPPED(X2, Z_MIN) + #define X2_USE_ENDSTOP _ZMIN_ + #elif DIAG_REMAPPED(X2, X_MAX) + #define X2_USE_ENDSTOP _XMAX_ + #elif DIAG_REMAPPED(X2, Y_MAX) + #define X2_USE_ENDSTOP _YMAX_ + #elif DIAG_REMAPPED(X2, Z_MAX) + #define X2_USE_ENDSTOP _ZMAX_ + #else // Otherwise use the driver DIAG_PIN directly + #define _X2_USE_ENDSTOP(P) _E##P##_DIAG_ + #define X2_USE_ENDSTOP _X2_USE_ENDSTOP(X2_E_INDEX) + #endif + #undef X2_DIAG_PIN + #endif + + #define Y2_E_INDEX INCREMENT(X2_E_INDEX) +#else + #define Y2_E_INDEX X2_E_INDEX +#endif + +#ifndef X2_CS_PIN + #define X2_CS_PIN -1 +#endif +#ifndef X2_MS1_PIN + #define X2_MS1_PIN -1 +#endif +#ifndef X2_MS2_PIN + #define X2_MS2_PIN -1 +#endif +#ifndef X2_MS3_PIN + #define X2_MS3_PIN -1 +#endif + +// The Y2 axis, if any, should be the next open extruder port +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #ifndef Y2_STEP_PIN + #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) + #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) + #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) + #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP) + #error "No E stepper plug left for Y2!" + #endif + #endif + #ifndef Y2_MS1_PIN + #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1) + #endif + #ifndef Y2_MS2_PIN + #define Y2_MS2_PIN _EPIN(Y2_E_INDEX, MS2) + #endif + #ifndef Y2_MS3_PIN + #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3) + #endif + #if AXIS_HAS_SPI(Y2) && !defined(Y2_CS_PIN) + #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) + #endif + #if AXIS_HAS_UART(Y2) + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX) + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) + #endif + #endif + #if defined(Y2_STALL_SENSITIVITY) && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG) + #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG) + #if DIAG_REMAPPED(Y2, X_MIN) + #define Y2_USE_ENDSTOP _XMIN_ + #elif DIAG_REMAPPED(Y2, Y_MIN) + #define Y2_USE_ENDSTOP _YMIN_ + #elif DIAG_REMAPPED(Y2, Z_MIN) + #define Y2_USE_ENDSTOP _ZMIN_ + #elif DIAG_REMAPPED(Y2, X_MAX) + #define Y2_USE_ENDSTOP _XMAX_ + #elif DIAG_REMAPPED(Y2, Y_MAX) + #define Y2_USE_ENDSTOP _YMAX_ + #elif DIAG_REMAPPED(Y2, Z_MAX) + #define Y2_USE_ENDSTOP _ZMAX_ + #else + #define _Y2_USE_ENDSTOP(P) _E##P##_DIAG_ + #define Y2_USE_ENDSTOP _Y2_USE_ENDSTOP(Y2_E_INDEX) + #endif + #undef Y2_DIAG_PIN + #endif + #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) +#else + #define Z2_E_INDEX Y2_E_INDEX +#endif + +#ifndef Y2_CS_PIN + #define Y2_CS_PIN -1 +#endif +#ifndef Y2_MS1_PIN + #define Y2_MS1_PIN -1 +#endif +#ifndef Y2_MS2_PIN + #define Y2_MS2_PIN -1 +#endif +#ifndef Y2_MS3_PIN + #define Y2_MS3_PIN -1 +#endif + +// The Z2 axis, if any, should be the next open extruder port +#if NUM_Z_STEPPER_DRIVERS >= 2 + #ifndef Z2_STEP_PIN + #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) + #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) + #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) + #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP) + #error "No E stepper plug left for Z2!" + #endif + #endif + #ifndef Z2_MS1_PIN + #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1) + #endif + #ifndef Z2_MS2_PIN + #define Z2_MS2_PIN _EPIN(Z2_E_INDEX, MS2) + #endif + #ifndef Z2_MS3_PIN + #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3) + #endif + #if AXIS_HAS_SPI(Z2) && !defined(Z2_CS_PIN) + #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) + #endif + #if AXIS_HAS_UART(Z2) + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX) + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) + #endif + #endif + #if defined(Z2_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG) + #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG) + #if DIAG_REMAPPED(Z2, X_MIN) + #define Z2_USE_ENDSTOP _XMIN_ + #elif DIAG_REMAPPED(Z2, Y_MIN) + #define Z2_USE_ENDSTOP _YMIN_ + #elif DIAG_REMAPPED(Z2, Z_MIN) + #define Z2_USE_ENDSTOP _ZMIN_ + #elif DIAG_REMAPPED(Z2, X_MAX) + #define Z2_USE_ENDSTOP _XMAX_ + #elif DIAG_REMAPPED(Z2, Y_MAX) + #define Z2_USE_ENDSTOP _YMAX_ + #elif DIAG_REMAPPED(Z2, Z_MAX) + #define Z2_USE_ENDSTOP _ZMAX_ + #else + #define _Z2_USE_ENDSTOP(P) _E##P##_DIAG_ + #define Z2_USE_ENDSTOP _Z2_USE_ENDSTOP(Z2_E_INDEX) + #endif + #undef Z2_DIAG_PIN + #endif + #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) +#else + #define Z3_E_INDEX Z2_E_INDEX +#endif + +#ifndef Z2_CS_PIN + #define Z2_CS_PIN -1 +#endif +#ifndef Z2_MS1_PIN + #define Z2_MS1_PIN -1 +#endif +#ifndef Z2_MS2_PIN + #define Z2_MS2_PIN -1 +#endif +#ifndef Z2_MS3_PIN + #define Z2_MS3_PIN -1 +#endif + +#if NUM_Z_STEPPER_DRIVERS >= 3 + #ifndef Z3_STEP_PIN + #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) + #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) + #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) + #if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP) + #error "No E stepper plug left for Z3!" + #endif + #endif + #if AXIS_HAS_SPI(Z3) + #ifndef Z3_CS_PIN + #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) + #endif + #endif + #ifndef Z3_MS1_PIN + #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1) + #endif + #ifndef Z3_MS2_PIN + #define Z3_MS2_PIN _EPIN(Z3_E_INDEX, MS2) + #endif + #ifndef Z3_MS3_PIN + #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3) + #endif + #if AXIS_HAS_UART(Z3) + #ifndef Z3_SERIAL_TX_PIN + #define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX) + #endif + #ifndef Z3_SERIAL_RX_PIN + #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) + #endif + #endif + #if defined(Z3_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG) + #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG) + #if DIAG_REMAPPED(Z3, X_MIN) + #define Z3_USE_ENDSTOP _XMIN_ + #elif DIAG_REMAPPED(Z3, Y_MIN) + #define Z3_USE_ENDSTOP _YMIN_ + #elif DIAG_REMAPPED(Z3, Z_MIN) + #define Z3_USE_ENDSTOP _ZMIN_ + #elif DIAG_REMAPPED(Z3, X_MAX) + #define Z3_USE_ENDSTOP _XMAX_ + #elif DIAG_REMAPPED(Z3, Y_MAX) + #define Z3_USE_ENDSTOP _YMAX_ + #elif DIAG_REMAPPED(Z3, Z_MAX) + #define Z3_USE_ENDSTOP _ZMAX_ + #else + #define _Z3_USE_ENDSTOP(P) _E##P##_DIAG_ + #define Z3_USE_ENDSTOP _Z3_USE_ENDSTOP(Z3_E_INDEX) + #endif + #undef Z3_DIAG_PIN + #endif + #define Z4_E_INDEX INCREMENT(Z3_E_INDEX) +#endif + +#ifndef Z3_CS_PIN + #define Z3_CS_PIN -1 +#endif +#ifndef Z3_MS1_PIN + #define Z3_MS1_PIN -1 +#endif +#ifndef Z3_MS2_PIN + #define Z3_MS2_PIN -1 +#endif +#ifndef Z3_MS3_PIN + #define Z3_MS3_PIN -1 +#endif + +#if NUM_Z_STEPPER_DRIVERS >= 4 + #ifndef Z4_STEP_PIN + #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) + #define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR) + #define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE) + #if Z4_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z4_STEP) + #error "No E stepper plug left for Z4!" + #endif + #endif + #if AXIS_HAS_SPI(Z4) + #ifndef Z4_CS_PIN + #define Z4_CS_PIN _EPIN(Z4_E_INDEX, CS) + #endif + #endif + #ifndef Z4_MS1_PIN + #define Z4_MS1_PIN _EPIN(Z4_E_INDEX, MS1) + #endif + #ifndef Z4_MS2_PIN + #define Z4_MS2_PIN _EPIN(Z4_E_INDEX, MS2) + #endif + #ifndef Z4_MS3_PIN + #define Z4_MS3_PIN _EPIN(Z4_E_INDEX, MS3) + #endif + #if AXIS_HAS_UART(Z4) + #ifndef Z4_SERIAL_TX_PIN + #define Z4_SERIAL_TX_PIN _EPIN(Z4_E_INDEX, SERIAL_TX) + #endif + #ifndef Z4_SERIAL_RX_PIN + #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX) + #endif + #endif + #if defined(Z4_STALL_SENSITIVITY) && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG) + #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG) + #if DIAG_REMAPPED(Z4, X_MIN) + #define Z4_USE_ENDSTOP _XMIN_ + #elif DIAG_REMAPPED(Z4, Y_MIN) + #define Z4_USE_ENDSTOP _YMIN_ + #elif DIAG_REMAPPED(Z4, Z_MIN) + #define Z4_USE_ENDSTOP _ZMIN_ + #elif DIAG_REMAPPED(Z4, X_MAX) + #define Z4_USE_ENDSTOP _XMAX_ + #elif DIAG_REMAPPED(Z4, Y_MAX) + #define Z4_USE_ENDSTOP _YMAX_ + #elif DIAG_REMAPPED(Z4, Z_MAX) + #define Z4_USE_ENDSTOP _ZMAX_ + #else + #define _Z4_USE_ENDSTOP(P) _E##P##_DIAG_ + #define Z4_USE_ENDSTOP _Z4_USE_ENDSTOP(Z4_E_INDEX) + #endif + #undef Z4_DIAG_PIN + #endif +#endif + +#ifndef Z4_CS_PIN + #define Z4_CS_PIN -1 +#endif +#ifndef Z4_MS1_PIN + #define Z4_MS1_PIN -1 +#endif +#ifndef Z4_MS2_PIN + #define Z4_MS2_PIN -1 +#endif +#ifndef Z4_MS3_PIN + #define Z4_MS3_PIN -1 +#endif + +#if HAS_MARLINUI_U8GLIB + #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1) + #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 + #endif + #if !defined(ST7920_DELAY_2) && defined(BOARD_ST7920_DELAY_2) + #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 + #endif + #if !defined(ST7920_DELAY_3) && defined(BOARD_ST7920_DELAY_3) + #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 + #endif +#else + #undef ST7920_DELAY_1 + #undef ST7920_DELAY_2 + #undef ST7920_DELAY_3 +#endif + +#undef HAS_FREE_AUX2_PINS +#undef DIAG_REMAPPED From 2a6d48bf9e5031e48ef2e5b953fdccaa96d54903 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 24 Oct 2020 00:16:09 +0000 Subject: [PATCH 011/443] [cron] Bump distribution date (2020-10-24) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 17d70a7c253e..4a57749cf059 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-23" + #define STRING_DISTRIBUTION_DATE "2020-10-24" #endif /** From 5917b5cf5cdaaca3b460c2a8e470b838d01b06fe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 23 Oct 2020 19:25:22 -0500 Subject: [PATCH 012/443] Fix warning in gcode_D --- Marlin/src/HAL/LINUX/HAL.h | 2 +- Marlin/src/HAL/shared/Delay.h | 4 ++-- Marlin/src/gcode/gcode_d.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 2e545e03d6f3..1c8dbfd4dcfe 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -23,7 +23,7 @@ #define CPU_32_BIT -#define F_CPU 100000000 +#define F_CPU 100000000UL #define SystemCoreClock F_CPU #include #include diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index d98e96084850..a48f3f79cfd0 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -155,7 +155,7 @@ #endif // Delay in nanoseconds -#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) / 1000UL ) +#define DELAY_NS(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL) / 1000UL) // Delay in microseconds -#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) ) +#define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL)) diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 99968b625ab8..2fd03144c594 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -181,7 +181,7 @@ // Use a low-level delay that does not rely on interrupts to function // Do not spin forever, to avoid thermal risks if heaters are enabled and // watchdog does not work. - DELAY_US(10000000); + for (int i = 10000; i--;) DELAY_US(1000UL); ENABLE_ISRS(); SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); } From f53d5a0872a48ad308656a3a4bbf45da76c32610 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 23 Oct 2020 21:29:58 -0700 Subject: [PATCH 013/443] Fix Chitu V5/V6 FAN2 pins (#19874) --- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 2 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 33ec27ddbad2..6d87e6b14fdc 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -94,7 +94,7 @@ // #define CONTROLLER_FAN_PIN PD6 // BOARD FAN #define FAN_PIN PG13 // FAN -#define FAN_PIN_2 PG14 +#define FAN2_PIN PG14 // // Misc diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index 990d33b759a0..bdce2358419e 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -103,7 +103,7 @@ // #define CONTROLLER_FAN_PIN PD6 // BOARD FAN #define FAN_PIN PG13 // FAN -#define FAN_PIN_2 PG14 +#define FAN2_PIN PG14 // // Misc From 9630c2683c39468bf885c560a1768d8b377d9462 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 24 Oct 2020 01:37:45 -0300 Subject: [PATCH 014/443] More MKS UI cleanup, optimization (#19869) Co-authored-by: Scott Lahteine --- Marlin/src/feature/tmc_util.h | 24 +- .../lcd/extui/lib/mks_ui/SPIFlashStorage.cpp | 3 +- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 32 +- .../lib/mks_ui/draw_acceleration_settings.cpp | 347 +++-------- .../lib/mks_ui/draw_advance_settings.cpp | 237 +------ .../draw_auto_level_offset_settings.cpp | 133 +--- .../extui/lib/mks_ui/draw_baby_stepping.cpp | 200 ++---- .../extui/lib/mks_ui/draw_change_speed.cpp | 242 +++---- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 588 +++++++----------- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h | 77 +-- .../extui/lib/mks_ui/draw_eeprom_settings.cpp | 159 +---- .../lib/mks_ui/draw_encoder_settings.cpp | 74 +-- .../extui/lib/mks_ui/draw_error_message.cpp | 16 +- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 226 +++---- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 146 ++--- .../extui/lib/mks_ui/draw_filament_change.cpp | 170 ++--- .../lib/mks_ui/draw_filament_settings.cpp | 239 ++----- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 144 +---- .../draw_homing_sensitivity_settings.cpp | 179 ++---- .../extui/lib/mks_ui/draw_jerk_settings.cpp | 164 ++--- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 36 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 249 +++----- .../extui/lib/mks_ui/draw_level_settings.cpp | 183 +----- .../extui/lib/mks_ui/draw_machine_para.cpp | 207 +----- .../lib/mks_ui/draw_machine_settings.cpp | 185 +----- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 216 ++----- .../mks_ui/draw_manual_level_pos_settings.cpp | 377 +++-------- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 262 ++------ .../extui/lib/mks_ui/draw_motor_settings.cpp | 260 ++------ .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 219 ++----- .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 473 +++++--------- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 178 ++---- .../extui/lib/mks_ui/draw_pause_position.cpp | 132 +--- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 261 +++----- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 249 +++----- .../lcd/extui/lib/mks_ui/draw_print_file.h | 4 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 140 ++--- .../src/lcd/extui/lib/mks_ui/draw_printing.h | 18 +- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 88 +-- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 219 ++----- .../extui/lib/mks_ui/draw_step_settings.cpp | 251 ++------ .../lib/mks_ui/draw_tmc_current_settings.cpp | 324 +++------- .../mks_ui/draw_tmc_step_mode_settings.cpp | 336 ++-------- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 190 ++---- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 254 ++++++-- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 124 ++-- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 113 ++-- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 97 ++- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 206 +++--- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 18 +- .../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 6 +- .../extui/lib/mks_ui/mks_hardware_test.cpp | 2 +- .../extui/lib/mks_ui/printer_operation.cpp | 7 - .../lib/mks_ui/tft_lvgl_configuration.cpp | 30 +- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 4 +- buildroot/tests/mks_robin_nano35-tests | 12 + 56 files changed, 2726 insertions(+), 6604 deletions(-) diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index abde3423076f..b21b89f68bcb 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -103,9 +103,11 @@ class TMCMarlin : public TMC, public TMCStorage { inline uint16_t get_microstep_counter() { return TMC::MSCNT(); } #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } - inline bool get_stealthChop() { return this->en_pwm_mode(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + 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(); } #endif #if ENABLED(HYBRID_THRESHOLD) @@ -170,9 +172,11 @@ class TMCMarlin : public TMC220 inline uint16_t get_microstep_counter() { return TMC2208Stepper::MSCNT(); } #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + 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(); } #endif #if ENABLED(HYBRID_THRESHOLD) @@ -216,9 +220,11 @@ class TMCMarlin : public TMC220 inline uint16_t get_microstep_counter() { return TMC2209Stepper::MSCNT(); } #if HAS_STEALTHCHOP - inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); } - inline bool get_stealthChop() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + 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(); } #endif #if ENABLED(HYBRID_THRESHOLD) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp index 3f5712445138..e028b3e6ec04 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp @@ -183,10 +183,9 @@ void SPIFlashStorage::loadPage(uint8_t* buffer) { // Test env // char fname[256]; - // memset(buffer, 0, SPI_FLASH_PageSize); // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); // FILE *fp = fopen(fname, "rb"); - // if (fp != NULL) { + // if (fp != nullptr) { // fread(buffer, 1, SPI_FLASH_PageSize, fp); // fclose(fp); // } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 48a2cb136202..b5e59692fdb2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -32,22 +32,18 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t * fw_type, *board; //*fw_version; +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *fw_type, *board; //*fw_version; -#define ID_A_RETURN 1 +enum { ID_A_RETURN = 1 }; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_A_RETURN: - if (event == LV_EVENT_CLICKED) { - // do nothing - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } @@ -59,11 +55,7 @@ void lv_draw_about(void) { } disp_state = ABOUT_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); @@ -84,13 +76,13 @@ void lv_draw_about(void) { } //fw_version = lv_label_create(scr, SHORT_BUILD_VERSION); - //lv_obj_align(fw_version, NULL, LV_ALIGN_CENTER, 0, -60); + //lv_obj_align(fw_version, nullptr, LV_ALIGN_CENTER, 0, -60); fw_type = lv_label_create(scr, "Firmware: Marlin " SHORT_BUILD_VERSION); - lv_obj_align(fw_type, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(fw_type, nullptr, LV_ALIGN_CENTER, 0, -20); board = lv_label_create(scr, "Board: " BOARD_INFO_NAME); - lv_obj_align(board, NULL, LV_ALIGN_CENTER, 0, -60); + lv_obj_align(board, nullptr, LV_ALIGN_CENTER, 0, -60); } void lv_clear_about() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp index 95bba3b549a1..9b86929bca3d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp @@ -29,331 +29,128 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_ACCE_RETURN 1 -#define ID_ACCE_PRINT 2 -#define ID_ACCE_RETRA 3 -#define ID_ACCE_TRAVEL 4 -#define ID_ACCE_X 5 -#define ID_ACCE_Y 6 -#define ID_ACCE_Z 7 -#define ID_ACCE_E0 8 -#define ID_ACCE_E1 9 -#define ID_ACCE_UP 10 -#define ID_ACCE_DOWN 11 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_ACCE_RETURN = 1, + ID_ACCE_PRINT, + ID_ACCE_RETRA, + ID_ACCE_TRAVEL, + ID_ACCE_X, + ID_ACCE_Y, + ID_ACCE_Z, + ID_ACCE_E0, + ID_ACCE_E1, + ID_ACCE_UP, + ID_ACCE_DOWN +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_ACCE_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_acceleration_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_acceleration_settings(); + draw_return_ui(); break; case ID_ACCE_PRINT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = PrintAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = PrintAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_RETRA: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = RetractAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = RetractAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_TRAVEL: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = TravelAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = TravelAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = XAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = XAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = YAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = YAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = ZAcceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = ZAcceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_E0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E0Acceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = E0Acceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_E1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E1Acceleration; - lv_clear_acceleration_settings(); - lv_draw_number_key(); - } + value = E1Acceleration; + lv_clear_acceleration_settings(); + lv_draw_number_key(); break; case ID_ACCE_UP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_acceleration_settings(); - lv_draw_acceleration_settings(); - } + uiCfg.para_ui_page = 0; + lv_clear_acceleration_settings(); + lv_draw_acceleration_settings(); break; case ID_ACCE_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_acceleration_settings(); - lv_draw_acceleration_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_acceleration_settings(); + lv_draw_acceleration_settings(); break; } } void lv_draw_acceleration_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonPrintValue = NULL, *labelPrintValue = NULL; - lv_obj_t *buttonRetraValue = NULL, *labelRetraValue = NULL; - lv_obj_t *buttonTravelValue = NULL, *labelTravelValue = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ACCELERATION_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ACCELERATION_UI; } disp_state = ACCELERATION_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AccelerationConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.acceleration); + lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_PRINT, 0, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.PrintAcceleration); - - buttonPrintValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_PRINT); - labelPrintValue = lv_label_create_empty(buttonPrintValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.RetractAcceleration); - - buttonRetraValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_RETRA); - labelRetraValue = lv_label_create_empty(buttonRetraValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.retract_acceleration); + lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_RETRA, 1, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.TravelAcceleration); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.travel_acceleration); + lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l); - buttonTravelValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_TRAVEL); - labelTravelValue = lv_label_create_empty(buttonTravelValue); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.X_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_X, 3, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.X_Acceleration); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_ACCE_DOWN); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonPrintValue); - lv_group_add_obj(g, buttonRetraValue); - lv_group_add_obj(g, buttonTravelValue); - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_ACCE_DOWN, true); } else { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.Y_Acceleration); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_Y); - labelYValue = lv_label_create_empty(buttonYValue); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Y_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_Y, 0, public_buf_l); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Z_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_Z, 1, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Z_Acceleration); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.E0_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_E0, 2, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_Z); - labelZValue = lv_label_create_empty(buttonZValue); + sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]); + lv_screen_menu_item_1_edit(scr, machine_menu.E1_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_E1, 3, public_buf_l); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.E0_Acceleration); - - buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_E0); - labelE0Value = lv_label_create_empty(buttonE0Value); - - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E1_Acceleration); - - buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_ACCE_E1); - labelE1Value = lv_label_create_empty(buttonE1Value); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_ACCE_UP); - //lv_imgbtn_set_src_both(buttonTurnPage, "F:/bmp_back70x40.bin"); - //lv_imgbtn_use_label_style(buttonTurnPage); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonE0Value); - lv_group_add_obj(g, buttonE1Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_ACCE_UP, true); } - //lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - //lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); - //labelTurnPage = lv_label_create_empty(buttonTurnPage); - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_ACCE_RETURN); - //lv_imgbtn_set_src_both(buttonBack, "F:/bmp_back70x40.bin"); - //lv_imgbtn_use_label_style(buttonBack); - label_Back = lv_label_create_empty(buttonBack); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - //lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - //lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.acceleration); - lv_label_set_text(labelPrintValue, public_buf_l); - lv_obj_align(labelPrintValue, buttonPrintValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.retract_acceleration); - lv_label_set_text(labelRetraValue, public_buf_l); - lv_obj_align(labelRetraValue, buttonRetraValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.travel_acceleration); - lv_label_set_text(labelTravelValue, public_buf_l); - lv_obj_align(labelTravelValue, buttonTravelValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - } - else { - - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS]); - lv_label_set_text(labelE0Value, public_buf_l); - lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]); - lv_label_set_text(labelE1Value, public_buf_l); - lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ACCE_RETURN, true); } void lv_clear_acceleration_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp index 99de179a9c2c..5c3b067682f4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -28,248 +28,71 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_ADVANCE_RETURN 1 -#define ID_PAUSE_POS 2 -#define ID_PAUSE_POS_ARROW 3 -#define ID_WIFI_PARA 4 -#define ID_WIFI_PARA_ARROW 5 -#define ID_FILAMENT_SETTINGS 6 -#define ID_FILAMENT_SETTINGS_ARROW 7 -#define ID_ENCODER_SETTINGS 8 -#define ID_ENCODER_SETTINGS_ARROW 9 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_ADVANCE_RETURN = 1, + ID_PAUSE_POS, + ID_WIFI_PARA, + ID_FILAMENT_SETTINGS, + ID_ENCODER_SETTINGS +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_ADVANCE_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - draw_return_ui(); - } + lv_clear_advance_settings(); + draw_return_ui(); break; case ID_PAUSE_POS: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_pause_position(); - } - break; - case ID_PAUSE_POS_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_pause_position(); - } + lv_clear_advance_settings(); + lv_draw_pause_position(); break; case ID_FILAMENT_SETTINGS: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_filament_settings(); - } - break; - case ID_FILAMENT_SETTINGS_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_filament_settings(); - } + lv_clear_advance_settings(); + lv_draw_filament_settings(); break; #if ENABLED(USE_WIFI_FUNCTION) case ID_WIFI_PARA: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_wifi_settings(); - } - break; - case ID_WIFI_PARA_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_wifi_settings(); - } + lv_clear_advance_settings(); + lv_draw_wifi_settings(); break; #endif #if HAS_ROTARY_ENCODER case ID_ENCODER_SETTINGS: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_encoder_settings(); - } - break; - case ID_ENCODER_SETTINGS_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_advance_settings(); - lv_draw_encoder_settings(); - } + lv_clear_advance_settings(); + lv_draw_encoder_settings(); break; #endif } } void lv_draw_advance_settings(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonPausePos, *labelPausePos; - lv_obj_t *buttonFilamentSettings, *labelFilamentSettings; - lv_obj_t * line1,* line2; - #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_t *buttonWifiSet, *labelWifiSet, *buttonWifiSetNarrow; - #endif - #if HAS_ROTARY_ENCODER - lv_obj_t *buttonEncoder, *labelEncoder, *buttonEncoderNarrow; - #endif - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ADVANCED_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ADVANCED_UI; } disp_state = ADVANCED_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AdvancedConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonPausePos = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonPausePos, PARA_UI_POS_X, PARA_UI_POS_Y); - lv_obj_set_size(buttonPausePos, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonPausePos, event_handler, ID_PAUSE_POS, NULL, 0); - lv_btn_use_label_style(buttonPausePos); - lv_btn_set_layout(buttonPausePos, LV_LAYOUT_OFF); - labelPausePos = lv_label_create_empty(buttonPausePos); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonPausePos); - #endif - - (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_PAUSE_POS_ARROW); - - line1 = lv_line_create(lv_scr_act(), NULL); - lv_ex_line(line1, line_points[0]); - - buttonFilamentSettings = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonFilamentSettings, PARA_UI_POS_X, PARA_UI_POS_Y*2); - lv_obj_set_size(buttonFilamentSettings, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonFilamentSettings, event_handler, ID_FILAMENT_SETTINGS, NULL, 0); - lv_btn_use_label_style(buttonFilamentSettings); - lv_btn_set_layout(buttonFilamentSettings, LV_LAYOUT_OFF); - labelFilamentSettings = lv_label_create_empty(buttonFilamentSettings); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonFilamentSettings); - #endif - - (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y*2 + PARA_UI_ARROW_V, event_handler, ID_FILAMENT_SETTINGS_ARROW); - - line2 = lv_line_create(lv_scr_act(), NULL); - lv_ex_line(line2, line_points[1]); - + int index = 0; + lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++); + lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++); #if ENABLED(USE_WIFI_FUNCTION) - - buttonWifiSet = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonWifiSet, PARA_UI_POS_X,PARA_UI_POS_Y*3); - lv_obj_set_size(buttonWifiSet, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonWifiSet, event_handler,ID_WIFI_PARA,NULL, 0); - lv_btn_use_label_style(buttonWifiSet); - lv_btn_set_layout(buttonWifiSet, LV_LAYOUT_OFF); - labelWifiSet = lv_label_create_empty(buttonWifiSet); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonWifiSet); - #endif - - buttonWifiSetNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_WIFI_PARA_ARROW); - - lv_obj_t * line3 = lv_line_create(scr, NULL); - lv_ex_line(line3,line_points[2]); - - #if HAS_ROTARY_ENCODER - buttonEncoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonEncoder, PARA_UI_POS_X,PARA_UI_POS_Y*4); - lv_obj_set_size(buttonEncoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonEncoder, event_handler,ID_ENCODER_SETTINGS,NULL, 0); - lv_btn_use_label_style(buttonEncoder); - lv_btn_set_layout(buttonEncoder, LV_LAYOUT_OFF); - labelEncoder = lv_label_create_empty(buttonEncoder); - - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEncoder); - - buttonEncoderNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 4 + PARA_UI_ARROW_V, event_handler, ID_ENCODER_SETTINGS_ARROW); - - lv_obj_t * line4 = lv_line_create(scr, NULL); - lv_ex_line(line4,line_points[3]); - #endif - - #elif HAS_ROTARY_ENCODER - buttonEncoder = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonEncoder, PARA_UI_POS_X,PARA_UI_POS_Y*3); - lv_obj_set_size(buttonEncoder, PARA_UI_SIZE_X,PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonEncoder, event_handler,ID_ENCODER_SETTINGS,NULL, 0); - lv_btn_use_label_style(buttonEncoder); - lv_btn_set_layout(buttonEncoder, LV_LAYOUT_OFF); - labelEncoder = lv_label_create_empty(buttonEncoder); - - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonEncoder); - - buttonEncoderNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_ENCODER_SETTINGS_ARROW); - - lv_obj_t * line3 = lv_line_create(scr, NULL); - lv_ex_line(line3,line_points[2]); + lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++); #endif - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ADVANCE_RETURN); #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); + lv_screen_menu_item(scr, machine_menu.EncoderSettings, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_ENCODER_SETTINGS, index); + index++; #endif - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelPausePos, machine_menu.PausePosition); - lv_obj_align(labelPausePos, buttonPausePos, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelFilamentSettings, machine_menu.FilamentConf); - lv_obj_align(labelFilamentSettings, buttonFilamentSettings, LV_ALIGN_IN_LEFT_MID, 0, 0); - - #if ENABLED(USE_WIFI_FUNCTION) - lv_label_set_text(labelWifiSet, machine_menu.WifiSettings); - lv_obj_align(labelWifiSet, buttonWifiSet, LV_ALIGN_IN_LEFT_MID,0, 0); - #endif - #if HAS_ROTARY_ENCODER - lv_label_set_text(labelEncoder, machine_menu.EncoderSettings); - lv_obj_align(labelEncoder, buttonEncoder, LV_ALIGN_IN_LEFT_MID,0, 0); - #endif - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_ADVANCE_RETURN, true); } void lv_clear_advance_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp index 87632a27c90a..8e40956c0f21 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp @@ -29,135 +29,64 @@ #include "../../../../module/probe.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_OFFSET_RETURN 1 -#define ID_OFFSET_X 2 -#define ID_OFFSET_Y 3 -#define ID_OFFSET_Z 4 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_OFFSET_RETURN = 1, + ID_OFFSET_X, + ID_OFFSET_Y, + ID_OFFSET_Z +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_OFFSET_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_auto_level_offset_settings(); - draw_return_ui(); - } + lv_clear_auto_level_offset_settings(); + draw_return_ui(); break; case ID_OFFSET_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = x_offset; - lv_clear_auto_level_offset_settings(); - lv_draw_number_key(); - } + value = x_offset; + lv_clear_auto_level_offset_settings(); + lv_draw_number_key(); break; case ID_OFFSET_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = y_offset; - lv_clear_auto_level_offset_settings(); - lv_draw_number_key(); - } + value = y_offset; + lv_clear_auto_level_offset_settings(); + lv_draw_number_key(); break; case ID_OFFSET_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = z_offset; - lv_clear_auto_level_offset_settings(); - lv_draw_number_key(); - } + value = z_offset; + lv_clear_auto_level_offset_settings(); + lv_draw_number_key(); break; } } void lv_draw_auto_level_offset_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NOZZLE_PROBE_OFFSET_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = NOZZLE_PROBE_OFFSET_UI; } disp_state = NOZZLE_PROBE_OFFSET_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.OffsetConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.Xoffset); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Yoffset); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_Y); - labelYValue = lv_label_create_empty(buttonYValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); + sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.Xoffset, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_OFFSET_X, 0, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Zoffset); + sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.y, 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.Yoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_OFFSET_Y, 1, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_OFFSET_Z); - labelZValue = lv_label_create_empty(buttonZValue); + sprintf_P(public_buf_l, PSTR("%.1f"), probe.offset.z); + lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_OFFSET_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonBack); - } - #endif - - if (gCfgItems.multiple_language) { - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0)); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.y, 0)); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), probe.offset.z); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_OFFSET_RETURN, true); } void lv_clear_auto_level_offset_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp index adf69719cdc5..b0a004ed9eaa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp @@ -38,113 +38,75 @@ #include "../../../../module/probe.h" #endif -extern lv_group_t * g; -static lv_obj_t * scr; - -static lv_obj_t *labelV, *buttonV, * zOffsetText; - -#define ID_BABY_STEP_X_P 1 -#define ID_BABY_STEP_X_N 2 -#define ID_BABY_STEP_Y_P 3 -#define ID_BABY_STEP_Y_N 4 -#define ID_BABY_STEP_Z_P 5 -#define ID_BABY_STEP_Z_N 6 -#define ID_BABY_STEP_DIST 7 -#define ID_BABY_STEP_RETURN 8 +extern lv_group_t *g; +static lv_obj_t *scr; + +static lv_obj_t *labelV, *buttonV, *zOffsetText; + +enum { + ID_BABY_STEP_X_P = 1, + ID_BABY_STEP_X_N, + ID_BABY_STEP_Y_P, + ID_BABY_STEP_Y_N, + ID_BABY_STEP_Z_P, + ID_BABY_STEP_Z_N, + ID_BABY_STEP_DIST, + ID_BABY_STEP_RETURN +}; static float babystep_dist=0.01; static uint8_t has_adjust_z = 0; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; char baby_buf[30] = { 0 }; switch (obj->mks_obj_id) { case ID_BABY_STEP_X_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 X%.3f"),babystep_dist); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 X%.3f"), babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_X_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 X%.3f"),((float)0 - babystep_dist)); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 X%.3f"), -babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_Y_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 Y%.3f"), babystep_dist); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 Y%.3f"), babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_Y_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 Y%.3f"),((float)0 - babystep_dist)); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 Y%.3f"), -babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_Z_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_Z_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - sprintf_P(baby_buf, PSTR("M290 Z%.3f"),((float)0 - babystep_dist)); - gcode.process_subcommands_now_P(PSTR(baby_buf)); - has_adjust_z = 1; - } + sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); + gcode.process_subcommands_now_P(PSTR(baby_buf)); + has_adjust_z = 1; break; case ID_BABY_STEP_DIST: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (abs((int)(100 * babystep_dist)) == 1) - babystep_dist = 0.05; - else if (abs((int)(100 * babystep_dist)) == 5) - babystep_dist = 0.1; - else - babystep_dist = 0.01; - disp_baby_step_dist(); - } - + if (abs((int)(100 * babystep_dist)) == 1) + babystep_dist = 0.05; + else if (abs((int)(100 * babystep_dist)) == 5) + babystep_dist = 0.1; + else + babystep_dist = 0.01; + disp_baby_step_dist(); break; case ID_BABY_STEP_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (has_adjust_z == 1) { - TERN_(EEPROM_SETTINGS, (void)settings.save()); - has_adjust_z = 0; - } - clear_cur_ui(); - draw_return_ui(); + if (has_adjust_z == 1) { + TERN_(EEPROM_SETTINGS, (void)settings.save()); + has_adjust_z = 0; } + clear_cur_ui(); + draw_return_ui(); break; } } @@ -156,75 +118,31 @@ void lv_draw_baby_stepping(void) { } disp_state = BABY_STEP_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create an Image button - lv_obj_t *buttonXI = lv_imgbtn_create(scr, "F:/bmp_xAdd.bin", INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P); - lv_obj_t *buttonXD = lv_imgbtn_create(scr, "F:/bmp_xDec.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N); - lv_obj_t *buttonYI = lv_imgbtn_create(scr, "F:/bmp_yAdd.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P); - lv_obj_t *buttonYD = lv_imgbtn_create(scr, "F:/bmp_yDec.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Y_N); - lv_obj_t *buttonZI = lv_imgbtn_create(scr, "F:/bmp_zAdd.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABY_STEP_Z_P); - lv_obj_t *buttonZD = lv_imgbtn_create(scr, "F:/bmp_zDec.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Z_N); - buttonV = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABY_STEP_DIST); - lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelXI = lv_label_create_empty(buttonXI); - lv_obj_t *labelXD = lv_label_create_empty(buttonXD); - lv_obj_t *labelYI = lv_label_create_empty(buttonYI); - lv_obj_t *labelYD = lv_label_create_empty(buttonYD); - lv_obj_t *labelZI = lv_label_create_empty(buttonZI); - lv_obj_t *labelZD = lv_label_create_empty(buttonZD); + lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P); + lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N); + lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P); + lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Y_N); + lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABY_STEP_Z_P); + lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Z_N); + buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABY_STEP_DIST); labelV = lv_label_create_empty(buttonV); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelXI, move_menu.x_add); - lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelXD, move_menu.x_dec); - lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYI, move_menu.y_add); - lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYD, move_menu.y_dec); - lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZI, move_menu.z_add); - lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZD, move_menu.z_dec); - lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXI); - lv_group_add_obj(g, buttonXD); - lv_group_add_obj(g, buttonYI); - lv_group_add_obj(g, buttonYD); - lv_group_add_obj(g, buttonZI); - lv_group_add_obj(g, buttonZD); lv_group_add_obj(g, buttonV); - lv_group_add_obj(g, buttonBack); } #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_RETURN); + disp_baby_step_dist(); - zOffsetText = lv_label_create(scr, 290, TITLE_YPOS, NULL); + zOffsetText = lv_label_create(scr, 290, TITLE_YPOS, nullptr); disp_z_offset_value(); } @@ -255,7 +173,7 @@ void disp_baby_step_dist() { void disp_z_offset_value() { char buf[20]; - sprintf_P(buf, PSTR("offset Z: %.3f"), (double)TERN(HAS_BED_PROBE, probe.offset.z, 0)); + sprintf_P(buf, PSTR("offset Z: %.3f"), (float)TERN(HAS_BED_PROBE, probe.offset.z, 0)); lv_label_set_text(zOffsetText, buf); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index 848b625559f8..05158b181c57 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -33,179 +33,136 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; static lv_obj_t *labelStep, *buttonStep, *buttonMov, *buttonExt; static lv_obj_t *labelMov, *labelExt; -static lv_obj_t * printSpeedText; +static lv_obj_t *printSpeedText; -#define ID_C_ADD 1 -#define ID_C_DEC 2 -#define ID_C_MOVE 3 -#define ID_C_EXT 4 -#define ID_C_STEP 5 -#define ID_C_RETURN 6 +enum { + ID_C_ADD = 1, + ID_C_DEC, + ID_C_MOVE, + ID_C_EXT, + ID_C_STEP, + ID_C_RETURN +}; -static uint8_t speedType; +static bool editingFlowrate; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_C_ADD: - if (event == LV_EVENT_CLICKED) { - // nothing to do + if (!editingFlowrate) { + if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + feedrate_percentage += uiCfg.stepPrintSpeed; + else + feedrate_percentage = MAX_EXT_SPEED_PERCENT; } - else if (event == LV_EVENT_RELEASED) { - if (speedType == 0) { - if (feedrate_percentage < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) - feedrate_percentage += uiCfg.stepPrintSpeed; - else - feedrate_percentage = MAX_EXT_SPEED_PERCENT; - } - else if (speedType == 1) { - if (planner.flow_percentage[0] < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) - planner.flow_percentage[0] += uiCfg.stepPrintSpeed; - else - planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; - planner.refresh_e_factor(0); - #if HAS_MULTI_EXTRUDER - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); - #endif - } - disp_print_speed(); + else { + if (planner.flow_percentage[0] < MAX_EXT_SPEED_PERCENT - uiCfg.stepPrintSpeed) + planner.flow_percentage[0] += uiCfg.stepPrintSpeed; + else + planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; + //planner.e_factor[0]= planner.flow_percentage[0]*0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1]*0.01; + planner.refresh_e_factor(0); + #if HAS_MULTI_EXTRUDER + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + #endif } + disp_print_speed(); break; case ID_C_DEC: - if (event == LV_EVENT_CLICKED) { - // nothing to do + if (!editingFlowrate) { + if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + feedrate_percentage -= uiCfg.stepPrintSpeed; + else + feedrate_percentage = MIN_EXT_SPEED_PERCENT; } - else if (event == LV_EVENT_RELEASED) { - if (speedType == 0) { - if (feedrate_percentage > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) - feedrate_percentage -= uiCfg.stepPrintSpeed; - else - feedrate_percentage = MIN_EXT_SPEED_PERCENT; - } - else if (speedType == 1) { - if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) - planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; - else - planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; - //planner.e_factor[0]= planner.flow_percentage[0] * 0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1] * 0.01; - planner.refresh_e_factor(0); - #if HAS_MULTI_EXTRUDER - planner.flow_percentage[1] = planner.flow_percentage[0]; - planner.refresh_e_factor(1); - #endif - } - disp_print_speed(); + else { + if (planner.flow_percentage[0] > MIN_EXT_SPEED_PERCENT + uiCfg.stepPrintSpeed) + planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; + else + planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; + //planner.e_factor[0]= planner.flow_percentage[0] * 0.01; + //planner.flow_percentage[1] = planner.flow_percentage[0]; + //planner.e_factor[1]= planner.flow_percentage[1] * 0.01; + planner.refresh_e_factor(0); + #if HAS_MULTI_EXTRUDER + planner.flow_percentage[1] = planner.flow_percentage[0]; + planner.refresh_e_factor(1); + #endif } + disp_print_speed(); break; case ID_C_MOVE: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - speedType = 0; - disp_speed_type(); - disp_print_speed(); - } + editingFlowrate = false; + disp_speed_type(); + disp_print_speed(); break; case ID_C_EXT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - speedType = 1; - disp_speed_type(); - disp_print_speed(); - } + editingFlowrate = true; + disp_speed_type(); + disp_print_speed(); break; case ID_C_STEP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.stepPrintSpeed == 1) - uiCfg.stepPrintSpeed = 5; - else if (uiCfg.stepPrintSpeed == 5) - uiCfg.stepPrintSpeed = 10; - else - uiCfg.stepPrintSpeed = 1; - disp_speed_step(); - } + if (uiCfg.stepPrintSpeed == 1) + uiCfg.stepPrintSpeed = 5; + else if (uiCfg.stepPrintSpeed == 5) + uiCfg.stepPrintSpeed = 10; + else + uiCfg.stepPrintSpeed = 1; + disp_speed_step(); break; case ID_C_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_change_speed(void) { - lv_obj_t *buttonAdd, *buttonDec; - lv_obj_t *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; } disp_state = CHANGE_SPEED_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_C_ADD); - buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_C_DEC); - buttonMov = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_MOVE); - buttonExt = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_EXT); - buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_STEP); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_RETURN); + lv_big_button_create(scr, "F:/bmp_Add.bin", speed_menu.add, INTERVAL_V, titleHeight, event_handler, ID_C_ADD); + lv_big_button_create(scr, "F:/bmp_Dec.bin", speed_menu.dec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_C_DEC); + buttonMov = lv_imgbtn_create(scr, nullptr, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_MOVE); + buttonExt = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_EXT); + buttonStep = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_STEP); + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) { + lv_group_add_obj(g, buttonMov); + lv_group_add_obj(g, buttonExt); + lv_group_add_obj(g, buttonStep); + } + #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_RETURN); // Create labels on the image buttons - lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); - lv_obj_t *labelDec = lv_label_create_empty(buttonDec); labelMov = lv_label_create_empty(buttonMov); labelExt = lv_label_create_empty(buttonExt); labelStep = lv_label_create_empty(buttonStep); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - if (gCfgItems.multiple_language) { - lv_label_set_text(labelAdd, speed_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, speed_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonAdd); - lv_group_add_obj(g, buttonDec); lv_group_add_obj(g, buttonMov); lv_group_add_obj(g, buttonExt); lv_group_add_obj(g, buttonStep); - lv_group_add_obj(g, buttonBack); } #endif @@ -246,34 +203,27 @@ void disp_print_speed() { public_buf_l[0] = '\0'; - if (speedType == 0) { // move - strcat(public_buf_l, speed_menu.move_speed); - strcat_P(public_buf_l, PSTR(": ")); - sprintf_P(buf, PSTR("%d%%"), feedrate_percentage); - strcat(public_buf_l, buf); + int16_t val; + const char *lbl; + if (editingFlowrate) { + lbl = speed_menu.extrude_speed; + val = planner.flow_percentage[0]; } - else if (speedType == 1) { // e1 - strcat(public_buf_l, speed_menu.extrude_speed); - strcat_P(public_buf_l, PSTR(": ")); - sprintf_P(buf, PSTR("%d%%"), planner.flow_percentage[0]); - strcat(public_buf_l, buf); + else { + lbl = speed_menu.move_speed; + val = feedrate_percentage; } + strcpy(public_buf_l, lbl); + strcat_P(public_buf_l, PSTR(": ")); + sprintf_P(buf, PSTR("%d%%"), val); + strcat(public_buf_l, buf); lv_label_set_text(printSpeedText, public_buf_l); - lv_obj_align(printSpeedText, NULL, LV_ALIGN_CENTER, 0, -65); + lv_obj_align(printSpeedText, nullptr, LV_ALIGN_CENTER, 0, -65); } void disp_speed_type() { - switch (speedType) { - case 1: - lv_imgbtn_set_src_both(buttonMov, "F:/bmp_mov_changeSpeed.bin"); - lv_imgbtn_set_src_both(buttonExt, "F:/bmp_extruct_sel.bin"); - break; - - default: - lv_imgbtn_set_src_both(buttonMov, "F:/bmp_mov_sel.bin"); - lv_imgbtn_set_src_both(buttonExt, "F:/bmp_speed_extruct.bin"); - break; - } + lv_imgbtn_set_src_both(buttonMov, editingFlowrate ? "F:/bmp_mov_changeSpeed.bin" : "F:/bmp_mov_sel.bin"); + lv_imgbtn_set_src_both(buttonExt, editingFlowrate ? "F:/bmp_extruct_sel.bin" : "F:/bmp_speed_extruct.bin"); lv_obj_refresh_ext_draw_pad(buttonExt); lv_obj_refresh_ext_draw_pad(buttonMov); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 07e0665ce461..a18964919a13 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -55,189 +55,162 @@ #include "../../../../feature/pause.h" #endif -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t * tempText1; -static lv_obj_t * filament_bar; +extern lv_group_t *g; +static lv_obj_t *scr, *tempText1, *filament_bar; extern uint8_t sel_id; extern bool once_flag, gcode_preview_over; -extern int upload_result ; +extern int upload_result; extern uint32_t upload_time; extern uint32_t upload_size; -extern uint8_t temperature_change_frequency; +extern bool temps_update_flag; -static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.dialogType == DIALOG_TYPE_PRINT_FILE) { - #if HAS_GCODE_PREVIEW - preview_gcode_prehandle(list_file.file_name[sel_id]); - #endif - reset_print_time(); - start_print_time(); - - uiCfg.print_state = WORKING; - lv_clear_dialog(); - lv_draw_printing(); - - #if ENABLED(SDSUPPORT) - if (!gcode_preview_over) { - char *cur_name; - cur_name = strrchr(list_file.file_name[sel_id], '/'); - - SdFile file, *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_READ)) { - gCfgItems.curFilesize = file.fileSize(); - file.close(); - update_spi_flash(); - } - card.openFileRead(cur_name); - if (card.isFileOpen()) { - feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; - planner.flow_percentage[0] = 100; - planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; - #if HAS_MULTI_EXTRUDER - planner.flow_percentage[1] = 100; - planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; - #endif - card.startFileprint(); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.prepare(); - #endif - once_flag = false; - } +static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; + if (DIALOG_IS(TYPE_PRINT_FILE)) { + #if HAS_GCODE_PREVIEW + preview_gcode_prehandle(list_file.file_name[sel_id]); + #endif + reset_print_time(); + start_print_time(); + + uiCfg.print_state = WORKING; + lv_clear_dialog(); + lv_draw_printing(); + + #if ENABLED(SDSUPPORT) + if (!gcode_preview_over) { + char *cur_name; + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file, *curDir; + card.endFilePrint(); + const char * const fname = card.diveToFile(true, curDir, cur_name); + if (!fname) return; + if (file.open(curDir, fname, O_READ)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + update_spi_flash(); + } + card.openFileRead(cur_name); + if (card.isFileOpen()) { + feedrate_percentage = 100; + //saved_feedrate_percentage = feedrate_percentage; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; + #if HAS_MULTI_EXTRUDER + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; + #endif + card.startFileprint(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif + once_flag = false; } - #endif - } - else if (uiCfg.dialogType == DIALOG_TYPE_STOP) { - wait_for_heatup = false; - stop_print_time(); - lv_clear_dialog(); - lv_draw_ready_print(); - - #if ENABLED(SDSUPPORT) - //card.endFilePrint(); - //wait_for_heatup = false; - uiCfg.print_state = IDLE; - card.flag.abort_sd_printing = true; - //queue.clear(); - //quickstop_stepper(); - //print_job_timer.stop(); - //thermalManager.disable_all_heaters(); - - //#if ENABLED(POWER_LOSS_RECOVERY) - // recovery.purge(); - //#endif - //queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0")); - //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); - #endif - } - else if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT) { - clear_cur_ui(); - lv_draw_ready_print(); - } - #if ENABLED(ADVANCED_PAUSE_FEATURE) - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT - ) { - wait_for_user = false; - } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; - } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { - clear_cur_ui(); - draw_return_ui(); } #endif - else if (uiCfg.dialogType == DIALOG_STORE_EEPROM_TIPS) { - TERN_(EEPROM_SETTINGS, (void)settings.save()); - clear_cur_ui(); - draw_return_ui(); - } - else if (uiCfg.dialogType == DIALOG_READ_EEPROM_TIPS) { - TERN_(EEPROM_SETTINGS, (void)settings.load()); - clear_cur_ui(); - draw_return_ui(); - } - else if (uiCfg.dialogType == DIALOG_REVERT_EEPROM_TIPS) { - TERN_(EEPROM_SETTINGS, (void)settings.reset()); - clear_cur_ui(); - draw_return_ui(); - } - else if (uiCfg.dialogType == DIALOG_WIFI_CONFIG_TIPS) { - uiCfg.configWifi = 1; - clear_cur_ui(); - draw_return_ui(); - } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) { - uiCfg.filament_heat_completed_load = 1; - } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) { - uiCfg.filament_heat_completed_unload = 1; - } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED - || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED - ) { + } + else if (DIALOG_IS(TYPE_STOP)) { + wait_for_heatup = false; + stop_print_time(); + lv_clear_dialog(); + lv_draw_ready_print(); + + #if ENABLED(SDSUPPORT) + //card.endFilePrint(); + //wait_for_heatup = false; + uiCfg.print_state = IDLE; + card.flag.abort_sd_printing = true; + //queue.clear(); + //quickstop_stepper(); + //print_job_timer.stop(); + //thermalManager.disable_all_heaters(); + + //#if ENABLED(POWER_LOSS_RECOVERY) + // recovery.purge(); + //#endif + //queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0")); + //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); + #endif + } + else if (DIALOG_IS(TYPE_FINISH_PRINT)) { + clear_cur_ui(); + lv_draw_ready_print(); + } + #if ENABLED(ADVANCED_PAUSE_FEATURE) + else if (DIALOG_IS(PAUSE_MESSAGE_WAITING, PAUSE_MESSAGE_INSERT, PAUSE_MESSAGE_HEAT)) + wait_for_user = false; + else if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + else if (DIALOG_IS(PAUSE_MESSAGE_RESUME)) { clear_cur_ui(); draw_return_ui(); } + #endif + else if (DIALOG_IS(STORE_EEPROM_TIPS)) { + TERN_(EEPROM_SETTINGS, (void)settings.save()); + clear_cur_ui(); + draw_return_ui(); + } + else if (DIALOG_IS(READ_EEPROM_TIPS)) { + TERN_(EEPROM_SETTINGS, (void)settings.load()); + clear_cur_ui(); + draw_return_ui(); + } + else if (DIALOG_IS(REVERT_EEPROM_TIPS)) { + TERN_(EEPROM_SETTINGS, (void)settings.reset()); + clear_cur_ui(); + draw_return_ui(); + } + else if (DIALOG_IS(WIFI_CONFIG_TIPS)) { + uiCfg.configWifi = 1; + clear_cur_ui(); + draw_return_ui(); + } + else if (DIALOG_IS(TYPE_FILAMENT_HEAT_LOAD_COMPLETED)) + uiCfg.filament_heat_completed_load = 1; + else if (DIALOG_IS(TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) + uiCfg.filament_heat_completed_unload = 1; + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED, TYPE_FILAMENT_UNLOAD_COMPLETED)) { + clear_cur_ui(); + draw_return_ui(); } } -static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { - if (event == LV_EVENT_CLICKED) { - // nothing to do +static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; + if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #endif } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; - #endif - } - else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) - || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT) - || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) - || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) - ) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak; - clear_cur_ui(); - draw_return_ui(); - } - else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING) - || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING) - ) { - queue.enqueue_one_P(PSTR("M410")); - uiCfg.filament_rate = 0; - uiCfg.filament_loading_completed = 0; - uiCfg.filament_unloading_completed = 0; - uiCfg.filament_loading_time_flg = 0; - uiCfg.filament_loading_time_cnt = 0; - uiCfg.filament_unloading_time_flg = 0; - uiCfg.filament_unloading_time_cnt = 0; - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; - clear_cur_ui(); - draw_return_ui(); - } - else { - clear_cur_ui(); - draw_return_ui(); - } + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT, TYPE_FILAMENT_HEAT_LOAD_COMPLETED, TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak; + clear_cur_ui(); + draw_return_ui(); + } + else if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) { + queue.enqueue_one_P(PSTR("M410")); + uiCfg.filament_rate = 0; + uiCfg.filament_loading_completed = 0; + uiCfg.filament_unloading_completed = 0; + uiCfg.filament_loading_time_flg = 0; + uiCfg.filament_loading_time_cnt = 0; + uiCfg.filament_unloading_time_flg = 0; + uiCfg.filament_unloading_time_cnt = 0; + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; + clear_cur_ui(); + draw_return_ui(); + } + else { + clear_cur_ui(); + draw_return_ui(); } } void lv_draw_dialog(uint8_t type) { - - lv_obj_t * btnOk = NULL; - lv_obj_t * btnCancel = NULL; + lv_obj_t *btnOk = nullptr, *btnCancel = nullptr; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; @@ -246,153 +219,70 @@ void lv_draw_dialog(uint8_t type) { uiCfg.dialogType = type; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - static lv_style_t style_btn_rel; // A variable to store the released style - lv_style_copy(&style_btn_rel, &lv_style_plain); // Initialize from a built-in style - style_btn_rel.body.border.color = lv_color_hex3(0x269); - style_btn_rel.body.border.width = 1; - style_btn_rel.body.main_color = lv_color_hex3(0xADF); - style_btn_rel.body.grad_color = lv_color_hex3(0x46B); - style_btn_rel.body.shadow.width = 4; - style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; - style_btn_rel.body.radius = LV_RADIUS_CIRCLE; - style_btn_rel.text.color = lv_color_hex3(0xDEF); - style_btn_rel.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); - - static lv_style_t style_btn_pr; // A variable to store the pressed style - lv_style_copy(&style_btn_pr, &style_btn_rel); // Initialize from the released style - style_btn_pr.body.border.color = lv_color_hex3(0x46B); - style_btn_pr.body.main_color = lv_color_hex3(0x8BD); - style_btn_pr.body.grad_color = lv_color_hex3(0x24A); - style_btn_pr.body.shadow.width = 2; - style_btn_pr.text.color = lv_color_hex3(0xBCD); - style_btn_pr.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); - - // Set button styles for Released and Pressed - auto lv_btn_use_button_style = [&](lv_obj_t *btn) { - lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); - lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); - }; - lv_obj_t *labelDialog = lv_label_create_empty(scr); - if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { - btnOk = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position - lv_obj_set_size(btnOk, 100, 50); // Set its size - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_use_button_style(btnOk); + if (DIALOG_IS(TYPE_FINISH_PRINT, PAUSE_MESSAGE_RESUME)) { + btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT - ) { - btnOk = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position - lv_obj_set_size(btnOk, 100, 50); // Set its size - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_use_button_style(btnOk); + else if (DIALOG_IS(PAUSE_MESSAGE_WAITING, PAUSE_MESSAGE_INSERT, PAUSE_MESSAGE_HEAT)) { + btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PAUSING - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_CHANGING - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_UNLOAD - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_LOAD - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PURGE - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME - || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEATING - ) { + else if (DIALOG_IS(PAUSE_MESSAGE_PAUSING, PAUSE_MESSAGE_CHANGING, PAUSE_MESSAGE_UNLOAD, PAUSE_MESSAGE_LOAD, PAUSE_MESSAGE_PURGE, PAUSE_MESSAGE_RESUME, PAUSE_MESSAGE_HEATING)) { // nothing to do } - else if (uiCfg.dialogType == WIFI_ENABLE_TIPS) { - btnCancel = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnCancel, 100, 50); - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + else if (DIALOG_IS(WIFI_ENABLE_TIPS)) { + btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } - else if (uiCfg.dialogType == DIALOG_TRANSFER_NO_DEVICE) { - btnCancel = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnCancel, 100, 50); - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + else if (DIALOG_IS(TRANSFER_NO_DEVICE)) { + btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } #if ENABLED(USE_WIFI_FUNCTION) - else if (uiCfg.dialogType == DIALOG_TYPE_UPLOAD_FILE) { + else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { if (upload_result == 2) { - btnCancel = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnCancel, 100, 50); - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } else if (upload_result == 3) { - btnOk = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnOk, 100, 50); - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_use_button_style(btnOk); + btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); lv_obj_t *labelOk = lv_label_create_empty(btnOk); lv_label_set_text(labelOk, print_file_dialog_menu.confirm); } } - #endif //USE_WIFI_FUNCTION - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT - || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT - ) { - btnCancel = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnCancel, 100, 50); - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + #endif + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT)) { + btnCancel = lv_button_btn_create(scr, BTN_OK_X+90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); tempText1 = lv_label_create_empty(scr); filament_sprayer_temp(); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED - || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED - ) { - btnOk = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); - lv_obj_set_size(btnOk, 100, 50); - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_use_button_style(btnOk); + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED, TYPE_FILAMENT_UNLOAD_COMPLETED)) { + btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); lv_obj_t *labelOk = lv_label_create_empty(btnOk); lv_label_set_text(labelOk, print_file_dialog_menu.confirm); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING - || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING - ) { - btnCancel = lv_btn_create(scr, NULL); - lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); - lv_obj_set_size(btnCancel, 100, 50); - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + else if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) { + btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); - filament_bar = lv_bar_create(scr, NULL); + filament_bar = lv_bar_create(scr, nullptr); lv_obj_set_pos(filament_bar, (TFT_WIDTH-400)/2, ((TFT_HEIGHT - titleHeight)-40)/2); lv_obj_set_size(filament_bar, 400, 25); lv_bar_set_style(filament_bar, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); @@ -400,21 +290,13 @@ void lv_draw_dialog(uint8_t type) { lv_bar_set_value(filament_bar, 0, LV_ANIM_ON); } else { - btnOk = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); // Set its position - lv_obj_set_size(btnOk, 100, 50); // Set its size - lv_obj_set_event_cb(btnOk, btn_ok_event_cb); - lv_btn_use_button_style(btnOk); + btnOk = lv_button_btn_create(scr, BTN_OK_X, BTN_OK_Y, 100, 50, btn_ok_event_cb); lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button - btnCancel = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); // Set its position - lv_obj_set_size(btnCancel, 100, 50); // Set its size - lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); - lv_btn_use_button_style(btnCancel); + btnCancel = lv_button_btn_create(scr, BTN_CANCEL_X, BTN_CANCEL_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); // Add a label to the button - if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); } @@ -423,105 +305,103 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } } - if (uiCfg.dialogType == DIALOG_TYPE_PRINT_FILE) { + if (DIALOG_IS(TYPE_PRINT_FILE)) { lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); lv_obj_t *labelFile = lv_label_create(scr, list_file.long_name[sel_id]); - lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); + lv_obj_align(labelFile, nullptr, LV_ALIGN_CENTER, 0, -60); } - else if (uiCfg.dialogType == DIALOG_TYPE_STOP) { + else if (DIALOG_IS(TYPE_STOP)) { lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT) { + else if (DIALOG_IS(TYPE_FINISH_PRINT)) { lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PAUSING) { + else if (DIALOG_IS(PAUSE_MESSAGE_PAUSING)) { lv_label_set_text(labelDialog, pause_msg_menu.pausing); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_CHANGING) { + else if (DIALOG_IS(PAUSE_MESSAGE_CHANGING)) { lv_label_set_text(labelDialog, pause_msg_menu.changing); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) { + else if (DIALOG_IS(PAUSE_MESSAGE_UNLOAD)) { lv_label_set_text(labelDialog, pause_msg_menu.unload); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING) { + else if (DIALOG_IS(PAUSE_MESSAGE_WAITING)) { lv_label_set_text(labelDialog, pause_msg_menu.waiting); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT) { + else if (DIALOG_IS(PAUSE_MESSAGE_INSERT)) { lv_label_set_text(labelDialog, pause_msg_menu.insert); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_LOAD) { + else if (DIALOG_IS(PAUSE_MESSAGE_LOAD)) { lv_label_set_text(labelDialog, pause_msg_menu.load); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PURGE) { + else if (DIALOG_IS(PAUSE_MESSAGE_PURGE)) { lv_label_set_text(labelDialog, pause_msg_menu.purge); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { + else if (DIALOG_IS(PAUSE_MESSAGE_RESUME)) { lv_label_set_text(labelDialog, pause_msg_menu.resume); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT) { + else if (DIALOG_IS(PAUSE_MESSAGE_HEAT)) { lv_label_set_text(labelDialog, pause_msg_menu.heat); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEATING) { + else if (DIALOG_IS(PAUSE_MESSAGE_HEATING)) { lv_label_set_text(labelDialog, pause_msg_menu.heating); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { + else if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { lv_label_set_text(labelDialog, pause_msg_menu.option); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_STORE_EEPROM_TIPS) { + else if (DIALOG_IS(STORE_EEPROM_TIPS)) { lv_label_set_text(labelDialog, eeprom_menu.storeTips); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_READ_EEPROM_TIPS) { + else if (DIALOG_IS(READ_EEPROM_TIPS)) { lv_label_set_text(labelDialog, eeprom_menu.readTips); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_REVERT_EEPROM_TIPS) { + else if (DIALOG_IS(REVERT_EEPROM_TIPS)) { lv_label_set_text(labelDialog, eeprom_menu.revertTips); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_WIFI_CONFIG_TIPS) { + else if (DIALOG_IS(WIFI_CONFIG_TIPS)) { lv_label_set_text(labelDialog, machine_menu.wifiConfigTips); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == WIFI_ENABLE_TIPS) { + else if (DIALOG_IS(WIFI_ENABLE_TIPS)) { lv_label_set_text(labelDialog, print_file_dialog_menu.wifi_enable_tips); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TRANSFER_NO_DEVICE) { + else if (DIALOG_IS(TRANSFER_NO_DEVICE)) { lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } #if ENABLED(USE_WIFI_FUNCTION) - else if (uiCfg.dialogType == DIALOG_TYPE_UPLOAD_FILE) { + else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { if (upload_result == 1) { lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } else if (upload_result == 2) { lv_label_set_text(labelDialog, DIALOG_UPLOAD_ERROR_EN); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } else if (upload_result == 3) { char buf[200]; int _index = 0; - ZERO(buf); - strcpy(buf, DIALOG_UPLOAD_FINISH_EN); _index = strlen(buf); buf[_index] = '\n'; @@ -546,41 +426,41 @@ void lv_draw_dialog(uint8_t type) { sprintf(&buf[_index], " %d KBytes/s\n", (int)(upload_size / upload_time / 1024)); lv_label_set_text(labelDialog, buf); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } } - #endif //USE_WIFI_FUNCTION - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) { + #endif // USE_WIFI_FUNCTION + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) { + else if (DIALOG_IS(TYPE_FILAMENT_HEAT_LOAD_COMPLETED)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat_confirm); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT) { + else if (DIALOG_IS(TYPE_FILAMENT_UNLOAD_HEAT)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) { + else if (DIALOG_IS(TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat_confirm); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED) { + else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_completed); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED) { + else if (DIALOG_IS(TYPE_FILAMENT_UNLOAD_COMPLETED)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_completed); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING) { + else if (DIALOG_IS(TYPE_FILAMENT_LOADING)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_loading); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70); } - else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING) { + else if (DIALOG_IS(TYPE_FILAMENT_UNLOADING)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_unloading); - lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70); + lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70); } #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { @@ -592,28 +472,19 @@ void lv_draw_dialog(uint8_t type) { void filament_sprayer_temp() { char buf[20] = {0}; + sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - public_buf_l[0] = '\0'; - - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, preheat_menu.ext1); - else - strcat(public_buf_l, preheat_menu.ext2); - sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); - + strcpy(public_buf_l, uiCfg.curSprayerChoose < 1 ? extrude_menu.ext1 : extrude_menu.ext2); strcat_P(public_buf_l, PSTR(": ")); strcat(public_buf_l, buf); lv_label_set_text(tempText1, public_buf_l); - lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); + lv_obj_align(tempText1, nullptr, LV_ALIGN_CENTER, 0, -50); } void filament_dialog_handle() { - if ((temperature_change_frequency == 1) - && ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) - || (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT)) - ) { + if (temps_update_flag && (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT))) { filament_sprayer_temp(); - temperature_change_frequency = 0; + temps_update_flag = false; } if (uiCfg.filament_heat_completed_load == 1) { uiCfg.filament_heat_completed_load = 0; @@ -667,9 +538,8 @@ void filament_dialog_handle() { lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED); } - if ( uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING - || uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING - ) lv_filament_setbar(); + if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) + lv_filament_setbar(); } void lv_filament_setbar() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h index dc5adc5ad64c..c6f42d90b3b1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -25,52 +25,55 @@ extern "C" { /* C-declarations for C++ */ #endif -#define DIALOG_TYPE_STOP 0 -#define DIALOG_TYPE_PRINT_FILE 1 -#define DIALOG_TYPE_REPRINT_NO_FILE 2 +enum { + DIALOG_TYPE_STOP = 0, + DIALOG_TYPE_PRINT_FILE, + DIALOG_TYPE_REPRINT_NO_FILE, -#define DIALOG_TYPE_M80_FAIL 3 //** -#define DIALOG_TYPE_MESSAGE_ERR1 4 //** + DIALOG_TYPE_M80_FAIL, + DIALOG_TYPE_MESSAGE_ERR1, -#define DIALOG_TYPE_UPDATE_ESP_FIRMARE 5 -#define DIALOG_TYPE_UPDATE_ESP_DATA 6 -#define DIALOG_TYPE_UPLOAD_FILE 7 -#define DIALOG_TYPE_UNBIND 8 + DIALOG_TYPE_UPDATE_ESP_FIRMARE, + DIALOG_TYPE_UPDATE_ESP_DATA, + DIALOG_TYPE_UPLOAD_FILE, + DIALOG_TYPE_UNBIND, -#define DIALOG_TYPE_FILAMENT_LOAD_HEAT 9 -#define DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED 10 -#define DIALOG_TYPE_FILAMENT_LOADING 11 -#define DIALOG_TYPE_FILAMENT_LOAD_COMPLETED 12 -#define DIALOG_TYPE_FILAMENT_UNLOAD_HEAT 13 -#define DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED 14 -#define DIALOG_TYPE_FILAMENT_UNLOADING 15 -#define DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED 16 + DIALOG_TYPE_FILAMENT_LOAD_HEAT, + DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED, + DIALOG_TYPE_FILAMENT_LOADING, + DIALOG_TYPE_FILAMENT_LOAD_COMPLETED, + DIALOG_TYPE_FILAMENT_UNLOAD_HEAT, + DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED, + DIALOG_TYPE_FILAMENT_UNLOADING, + DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED, -#define DIALOG_TYPE_FILE_LOADING 17 //** + DIALOG_TYPE_FILE_LOADING, -#define DIALOG_TYPE_FILAMENT_NO_PRESS 18 -#define DIALOG_TYPE_FINISH_PRINT 19 + DIALOG_TYPE_FILAMENT_NO_PRESS, + DIALOG_TYPE_FINISH_PRINT, -#define WIFI_ENABLE_TIPS 20 + DIALOG_WIFI_ENABLE_TIPS, -#define DIALOG_PAUSE_MESSAGE_PAUSING 21 -#define DIALOG_PAUSE_MESSAGE_CHANGING 22 -#define DIALOG_PAUSE_MESSAGE_UNLOAD 23 -#define DIALOG_PAUSE_MESSAGE_WAITING 24 -#define DIALOG_PAUSE_MESSAGE_INSERT 25 -#define DIALOG_PAUSE_MESSAGE_LOAD 26 -#define DIALOG_PAUSE_MESSAGE_PURGE 27 -#define DIALOG_PAUSE_MESSAGE_RESUME 28 -#define DIALOG_PAUSE_MESSAGE_HEAT 29 -#define DIALOG_PAUSE_MESSAGE_HEATING 30 -#define DIALOG_PAUSE_MESSAGE_OPTION 31 + DIALOG_PAUSE_MESSAGE_PAUSING, + DIALOG_PAUSE_MESSAGE_CHANGING, + DIALOG_PAUSE_MESSAGE_UNLOAD, + DIALOG_PAUSE_MESSAGE_WAITING, + DIALOG_PAUSE_MESSAGE_INSERT, + DIALOG_PAUSE_MESSAGE_LOAD, + DIALOG_PAUSE_MESSAGE_PURGE, + DIALOG_PAUSE_MESSAGE_RESUME, + DIALOG_PAUSE_MESSAGE_HEAT, + DIALOG_PAUSE_MESSAGE_HEATING, + DIALOG_PAUSE_MESSAGE_OPTION, -#define DIALOG_STORE_EEPROM_TIPS 32 -#define DIALOG_READ_EEPROM_TIPS 33 -#define DIALOG_REVERT_EEPROM_TIPS 34 + DIALOG_STORE_EEPROM_TIPS, + DIALOG_READ_EEPROM_TIPS, + DIALOG_REVERT_EEPROM_TIPS, + + DIALOG_WIFI_CONFIG_TIPS, + DIALOG_TRANSFER_NO_DEVICE +}; -#define DIALOG_WIFI_CONFIG_TIPS 35 -#define DIALOG_TRANSFER_NO_DEVICE 36 #define BTN_OK_X 100 #define BTN_OK_Y 180 #define BTN_CANCEL_X 280 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp index 59e04e74028d..5e5c6b490793 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp @@ -28,163 +28,58 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_EEPROM_RETURN 1 -#define ID_EEPROM_STORE 2 -#define ID_EEPROM_STORE_ARROW 3 -#define ID_EEPROM_READ 4 -#define ID_EEPROM_READ_ARROW 5 -#define ID_EEPROM_REVERT 6 -#define ID_EEPROM_REVERT_ARROW 7 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_EEPROM_RETURN = 1, + ID_EEPROM_STORE, + ID_EEPROM_STORE_ARROW, + ID_EEPROM_READ, + ID_EEPROM_READ_ARROW, + ID_EEPROM_REVERT, + ID_EEPROM_REVERT_ARROW +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_EEPROM_RETURN: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - draw_return_ui(); - } + lv_clear_eeprom_settings(); + draw_return_ui(); break; case ID_EEPROM_STORE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_STORE_EEPROM_TIPS); - } - break; - case ID_EEPROM_STORE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_STORE_EEPROM_TIPS); - } + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_STORE_EEPROM_TIPS); break; #if 0 case ID_EEPROM_READ: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_READ_EEPROM_TIPS); - } - break; - case ID_EEPROM_READ_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_READ_EEPROM_TIPS); - } + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_READ_EEPROM_TIPS); break; #endif - case ID_EEPROM_REVERT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_REVERT_EEPROM_TIPS); - } - break; - case ID_EEPROM_REVERT_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_eeprom_settings(); - lv_draw_dialog(DIALOG_REVERT_EEPROM_TIPS); - } + lv_clear_eeprom_settings(); + lv_draw_dialog(DIALOG_REVERT_EEPROM_TIPS); break; } } void lv_draw_eeprom_settings(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonStore, *labelStore; - //lv_obj_t *buttonRead,*labelRead,*buttonReadNarrow; - lv_obj_t *buttonRevert, *labelRevert; - lv_obj_t * line1, * line2; //* line3; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EEPROM_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = EEPROM_SETTINGS_UI; } disp_state = EEPROM_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); - buttonRevert = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonRevert, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonRevert, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonRevert, event_handler, ID_EEPROM_REVERT, NULL, 0); - lv_btn_use_label_style(buttonRevert); - lv_btn_set_layout(buttonRevert, LV_LAYOUT_OFF); - labelRevert = lv_label_create_empty(buttonRevert); /*Add a label to the button*/ - - (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_EEPROM_REVERT_ARROW); - - //line3 = lv_line_create(scr, NULL); - //lv_ex_line(line3,line_points[2]); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonStore = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonStore, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ - lv_obj_set_size(buttonStore, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonStore, event_handler, ID_EEPROM_STORE, NULL, 0); - lv_btn_use_label_style(buttonStore); - lv_btn_set_layout(buttonStore, LV_LAYOUT_OFF); - labelStore = lv_label_create_empty(buttonStore); /*Add a label to the button*/ - - (void)lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_EEPROM_STORE_ARROW); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelStore, eeprom_menu.store); - lv_obj_align(labelStore, buttonStore, LV_ALIGN_IN_LEFT_MID,0, 0); - - //lv_label_set_text(labelRead, eeprom_menu.read); - //lv_obj_align(labelRead, buttonRead, LV_ALIGN_IN_LEFT_MID,0, 0); - - lv_label_set_text(labelRevert, eeprom_menu.revert); - lv_obj_align(labelRevert, buttonRevert, LV_ALIGN_IN_LEFT_MID, 0, 0); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonRevert); - lv_group_add_obj(g, buttonStore); - lv_group_add_obj(g, buttonBack); - } - #endif - + lv_screen_menu_item(scr, eeprom_menu.revert, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_EEPROM_REVERT, 0); + lv_screen_menu_item(scr, eeprom_menu.store, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_EEPROM_STORE, 1); + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN, true); } void lv_clear_eeprom_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp index 096e72878a0e..35bbc6f061f9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp @@ -30,84 +30,44 @@ #if BUTTONS_EXIST(EN1, EN2) -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t * buttonEncoderState = NULL; -static lv_obj_t *labelEncoderState = NULL; +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *buttonEncoderState = nullptr; -#define ID_ENCODER_RETURN 1 -#define ID_ENCODER_STATE 2 +enum { + ID_ENCODER_RETURN = 1, + ID_ENCODER_STATE +}; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_ENCODER_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_encoder_settings(); - draw_return_ui(); - } + lv_clear_encoder_settings(); + draw_return_ui(); break; case ID_ENCODER_STATE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - gCfgItems.encoder_enable ^= true; - lv_imgbtn_set_src_both(buttonEncoderState, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); - lv_label_set_text(labelEncoderState, machine_menu.enable); - update_spi_flash(); - } + gCfgItems.encoder_enable ^= true; + lv_screen_menu_item_onoff_update(buttonEncoderState, gCfgItems.encoder_enable); + update_spi_flash(); break; } } void lv_draw_encoder_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *labelEncoderTips = NULL; - - lv_obj_t * line1 = NULL; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ENCODER_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ENCODER_SETTINGS_UI; } disp_state = ENCODER_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.EncoderConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - labelEncoderTips = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.EncoderConfText); + buttonEncoderState = lv_screen_menu_item_onoff(scr, machine_menu.EncoderConfText, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ENCODER_STATE, 0, gCfgItems.encoder_enable); - buttonEncoderState = lv_imgbtn_create(scr, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_ENCODER_STATE); - labelEncoderState = lv_label_create_empty(buttonEncoderState); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - lv_label_set_text(labelEncoderState, gCfgItems.encoder_enable ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonEncoderState); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN, true); } void lv_clear_encoder_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index 435b91e1d818..e82229c90949 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -36,35 +36,31 @@ #include "mks_hardware_test.h" #include "../../../../inc/MarlinConfig.h" -static lv_obj_t * scr; +static lv_obj_t *scr; void lv_draw_error_message(PGM_P const msg) { #if 0 - static lv_obj_t * message = NULL, *kill_message = NULL, *reset_tips = NULL; + static lv_obj_t *message = nullptr, *kill_message = nullptr, *reset_tips = nullptr; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; } disp_state = ERROR_MESSAGE_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); lv_refr_now(lv_refr_get_disp_refreshing()); if (msg) { message = lv_label_create(scr, msg); - lv_obj_align(message, NULL, LV_ALIGN_CENTER, 0, -50); + lv_obj_align(message, nullptr, LV_ALIGN_CENTER, 0, -50); } kill_message = lv_label_create(scr, "PRINTER HALTED"); - lv_obj_align(kill_message, NULL, LV_ALIGN_CENTER, 0, -10); + lv_obj_align(kill_message, nullptr, LV_ALIGN_CENTER, 0, -10); reset_tips = lv_label_create(scr, "Please Reset"); - lv_obj_align(reset_tips, NULL, LV_ALIGN_CENTER, 0, 30); + lv_obj_align(reset_tips, nullptr, LV_ALIGN_CENTER, 0, 30); lv_task_handler(); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 6402040898bd..9f803afea932 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -43,172 +43,121 @@ static lv_obj_t *labelSpeed; static lv_obj_t *tempText; static lv_obj_t *ExtruText; -#define ID_E_ADD 1 -#define ID_E_DEC 2 -#define ID_E_TYPE 3 -#define ID_E_STEP 4 -#define ID_E_SPEED 5 -#define ID_E_RETURN 6 - -static int32_t extructAmount; - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +enum { + ID_E_ADD = 1, + ID_E_DEC, + ID_E_TYPE, + ID_E_STEP, + ID_E_SPEED, + ID_E_RETURN +}; + +static int32_t extrudeAmount; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_E_ADD: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { - queue.enqueue_now_P(PSTR("G91")); - ZERO(public_buf_l); - sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - extructAmount += uiCfg.extruStep; - disp_extru_amount(); - } + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + extrudeAmount += uiCfg.extruStep; + disp_extru_amount(); } break; case ID_E_DEC: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { - queue.enqueue_now_P(PSTR("G91")); - ZERO(public_buf_l); - sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - extructAmount -= uiCfg.extruStep; - disp_extru_amount(); - } + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= EXTRUDE_MINTEMP) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P((char *)public_buf_l, PSTR("G1 E%d F%d"), 0 - uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); + extrudeAmount -= uiCfg.extruStep; + disp_extru_amount(); } break; case ID_E_TYPE: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (ENABLED(HAS_MULTI_EXTRUDER)) { - if (uiCfg.curSprayerChoose == 0) { - uiCfg.curSprayerChoose = 1; - queue.inject_P(PSTR("T1")); - } - else { - uiCfg.curSprayerChoose = 0; - queue.inject_P(PSTR("T0")); - } + if (ENABLED(HAS_MULTI_EXTRUDER)) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; + queue.inject_P(PSTR("T1")); } - else + else { uiCfg.curSprayerChoose = 0; - - extructAmount = 0; - disp_hotend_temp(); - disp_ext_type(); - disp_extru_amount(); + queue.inject_P(PSTR("T0")); + } } + else + uiCfg.curSprayerChoose = 0; + + extrudeAmount = 0; + disp_hotend_temp(); + disp_ext_type(); + disp_extru_amount(); break; case ID_E_STEP: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - switch (abs(uiCfg.extruStep)) { - case 1: uiCfg.extruStep = 5; break; - case 5: uiCfg.extruStep = 10; break; - case 10: uiCfg.extruStep = 1; break; - default: break; - } - disp_ext_step(); + switch (abs(uiCfg.extruStep)) { + case 1: uiCfg.extruStep = 5; break; + case 5: uiCfg.extruStep = 10; break; + case 10: uiCfg.extruStep = 1; break; + default: break; } + disp_ext_step(); break; case ID_E_SPEED: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - switch (uiCfg.extruSpeed) { - case 1: uiCfg.extruSpeed = 10; break; - case 10: uiCfg.extruSpeed = 20; break; - case 20: uiCfg.extruSpeed = 1; break; - default: break; - } - disp_ext_speed(); + switch (uiCfg.extruSpeed) { + case 1: uiCfg.extruSpeed = 10; break; + case 10: uiCfg.extruSpeed = 20; break; + case 20: uiCfg.extruSpeed = 1; break; + default: break; } + disp_ext_speed(); break; case ID_E_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_extrusion(void) { - lv_obj_t *buttonAdd, *buttonDec, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; } disp_state = EXTRUSION_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonAdd = lv_imgbtn_create(scr, "F:/bmp_in.bin", INTERVAL_V, titleHeight, event_handler, ID_E_ADD); + lv_obj_t *buttonAdd = lv_big_button_create(scr, "F:/bmp_in.bin", extrude_menu.in, INTERVAL_V, titleHeight, event_handler, ID_E_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); + lv_big_button_create(scr, "F:/bmp_out.bin", extrude_menu.out, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_E_DEC); - buttonDec = lv_imgbtn_create(scr, "F:/bmp_out.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_E_DEC); - buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_TYPE); - buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_STEP); - buttonSpeed = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_SPEED); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); - lv_obj_t *labelDec = lv_label_create_empty(buttonDec); - labelType = lv_label_create_empty(buttonType); - labelStep = lv_label_create_empty(buttonStep); - labelSpeed = lv_label_create_empty(buttonSpeed); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelAdd, extrude_menu.in); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, extrude_menu.out); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } + buttonType = lv_imgbtn_create(scr, nullptr, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_TYPE); + buttonStep = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_STEP); + buttonSpeed = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_SPEED); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonAdd); - lv_group_add_obj(g, buttonDec); lv_group_add_obj(g, buttonType); lv_group_add_obj(g, buttonStep); lv_group_add_obj(g, buttonSpeed); - lv_group_add_obj(g, buttonBack); } #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_E_RETURN); + + // Create labels on the image buttons + labelType = lv_label_create_empty(buttonType); + labelStep = lv_label_create_empty(buttonStep); + labelSpeed = lv_label_create_empty(buttonSpeed); + disp_ext_type(); disp_ext_step(); disp_ext_speed(); @@ -265,12 +214,11 @@ void disp_ext_speed() { void disp_hotend_temp() { char buf[20] = {0}; - public_buf_l[0] = '\0'; - strcat(public_buf_l, extrude_menu.temper_text); sprintf(buf, extrude_menu.temp_value, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); + strcpy(public_buf_l, extrude_menu.temper_text); strcat(public_buf_l, buf); lv_label_set_text(tempText, public_buf_l); - lv_obj_align(tempText, NULL, LV_ALIGN_CENTER, 0, -50); + lv_obj_align(tempText, nullptr, LV_ALIGN_CENTER, 0, -50); } void disp_extru_amount() { @@ -278,33 +226,17 @@ void disp_extru_amount() { public_buf_l[0] = '\0'; - if (extructAmount < 999 && extructAmount > -99) { - sprintf(buf1, extrude_menu.count_value_mm, extructAmount); - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, extrude_menu.ext1); - else - strcat(public_buf_l, extrude_menu.ext2); - strcat(public_buf_l, buf1); - } - else if (extructAmount < 9999 && extructAmount > -999) { - sprintf(buf1, extrude_menu.count_value_cm, extructAmount / 10); - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, extrude_menu.ext1); - else - strcat(public_buf_l, extrude_menu.ext2); - strcat(public_buf_l, buf1); - } - else { - sprintf(buf1, extrude_menu.count_value_m, extructAmount / 1000); - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, extrude_menu.ext1); - else - strcat(public_buf_l, extrude_menu.ext2); - strcat(public_buf_l, buf1); - } + if (extrudeAmount < 999 && extrudeAmount > -99) + sprintf(buf1, extrude_menu.count_value_mm, extrudeAmount); + else if (extrudeAmount < 9999 && extrudeAmount > -999) + sprintf(buf1, extrude_menu.count_value_cm, extrudeAmount / 10); + else + sprintf(buf1, extrude_menu.count_value_m, extrudeAmount / 1000); + strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? extrude_menu.ext1 : extrude_menu.ext2); + strcat(public_buf_l, buf1); lv_label_set_text(ExtruText, public_buf_l); - lv_obj_align(ExtruText, NULL, LV_ALIGN_CENTER, 0, -75); + lv_obj_align(ExtruText, nullptr, LV_ALIGN_CENTER, 0, -75); } void disp_ext_step() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 6024d58203a3..5306ab3a899e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -35,87 +35,56 @@ #include "../../../../gcode/gcode.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t * fanText; - -#define ID_F_ADD 1 -#define ID_F_DEC 2 -#define ID_F_HIGH 3 -#define ID_F_MID 4 -#define ID_F_OFF 5 -#define ID_F_RETURN 6 +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *fanText; + +enum { + ID_F_ADD = 1, + ID_F_DEC, + ID_F_HIGH, + ID_F_MID, + ID_F_OFF, + ID_F_RETURN +}; static uint8_t fanSpeed; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_F_ADD: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (fanSpeed + 1 <= 255) { - fanSpeed++; - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed + 1 <= 255) { + fanSpeed++; + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); } break; case ID_F_DEC: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (fanSpeed > 0) { - fanSpeed--; - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed > 0) { + fanSpeed--; + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); } - break; case ID_F_HIGH: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - gcode.process_subcommands_now_P(PSTR("M106 S255")); - } + gcode.process_subcommands_now_P(PSTR("M106 S255")); break; case ID_F_MID: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - gcode.process_subcommands_now_P(PSTR("M106 S127")); - } + gcode.process_subcommands_now_P(PSTR("M106 S127")); break; case ID_F_OFF: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - gcode.process_subcommands_now_P(PSTR("M107")); - } + gcode.process_subcommands_now_P(PSTR("M107")); break; case ID_F_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_fan(void) { - lv_obj_t *buttonAdd, *buttonDec, *buttonHigh, *buttonMid; - lv_obj_t *buttonOff, *buttonBack; + lv_obj_t *buttonAdd; #if HAS_FAN fanSpeed = thermalManager.fan_speed[0]; @@ -126,63 +95,20 @@ void lv_draw_fan(void) { } disp_state = FAN_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_F_ADD); + buttonAdd = lv_big_button_create(scr, "F:/bmp_Add.bin", fan_menu.add, INTERVAL_V, titleHeight, event_handler, ID_F_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - - buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_F_DEC); - buttonHigh = lv_imgbtn_create(scr, "F:/bmp_speed255.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_HIGH); - buttonMid = lv_imgbtn_create(scr, "F:/bmp_speed127.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_MID); - buttonOff = lv_imgbtn_create(scr, "F:/bmp_speed0.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_OFF); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); - lv_obj_t *labelDec = lv_label_create_empty(buttonDec); - lv_obj_t *labelHigh = lv_label_create_empty(buttonHigh); - lv_obj_t *labelMid = lv_label_create_empty(buttonMid); - lv_obj_t *labelOff = lv_label_create_empty(buttonOff); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelAdd, fan_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, fan_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHigh, fan_menu.full); - lv_obj_align(labelHigh, buttonHigh, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelMid, fan_menu.half); - lv_obj_align(labelMid, buttonMid, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOff, fan_menu.off); - lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonAdd); - lv_group_add_obj(g, buttonDec); - lv_group_add_obj(g, buttonHigh); - lv_group_add_obj(g, buttonMid); - lv_group_add_obj(g, buttonOff); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_Dec.bin", fan_menu.dec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_F_DEC); + lv_big_button_create(scr, "F:/bmp_speed255.bin", fan_menu.full, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_HIGH); + lv_big_button_create(scr, "F:/bmp_speed127.bin", fan_menu.half, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_MID); + lv_big_button_create(scr, "F:/bmp_speed0.bin", fan_menu.off, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_OFF); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_F_RETURN); fanText = lv_label_create_empty(scr); lv_obj_set_style(fanText, &tft_style_label_rel); @@ -197,7 +123,7 @@ void disp_fan_value() { sprintf_P(buf1, PSTR("%3d"), thermalManager.fan_speed[0]); strcat(public_buf_l, buf1); lv_label_set_text(fanText, public_buf_l); - lv_obj_align(fanText, NULL, LV_ALIGN_CENTER, 0, -65); + lv_obj_align(fanText, nullptr, LV_ALIGN_CENTER, 0, -65); } void lv_clear_fan() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index be6defda187c..a3f18cf9cbd3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -38,150 +38,109 @@ static lv_obj_t *buttonType; static lv_obj_t *labelType; static lv_obj_t *tempText1; -#define ID_FILAMNT_IN 1 -#define ID_FILAMNT_OUT 2 -#define ID_FILAMNT_TYPE 3 -#define ID_FILAMNT_RETURN 4 +enum { + ID_FILAMNT_IN = 1, + ID_FILAMNT_OUT, + ID_FILAMNT_TYPE, + ID_FILAMNT_RETURN +}; extern feedRate_t feedrate_mm_s; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_FILAMNT_IN: - if (event == LV_EVENT_CLICKED) { - // nothing to do + uiCfg.filament_load_heat_flg = 1; + if ((abs(thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius) <= 1) + || (gCfgItems.filament_limit_temper <= thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) { + lv_clear_filament_change(); + lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED); } - else if (event == LV_EVENT_RELEASED) { - uiCfg.filament_load_heat_flg = 1; - if ((abs(thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius) <= 1) - || (gCfgItems.filament_limit_temper <= thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) { - lv_clear_filament_change(); - lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED); - } - else { - lv_clear_filament_change(); - lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOAD_HEAT); - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } + else { + lv_clear_filament_change(); + lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOAD_HEAT); + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } } break; case ID_FILAMNT_OUT: - if (event == LV_EVENT_CLICKED) { - // nothing to do + uiCfg.filament_unload_heat_flg=1; + if ((thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > 0) + && ((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) <= 1) + || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= gCfgItems.filament_limit_temper)) + ) { + lv_clear_filament_change(); + lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED); } - else if (event == LV_EVENT_RELEASED) { - uiCfg.filament_unload_heat_flg=1; - if ((thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > 0) - && ((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target - thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius)) <= 1) - || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius >= gCfgItems.filament_limit_temper)) - ) { - lv_clear_filament_change(); - lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED); - } - else { - lv_clear_filament_change(); - lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_HEAT); - if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); - } - filament_sprayer_temp(); + else { + lv_clear_filament_change(); + lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_HEAT); + if (thermalManager.temp_hotend[uiCfg.curSprayerChoose].target < gCfgItems.filament_limit_temper) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = gCfgItems.filament_limit_temper; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } + filament_sprayer_temp(); } break; case ID_FILAMNT_TYPE: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - #if HAS_MULTI_EXTRUDER - if (uiCfg.curSprayerChoose == 0) - uiCfg.curSprayerChoose = 1; - else if (uiCfg.curSprayerChoose == 1) - uiCfg.curSprayerChoose = 0; - #endif - disp_filament_type(); - } + #if HAS_MULTI_EXTRUDER + if (uiCfg.curSprayerChoose == 0) + uiCfg.curSprayerChoose = 1; + else if (uiCfg.curSprayerChoose == 1) + uiCfg.curSprayerChoose = 0; + #endif + disp_filament_type(); break; case ID_FILAMNT_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - #if HAS_MULTI_EXTRUDER - if (uiCfg.print_state != IDLE && uiCfg.print_state != REPRINTED) - gcode.process_subcommands_now_P(uiCfg.curSprayerChoose_bak == 1 ? PSTR("T1") : PSTR("T0")); - #endif - feedrate_mm_s = (float)uiCfg.moveSpeed_bak; - if (uiCfg.print_state == PAUSED) - planner.set_e_position_mm((destination.e = current_position.e = uiCfg.current_e_position_bak)); - //current_position.e = destination.e = uiCfg.current_e_position_bak; - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; - - clear_cur_ui(); - draw_return_ui(); - } + #if HAS_MULTI_EXTRUDER + if (uiCfg.print_state != IDLE && uiCfg.print_state != REPRINTED) + gcode.process_subcommands_now_P(uiCfg.curSprayerChoose_bak == 1 ? PSTR("T1") : PSTR("T0")); + #endif + feedrate_mm_s = (float)uiCfg.moveSpeed_bak; + if (uiCfg.print_state == PAUSED) + planner.set_e_position_mm((destination.e = current_position.e = uiCfg.current_e_position_bak)); + //current_position.e = destination.e = uiCfg.current_e_position_bak; + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; + + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_filament_change(void) { - lv_obj_t *buttonIn, *buttonOut; - lv_obj_t *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FILAMENTCHANGE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = FILAMENTCHANGE_UI; } disp_state = FILAMENTCHANGE_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonIn = lv_imgbtn_create(scr, "F:/bmp_in.bin", INTERVAL_V, titleHeight, event_handler, ID_FILAMNT_IN); + lv_obj_t *buttonIn = lv_big_button_create(scr, "F:/bmp_in.bin", filament_menu.in, INTERVAL_V, titleHeight, event_handler, ID_FILAMNT_IN); lv_obj_clear_protect(buttonIn, LV_PROTECT_FOLLOW); + lv_big_button_create(scr, "F:/bmp_out.bin", filament_menu.out, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_FILAMNT_OUT); - buttonOut = lv_imgbtn_create(scr, "F:/bmp_out.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_FILAMNT_OUT); - buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_TYPE); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelIn = lv_label_create_empty(buttonIn); - lv_obj_t *labelOut = lv_label_create_empty(buttonOut); - labelType = lv_label_create_empty(buttonType); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelIn, filament_menu.in); - lv_obj_align(labelIn, buttonIn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOut, filament_menu.out); - lv_obj_align(labelOut, buttonOut, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - + buttonType = lv_imgbtn_create(scr, nullptr, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_TYPE); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonIn); - lv_group_add_obj(g, buttonOut); lv_group_add_obj(g, buttonType); - lv_group_add_obj(g, buttonBack); } #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FILAMNT_RETURN); + + // Create labels on the image buttons + labelType = lv_label_create_empty(buttonType); + disp_filament_type(); tempText1 = lv_label_create_empty(scr); @@ -211,16 +170,13 @@ void disp_filament_temp() { public_buf_l[0] = '\0'; - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, preheat_menu.ext1); - else - strcat(public_buf_l, preheat_menu.ext2); + strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? preheat_menu.ext1 : preheat_menu.ext2); sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); strcat_P(public_buf_l, PSTR(": ")); strcat(public_buf_l, buf); lv_label_set_text(tempText1, public_buf_l); - lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); + lv_obj_align(tempText1, nullptr, LV_ALIGN_CENTER, 0, -50); } void lv_clear_filament_change() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp index 2a096eafac3b..ecaeefee569c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp @@ -28,233 +28,102 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_FILAMENT_SET_RETURN 1 -#define ID_FILAMENT_SET_IN_LENGTH 2 -#define ID_FILAMENT_SET_IN_SPEED 3 -#define ID_FILAMENT_SET_OUT_LENGTH 4 -#define ID_FILAMENT_SET_OUT_SPEED 5 -#define ID_FILAMENT_SET_TEMP 6 -#define ID_FILAMENT_SET_DOWN 12 -#define ID_FILAMENT_SET_UP 13 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_FILAMENT_SET_RETURN = 1, + ID_FILAMENT_SET_IN_LENGTH, + ID_FILAMENT_SET_IN_SPEED, + ID_FILAMENT_SET_OUT_LENGTH, + ID_FILAMENT_SET_OUT_SPEED, + ID_FILAMENT_SET_TEMP, + ID_FILAMENT_SET_DOWN, + ID_FILAMENT_SET_UP +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_FILAMENT_SET_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_filament_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_filament_settings(); + draw_return_ui(); break; case ID_FILAMENT_SET_IN_LENGTH: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = load_length; - lv_clear_filament_settings(); - lv_draw_number_key(); - } + value = load_length; + lv_clear_filament_settings(); + lv_draw_number_key(); break; case ID_FILAMENT_SET_IN_SPEED: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = load_speed; - lv_clear_filament_settings(); - lv_draw_number_key(); - } + value = load_speed; + lv_clear_filament_settings(); + lv_draw_number_key(); break; case ID_FILAMENT_SET_OUT_LENGTH: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = unload_length; - lv_clear_filament_settings(); - lv_draw_number_key(); - } + value = unload_length; + lv_clear_filament_settings(); + lv_draw_number_key(); break; case ID_FILAMENT_SET_OUT_SPEED: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = unload_speed; - lv_clear_filament_settings(); - lv_draw_number_key(); - } + value = unload_speed; + lv_clear_filament_settings(); + lv_draw_number_key(); break; case ID_FILAMENT_SET_TEMP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = filament_temp; - lv_clear_filament_settings(); - lv_draw_number_key(); - } + value = filament_temp; + lv_clear_filament_settings(); + lv_draw_number_key(); break; case ID_FILAMENT_SET_UP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_filament_settings(); - lv_draw_filament_settings(); - } + uiCfg.para_ui_page = 0; + lv_clear_filament_settings(); + lv_draw_filament_settings(); break; case ID_FILAMENT_SET_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_filament_settings(); - lv_draw_filament_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_filament_settings(); + lv_draw_filament_settings(); break; } } void lv_draw_filament_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonInLengthValue = NULL, *labelInLengthValue = NULL; - lv_obj_t *buttonInSpeedValue = NULL, *labelInSpeedValue = NULL; - lv_obj_t *buttonOutLengthValue = NULL, *labelOutLengthValue = NULL; - lv_obj_t *buttonOutSpeedValue = NULL, *labelOutSpeedValue = NULL; - lv_obj_t *buttonTemperValue = NULL, *labelTemperValue = NULL; - lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FILAMENT_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = FILAMENT_SETTINGS_UI; } disp_state = FILAMENT_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.FilamentConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.InLength); - - buttonInLengthValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_IN_LENGTH); - labelInLengthValue = lv_label_create_empty(buttonInLengthValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.InSpeed); - - buttonInSpeedValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_IN_SPEED); - labelInSpeedValue = lv_label_create_empty(buttonInSpeedValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 6, machine_menu.OutLength); - - buttonOutLengthValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_OUT_LENGTH); - labelOutLengthValue = lv_label_create_empty(buttonOutLengthValue); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length); + lv_screen_menu_item_1_edit(scr, machine_menu.InLength, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FILAMENT_SET_IN_LENGTH, 0, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_speed); + lv_screen_menu_item_1_edit(scr, machine_menu.InSpeed, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SET_IN_SPEED, 1, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.OutSpeed); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_length); + lv_screen_menu_item_1_edit(scr, machine_menu.OutLength, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_FILAMENT_SET_OUT_LENGTH, 2, public_buf_l); - buttonOutSpeedValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_OUT_SPEED); - labelOutSpeedValue = lv_label_create_empty(buttonOutSpeedValue); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_speed); + lv_screen_menu_item_1_edit(scr, machine_menu.OutSpeed, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_FILAMENT_SET_OUT_SPEED, 3, public_buf_l); - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create_back(scr, event_handler, ID_FILAMENT_SET_DOWN); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonInLengthValue); - lv_group_add_obj(g, buttonInSpeedValue); - lv_group_add_obj(g, buttonOutLengthValue); - lv_group_add_obj(g, buttonOutSpeedValue); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FILAMENT_SET_DOWN, true); } else { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.FilamentTemperature); - - buttonTemperValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_TEMP); - labelTemperValue = lv_label_create_empty(buttonTemperValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_btn_create_back(scr, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_UP); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filament_limit_temper); + lv_screen_menu_item_1_edit(scr, machine_menu.FilamentTemperature, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FILAMENT_SET_TEMP, 0, public_buf_l); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonTemperValue); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FILAMENT_SET_UP, true); } - labelTurnPage = lv_label_create_empty(buttonTurnPage); - - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_FILAMENT_SET_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length); - lv_label_set_text(labelInLengthValue, public_buf_l); - lv_obj_align(labelInLengthValue, buttonInLengthValue, LV_ALIGN_CENTER, 0, 0); - - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_speed); - lv_label_set_text(labelInSpeedValue, public_buf_l); - lv_obj_align(labelInSpeedValue, buttonInSpeedValue, LV_ALIGN_CENTER, 0, 0); - - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_length); - lv_label_set_text(labelOutLengthValue, public_buf_l); - lv_obj_align(labelOutLengthValue, buttonOutLengthValue, LV_ALIGN_CENTER, 0, 0); - - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_unload_speed); - lv_label_set_text(labelOutSpeedValue, public_buf_l); - lv_obj_align(labelOutSpeedValue, buttonOutSpeedValue, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - } - else { - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filament_limit_temper); - lv_label_set_text(labelTemperValue, public_buf_l); - lv_obj_align(labelTemperValue, buttonTemperValue, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_FILAMENT_SET_RETURN, true); } void lv_clear_filament_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 4e22c134ac24..92510cbc8e5a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -35,149 +35,67 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_H_ALL 1 -#define ID_H_X 2 -#define ID_H_Y 3 -#define ID_H_Z 4 -#define ID_H_RETURN 5 -#define ID_H_OFF_ALL 6 -#define ID_H_OFF_XY 7 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_H_ALL = 1, + ID_H_X, + ID_H_Y, + ID_H_Z, + ID_H_RETURN, + ID_H_OFF_ALL, + ID_H_OFF_XY +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_H_ALL: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28")); - } + queue.inject_P(PSTR("G28")); break; case ID_H_X: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 X0")); - } + queue.inject_P(PSTR("G28 X0")); break; case ID_H_Y: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 Y0")); - } + queue.inject_P(PSTR("G28 Y0")); break; case ID_H_Z: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("G28 Z0")); - } + queue.inject_P(PSTR("G28 Z0")); break; case ID_H_OFF_ALL: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("M84")); - } + queue.inject_P(PSTR("M84")); break; case ID_H_OFF_XY: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - queue.inject_P(PSTR("M84 X Y")); - } + queue.inject_P(PSTR("M84 X Y")); break; case ID_H_RETURN: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_home(); - lv_draw_tool(); - } + lv_clear_home(); + lv_draw_tool(); break; } } void lv_draw_home(void) { - lv_obj_t *buttonHomeAll, *buttonHomeX, *buttonHomeY, *buttonHomeZ; - lv_obj_t *buttonBack; - lv_obj_t *buttonOffAll, *buttonOffXY; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; } disp_state = ZERO_UI; - scr = lv_obj_create(NULL, NULL); - - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create image buttons - //buttonWifi = lv_imgbtn_create(scr, NULL); - //buttonContinue = lv_imgbtn_create(scr, NULL); - buttonHomeAll = lv_imgbtn_create(scr, "F:/bmp_zeroAll.bin", INTERVAL_V, titleHeight, event_handler, ID_H_ALL); - buttonHomeX = lv_imgbtn_create(scr, "F:/bmp_zeroX.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_H_X); - buttonHomeY = lv_imgbtn_create(scr, "F:/bmp_zeroY.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_H_Y); - buttonHomeZ = lv_imgbtn_create(scr, "F:/bmp_zeroZ.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_H_Z); - buttonOffAll = lv_imgbtn_create(scr, "F:/bmp_function1.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_ALL); - buttonOffXY = lv_imgbtn_create(scr, "F:/bmp_function1.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_XY); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelHomeAll = lv_label_create_empty(buttonHomeAll); - lv_obj_t *labelHomeX = lv_label_create_empty(buttonHomeX); - lv_obj_t *labelHomeY = lv_label_create_empty(buttonHomeY); - lv_obj_t *labelHomeZ = lv_label_create_empty(buttonHomeZ); - lv_obj_t *labelOffAll = lv_label_create_empty(buttonOffAll); - lv_obj_t *labelOffXY = lv_label_create_empty(buttonOffXY); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelHomeAll, home_menu.home_all); - lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeX, home_menu.home_x); - lv_obj_align(labelHomeX, buttonHomeX, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeY, home_menu.home_y); - lv_obj_align(labelHomeY, buttonHomeY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelHomeZ, home_menu.home_z); - lv_obj_align(labelHomeZ, buttonHomeZ, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOffAll, set_menu.motoroff); - lv_obj_align(labelOffAll, buttonOffAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOffXY, set_menu.motoroffXY); - lv_obj_align(labelOffXY, buttonOffXY, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonHomeAll); - lv_group_add_obj(g, buttonHomeX); - lv_group_add_obj(g, buttonHomeY); - lv_group_add_obj(g, buttonHomeZ); - lv_group_add_obj(g, buttonOffAll); - lv_group_add_obj(g, buttonOffXY); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_zeroAll.bin", home_menu.home_all, INTERVAL_V, titleHeight, event_handler, ID_H_ALL); + lv_big_button_create(scr, "F:/bmp_zeroX.bin", home_menu.home_x, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_H_X); + lv_big_button_create(scr, "F:/bmp_zeroY.bin", home_menu.home_y, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_H_Y); + lv_big_button_create(scr, "F:/bmp_zeroZ.bin", home_menu.home_z, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_H_Z); + lv_big_button_create(scr, "F:/bmp_function1.bin", set_menu.motoroff, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_ALL); + lv_big_button_create(scr, "F:/bmp_function1.bin", set_menu.motoroffXY, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_OFF_XY); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_H_RETURN); } void lv_clear_home() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp index 67025f92c58c..e01208605fc8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp @@ -31,180 +31,75 @@ #include "../../../../module/stepper/indirection.h" #include "../../../../feature/tmc_util.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_SENSITIVITY_RETURN 1 -#define ID_SENSITIVITY_X 2 -#define ID_SENSITIVITY_Y 3 -#define ID_SENSITIVITY_Z 4 -#define ID_SENSITIVITY_Z2 5 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_SENSITIVITY_RETURN = 1, + ID_SENSITIVITY_X, + ID_SENSITIVITY_Y, + ID_SENSITIVITY_Z, + ID_SENSITIVITY_Z2 +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_SENSITIVITY_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_homing_sensitivity_settings(); - draw_return_ui(); - } + lv_clear_homing_sensitivity_settings(); + draw_return_ui(); break; case ID_SENSITIVITY_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = x_sensitivity; - lv_clear_homing_sensitivity_settings(); - lv_draw_number_key(); - } + value = x_sensitivity; + lv_clear_homing_sensitivity_settings(); + lv_draw_number_key(); break; case ID_SENSITIVITY_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = y_sensitivity; - lv_clear_homing_sensitivity_settings(); - lv_draw_number_key(); - } + value = y_sensitivity; + lv_clear_homing_sensitivity_settings(); + lv_draw_number_key(); break; case ID_SENSITIVITY_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = z_sensitivity; - lv_clear_homing_sensitivity_settings(); - lv_draw_number_key(); - } + value = z_sensitivity; + lv_clear_homing_sensitivity_settings(); + lv_draw_number_key(); break; #if Z2_SENSORLESS case ID_SENSITIVITY_Z2: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = z2_sensitivity; - lv_clear_homing_sensitivity_settings(); - lv_draw_number_key(); - } + value = z2_sensitivity; + lv_clear_homing_sensitivity_settings(); + lv_draw_number_key(); break; #endif } } void lv_draw_homing_sensitivity_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; - #if Z2_SENSORLESS - lv_obj_t *buttonZ2Value = NULL, *labelZ2Value = NULL; - lv_obj_t *line4 = NULL; - #endif if (disp_state_stack._disp_state[disp_state_stack._disp_index] != HOMING_SENSITIVITY_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = HOMING_SENSITIVITY_UI; } disp_state = HOMING_SENSITIVITY_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.HomingSensitivityConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Sensitivity); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_X); - labelXValue = lv_label_create_empty(buttonXValue); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonXValue); - #endif - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Sensitivity); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Y); - labelYValue = lv_label_create_empty(buttonYValue); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonYValue); - #endif - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Sensitivity); + sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.X_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_SENSITIVITY_X, 0, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Z); - labelZValue = lv_label_create_empty(buttonZValue); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) lv_group_add_obj(g, buttonZValue); - #endif + sprintf_P(public_buf_l, PSTR("%d"), TERN(Y_SENSORLESS, stepperY.homing_threshold(), 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.Y_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_SENSITIVITY_Y, 1, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); + sprintf_P(public_buf_l, PSTR("%d"), TERN(Z_SENSORLESS, stepperZ.homing_threshold(), 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.Z_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_SENSITIVITY_Z, 2, public_buf_l); #if Z2_SENSORLESS - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.Z2_Sensitivity); - - buttonZ2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_Z2); - labelZ2Value = lv_label_create_empty(buttonZ2Value); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZ2Value); - #endif - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); + sprintf_P(public_buf_l, PSTR("%d"), TERN(Z2_SENSORLESS, stepperZ2.homing_threshold(), 0)); + lv_screen_menu_item_1_edit(scr, machine_menu.Z2_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_SENSITIVITY_Z2, 3, public_buf_l); #endif - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_SENSITIVITY_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0)); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), TERN(Y_SENSORLESS, stepperY.homing_threshold(), 0)); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), TERN(Z_SENSORLESS, stepperZ.homing_threshold(), 0)); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - #if Z2_SENSORLESS - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), TERN(Z2_SENSORLESS, stepperZ2.homing_threshold(), 0)); - lv_label_set_text(labelZ2Value, public_buf_l); - lv_obj_align(labelZ2Value, buttonZ2Value, LV_ALIGN_CENTER, 0, 0); - #endif - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_SENSITIVITY_RETURN, true); } void lv_clear_homing_sensitivity_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp index 45d94020e261..5b8f7b45fdea 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp @@ -29,161 +29,71 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_JERK_RETURN 1 -#define ID_JERK_X 2 -#define ID_JERK_Y 3 -#define ID_JERK_Z 4 -#define ID_JERK_E 5 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_JERK_RETURN = 1, + ID_JERK_X, + ID_JERK_Y, + ID_JERK_Z, + ID_JERK_E +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_JERK_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_jerk_settings(); - draw_return_ui(); - } + lv_clear_jerk_settings(); + draw_return_ui(); break; case ID_JERK_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = XJerk; - lv_clear_jerk_settings(); - lv_draw_number_key(); - } + value = XJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); break; case ID_JERK_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = YJerk; - lv_clear_jerk_settings(); - lv_draw_number_key(); - } + value = YJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); break; case ID_JERK_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = ZJerk; - lv_clear_jerk_settings(); - lv_draw_number_key(); - } + value = ZJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); break; case ID_JERK_E: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = EJerk; - lv_clear_jerk_settings(); - lv_draw_number_key(); - } + value = EJerk; + lv_clear_jerk_settings(); + lv_draw_number_key(); break; } } void lv_draw_jerk_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *buttonEValue = NULL, *labelEValue = NULL; - lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != JERK_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = JERK_UI; } disp_state = JERK_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.JerkConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Jerk); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Jerk); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_Y); - labelYValue = lv_label_create_empty(buttonYValue); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l); - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Jerk); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_Z); - labelZValue = lv_label_create_empty(buttonZValue); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[E_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E_Jerk); - - buttonEValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_JERK_E); - labelEValue = lv_label_create_empty(buttonEValue); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_JERK_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonEValue); - lv_group_add_obj(g, buttonBack); - } - #endif - - if (gCfgItems.multiple_language) { - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[E_AXIS]); - lv_label_set_text(labelEValue, public_buf_l); - lv_obj_align(labelEValue, buttonEValue, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_JERK_RETURN, true); } void lv_clear_jerk_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index 35ad439c6e05..0debf8fa8f6a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -28,8 +28,8 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; #define LV_KB_CTRL_BTN_FLAGS (LV_BTNM_CTRL_NO_REPEAT | LV_BTNM_CTRL_CLICK_TRIG) @@ -72,7 +72,7 @@ static const lv_btnm_ctrl_t kb_ctrl_num_map[] = { 1, 1, 1, 2, 1, 1, 1, 1, 1}; -static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { +static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { //LV_ASSERT_OBJ(kb, LV_OBJX_NAME); if (event != LV_EVENT_VALUE_CHANGED) return; @@ -84,7 +84,7 @@ static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { if (lv_btnm_get_btn_ctrl(kb, btn_id, LV_BTNM_CTRL_NO_REPEAT) && event == LV_EVENT_LONG_PRESSED_REPEAT) return; const char * txt = lv_btnm_get_active_btn_text(kb); - if (txt == NULL) return; + if (txt == nullptr) return; // Do the corresponding action according to the text of the button if (strcmp(txt, "abc") == 0) { @@ -104,13 +104,13 @@ static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { } else if (strcmp(txt, LV_SYMBOL_CLOSE) == 0) { if (kb->event_cb != lv_kb_def_event_cb) { - //lv_res_t res = lv_event_send(kb, LV_EVENT_CANCEL, NULL); + //lv_res_t res = lv_event_send(kb, LV_EVENT_CANCEL, nullptr); //if (res != LV_RES_OK) return; lv_clear_keyboard(); draw_return_ui(); } else { - lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ + lv_kb_set_ta(kb, nullptr); /*De-assign the text area to hide it cursor if needed*/ lv_obj_del(kb); return; } @@ -118,7 +118,7 @@ static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { } else if (strcmp(txt, LV_SYMBOL_OK) == 0) { if (kb->event_cb != lv_kb_def_event_cb) { - //lv_res_t res = lv_event_send(kb, LV_EVENT_APPLY, NULL); + //lv_res_t res = lv_event_send(kb, LV_EVENT_APPLY, nullptr); //if (res != LV_RES_OK) return; const char * ret_ta_txt = lv_ta_get_text(ext->ta); switch (keyboard_value) { @@ -134,18 +134,16 @@ static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { draw_return_ui(); break; case wifiConfig: - memset((void *)uiCfg.wifi_name, 0, sizeof(uiCfg.wifi_name)); + ZERO(uiCfg.wifi_name); memcpy((void *)uiCfg.wifi_name, wifi_list.wifiName[wifi_list.nameIndex], 32); - memset((void *)uiCfg.wifi_key, 0, sizeof(uiCfg.wifi_key)); + ZERO(uiCfg.wifi_key); memcpy((void *)uiCfg.wifi_key, ret_ta_txt, sizeof(uiCfg.wifi_key)); gCfgItems.wifi_mode_sel = STA_MODEL; package_to_wifi(WIFI_PARA_SET, (char *)0, 0); - memset(public_buf_l,0,sizeof(public_buf_l)); - public_buf_l[0] = 0xA5; public_buf_l[1] = 0x09; public_buf_l[2] = 0x01; @@ -172,13 +170,13 @@ static void lv_kb_event_cb(lv_obj_t * kb, lv_event_t event) { } } else { - lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ + lv_kb_set_ta(kb, nullptr); /*De-assign the text area to hide it cursor if needed*/ } return; } /*Add the characters to the text area if set*/ - if (ext->ta == NULL) return; + if (ext->ta == nullptr) return; if (strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) lv_ta_add_char(ext->ta, '\n'); @@ -221,11 +219,7 @@ void lv_draw_keyboard() { } disp_state = KEY_BOARD_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -245,7 +239,7 @@ void lv_draw_keyboard() { pr_style.body.grad_color = lv_color_make(0x6A, 0x3A, 0x0C); /*Create a keyboard and apply the styles*/ - lv_obj_t *kb = lv_kb_create(scr, NULL); + lv_obj_t *kb = lv_kb_create(scr, nullptr); lv_obj_set_event_cb(kb, lv_kb_event_cb); lv_kb_set_cursor_manage(kb, true); lv_kb_set_style(kb, LV_KB_STYLE_BG, &lv_style_transp_tight); @@ -259,8 +253,8 @@ void lv_draw_keyboard() { #endif /*Create a text area. The keyboard will write here*/ - lv_obj_t *ta = lv_ta_create(scr, NULL); - lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_MID, 0, 10); + lv_obj_t *ta = lv_ta_create(scr, nullptr); + lv_obj_align(ta, nullptr, LV_ALIGN_IN_TOP_MID, 0, 10); if (keyboard_value == gcodeCommand) { get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m); public_buf_m[sizeof(public_buf_m)-1] = 0; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index b5c2da09aa33..1ff60d9b9b93 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -33,139 +33,98 @@ #include "../../../../inc/MarlinConfig.h" #include -//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn; - -#define ID_CN 1 -#define ID_T_CN 2 -#define ID_EN 3 -#define ID_RU 4 -#define ID_ES 5 -#define ID_FR 6 -#define ID_IT 7 -#define ID_L_RETURN 8 +enum { + ID_CN = 1, + ID_T_CN, + ID_EN, + ID_RU, + ID_ES, + ID_FR, + ID_IT, + ID_L_RETURN +}; #define SELECTED 1 #define UNSELECTED 0 static void disp_language(uint8_t language, uint8_t state); -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; static lv_obj_t *buttonCN, *buttonT_CN, *buttonEN, *buttonRU; -static lv_obj_t *buttonES, *buttonFR, *buttonIT, *buttonBack; +static lv_obj_t *buttonES, *buttonFR, *buttonIT; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_CN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonCN, "F:/bmp_simplified_cn_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonCN); - gCfgItems.language = LANG_SIMPLE_CHINESE; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonCN, "F:/bmp_simplified_cn_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonCN); + gCfgItems.language = LANG_SIMPLE_CHINESE; + update_spi_flash(); + disp_language_init(); break; case ID_T_CN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonT_CN, "F:/bmp_traditional_cn_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonT_CN); - gCfgItems.language = LANG_COMPLEX_CHINESE; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonT_CN, "F:/bmp_traditional_cn_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonT_CN); + gCfgItems.language = LANG_COMPLEX_CHINESE; + update_spi_flash(); + disp_language_init(); break; case ID_EN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonEN, "F:/bmp_english_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonEN); - gCfgItems.language = LANG_ENGLISH; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonEN, "F:/bmp_english_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonEN); + gCfgItems.language = LANG_ENGLISH; + update_spi_flash(); + disp_language_init(); break; case ID_RU: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonRU, "F:/bmp_russian_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonRU); - gCfgItems.language = LANG_RUSSIAN; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonRU, "F:/bmp_russian_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonRU); + gCfgItems.language = LANG_RUSSIAN; + update_spi_flash(); + disp_language_init(); break; case ID_ES: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonES, "F:/bmp_spanish_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonES); - gCfgItems.language = LANG_SPANISH; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonES, "F:/bmp_spanish_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonES); + gCfgItems.language = LANG_SPANISH; + update_spi_flash(); + disp_language_init(); break; case ID_FR: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonFR, "F:/bmp_french_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonFR); - gCfgItems.language = LANG_FRENCH; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonFR, "F:/bmp_french_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonFR); + gCfgItems.language = LANG_FRENCH; + update_spi_flash(); + disp_language_init(); break; case ID_IT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - disp_language(gCfgItems.language, UNSELECTED); - lv_imgbtn_set_src_both(buttonIT, "F:/bmp_italy_sel.bin"); - lv_obj_refresh_ext_draw_pad(buttonIT); - gCfgItems.language = LANG_ITALY; - update_spi_flash(); - disp_language_init(); - } + disp_language(gCfgItems.language, UNSELECTED); + lv_imgbtn_set_src_both(buttonIT, "F:/bmp_italy_sel.bin"); + lv_obj_refresh_ext_draw_pad(buttonIT); + gCfgItems.language = LANG_ITALY; + update_spi_flash(); + disp_language_init(); break; case ID_L_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - buttonCN = NULL; - buttonT_CN = NULL; - buttonEN = NULL; - buttonRU = NULL; - buttonES = NULL; - buttonFR = NULL; - buttonFR = NULL; - buttonIT = NULL; - buttonBack = NULL; - lv_clear_language(); - lv_draw_set(); - } + buttonCN = nullptr; + buttonT_CN = nullptr; + buttonEN = nullptr; + buttonRU = nullptr; + buttonES = nullptr; + buttonFR = nullptr; + buttonFR = nullptr; + buttonIT = nullptr; + lv_clear_language(); + lv_draw_set(); break; - } } @@ -222,7 +181,7 @@ static void disp_language(uint8_t language, uint8_t state) { strcat_P(public_buf_l, PSTR(".bin")); - lv_obj_set_event_cb_mks(obj, event_handler, id, NULL, 0); + lv_obj_set_event_cb_mks(obj, event_handler, id, nullptr, 0); lv_imgbtn_set_src_both(obj, public_buf_l); if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); @@ -236,78 +195,24 @@ void lv_draw_language(void) { } disp_state = LANGUAGE_UI; - scr = lv_obj_create(NULL, NULL); - - // static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonCN = lv_imgbtn_create(scr, "F:/bmp_simplified_cn.bin", INTERVAL_V, titleHeight, event_handler, ID_CN); + buttonCN = lv_big_button_create(scr, "F:/bmp_simplified_cn.bin", language_menu.chinese_s, INTERVAL_V, titleHeight, event_handler, ID_CN); lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); - buttonT_CN = lv_imgbtn_create(scr, "F:/bmp_traditional_cn.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_CN); - buttonEN = lv_imgbtn_create(scr, "F:/bmp_english.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_EN); - buttonRU = lv_imgbtn_create(scr, "F:/bmp_russian.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_RU); - buttonES = lv_imgbtn_create(scr, "F:/bmp_spanish.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_ES); - buttonFR = lv_imgbtn_create(scr, "F:/bmp_french.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FR); - buttonIT = lv_imgbtn_create(scr, "F:/bmp_italy.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_IT); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_L_RETURN); - - // Create labels on the image buttons - lv_obj_t *label_CN = lv_label_create_empty(buttonCN); - lv_obj_t *label_T_CN = lv_label_create_empty(buttonT_CN); - lv_obj_t *label_EN = lv_label_create_empty(buttonEN); - lv_obj_t *label_RU = lv_label_create_empty(buttonRU); - lv_obj_t *label_ES = lv_label_create_empty(buttonES); - lv_obj_t *label_FR = lv_label_create_empty(buttonFR); - lv_obj_t *label_IT = lv_label_create_empty(buttonIT); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); + buttonT_CN = lv_big_button_create(scr, "F:/bmp_traditional_cn.bin", language_menu.chinese_t, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_CN); + buttonEN = lv_big_button_create(scr, "F:/bmp_english.bin", language_menu.english, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_EN); + buttonRU = lv_big_button_create(scr, "F:/bmp_russian.bin", language_menu.russian, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_RU); + buttonES = lv_big_button_create(scr, "F:/bmp_spanish.bin", language_menu.spanish, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_ES); + buttonFR = lv_big_button_create(scr, "F:/bmp_french.bin", language_menu.french, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FR); + buttonIT = lv_big_button_create(scr, "F:/bmp_italy.bin", language_menu.italy, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_IT); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_L_RETURN); disp_language(gCfgItems.language, SELECTED); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_CN, language_menu.chinese_s); - lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_T_CN, language_menu.chinese_t); - lv_obj_align(label_T_CN, buttonT_CN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_EN, language_menu.english); - lv_obj_align(label_EN, buttonEN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_RU, language_menu.russian); - lv_obj_align(label_RU, buttonRU, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_ES, language_menu.spanish); - lv_obj_align(label_ES, buttonES, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_FR, language_menu.french); - lv_obj_align(label_FR, buttonFR, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_IT, language_menu.italy); - lv_obj_align(label_IT, buttonIT, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonCN); - lv_group_add_obj(g, buttonT_CN); - lv_group_add_obj(g, buttonEN); - lv_group_add_obj(g, buttonRU); - lv_group_add_obj(g, buttonES); - lv_group_add_obj(g, buttonFR); - lv_group_add_obj(g, buttonIT); - lv_group_add_obj(g, buttonBack); - } - #endif } void lv_clear_language() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp index d742f79e5971..7bd2b83ace80 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp @@ -28,194 +28,57 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; -#define ID_LEVEL_RETURN 1 -#define ID_LEVEL_POSITION 2 -#define ID_LEVEL_POSITION_ARROW 3 -#define ID_LEVEL_COMMAND 4 -#define ID_LEVEL_COMMAND_ARROW 5 -#define ID_LEVEL_ZOFFSET 6 -#define ID_LEVEL_ZOFFSET_ARROW 7 +enum { + ID_LEVEL_RETURN = 1, + ID_LEVEL_POSITION, + ID_LEVEL_COMMAND, + ID_LEVEL_ZOFFSET +}; - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_LEVEL_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_level_settings(); - draw_return_ui(); - } + lv_clear_level_settings(); + draw_return_ui(); break; case ID_LEVEL_POSITION: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_level_settings(); - lv_draw_manual_level_pos_settings(); - } - break; - case ID_LEVEL_POSITION_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_level_settings(); - lv_draw_manual_level_pos_settings(); - } + lv_clear_level_settings(); + lv_draw_manual_level_pos_settings(); break; case ID_LEVEL_COMMAND: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - keyboard_value = gcodeCommand; - lv_clear_level_settings(); - lv_draw_keyboard(); - } - break; - case ID_LEVEL_COMMAND_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - keyboard_value = gcodeCommand; - lv_clear_level_settings(); - lv_draw_keyboard(); - } + keyboard_value = gcodeCommand; + lv_clear_level_settings(); + lv_draw_keyboard(); break; #if HAS_BED_PROBE case ID_LEVEL_ZOFFSET: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_level_settings(); - lv_draw_auto_level_offset_settings(); - } - break; - case ID_LEVEL_ZOFFSET_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_level_settings(); - lv_draw_auto_level_offset_settings(); - } + lv_clear_level_settings(); + lv_draw_auto_level_offset_settings(); break; #endif } } void lv_draw_level_settings(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonPosition, *labelPosition, *buttonPositionNarrow; - lv_obj_t *buttonCommand, *labelCommand, *buttonCommandNarrow; - #if HAS_BED_PROBE - lv_obj_t *buttonZoffset, *labelZoffset, *buttonZoffsetNarrow; - lv_obj_t * line3; - #endif - lv_obj_t * line1, * line2; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_PARA_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_PARA_UI; } disp_state = LEVELING_PARA_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - - buttonPosition = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonPosition, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonPosition, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - lv_obj_set_event_cb_mks(buttonPosition, event_handler, ID_LEVEL_POSITION, NULL, 0); - lv_btn_use_label_style(buttonPosition); - lv_btn_set_layout(buttonPosition, LV_LAYOUT_OFF); - labelPosition = lv_label_create_empty(buttonPosition); /*Add a label to the button*/ - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonPosition); - #endif - - buttonPositionNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_LEVEL_POSITION_ARROW); - lv_btn_set_layout(buttonPositionNarrow, LV_LAYOUT_OFF); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonCommand = lv_btn_create(scr, NULL); - lv_obj_set_pos(buttonCommand, PARA_UI_POS_X, PARA_UI_POS_Y * 2); - lv_obj_set_size(buttonCommand, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); - lv_obj_set_event_cb_mks(buttonCommand, event_handler, ID_LEVEL_COMMAND, NULL, 0); - lv_btn_use_label_style(buttonCommand); - lv_btn_set_layout(buttonCommand, LV_LAYOUT_OFF); - labelCommand = lv_label_create_empty(buttonCommand); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonCommand); - #endif - - buttonCommandNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_LEVEL_COMMAND_ARROW); - lv_btn_set_layout(buttonCommandNarrow, LV_LAYOUT_OFF); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - + lv_screen_menu_item(scr, machine_menu.LevelingManuPosConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_LEVEL_POSITION, 0); + lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1); #if HAS_BED_PROBE - - buttonZoffset = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_LEVEL_ZOFFSET); - lv_btn_set_layout(buttonZoffset, LV_LAYOUT_OFF); - labelZoffset = lv_label_create_empty(buttonZoffset); /*Add a label to the button*/ - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZoffset); - #endif - - buttonZoffsetNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_LEVEL_ZOFFSET_ARROW); - lv_btn_set_layout(buttonZoffsetNarrow, LV_LAYOUT_OFF); - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - #endif // HAS_BED_PROBE - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_LEVEL_RETURN); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); + lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2); #endif - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelPosition, machine_menu.LevelingManuPosConf); - lv_obj_align(labelPosition, buttonPosition, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelCommand, machine_menu.LevelingAutoCommandConf); - lv_obj_align(labelCommand, buttonCommand, LV_ALIGN_IN_LEFT_MID, 0, 0); - #if HAS_BED_PROBE - lv_label_set_text(labelZoffset, machine_menu.LevelingAutoZoffsetConf); - lv_obj_align(labelZoffset, buttonZoffset, LV_ALIGN_IN_LEFT_MID, 0, 0); - #endif - } - + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_LEVEL_RETURN, true); } void lv_clear_level_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp index 2309822e863e..45aabae079a0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp @@ -28,209 +28,60 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_PARA_RETURN 1 -#define ID_PARA_MACHINE 2 -#define ID_PARA_MACHINE_ARROW 3 -#define ID_PARA_MOTOR 4 -#define ID_PARA_MOTOR_ARROW 5 -#define ID_PARA_LEVEL 6 -#define ID_PARA_LEVEL_ARROW 7 -#define ID_PARA_ADVANCE 8 -#define ID_PARA_ADVANCE_ARROW 9 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_PARA_RETURN = 1, + ID_PARA_MACHINE, + ID_PARA_MOTOR, + ID_PARA_LEVEL, + ID_PARA_ADVANCE +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_PARA_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - draw_return_ui(); - } + lv_clear_machine_para(); + draw_return_ui(); break; case ID_PARA_MACHINE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_machine_settings(); - } - break; - case ID_PARA_MACHINE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_machine_settings(); - } + lv_clear_machine_para(); + lv_draw_machine_settings(); break; case ID_PARA_MOTOR: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_motor_settings(); - } - break; - case ID_PARA_MOTOR_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_motor_settings(); - } + lv_clear_machine_para(); + lv_draw_motor_settings(); break; case ID_PARA_LEVEL: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_level_settings(); - } - break; - case ID_PARA_LEVEL_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_level_settings(); - } + lv_clear_machine_para(); + lv_draw_level_settings(); break; case ID_PARA_ADVANCE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_advance_settings(); - } - break; - case ID_PARA_ADVANCE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_para(); - lv_draw_advance_settings(); - } + lv_clear_machine_para(); + lv_draw_advance_settings(); break; } } void lv_draw_machine_para(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonMachine, *labelMachine, *buttonMachineNarrow; - lv_obj_t *buttonMotor, *labelMotor, *buttonMotorNarrow; - lv_obj_t *buttonLevel, *labelLevel, *buttonLevelNarrow; - lv_obj_t *buttonAdvance, *labelAdvance, *buttonAdvanceNarrow; - lv_obj_t * line1, * line2, * line3, * line4; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_PARA_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_PARA_UI; } disp_state = MACHINE_PARA_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); - buttonMachine = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonMachine, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonMachine, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonMachine, event_handler, ID_PARA_MACHINE, NULL, 0); - lv_btn_use_label_style(buttonMachine); - lv_btn_set_layout(buttonMachine, LV_LAYOUT_OFF); - labelMachine = lv_label_create_empty(buttonMachine); /*Add a label to the button*/ - - buttonMachineNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_PARA_MACHINE_ARROW); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonMotor = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonMotor, PARA_UI_POS_X, PARA_UI_POS_Y * 2); /*Set its position*/ - lv_obj_set_size(buttonMotor, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonMotor, event_handler, ID_PARA_MOTOR, NULL, 0); - lv_btn_use_label_style(buttonMotor); - lv_btn_set_layout(buttonMotor, LV_LAYOUT_OFF); - labelMotor = lv_label_create_empty(buttonMotor); /*Add a label to the button*/ - - buttonMotorNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_PARA_MOTOR_ARROW); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - buttonLevel = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_PARA_LEVEL); - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_btn_set_layout(buttonLevel, LV_LAYOUT_OFF); - labelLevel = lv_label_create_empty(buttonLevel); /*Add a label to the button*/ - - buttonLevelNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_PARA_LEVEL_ARROW); - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - buttonAdvance = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonAdvance, PARA_UI_POS_X, PARA_UI_POS_Y * 4); /*Set its position*/ - lv_obj_set_size(buttonAdvance, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonAdvance, event_handler, ID_PARA_ADVANCE, NULL, 0); - lv_btn_use_label_style(buttonAdvance); - lv_btn_set_layout(buttonAdvance, LV_LAYOUT_OFF); - labelAdvance = lv_label_create_empty(buttonAdvance); /*Add a label to the button*/ - - buttonAdvanceNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 4 + PARA_UI_ARROW_V, event_handler, ID_PARA_ADVANCE_ARROW); - lv_btn_set_layout(buttonAdvanceNarrow, LV_LAYOUT_OFF); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_PARA_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, -2); - - lv_label_set_text(labelMachine, MachinePara_menu.MachineSetting); - lv_obj_align(labelMachine, buttonMachine, LV_ALIGN_IN_LEFT_MID, 0, -3); - - lv_label_set_text(labelMotor, MachinePara_menu.MotorSetting); - lv_obj_align(labelMotor, buttonMotor, LV_ALIGN_IN_LEFT_MID, 0, -3); - - lv_label_set_text(labelLevel, MachinePara_menu.leveling); - lv_obj_align(labelLevel, buttonLevel, LV_ALIGN_IN_LEFT_MID, 0, -3); - - lv_label_set_text(labelAdvance, MachinePara_menu.AdvanceSetting); - lv_obj_align(labelAdvance, buttonAdvance, LV_ALIGN_IN_LEFT_MID, 0, -3); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonMachine); - lv_group_add_obj(g, buttonMotor); - lv_group_add_obj(g, buttonLevel); - lv_group_add_obj(g, buttonAdvance); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_screen_menu_item(scr, MachinePara_menu.MachineSetting, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PARA_MACHINE, 0); + lv_screen_menu_item(scr, MachinePara_menu.MotorSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PARA_MOTOR, 1); + lv_screen_menu_item(scr, MachinePara_menu.leveling, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PARA_LEVEL, 2); + lv_screen_menu_item(scr, MachinePara_menu.AdvanceSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_PARA_ADVANCE, 3); + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_PARA_RETURN, true); } void lv_clear_machine_para() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp index ae83b7efbc40..000b122b34fe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp @@ -28,188 +28,59 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_MACHINE_RETURN 1 -#define ID_MACHINE_ACCELERATION 2 -#define ID_MACHINE_ACCELERATION_ARROW 3 -#define ID_MACHINE_FEEDRATE 4 -#define ID_MACHINE_FEEDRATE_ARROW 5 -#define ID_MACHINE_JERK 6 -#define ID_MACHINE_JERK_ARROW 7 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_MACHINE_RETURN = 1, + ID_MACHINE_ACCELERATION, + ID_MACHINE_FEEDRATE, + ID_MACHINE_JERK +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_MACHINE_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - draw_return_ui(); - } + lv_clear_machine_settings(); + draw_return_ui(); break; case ID_MACHINE_ACCELERATION: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - lv_draw_acceleration_settings(); - } - break; - case ID_MACHINE_ACCELERATION_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - lv_draw_acceleration_settings(); - } + lv_clear_machine_settings(); + lv_draw_acceleration_settings(); break; case ID_MACHINE_FEEDRATE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - lv_draw_max_feedrate_settings(); - } + lv_clear_machine_settings(); + lv_draw_max_feedrate_settings(); break; - case ID_MACHINE_FEEDRATE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { + #if HAS_CLASSIC_JERK + case ID_MACHINE_JERK: lv_clear_machine_settings(); - lv_draw_max_feedrate_settings(); - } - break; - #if HAS_CLASSIC_JERK - case ID_MACHINE_JERK: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - lv_draw_jerk_settings(); - } - break; - case ID_MACHINE_JERK_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_machine_settings(); - lv_draw_jerk_settings(); - } - break; - #endif + lv_draw_jerk_settings(); + break; + #endif } } void lv_draw_machine_settings(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonAcceleration, *labelAcceleration, *buttonAccelerationNarrow; - lv_obj_t *buttonMaxFeedrate, *labelMaxFeedrate, *buttonMaxFeedrateNarrow; - #if HAS_CLASSIC_JERK - lv_obj_t *buttonJerk, *labelJerk, *buttonJerkNarrow; - #endif - lv_obj_t * line1, * line2; - #if HAS_CLASSIC_JERK - lv_obj_t * line3; - #endif if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_SETTINGS_UI; } disp_state = MACHINE_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MachineConfigTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonAcceleration = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(buttonAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y); // Set its position - lv_obj_set_size(buttonAcceleration, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonAcceleration, event_handler, ID_MACHINE_ACCELERATION, NULL, 0); - lv_btn_use_label_style(buttonAcceleration); - lv_btn_set_layout(buttonAcceleration, LV_LAYOUT_OFF); - labelAcceleration = lv_label_create_empty(buttonAcceleration); // Add a label to the button - - buttonAccelerationNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_MACHINE_ACCELERATION_ARROW); - - line1 = lv_line_create(lv_scr_act(), NULL); - lv_ex_line(line1, line_points[0]); - - buttonMaxFeedrate = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(buttonMaxFeedrate, PARA_UI_POS_X, PARA_UI_POS_Y * 2); // Set its position - lv_obj_set_size(buttonMaxFeedrate, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonMaxFeedrate, event_handler, ID_MACHINE_FEEDRATE, NULL, 0); - lv_btn_use_label_style(buttonMaxFeedrate); - lv_btn_set_layout(buttonMaxFeedrate, LV_LAYOUT_OFF); - labelMaxFeedrate = lv_label_create_empty(buttonMaxFeedrate); // Add a label to the button - - buttonMaxFeedrateNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_MACHINE_FEEDRATE_ARROW); - - line2 = lv_line_create(lv_scr_act(), NULL); - lv_ex_line(line2, line_points[1]); - + lv_screen_menu_item(scr, machine_menu.AccelerationConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MACHINE_ACCELERATION, 0); + lv_screen_menu_item(scr, machine_menu.MaxFeedRateConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_MACHINE_FEEDRATE, 1); #if HAS_CLASSIC_JERK - buttonJerk = lv_btn_create(scr, NULL); // Add a button the current screen - lv_obj_set_pos(buttonJerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3); // Set its position - lv_obj_set_size(buttonJerk, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); // Set its size - //lv_obj_set_event_cb(buttonMotor, event_handler); - lv_obj_set_event_cb_mks(buttonJerk, event_handler, ID_MACHINE_JERK, NULL, 0); - lv_btn_use_label_style(buttonJerk); - lv_btn_set_layout(buttonJerk, LV_LAYOUT_OFF); - labelJerk = lv_label_create_empty(buttonJerk); // Add a label to the button - - buttonJerkNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 3 + PARA_UI_ARROW_V, event_handler, ID_MACHINE_JERK_ARROW); - - line3 = lv_line_create(lv_scr_act(), NULL); - lv_ex_line(line3, line_points[2]); - #endif - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_MACHINE_RETURN); - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelAcceleration, machine_menu.AccelerationConf); - lv_obj_align(labelAcceleration, buttonAcceleration, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelMaxFeedrate, machine_menu.MaxFeedRateConf); - lv_obj_align(labelMaxFeedrate, buttonMaxFeedrate, LV_ALIGN_IN_LEFT_MID, 0, 0); - #if HAS_CLASSIC_JERK - lv_label_set_text(labelJerk, machine_menu.JerkConf); - lv_obj_align(labelJerk, buttonJerk, LV_ALIGN_IN_LEFT_MID, 0, 0); - #endif - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonAcceleration); - lv_group_add_obj(g, buttonMaxFeedrate); - #if HAS_CLASSIC_JERK - lv_group_add_obj(g, buttonJerk); - #endif - lv_group_add_obj(g, buttonBack); - } + lv_screen_menu_item(scr, machine_menu.JerkConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_MACHINE_JERK, 2); #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_MACHINE_RETURN, true); } void lv_clear_machine_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 8c0575d34324..0513437353ec 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -33,201 +33,109 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; -#define ID_M_POINT1 1 -#define ID_M_POINT2 2 -#define ID_M_POINT3 3 -#define ID_M_POINT4 4 -#define ID_M_POINT5 5 -#define ID_MANUAL_RETURN 6 +enum { + ID_M_POINT1 = 1, + ID_M_POINT2, + ID_M_POINT3, + ID_M_POINT4, + ID_M_POINT5, + ID_MANUAL_RETURN +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; -static void event_handler(lv_obj_t * obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_M_POINT1: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - - if (queue.length == 0) { - if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_now_P(PSTR("G1 Z10")); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[0][0], (int)gCfgItems.levelingPos[0][1]); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G1 Z0")); + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; } + queue.enqueue_now_P(PSTR("G1 Z10")); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[0][0], (int)gCfgItems.levelingPos[0][1]); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); } break; case ID_M_POINT2: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) { - if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_now_P(PSTR("G1 Z10")); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[1][0], (int)gCfgItems.levelingPos[1][1]); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G1 Z0")); + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; } + queue.enqueue_now_P(PSTR("G1 Z10")); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[1][0], (int)gCfgItems.levelingPos[1][1]); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); } break; case ID_M_POINT3: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) { - if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_now_P(PSTR("G1 Z10")); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[2][0], (int)gCfgItems.levelingPos[2][1]); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G1 Z0")); + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; } + queue.enqueue_now_P(PSTR("G1 Z10")); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[2][0], (int)gCfgItems.levelingPos[2][1]); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); } break; case ID_M_POINT4: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) { - if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_now_P(PSTR("G1 Z10")); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[3][0], (int)gCfgItems.levelingPos[3][1]); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G1 Z0")); + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; } + queue.enqueue_now_P(PSTR("G1 Z10")); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[3][0], (int)gCfgItems.levelingPos[3][1]); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); } break; case ID_M_POINT5: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length == 0) { - if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; - } - - queue.enqueue_now_P(PSTR("G1 Z10")); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[4][0], (int)gCfgItems.levelingPos[4][1]); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G1 Z0")); + if (queue.length == 0) { + if (uiCfg.leveling_first_time) { + queue.enqueue_now_P(PSTR("G28")); + uiCfg.leveling_first_time = 0; } + queue.enqueue_now_P(PSTR("G1 Z10")); + sprintf_P(public_buf_l, PSTR("G1 X%d Y%d"), (int)gCfgItems.levelingPos[4][0], (int)gCfgItems.levelingPos[4][1]); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G1 Z0")); } - break; case ID_MANUAL_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_manualLevel(); - lv_draw_tool(); - } + lv_clear_manualLevel(); + lv_draw_tool(); break; } } void lv_draw_manualLevel(void) { - lv_obj_t *buttonPoint1, *buttonPoint2, *buttonPoint3, *buttonPoint4, *buttonPoint5; - lv_obj_t *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; } disp_state = LEVELING_UI; - scr = lv_obj_create(NULL, NULL); - - // static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonPoint1 = lv_imgbtn_create(scr, "F:/bmp_leveling1.bin", INTERVAL_V, titleHeight, event_handler, ID_M_POINT1); + lv_obj_t *buttonPoint1 = lv_big_button_create(scr, "F:/bmp_leveling1.bin", leveling_menu.position1, INTERVAL_V, titleHeight, event_handler, ID_M_POINT1); lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); - buttonPoint2 = lv_imgbtn_create(scr, "F:/bmp_leveling2.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_POINT2); - buttonPoint3 = lv_imgbtn_create(scr, "F:/bmp_leveling3.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_POINT3); - buttonPoint4 = lv_imgbtn_create(scr, "F:/bmp_leveling4.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_POINT4); - buttonPoint5 = lv_imgbtn_create(scr, "F:/bmp_leveling5.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_POINT5); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_MANUAL_RETURN); - - // Create labels on the image buttons - lv_obj_t *label_Point1 = lv_label_create_empty(buttonPoint1); - lv_obj_t *label_Point2 = lv_label_create_empty(buttonPoint2); - lv_obj_t *label_Point3 = lv_label_create_empty(buttonPoint3); - lv_obj_t *label_Point4 = lv_label_create_empty(buttonPoint4); - lv_obj_t *label_Point5 = lv_label_create_empty(buttonPoint5); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Point1, leveling_menu.position1); - lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point2, leveling_menu.position2); - lv_obj_align(label_Point2, buttonPoint2, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point3, leveling_menu.position3); - lv_obj_align(label_Point3, buttonPoint3, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point4, leveling_menu.position4); - lv_obj_align(label_Point4, buttonPoint4, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Point5, leveling_menu.position5); - lv_obj_align(label_Point5, buttonPoint5, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonPoint1); - lv_group_add_obj(g, buttonPoint2); - lv_group_add_obj(g, buttonPoint3); - lv_group_add_obj(g, buttonPoint4); - lv_group_add_obj(g, buttonPoint5); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_leveling2.bin", leveling_menu.position2, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_POINT2); + lv_big_button_create(scr, "F:/bmp_leveling3.bin", leveling_menu.position3, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_POINT3); + lv_big_button_create(scr, "F:/bmp_leveling4.bin", leveling_menu.position4, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_POINT4); + lv_big_button_create(scr, "F:/bmp_leveling5.bin", leveling_menu.position5, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_POINT5); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_MANUAL_RETURN); } void lv_clear_manualLevel() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp index 3f51bc1a743b..8dedcd4c7b7a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp @@ -29,353 +29,136 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_MANUAL_POS_RETURN 1 -#define ID_MANUAL_POS_X1 2 -#define ID_MANUAL_POS_Y1 3 -#define ID_MANUAL_POS_X2 4 -#define ID_MANUAL_POS_Y2 5 -#define ID_MANUAL_POS_X3 6 -#define ID_MANUAL_POS_Y3 7 -#define ID_MANUAL_POS_X4 8 -#define ID_MANUAL_POS_Y4 9 -#define ID_MANUAL_POS_X5 10 -#define ID_MANUAL_POS_Y5 11 -#define ID_MANUAL_POS_DOWN 12 -#define ID_MANUAL_POS_UP 13 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_MANUAL_POS_RETURN = 1, + ID_MANUAL_POS_X1, + ID_MANUAL_POS_Y1, + ID_MANUAL_POS_X2, + ID_MANUAL_POS_Y2, + ID_MANUAL_POS_X3, + ID_MANUAL_POS_Y3, + ID_MANUAL_POS_X4, + ID_MANUAL_POS_Y4, + ID_MANUAL_POS_X5, + ID_MANUAL_POS_Y5, + ID_MANUAL_POS_DOWN, + ID_MANUAL_POS_UP +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_MANUAL_POS_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_manual_level_pos_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_manual_level_pos_settings(); + draw_return_ui(); break; case ID_MANUAL_POS_X1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_x1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_x1; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_Y1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y1; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_X2: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_x2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_x2; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_Y2: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y2; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_X3: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_x3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_x3; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_Y3: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y3; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_X4: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_x4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_x4; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_Y4: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y4; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_X5: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y5; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_Y5: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); - } + value = level_pos_y5; + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); break; case ID_MANUAL_POS_UP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_manual_level_pos_settings(); - lv_draw_manual_level_pos_settings(); - } + uiCfg.para_ui_page = 0; + lv_clear_manual_level_pos_settings(); + lv_draw_manual_level_pos_settings(); break; case ID_MANUAL_POS_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_manual_level_pos_settings(); - lv_draw_manual_level_pos_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_manual_level_pos_settings(); + lv_draw_manual_level_pos_settings(); break; } } void lv_draw_manual_level_pos_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonX1Value = NULL, *labelX1Value = NULL; - lv_obj_t *buttonY1Value = NULL, *labelY1Value = NULL; - lv_obj_t *buttonX2Value = NULL, *labelX2Value = NULL; - lv_obj_t *buttonY2Value = NULL, *labelY2Value = NULL; - lv_obj_t *buttonX3Value = NULL, *labelX3Value = NULL; - lv_obj_t *buttonY3Value = NULL, *labelY3Value = NULL; - lv_obj_t *buttonX4Value = NULL, *labelX4Value = NULL; - lv_obj_t *buttonY4Value = NULL, *labelY4Value = NULL; - lv_obj_t *buttonX5Value = NULL, *labelX5Value = NULL; - lv_obj_t *buttonY5Value = NULL, *labelY5Value = NULL; - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; + char buf2[50]; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MANUAL_LEVELING_POSIGION_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MANUAL_LEVELING_POSIGION_UI; } disp_state = MANUAL_LEVELING_POSIGION_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, leveling_menu.position1); - - buttonX1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X1); - labelX1Value = lv_label_create_empty(buttonX1Value); - - buttonY1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y1); - labelY1Value = lv_label_create_empty(buttonY1Value); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, leveling_menu.position2); - - buttonX2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X2); - labelX2Value = lv_label_create_empty(buttonX2Value); - - buttonY2Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y2); - labelY2Value = lv_label_create_empty(buttonY2Value); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, leveling_menu.position3); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]); + sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[0][1]); + lv_screen_menu_item_2_edit(scr, leveling_menu.position1, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MANUAL_POS_Y1, 0, buf2, ID_MANUAL_POS_X1, public_buf_l); - buttonX3Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X3); - labelX3Value = lv_label_create_empty(buttonX3Value); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][0]); + sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[1][1]); + lv_screen_menu_item_2_edit(scr, leveling_menu.position2, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_MANUAL_POS_Y2, 1, buf2, ID_MANUAL_POS_X2, public_buf_l); - buttonY3Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y3); - labelY3Value = lv_label_create_empty(buttonY3Value); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][0]); + sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[2][1]); + lv_screen_menu_item_2_edit(scr, leveling_menu.position3, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_MANUAL_POS_Y3, 2, buf2, ID_MANUAL_POS_X3, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][0]); + sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[3][1]); + lv_screen_menu_item_2_edit(scr, leveling_menu.position4, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_MANUAL_POS_Y4, 3, buf2, ID_MANUAL_POS_X4, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, leveling_menu.position4); - - buttonX4Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X4); - labelX4Value = lv_label_create_empty(buttonX4Value); - - buttonY4Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y4); - labelY4Value = lv_label_create_empty(buttonY4Value); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_DOWN, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonX1Value); - lv_group_add_obj(g, buttonY1Value); - lv_group_add_obj(g, buttonX2Value); - lv_group_add_obj(g, buttonY2Value); - lv_group_add_obj(g, buttonX3Value); - lv_group_add_obj(g, buttonY3Value); - lv_group_add_obj(g, buttonX4Value); - lv_group_add_obj(g, buttonY4Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_MANUAL_POS_DOWN, true); } else { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, leveling_menu.position5); - - buttonX5Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_X5); - labelX5Value = lv_label_create_empty(buttonX5Value); - - buttonY5Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_MANUAL_POS_Y5); - labelY5Value = lv_label_create_empty(buttonY5Value); + sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][0]); + sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[4][1]); + lv_screen_menu_item_2_edit(scr, leveling_menu.position4, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MANUAL_POS_Y5, 0, buf2, ID_MANUAL_POS_X5, public_buf_l); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_UP, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonX5Value); - lv_group_add_obj(g, buttonY5Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_MANUAL_POS_UP, true); } - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_POS_RETURN, NULL, 0); - lv_btn_set_style_both(buttonBack, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]); - lv_label_set_text(labelX1Value, public_buf_l); - lv_obj_align(labelX1Value, buttonX1Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][1]); - lv_label_set_text(labelY1Value, public_buf_l); - lv_obj_align(labelY1Value, buttonY1Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][0]); - lv_label_set_text(labelX2Value, public_buf_l); - lv_obj_align(labelX2Value, buttonX2Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][1]); - lv_label_set_text(labelY2Value, public_buf_l); - lv_obj_align(labelY2Value, buttonY2Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][0]); - lv_label_set_text(labelX3Value, public_buf_l); - lv_obj_align(labelX3Value, buttonX3Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][1]); - lv_label_set_text(labelY3Value, public_buf_l); - lv_obj_align(labelY3Value, buttonY3Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][0]); - lv_label_set_text(labelX4Value, public_buf_l); - lv_obj_align(labelX4Value, buttonX4Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][1]); - lv_label_set_text(labelY4Value, public_buf_l); - lv_obj_align(labelY4Value, buttonY4Value, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - } - else { - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][0]); - lv_label_set_text(labelX5Value, public_buf_l); - lv_obj_align(labelX5Value, buttonX5Value, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][1]); - lv_label_set_text(labelY5Value, public_buf_l); - lv_obj_align(labelY5Value, buttonY5Value, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_MANUAL_POS_RETURN, true); } void lv_clear_manual_level_pos_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp index ff01ceaa6e01..5088e859c093 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -29,254 +29,100 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_FEED_RETURN 1 -#define ID_FEED_X 2 -#define ID_FEED_Y 3 -#define ID_FEED_Z 4 -#define ID_FEED_E0 5 -#define ID_FEED_E1 6 -#define ID_FEED_DOWN 7 -#define ID_FEED_UP 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_FEED_RETURN = 1, + ID_FEED_X, + ID_FEED_Y, + ID_FEED_Z, + ID_FEED_E0, + ID_FEED_E1, + ID_FEED_DOWN, + ID_FEED_UP +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_FEED_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_max_feedrate_settings(); + draw_return_ui(); break; case ID_FEED_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = XMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); - } + value = XMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); break; case ID_FEED_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = YMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); - } + value = YMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); break; case ID_FEED_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = ZMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); - } + value = ZMaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); break; case ID_FEED_E0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E0MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); - } + value = E0MaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); break; case ID_FEED_E1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E1MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); - } + value = E1MaxFeedRate; + lv_clear_max_feedrate_settings(); + lv_draw_number_key(); break; case ID_FEED_UP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); - lv_draw_max_feedrate_settings(); - } + uiCfg.para_ui_page = 0; + lv_clear_max_feedrate_settings(); + lv_draw_max_feedrate_settings(); break; case ID_FEED_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_max_feedrate_settings(); - lv_draw_max_feedrate_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_max_feedrate_settings(); + lv_draw_max_feedrate_settings(); break; } } void lv_draw_max_feedrate_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; - lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MAXFEEDRATE_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MAXFEEDRATE_UI; } disp_state = MAXFEEDRATE_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MaxFeedRateConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.XMaxFeedRate); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_X); - lv_btn_set_layout(buttonXValue, LV_LAYOUT_OFF); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.YMaxFeedRate); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_Y); - lv_btn_set_layout(buttonYValue, LV_LAYOUT_OFF); - labelYValue = lv_label_create_empty(buttonYValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.ZMaxFeedRate); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.XMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_X, 0, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_Z); - lv_btn_set_layout(buttonZValue, LV_LAYOUT_OFF); - labelZValue = lv_label_create_empty(buttonZValue); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.YMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FEED_Y, 1, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.ZMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_FEED_Z, 2, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0MaxFeedRate); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.E0MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_FEED_E0, 3, public_buf_l); - buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_E0); - lv_btn_set_layout(buttonE0Value, LV_LAYOUT_OFF); - labelE0Value = lv_label_create_empty(buttonE0Value); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_DOWN, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonE0Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_DOWN, true); } else { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1MaxFeedRate); - - buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_FEED_E1); - lv_btn_set_layout(buttonE1Value, LV_LAYOUT_OFF); - labelE1Value = lv_label_create_empty(buttonE1Value); - + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); + lv_screen_menu_item_1_edit(scr, machine_menu.E1MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_E1, 0, public_buf_l); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_FEED_UP, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonE1Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_UP, true); } - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_FEED_RETURN, NULL, 0); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - lv_btn_set_style_both(buttonBack, &style_para_back); - label_Back = lv_label_create_empty(buttonBack); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); - lv_label_set_text(labelE0Value, public_buf_l); - lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); - } - else { - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); - lv_label_set_text(labelE1Value, public_buf_l); - lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_FEED_RETURN, true); } void lv_clear_max_feedrate_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp index c54318a1b2be..697b7de34532 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -28,258 +28,78 @@ #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_MOTOR_RETURN 1 -#define ID_MOTOR_STEPS 2 -#define ID_MOTOR_STEPS_ARROW 3 -#define ID_MOTOR_TMC_CURRENT 4 -#define ID_MOTOR_TMC_CURRENT_ARROW 5 -#define ID_MOTOR_STEP_MODE 6 -#define ID_MOTOR_STEP_MODE_ARROW 7 -#define ID_HOME_SENSE 8 -#define ID_HOME_SENSE_ARROW 9 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_MOTOR_RETURN = 1, + ID_MOTOR_STEPS, + ID_MOTOR_TMC_CURRENT, + ID_MOTOR_STEP_MODE, + ID_HOME_SENSE +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_MOTOR_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - draw_return_ui(); - } + lv_clear_motor_settings(); + draw_return_ui(); break; case ID_MOTOR_STEPS: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_step_settings(); - } - break; - case ID_MOTOR_STEPS_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_step_settings(); - } + lv_clear_motor_settings(); + lv_draw_step_settings(); break; #if USE_SENSORLESS - case ID_HOME_SENSE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { + case ID_HOME_SENSE: lv_clear_motor_settings(); lv_draw_homing_sensitivity_settings(); - } - break; - case ID_HOME_SENSE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_homing_sensitivity_settings(); - } - break; + break; #endif - #if HAS_TRINAMIC_CONFIG - case ID_MOTOR_TMC_CURRENT: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_tmc_current_settings(); - } - break; - case ID_MOTOR_TMC_CURRENT_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_tmc_current_settings(); - } + #if HAS_TRINAMIC_CONFIG + case ID_MOTOR_TMC_CURRENT: + lv_clear_motor_settings(); + lv_draw_tmc_current_settings(); + break; + #if HAS_STEALTHCHOP + case ID_MOTOR_STEP_MODE: + lv_clear_motor_settings(); + lv_draw_tmc_step_mode_settings(); break; - #if HAS_STEALTHCHOP - case ID_MOTOR_STEP_MODE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_tmc_step_mode_settings(); - } - break; - case ID_MOTOR_STEP_MODE_ARROW: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_motor_settings(); - lv_draw_tmc_step_mode_settings(); - } - break; - #endif #endif + #endif } } void lv_draw_motor_settings(void) { - lv_obj_t *buttonBack, *label_Back; - lv_obj_t *buttonSteps, *labelSteps, *buttonStepsNarrow; - lv_obj_t * line1; - #if USE_SENSORLESS - lv_obj_t *buttonSensitivity, *labelSensitivity, *buttonSensitivityNarrow; - lv_obj_t * line2; - #endif - #if HAS_TRINAMIC_CONFIG - #if USE_SENSORLESS - lv_obj_t * line3; - #else - lv_obj_t * line2; - #endif - lv_obj_t *buttonTMCcurrent, *labelTMCcurrent, *buttonTMCcurrentNarrow; - #if HAS_STEALTHCHOP - #if USE_SENSORLESS - lv_obj_t * line4; - #else - lv_obj_t * line3; - #endif - lv_obj_t *buttonStepMode, *labelStepMode, *buttonStepModeNarrow; - #endif - #endif if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOTOR_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MOTOR_SETTINGS_UI; } disp_state = MOTOR_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MotorConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonSteps = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonSteps, PARA_UI_POS_X, PARA_UI_POS_Y); /*Set its position*/ - lv_obj_set_size(buttonSteps, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonSteps, event_handler, ID_MOTOR_STEPS, NULL, 0); - lv_btn_use_label_style(buttonSteps); - lv_btn_set_layout(buttonSteps, LV_LAYOUT_OFF); - labelSteps = lv_label_create_empty(buttonSteps); /*Add a label to the button*/ - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonSteps); - #endif - - buttonStepsNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y + PARA_UI_ARROW_V, event_handler, ID_MOTOR_STEPS_ARROW); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - + int index = 0; + lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index++); #if USE_SENSORLESS - buttonSensitivity = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2, PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_HOME_SENSE); - //lv_obj_set_event_cb(buttonMachine, event_handler); - labelSensitivity = lv_label_create_empty(buttonSensitivity); /*Add a label to the button*/ - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonSensitivity); - #endif - - buttonSensitivityNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, PARA_UI_POS_Y * 2 + PARA_UI_ARROW_V, event_handler, ID_HOME_SENSE_ARROW); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); + lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index); + index++; #endif - - #if HAS_TRINAMIC_CONFIG - buttonTMCcurrent = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonTMCcurrent, PARA_UI_POS_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 3, PARA_UI_POS_Y * 2)); - lv_obj_set_size(buttonTMCcurrent, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - //lv_obj_set_event_cb(buttonMachine, event_handler); - lv_obj_set_event_cb_mks(buttonTMCcurrent, event_handler, ID_MOTOR_TMC_CURRENT, NULL, 0); - lv_btn_use_label_style(buttonTMCcurrent); - lv_btn_set_layout(buttonTMCcurrent, LV_LAYOUT_OFF); - labelTMCcurrent = lv_label_create_empty(buttonTMCcurrent); /*Add a label to the button*/ - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTMCcurrent); - #endif - - buttonTMCcurrentNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 3, PARA_UI_POS_Y * 2) + PARA_UI_ARROW_V, event_handler, ID_MOTOR_TMC_CURRENT_ARROW); - - #if USE_SENSORLESS - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - #else - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - #endif - + lv_screen_menu_item(scr, machine_menu.TMCcurrentConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_TMC_CURRENT, index); + index++; #if HAS_STEALTHCHOP - buttonStepMode = lv_btn_create(scr, NULL, PARA_UI_POS_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3), PARA_UI_SIZE_X, PARA_UI_SIZE_Y, event_handler, ID_MOTOR_STEP_MODE); - labelStepMode = lv_label_create_empty(buttonStepMode); /*Add a label to the button*/ - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonStepMode); - #endif - - buttonStepModeNarrow = lv_imgbtn_create(scr, "F:/bmp_arrow.bin", PARA_UI_POS_X + PARA_UI_SIZE_X, TERN(USE_SENSORLESS, PARA_UI_POS_Y * 4, PARA_UI_POS_Y * 3) + PARA_UI_ARROW_V, event_handler, ID_MOTOR_STEP_MODE_ARROW); - - #if USE_SENSORLESS - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - #else - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - #endif - - #endif // HAS_STEALTHCHOP - - #endif // HAS_TRINAMIC_CONFIG - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_MOTOR_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelSteps, machine_menu.StepsConf); - lv_obj_align(labelSteps, buttonSteps, LV_ALIGN_IN_LEFT_MID, 0, 0); - - #if USE_SENSORLESS - lv_label_set_text(labelSensitivity, machine_menu.HomingSensitivityConf); - lv_obj_align(labelSensitivity, buttonSensitivity, LV_ALIGN_IN_LEFT_MID, 0, 0); + lv_screen_menu_item(scr, machine_menu.TMCStepModeConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_STEP_MODE, index); + index++; #endif - #if HAS_TRINAMIC_CONFIG - lv_label_set_text(labelTMCcurrent, machine_menu.TMCcurrentConf); - lv_obj_align(labelTMCcurrent, buttonTMCcurrent, LV_ALIGN_IN_LEFT_MID, 0, 0); - #if HAS_STEALTHCHOP - lv_label_set_text(labelStepMode, machine_menu.TMCStepModeConf); - lv_obj_align(labelStepMode, buttonStepMode, LV_ALIGN_IN_LEFT_MID, 0, 0); - #endif - #endif - } - + #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_MOTOR_RETURN, true); } void lv_clear_motor_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 3dde4ad5a052..0718ffd86e11 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -33,210 +33,119 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; static lv_obj_t *labelV, *buttonV; -#define ID_M_X_P 1 -#define ID_M_X_N 2 -#define ID_M_Y_P 3 -#define ID_M_Y_N 4 -#define ID_M_Z_P 5 -#define ID_M_Z_N 6 -#define ID_M_STEP 7 -#define ID_M_RETURN 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +enum { + ID_M_X_P = 1, + ID_M_X_N, + ID_M_Y_P, + ID_M_Y_N, + ID_M_Z_P, + ID_M_Z_N, + ID_M_STEP, + ID_M_RETURN +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_M_X_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_one_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 X%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_one_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_one_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 X%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_one_P(PSTR("G90")); } break; case ID_M_X_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 X-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 X-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); } break; case ID_M_Y_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Y%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Y%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); } break; case ID_M_Y_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Y-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Y-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); } break; case ID_M_Z_P: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Z%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Z%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); } break; case ID_M_Z_N: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (queue.length <= (BUFSIZE - 3)) { - ZERO(public_buf_l); - queue.enqueue_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Z-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); - queue.enqueue_one_now(public_buf_l); - queue.enqueue_now_P(PSTR("G90")); - } + if (queue.length <= (BUFSIZE - 3)) { + queue.enqueue_now_P(PSTR("G91")); + sprintf_P(public_buf_l, PSTR("G1 Z-%3.1f F%d"), uiCfg.move_dist, uiCfg.moveSpeed); + queue.enqueue_one_now(public_buf_l); + queue.enqueue_now_P(PSTR("G90")); } break; case ID_M_STEP: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (abs(10 * (int)uiCfg.move_dist) == 100) - uiCfg.move_dist = 0.1; - else - uiCfg.move_dist *= (float)10; - - disp_move_dist(); - } - + if (abs(10 * (int)uiCfg.move_dist) == 100) + uiCfg.move_dist = 0.1; + else + uiCfg.move_dist *= (float)10; + disp_move_dist(); break; case ID_M_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_move_motor(void) { - lv_obj_t *buttonXI, *buttonXD, *buttonYI, *buttonYD, *buttonZI, *buttonZD, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; } disp_state = MOVE_MOTOR_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create an Image button - buttonXI = lv_imgbtn_create(scr, "F:/bmp_xAdd.bin", INTERVAL_V, titleHeight, event_handler, ID_M_X_P); + lv_obj_t *buttonXI = lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_M_X_P); lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); - buttonXD = lv_imgbtn_create(scr, "F:/bmp_xDec.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_X_N); - buttonYI = lv_imgbtn_create(scr, "F:/bmp_yAdd.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_Y_P); - buttonYD = lv_imgbtn_create(scr, "F:/bmp_yDec.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Y_N); - buttonZI = lv_imgbtn_create(scr, "F:/bmp_zAdd.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_Z_P); - buttonZD = lv_imgbtn_create(scr, "F:/bmp_zDec.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N); - - buttonV = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP); - //lv_obj_set_event_cb_mks(buttonV, event_handler,ID_T_MORE,"bmp_More.bin",0); - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelXI = lv_label_create_empty(buttonXI); - lv_obj_t *labelXD = lv_label_create_empty(buttonXD); - lv_obj_t *labelYI = lv_label_create_empty(buttonYI); - lv_obj_t *labelYD = lv_label_create_empty(buttonYD); - lv_obj_t *labelZI = lv_label_create_empty(buttonZI); - lv_obj_t *labelZD = lv_label_create_empty(buttonZD); + lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_X_N); + lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_M_Y_P); + lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Y_N); + lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_Z_P); + lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N); + + // button with image and label changed dinamycally by disp_move_dist + buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP); labelV = lv_label_create_empty(buttonV); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelXI, move_menu.x_add); - lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelXD, move_menu.x_dec); - lv_obj_align(labelXD, buttonXD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYI, move_menu.y_add); - lv_obj_align(labelYI, buttonYI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelYD, move_menu.y_dec); - lv_obj_align(labelYD, buttonYD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZI, move_menu.z_add); - lv_obj_align(labelZI, buttonZI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelZD, move_menu.z_dec); - lv_obj_align(labelZD, buttonZD, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXI); - lv_group_add_obj(g, buttonXD); - lv_group_add_obj(g, buttonYI); - lv_group_add_obj(g, buttonYD); - lv_group_add_obj(g, buttonZI); - lv_group_add_obj(g, buttonZD); lv_group_add_obj(g, buttonV); - lv_group_add_obj(g, buttonBack); } #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN); + disp_move_dist(); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp index 01d6e9a2d5c9..9ed4d60139b9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -49,30 +49,32 @@ #include "../../../../module/probe.h" #endif -extern lv_group_t * g; -static lv_obj_t * scr; -static lv_obj_t *buttonValue = NULL; -static lv_obj_t *labelValue = NULL; - -static char key_value[11] = {0}; -static uint8_t cnt = 0; -static char point_flg = 1; - -#define ID_NUM_KEY1 1 -#define ID_NUM_KEY2 2 -#define ID_NUM_KEY3 3 -#define ID_NUM_KEY4 4 -#define ID_NUM_KEY5 5 -#define ID_NUM_KEY6 6 -#define ID_NUM_KEY7 7 -#define ID_NUM_KEY8 8 -#define ID_NUM_KEY9 9 -#define ID_NUM_KEY0 10 -#define ID_NUM_BACK 11 -#define ID_NUM_RESET 12 -#define ID_NUM_CONFIRM 13 -#define ID_NUM_POINT 14 -#define ID_NUM_NAGETIVE 15 +extern lv_group_t *g; +static lv_obj_t *scr; +static lv_obj_t *buttonValue = nullptr; +static lv_obj_t *labelValue = nullptr; + +static char key_value[11] = { 0 }; +static uint8_t cnt = 0; +static bool point_flag = true; + +enum { + ID_NUM_KEY1 = 1, + ID_NUM_KEY2, + ID_NUM_KEY3, + ID_NUM_KEY4, + ID_NUM_KEY5, + ID_NUM_KEY6, + ID_NUM_KEY7, + ID_NUM_KEY8, + ID_NUM_KEY9, + ID_NUM_KEY0, + ID_NUM_BACK, + ID_NUM_RESET, + ID_NUM_CONFIRM, + ID_NUM_POINT, + ID_NUM_NEGATIVE +}; static void disp_key_value() { char *temp; @@ -80,8 +82,6 @@ static void disp_key_value() { float milliamps; #endif - ZERO(public_buf_m); - switch (value) { case PrintAcceleration: sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.acceleration); @@ -289,14 +289,11 @@ static void disp_key_value() { #endif break; } - ZERO(key_value); + strcpy(key_value, public_buf_m); cnt = strlen(key_value); temp = strchr(key_value, '.'); - if (temp) - point_flg = 0; - else - point_flg = 1; + point_flag = !temp; lv_label_set_text(labelValue, key_value); lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); @@ -540,406 +537,218 @@ static void set_value_confirm() { gcode.process_subcommands_now_P(PSTR("M500")); } -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_NUM_KEY1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'1'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'1'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY2: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'2'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'2'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY3: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'3'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'3'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY4: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'4'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'4'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY5: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'5'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'5'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY6: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'6'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'6'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY7: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'7'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'7'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY8: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'8'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt <= 10) { + key_value[cnt] = (char)'8'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_KEY9: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'9'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } - } - break; - case ID_NUM_KEY0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt <= 10) { - key_value[cnt] = (char)'0'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } - } - break; - case ID_NUM_BACK: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt > 0) - cnt--; - if (key_value[cnt] == (char)'.') point_flg = 1; - key_value[cnt] = (char)'\0'; + if (cnt <= 10) { + key_value[cnt] = (char)'9'; lv_label_set_text(labelValue, key_value); lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; - case ID_NUM_RESET: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - ZERO(key_value); - cnt = 0; + case ID_NUM_KEY0: + if (cnt <= 10) { key_value[cnt] = (char)'0'; - point_flg = 1; lv_label_set_text(labelValue, key_value); lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; + case ID_NUM_BACK: + if (cnt > 0) cnt--; + if (key_value[cnt] == (char)'.') point_flag = true; + key_value[cnt] = (char)'\0'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + break; + case ID_NUM_RESET: + ZERO(key_value); + cnt = 0; + key_value[cnt] = (char)'0'; + point_flag = true; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + break; case ID_NUM_POINT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if ((cnt != 0) && (point_flg == 1)) { - point_flg = 0; - key_value[cnt] = (char)'.'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + if (cnt != 0 && point_flag) { + point_flag = false; + key_value[cnt] = (char)'.'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; - case ID_NUM_NAGETIVE: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (cnt == 0) { - key_value[cnt] = (char)'-'; - lv_label_set_text(labelValue, key_value); - lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); - cnt++; - } + case ID_NUM_NEGATIVE: + if (cnt == 0) { + key_value[cnt] = (char)'-'; + lv_label_set_text(labelValue, key_value); + lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0); + cnt++; } break; case ID_NUM_CONFIRM: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - last_disp_state = NUMBER_KEY_UI; - if (strlen(key_value) != 0) - set_value_confirm(); - lv_clear_number_key(); - draw_return_ui(); - } + last_disp_state = NUMBER_KEY_UI; + if (strlen(key_value) != 0) set_value_confirm(); + lv_clear_number_key(); + draw_return_ui(); break; } } void lv_draw_number_key(void) { - lv_obj_t *NumberKey_1 = NULL, *NumberKey_2 = NULL, *NumberKey_3 = NULL, *NumberKey_4 = NULL, *NumberKey_5 = NULL; - lv_obj_t *NumberKey_6 = NULL, *NumberKey_7 = NULL, *NumberKey_8 = NULL, *NumberKey_9 = NULL, *NumberKey_0 = NULL; - lv_obj_t *KeyPoint = NULL, *KeyConfirm = NULL, *KeyReset = NULL, *KeyBack = NULL; - lv_obj_t *Minus = NULL; - lv_obj_t *labelKey_1 = NULL, *labelKey_2 = NULL, *labelKey_3 = NULL, *labelKey_4 = NULL, *labelKey_5 = NULL; - lv_obj_t *labelKey_6 = NULL, *labelKey_7 = NULL, *labelKey_8 = NULL, *labelKey_9 = NULL, *labelKey_0 = NULL; - lv_obj_t *labelKeyPoint = NULL, *labelKeyConfirm = NULL, *labelKeyReset = NULL, *labelKeyBack = NULL; - lv_obj_t *labelMinus = NULL; - - buttonValue = NULL; - labelValue = NULL; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NUMBER_KEY_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = NUMBER_KEY_UI; } disp_state = NUMBER_KEY_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonValue = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonValue, 92, 40); /*Set its position*/ - lv_obj_set_size(buttonValue, 296, 40); - lv_obj_set_event_cb_mks(buttonValue, event_handler, ID_NUM_KEY1, NULL, 0); - lv_btn_set_style(buttonValue, LV_BTN_STYLE_REL, &style_num_text); /*Set the button's released style*/ - lv_btn_set_style(buttonValue, LV_BTN_STYLE_PR, &style_num_text); /*Set the button's pressed style*/ - //lv_btn_set_layout(buttonValue, LV_LAYOUT_OFF); - labelValue = lv_label_create_empty(buttonValue); /*Add a label to the button*/ - - NumberKey_1 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_1, 92, 90); /*Set its position*/ - lv_obj_set_size(NumberKey_1, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_1, event_handler, ID_NUM_KEY1, NULL, 0); - lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_1, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_1, LV_LAYOUT_OFF); - labelKey_1 = lv_label_create_empty(NumberKey_1); /*Add a label to the button*/ + buttonValue = lv_btn_create(scr, 92, 40, 296, 40, event_handler, ID_NUM_KEY1, &style_num_text); + labelValue = lv_label_create_empty(buttonValue); + + lv_obj_t *NumberKey_1 = lv_btn_create(scr, 92, 90, 68, 40, event_handler, ID_NUM_KEY1, &style_num_key_pre); + lv_obj_t *labelKey_1 = lv_label_create_empty(NumberKey_1); lv_label_set_text(labelKey_1, machine_menu.key_1); lv_obj_align(labelKey_1, NumberKey_1, LV_ALIGN_CENTER, 0, 0); - NumberKey_2 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_2, 168, 90); /*Set its position*/ - lv_obj_set_size(NumberKey_2, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_2, event_handler, ID_NUM_KEY2, NULL, 0); - lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_2, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_2, LV_LAYOUT_OFF); - labelKey_2 = lv_label_create_empty(NumberKey_2); /*Add a label to the button*/ + lv_obj_t *NumberKey_2 = lv_btn_create(scr, 168, 90, 68, 40, event_handler, ID_NUM_KEY2, &style_num_key_pre); + lv_obj_t *labelKey_2 = lv_label_create_empty(NumberKey_2); lv_label_set_text(labelKey_2, machine_menu.key_2); lv_obj_align(labelKey_2, NumberKey_2, LV_ALIGN_CENTER, 0, 0); - NumberKey_3 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_3, 244, 90); /*Set its position*/ - lv_obj_set_size(NumberKey_3, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_3, event_handler, ID_NUM_KEY3, NULL, 0); - lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_3, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_3, LV_LAYOUT_OFF); - labelKey_3 = lv_label_create_empty(NumberKey_3); /*Add a label to the button*/ + lv_obj_t *NumberKey_3 = lv_btn_create(scr, 244, 90, 68, 40, event_handler, ID_NUM_KEY3, &style_num_key_pre); + lv_obj_t *labelKey_3 = lv_label_create_empty(NumberKey_3); lv_label_set_text(labelKey_3, machine_menu.key_3); lv_obj_align(labelKey_3, NumberKey_3, LV_ALIGN_CENTER, 0, 0); - NumberKey_4 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_4, 92, 140); /*Set its position*/ - lv_obj_set_size(NumberKey_4, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_4, event_handler, ID_NUM_KEY4, NULL, 0); - lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_4, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_4, LV_LAYOUT_OFF); - labelKey_4 = lv_label_create_empty(NumberKey_4); /*Add a label to the button*/ + lv_obj_t *NumberKey_4 = lv_btn_create(scr, 92, 140, 68, 40, event_handler, ID_NUM_KEY4, &style_num_key_pre); + lv_obj_t *labelKey_4 = lv_label_create_empty(NumberKey_4); lv_label_set_text(labelKey_4, machine_menu.key_4); lv_obj_align(labelKey_4, NumberKey_4, LV_ALIGN_CENTER, 0, 0); - NumberKey_5 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_5, 168, 140); /*Set its position*/ - lv_obj_set_size(NumberKey_5, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_5, event_handler, ID_NUM_KEY5, NULL, 0); - lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_5, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_5, LV_LAYOUT_OFF); - labelKey_5 = lv_label_create_empty(NumberKey_5); /*Add a label to the button*/ + lv_obj_t *NumberKey_5 = lv_btn_create(scr, 168, 140, 68, 40, event_handler, ID_NUM_KEY5, &style_num_key_pre); + lv_obj_t *labelKey_5 = lv_label_create_empty(NumberKey_5); lv_label_set_text(labelKey_5, machine_menu.key_5); lv_obj_align(labelKey_5, NumberKey_5, LV_ALIGN_CENTER, 0, 0); - NumberKey_6 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_6, 244, 140); /*Set its position*/ - lv_obj_set_size(NumberKey_6, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_6, event_handler, ID_NUM_KEY6, NULL, 0); - lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_6, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_6, LV_LAYOUT_OFF); - labelKey_6 = lv_label_create_empty(NumberKey_6); /*Add a label to the button*/ + lv_obj_t *NumberKey_6 = lv_btn_create(scr, 244, 140, 68, 40, event_handler, ID_NUM_KEY6, &style_num_key_pre); + lv_obj_t *labelKey_6 = lv_label_create_empty(NumberKey_6); lv_label_set_text(labelKey_6, machine_menu.key_6); lv_obj_align(labelKey_6, NumberKey_6, LV_ALIGN_CENTER, 0, 0); - NumberKey_7 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_7, 92, 190); /*Set its position*/ - lv_obj_set_size(NumberKey_7, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_7, event_handler, ID_NUM_KEY7, NULL, 0); - lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_7, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_7, LV_LAYOUT_OFF); - labelKey_7 = lv_label_create_empty(NumberKey_7); /*Add a label to the button*/ + lv_obj_t *NumberKey_7 = lv_btn_create(scr, 92, 190, 68, 40, event_handler, ID_NUM_KEY7, &style_num_key_pre); + lv_obj_t *labelKey_7 = lv_label_create_empty(NumberKey_7); lv_label_set_text(labelKey_7, machine_menu.key_7); lv_obj_align(labelKey_7, NumberKey_7, LV_ALIGN_CENTER, 0, 0); - NumberKey_8 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_8, 168, 190); /*Set its position*/ - lv_obj_set_size(NumberKey_8, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_8, event_handler, ID_NUM_KEY8, NULL, 0); - lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_8, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_8, LV_LAYOUT_OFF); - labelKey_8 = lv_label_create_empty(NumberKey_8); /*Add a label to the button*/ + lv_obj_t *NumberKey_8 = lv_btn_create(scr, 168, 190, 68, 40, event_handler, ID_NUM_KEY8, &style_num_key_pre); + lv_obj_t *labelKey_8 = lv_label_create_empty(NumberKey_8); lv_label_set_text(labelKey_8, machine_menu.key_8); lv_obj_align(labelKey_8, NumberKey_8, LV_ALIGN_CENTER, 0, 0); - NumberKey_9 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_9, 244, 190); /*Set its position*/ - lv_obj_set_size(NumberKey_9, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_9, event_handler, ID_NUM_KEY9, NULL, 0); - lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_9, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_9, LV_LAYOUT_OFF); - labelKey_9 = lv_label_create_empty(NumberKey_9); /*Add a label to the button*/ + lv_obj_t *NumberKey_9 = lv_btn_create(scr, 244, 190, 68, 40, event_handler, ID_NUM_KEY9, &style_num_key_pre); + lv_obj_t *labelKey_9 = lv_label_create_empty(NumberKey_9); lv_label_set_text(labelKey_9, machine_menu.key_9); lv_obj_align(labelKey_9, NumberKey_9, LV_ALIGN_CENTER, 0, 0); - NumberKey_0 = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(NumberKey_0, 92, 240); /*Set its position*/ - lv_obj_set_size(NumberKey_0, 68, 40); - lv_obj_set_event_cb_mks(NumberKey_0, event_handler, ID_NUM_KEY0, NULL, 0); - lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(NumberKey_0, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(NumberKey_0, LV_LAYOUT_OFF); - labelKey_0 = lv_label_create_empty(NumberKey_0); /*Add a label to the button*/ + lv_obj_t *NumberKey_0 = lv_btn_create(scr, 92, 240, 68, 40, event_handler, ID_NUM_KEY0, &style_num_key_pre); + lv_obj_t *labelKey_0 = lv_label_create_empty(NumberKey_0); lv_label_set_text(labelKey_0, machine_menu.key_0); lv_obj_align(labelKey_0, NumberKey_0, LV_ALIGN_CENTER, 0, 0); - KeyBack = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(KeyBack, 320, 90); /*Set its position*/ - lv_obj_set_size(KeyBack, 68, 40); - lv_obj_set_event_cb_mks(KeyBack, event_handler, ID_NUM_BACK, NULL, 0); - lv_btn_set_style(KeyBack, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(KeyBack, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(KeyBack, LV_LAYOUT_OFF); - labelKeyBack = lv_label_create_empty(KeyBack); /*Add a label to the button*/ + lv_obj_t *KeyBack = lv_btn_create(scr, 320, 90, 68, 40, event_handler, ID_NUM_BACK, &style_num_key_pre); + lv_obj_t *labelKeyBack = lv_label_create_empty(KeyBack); lv_label_set_text(labelKeyBack, machine_menu.key_back); lv_obj_align(labelKeyBack, KeyBack, LV_ALIGN_CENTER, 0, 0); - KeyReset = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(KeyReset, 320, 140); /*Set its position*/ - lv_obj_set_size(KeyReset, 68, 40); - lv_obj_set_event_cb_mks(KeyReset, event_handler, ID_NUM_RESET, NULL, 0); - lv_btn_set_style(KeyReset, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(KeyReset, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(KeyReset, LV_LAYOUT_OFF); - labelKeyReset = lv_label_create_empty(KeyReset); /*Add a label to the button*/ + lv_obj_t *KeyReset = lv_btn_create(scr, 320, 140, 68, 40, event_handler, ID_NUM_RESET, &style_num_key_pre); + lv_obj_t *labelKeyReset = lv_label_create_empty(KeyReset); lv_label_set_text(labelKeyReset, machine_menu.key_reset); lv_obj_align(labelKeyReset, KeyReset, LV_ALIGN_CENTER, 0, 0); - KeyConfirm = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(KeyConfirm, 320, 190); /*Set its position*/ - lv_obj_set_size(KeyConfirm, 68, 90); - lv_obj_set_event_cb_mks(KeyConfirm, event_handler, ID_NUM_CONFIRM, NULL, 0); - lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(KeyConfirm, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(KeyConfirm, LV_LAYOUT_OFF); - labelKeyConfirm = lv_label_create_empty(KeyConfirm); /*Add a label to the button*/ + lv_obj_t *KeyConfirm = lv_btn_create(scr, 320, 190, 68, 90, event_handler, ID_NUM_CONFIRM, &style_num_key_pre); + lv_obj_t *labelKeyConfirm = lv_label_create_empty(KeyConfirm); lv_label_set_text(labelKeyConfirm, machine_menu.key_confirm); lv_obj_align(labelKeyConfirm, KeyConfirm, LV_ALIGN_CENTER, 0, 0); - KeyPoint = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(KeyPoint, 244, 240); /*Set its position*/ - lv_obj_set_size(KeyPoint, 68, 40); - lv_obj_set_event_cb_mks(KeyPoint, event_handler, ID_NUM_POINT, NULL, 0); - lv_btn_set_style(KeyPoint, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(KeyPoint, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(KeyPoint, LV_LAYOUT_OFF); - labelKeyPoint = lv_label_create_empty(KeyPoint); /*Add a label to the button*/ + lv_obj_t *KeyPoint = lv_btn_create(scr, 244, 240, 68, 40, event_handler, ID_NUM_POINT, &style_num_key_pre); + lv_obj_t *labelKeyPoint = lv_label_create_empty(KeyPoint); lv_label_set_text(labelKeyPoint, machine_menu.key_point); lv_obj_align(labelKeyPoint, KeyPoint, LV_ALIGN_CENTER, 0, 0); - Minus = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(Minus, 168, 240); /*Set its position*/ - lv_obj_set_size(Minus, 68, 40); - lv_obj_set_event_cb_mks(Minus, event_handler, ID_NUM_NAGETIVE, NULL, 0); - lv_btn_set_style(Minus, LV_BTN_STYLE_REL, &style_num_key_pre); /*Set the button's released style*/ - lv_btn_set_style(Minus, LV_BTN_STYLE_PR, &style_num_key_rel); /*Set the button's pressed style*/ - //lv_btn_set_layout(Minus, LV_LAYOUT_OFF); - labelMinus = lv_label_create_empty(Minus); /*Add a label to the button*/ + lv_obj_t *Minus = lv_btn_create(scr, 168, 240, 68, 40, event_handler, ID_NUM_NEGATIVE, &style_num_key_pre); + lv_obj_t *labelMinus = lv_label_create_empty(Minus); lv_label_set_text(labelMinus, machine_menu.negative); lv_obj_align(labelMinus, Minus, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index dc8bb5714905..16f50c16c5cf 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -35,141 +35,99 @@ #include "../../../../sd/cardreader.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_O_PRE_HEAT 1 -#define ID_O_EXTRUCT 2 -#define ID_O_MOV 3 -#define ID_O_FILAMENT 4 -#define ID_O_SPEED 5 -#define ID_O_RETURN 6 -#define ID_O_FAN 7 -#define ID_O_POWER_OFF 8 -#define ID_O_BABY_STEP 9 +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_O_PRE_HEAT = 1, + ID_O_EXTRUCT, + ID_O_MOV, + ID_O_FILAMENT, + ID_O_SPEED, + ID_O_RETURN, + ID_O_FAN, + ID_O_POWER_OFF, + ID_O_BABY_STEP +}; static lv_obj_t *label_PowerOff; static lv_obj_t *buttonPowerOff; extern feedRate_t feedrate_mm_s; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_O_PRE_HEAT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_preHeat(); - } + lv_clear_operation(); + lv_draw_preHeat(); break; case ID_O_EXTRUCT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_extrusion(); - } + lv_clear_operation(); + lv_draw_extrusion(); break; case ID_O_MOV: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_move_motor(); - } + lv_clear_operation(); + lv_draw_move_motor(); break; case ID_O_FILAMENT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - #if HAS_MULTI_EXTRUDER - uiCfg.curSprayerChoose_bak = active_extruder; + #if HAS_MULTI_EXTRUDER + uiCfg.curSprayerChoose_bak = active_extruder; + #endif + if (uiCfg.print_state == WORKING) { + #if ENABLED(SDSUPPORT) + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; #endif - if (uiCfg.print_state == WORKING) { - #if ENABLED(SDSUPPORT) - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - #endif - } - uiCfg.moveSpeed_bak = (uint16_t)feedrate_mm_s; - uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[active_extruder].target; - lv_clear_operation(); - lv_draw_filament_change(); } + uiCfg.moveSpeed_bak = (uint16_t)feedrate_mm_s; + uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[active_extruder].target; + lv_clear_operation(); + lv_draw_filament_change(); break; case ID_O_FAN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_fan(); - } + lv_clear_operation(); + lv_draw_fan(); break; case ID_O_SPEED: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_change_speed(); - } + lv_clear_operation(); + lv_draw_change_speed(); break; case ID_O_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; case ID_O_POWER_OFF: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.finish_power_off) { - gCfgItems.finish_power_off = false; - lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_manual_off.bin"); - lv_label_set_text(label_PowerOff, printing_more_menu.manual); - } - else { - gCfgItems.finish_power_off = true; - lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_auto_off.bin"); - lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); - } - lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - lv_obj_refresh_ext_draw_pad(label_PowerOff); - update_spi_flash(); - } + if (gCfgItems.finish_power_off) { + gCfgItems.finish_power_off = false; + lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_manual_off.bin"); + lv_label_set_text(label_PowerOff, printing_more_menu.manual); + } + else { + gCfgItems.finish_power_off = true; + lv_imgbtn_set_src_both(buttonPowerOff, "F:/bmp_auto_off.bin"); + lv_label_set_text(label_PowerOff, printing_more_menu.auto_close); + } + lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_obj_refresh_ext_draw_pad(label_PowerOff); + update_spi_flash(); break; case ID_O_BABY_STEP: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_operation(); - lv_draw_baby_stepping(); - } + lv_clear_operation(); + lv_draw_baby_stepping(); break; } } void lv_draw_operation(void) { - lv_obj_t *buttonPreHeat = NULL, *buttonExtrusion = NULL, *buttonSpeed = NULL; - lv_obj_t *buttonBack = NULL, *buttonFan = NULL; - lv_obj_t *labelPreHeat = NULL, *labelExtrusion = NULL; - lv_obj_t *label_Back = NULL, *label_Speed = NULL, *label_Fan = NULL; - lv_obj_t *buttonMove = NULL, *label_Move = NULL; - lv_obj_t *buttonBabyStep = NULL, *label_BabyStep = NULL; - lv_obj_t *buttonFilament = NULL, *label_Filament = NULL; + lv_obj_t *buttonExtrusion = nullptr, *buttonSpeed = nullptr, + *buttonBack = nullptr, + *labelPreHeat = nullptr, *labelExtrusion = nullptr, + *label_Back = nullptr, *label_Speed = nullptr, *label_Fan = nullptr, + *buttonMove = nullptr, *label_Move = nullptr, + *buttonBabyStep = nullptr, *label_BabyStep = nullptr, + *label_Filament = nullptr; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) { disp_state_stack._disp_index++; @@ -177,20 +135,16 @@ void lv_draw_operation(void) { } disp_state = OPERATE_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_temp.bin", INTERVAL_V, titleHeight, event_handler, ID_O_PRE_HEAT); - buttonFilament = lv_imgbtn_create(scr, "F:/bmp_filamentchange.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_O_FILAMENT); - buttonFan = lv_imgbtn_create(scr, "F:/bmp_fan.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_O_FAN); + lv_obj_t *buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_temp.bin", INTERVAL_V, titleHeight, event_handler, ID_O_PRE_HEAT); + lv_obj_t *buttonFilament = lv_imgbtn_create(scr, "F:/bmp_filamentchange.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_O_FILAMENT); + lv_obj_t *buttonFan = lv_imgbtn_create(scr, "F:/bmp_fan.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_O_FAN); buttonPowerOff = lv_imgbtn_create(scr, gCfgItems.finish_power_off ? "F:/bmp_auto_off.bin" : "F:/bmp_manual_off.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_O_POWER_OFF); #if HAS_ROTARY_ENCODER diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp index c7d2de2e1be9..930773b129d9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -29,132 +29,62 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_PAUSE_RETURN 1 -#define ID_PAUSE_X 2 -#define ID_PAUSE_Y 3 -#define ID_PAUSE_Z 4 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_PAUSE_RETURN = 1, + ID_PAUSE_X, + ID_PAUSE_Y, + ID_PAUSE_Z +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_PAUSE_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_pause_position(); - draw_return_ui(); - } + lv_clear_pause_position(); + draw_return_ui(); break; case ID_PAUSE_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = pause_pos_x; - lv_clear_pause_position(); - lv_draw_number_key(); - } + value = pause_pos_x; + lv_clear_pause_position(); + lv_draw_number_key(); break; case ID_PAUSE_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = pause_pos_y; - lv_clear_pause_position(); - lv_draw_number_key(); - } + value = pause_pos_y; + lv_clear_pause_position(); + lv_draw_number_key(); break; case ID_PAUSE_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = pause_pos_z; - lv_clear_pause_position(); - lv_draw_number_key(); - } + value = pause_pos_z; + lv_clear_pause_position(); + lv_draw_number_key(); break; } } void lv_draw_pause_position(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PAUSE_POS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = PAUSE_POS_UI; } disp_state = PAUSE_POS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.PausePosText); - lv_refr_now(lv_refr_get_disp_refreshing()); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.xPos); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); + lv_screen_menu_item_1_edit(scr, machine_menu.xPos, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_X, 0, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.yPos); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosY); + lv_screen_menu_item_1_edit(scr, machine_menu.yPos, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PAUSE_Y, 1, public_buf_l); - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_Y); - labelYValue = lv_label_create_empty(buttonYValue); + sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosZ); + lv_screen_menu_item_1_edit(scr, machine_menu.zPos, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PAUSE_Z, 2, public_buf_l); - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.zPos); - - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_PAUSE_Z); - labelZValue = lv_label_create_empty(buttonZValue); - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - buttonBack = lv_btn_create_back(scr, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE, event_handler, ID_PAUSE_RETURN); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosY); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosZ); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_PAUSE_RETURN, true); } void lv_clear_pause_position() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index 966d85b6de95..a222c7adbfe8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -33,221 +33,163 @@ #include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" -static lv_obj_t * scr; +static lv_obj_t *scr; extern lv_group_t* g; static lv_obj_t *buttonType, *buttonStep; static lv_obj_t *labelType; static lv_obj_t *labelStep; -static lv_obj_t * tempText1; +static lv_obj_t *tempText1; -#define ID_P_ADD 1 -#define ID_P_DEC 2 -#define ID_P_TYPE 3 -#define ID_P_STEP 4 -#define ID_P_OFF 5 -#define ID_P_RETURN 6 +enum { + ID_P_ADD = 1, + ID_P_DEC, + ID_P_TYPE, + ID_P_STEP, + ID_P_OFF, + ID_P_RETURN +}; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_P_ADD: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; - if (uiCfg.curSprayerChoose == 0) { - if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - } + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target += uiCfg.stepHeat; + if (uiCfg.curSprayerChoose == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); } - #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER - else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); - } - #endif - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } - #if HAS_HEATED_BED - else { - thermalManager.temp_bed.target += uiCfg.stepHeat; - if ((int)thermalManager.temp_bed.target > BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { - thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); - } - thermalManager.start_watching_bed(); + #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER + else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); } #endif - disp_desire_temp(); + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } - break; - case ID_P_DEC: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) { - if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; - } - else { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; + #if HAS_HEATED_BED + else { + thermalManager.temp_bed.target += uiCfg.stepHeat; + if ((int)thermalManager.temp_bed.target > BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { + thermalManager.temp_bed.target = (float)BED_MAXTEMP - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1); } - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + thermalManager.start_watching_bed(); } - #if HAS_HEATED_BED - else { - if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) { - thermalManager.temp_bed.target -= uiCfg.stepHeat; - } - else { - thermalManager.temp_bed.target = (float)0; - } - thermalManager.start_watching_bed(); - } - #endif - disp_desire_temp(); + #endif + disp_desire_temp(); + break; + case ID_P_DEC: + if (uiCfg.curTempType == 0) { + if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > uiCfg.stepHeat) + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target -= uiCfg.stepHeat; + else + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = 0; + + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } + #if HAS_HEATED_BED + else { + if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat) + thermalManager.temp_bed.target -= uiCfg.stepHeat; + else + thermalManager.temp_bed.target = 0; + thermalManager.start_watching_bed(); + } + #endif + disp_desire_temp(); break; case ID_P_TYPE: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) { - if (ENABLED(HAS_MULTI_EXTRUDER)) { - if (uiCfg.curSprayerChoose == 0) { - uiCfg.curSprayerChoose = 1; - } - else if (uiCfg.curSprayerChoose == 1) { - if (TEMP_SENSOR_BED != 0) { - uiCfg.curTempType = 1; - } - else { - uiCfg.curTempType = 0; - uiCfg.curSprayerChoose = 0; - } - } + if (uiCfg.curTempType == 0) { + if (ENABLED(HAS_MULTI_EXTRUDER)) { + if (uiCfg.curSprayerChoose == 0) { + uiCfg.curSprayerChoose = 1; } - else if (uiCfg.curSprayerChoose == 0) { - if (TEMP_SENSOR_BED != 0) + else if (uiCfg.curSprayerChoose == 1) { + if (TEMP_SENSOR_BED != 0) { uiCfg.curTempType = 1; - else - uiCfg.curTempType = 0; + } + else { + uiCfg.curTempType = 0; + uiCfg.curSprayerChoose = 0; + } } } - else if (uiCfg.curTempType == 1) { - uiCfg.curSprayerChoose = 0; - uiCfg.curTempType = 0; + else if (uiCfg.curSprayerChoose == 0) { + if (TEMP_SENSOR_BED != 0) + uiCfg.curTempType = 1; + else + uiCfg.curTempType = 0; } - disp_temp_type(); } + else if (uiCfg.curTempType == 1) { + uiCfg.curSprayerChoose = 0; + uiCfg.curTempType = 0; + } + disp_temp_type(); break; case ID_P_STEP: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - switch (uiCfg.stepHeat) { - case 1: uiCfg.stepHeat = 5; break; - case 5: uiCfg.stepHeat = 10; break; - case 10: uiCfg.stepHeat = 1; break; - default: break; - } - disp_step_heat(); + switch (uiCfg.stepHeat) { + case 1: uiCfg.stepHeat = 5; break; + case 5: uiCfg.stepHeat = 10; break; + case 10: uiCfg.stepHeat = 1; break; + default: break; } + disp_step_heat(); break; case ID_P_OFF: - if (event == LV_EVENT_CLICKED) { - // nothing to do + if (uiCfg.curTempType == 0) { + thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = 0; + thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); } - else if (event == LV_EVENT_RELEASED) { - if (uiCfg.curTempType == 0) { - thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)0; - thermalManager.start_watching_hotend(uiCfg.curSprayerChoose); + #if HAS_HEATED_BED + else { + thermalManager.temp_bed.target = 0; + thermalManager.start_watching_bed(); } - #if HAS_HEATED_BED - else { - thermalManager.temp_bed.target = (float)0; - thermalManager.start_watching_bed(); - } - #endif - disp_desire_temp(); - } + #endif + disp_desire_temp(); break; case ID_P_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - draw_return_ui(); - } + clear_cur_ui(); + draw_return_ui(); break; } } void lv_draw_preHeat(void) { - lv_obj_t *buttonAdd, *buttonDec; - lv_obj_t *buttonOff, *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; } disp_state = PRE_HEAT_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - buttonAdd = lv_imgbtn_create(scr, "F:/bmp_Add.bin", INTERVAL_V, titleHeight, event_handler, ID_P_ADD); - lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); - buttonDec = lv_imgbtn_create(scr, "F:/bmp_Dec.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_DEC); - buttonType = lv_imgbtn_create(scr, NULL, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_TYPE); - buttonStep = lv_imgbtn_create(scr, NULL, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_STEP); - buttonOff = lv_imgbtn_create(scr, "F:/bmp_speed0.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_OFF); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelAdd = lv_label_create_empty(buttonAdd); - lv_obj_t *labelDec = lv_label_create_empty(buttonDec); - labelType = lv_label_create_empty(buttonType); - labelStep = lv_label_create_empty(buttonStep); - lv_obj_t *labelOff = lv_label_create_empty(buttonOff); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelAdd, preheat_menu.add); - lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelDec, preheat_menu.dec); - lv_obj_align(labelDec, buttonDec, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelOff, preheat_menu.off); - lv_obj_align(labelOff, buttonOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + lv_big_button_create(scr, "F:/bmp_Add.bin", preheat_menu.add, INTERVAL_V, titleHeight, event_handler, ID_P_ADD); + lv_big_button_create(scr, "F:/bmp_Dec.bin", preheat_menu.dec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_DEC); - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } + buttonType = lv_imgbtn_create(scr, nullptr, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_TYPE); + buttonStep = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_STEP); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonAdd); - lv_group_add_obj(g, buttonDec); lv_group_add_obj(g, buttonType); lv_group_add_obj(g, buttonStep); - lv_group_add_obj(g, buttonOff); - lv_group_add_obj(g, buttonBack); } #endif + lv_big_button_create(scr, "F:/bmp_speed0.bin", preheat_menu.off, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_OFF); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_RETURN); + + // Create labels on the image buttons + labelType = lv_label_create_empty(buttonType); + labelStep = lv_label_create_empty(buttonStep); + disp_temp_type(); disp_step_heat(); @@ -289,10 +231,7 @@ void disp_desire_temp() { public_buf_l[0] = '\0'; if (uiCfg.curTempType == 0) { - if (uiCfg.curSprayerChoose < 1) - strcat(public_buf_l, preheat_menu.ext1); - else - strcat(public_buf_l, preheat_menu.ext2); + strcat(public_buf_l, uiCfg.curSprayerChoose < 1 ? preheat_menu.ext1 : preheat_menu.ext2); sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); } #if HAS_HEATED_BED @@ -304,7 +243,7 @@ void disp_desire_temp() { strcat_P(public_buf_l, PSTR(": ")); strcat(public_buf_l, buf); lv_label_set_text(tempText1, public_buf_l); - lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); + lv_obj_align(tempText1, nullptr, LV_ALIGN_CENTER, 0, -50); } void disp_step_heat() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 8db84c51592a..141ea4cd6fd6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -33,15 +33,17 @@ #include "../../../../sd/cardreader.h" #include "../../../../inc/MarlinConfig.h" -static lv_obj_t * scr; +static lv_obj_t *scr; extern lv_group_t* g; static lv_obj_t *buttonPageUp, *buttonPageDown, *buttonBack, *buttonGcode[FILE_BTN_CNT], *labelPageUp[FILE_BTN_CNT], *buttonText[FILE_BTN_CNT]; -#define ID_P_UP 7 -#define ID_P_DOWN 8 -#define ID_P_RETURN 9 +enum { + ID_P_UP = 7, + ID_P_DOWN, + ID_P_RETURN +}; int8_t curDirLever = 0; LIST_FILE list_file; @@ -74,38 +76,21 @@ uint8_t sel_id = 0; const uint16_t nr = SD_ORDER(i, fileCnt); card.getfilename_sorted(nr); - if (card.flag.filenameIsDir) { - //SERIAL_ECHOLN(card.longest_filename); - list_file.IsFolder[valid_name_cnt] = 1; - } - else { - //SERIAL_ECHOLN(card.longFilename); - list_file.IsFolder[valid_name_cnt] = 0; - } - - #if 1 - // - memset(list_file.file_name[valid_name_cnt], 0, strlen(list_file.file_name[valid_name_cnt])); - strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); - strcat_P(list_file.file_name[valid_name_cnt], PSTR("/")); - strcat(list_file.file_name[valid_name_cnt], card.filename); - // - memset(list_file.long_name[valid_name_cnt], 0, strlen(list_file.long_name[valid_name_cnt])); - if (card.longFilename[0] == 0) - strncpy(list_file.long_name[valid_name_cnt], card.filename, strlen(card.filename)); - else - strncpy(list_file.long_name[valid_name_cnt], card.longFilename, strlen(card.longFilename)); - - valid_name_cnt++; - if (valid_name_cnt == 1) - dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; - if (valid_name_cnt >= FILE_NUM) { - dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; - list_file.Sd_file_offset++; - break; - } + list_file.IsFolder[valid_name_cnt] = card.flag.filenameIsDir; + strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); + strcat_P(list_file.file_name[valid_name_cnt], PSTR("/")); + strcat(list_file.file_name[valid_name_cnt], card.filename); + strcpy(list_file.long_name[valid_name_cnt], card.longest_filename()); + + valid_name_cnt++; + if (valid_name_cnt == 1) + dir_offset[curDirLever].cur_page_first_offset = list_file.Sd_file_offset; + if (valid_name_cnt >= FILE_NUM) { + dir_offset[curDirLever].cur_page_last_offset = list_file.Sd_file_offset; list_file.Sd_file_offset++; - #endif + break; + } + list_file.Sd_file_offset++; } list_file.Sd_file_cnt++; } @@ -115,125 +100,105 @@ uint8_t sel_id = 0; #endif // SDSUPPORT -uint8_t have_pre_pic(char *path) { +bool have_pre_pic(char *path) { #if ENABLED(SDSUPPORT) char *ps1, *ps2, *cur_name = strrchr(path, '/'); - card.openFileRead(cur_name); card.read(public_buf, 512); ps1 = strstr((char *)public_buf, ";simage:"); card.read(public_buf, 512); ps2 = strstr((char *)public_buf, ";simage:"); - if (ps1 || ps2) { - card.closefile(); - return 1; - } card.closefile(); + if (ps1 || ps2) return true; #endif - return 0; + return false; } -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; uint8_t i, file_count = 0; //switch (obj->mks_obj_id) //{ if (obj->mks_obj_id == ID_P_UP) { - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (dir_offset[curDirLever].curPage > 0) { - // 2015.05.19 - list_file.Sd_file_cnt = 0; + if (dir_offset[curDirLever].curPage > 0) { + // 2015.05.19 + list_file.Sd_file_cnt = 0; - if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; + if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - if (file_count != 0) { - dir_offset[curDirLever].curPage--; - lv_clear_print_file(); - disp_gcode_icon(file_count); - } + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage--; + lv_clear_print_file(); + disp_gcode_icon(file_count); } } } else if (obj->mks_obj_id == ID_P_DOWN) { - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (dir_offset[curDirLever].cur_page_last_offset > 0) { - list_file.Sd_file_cnt = 0; - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - if (file_count != 0) { - dir_offset[curDirLever].curPage++; - lv_clear_print_file(); - disp_gcode_icon(file_count); - } - if (file_count < FILE_NUM) - dir_offset[curDirLever].cur_page_last_offset = 0; + if (dir_offset[curDirLever].cur_page_last_offset > 0) { + list_file.Sd_file_cnt = 0; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + if (file_count != 0) { + dir_offset[curDirLever].curPage++; + lv_clear_print_file(); + disp_gcode_icon(file_count); } + if (file_count < FILE_NUM) + dir_offset[curDirLever].cur_page_last_offset = 0; } } else if (obj->mks_obj_id == ID_P_RETURN) { - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (curDirLever > 0) { - int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); - if (ch) { - *ch = 0; - #if ENABLED(SDSUPPORT) - card.cdup(); - #endif - dir_offset[curDirLever].curPage = 0; - dir_offset[curDirLever].cur_page_first_offset = 0; - dir_offset[curDirLever].cur_page_last_offset = 0; - curDirLever--; - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - lv_clear_print_file(); - disp_gcode_icon(file_count); - } - } - else { + if (curDirLever > 0) { + int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); + if (ch) { + *ch = 0; + #if ENABLED(SDSUPPORT) + card.cdup(); + #endif + dir_offset[curDirLever].curPage = 0; + dir_offset[curDirLever].cur_page_first_offset = 0; + dir_offset[curDirLever].cur_page_last_offset = 0; + curDirLever--; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif lv_clear_print_file(); - lv_draw_ready_print(); + disp_gcode_icon(file_count); } } + else { + lv_clear_print_file(); + lv_draw_ready_print(); + } } else { for (i = 0; i < FILE_BTN_CNT; i++) { if (obj->mks_obj_id == (i + 1)) { - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - if (list_file.file_name[i][0] != 0) { - if (list_file.IsFolder[i] == 1) { - ZERO(list_file.curDirPath); - strcpy(list_file.curDirPath, list_file.file_name[i]); - curDirLever++; - list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) - file_count = search_file(); - #endif - lv_clear_print_file(); - disp_gcode_icon(file_count); - } - else { - sel_id = i; - lv_clear_print_file(); - lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); - } - break; + if (list_file.file_name[i][0] != 0) { + if (list_file.IsFolder[i]) { + strcpy(list_file.curDirPath, list_file.file_name[i]); + curDirLever++; + list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; + #if ENABLED(SDSUPPORT) + file_count = search_file(); + #endif + lv_clear_print_file(); + disp_gcode_icon(file_count); } + else { + sel_id = i; + lv_clear_print_file(); + lv_draw_dialog(DIALOG_TYPE_PRINT_FILE); + } + break; } } } @@ -249,11 +214,11 @@ void lv_draw_print_file(void) { } disp_state = PRINT_FILE_UI; - curDirLever = 0; + curDirLever = 0; dir_offset[curDirLever].curPage = 0; list_file.Sd_file_offset = 0; - list_file.Sd_file_cnt = 0; + list_file.Sd_file_cnt = 0; ZERO(dir_offset); ZERO(list_file.IsFolder); @@ -287,14 +252,7 @@ static char test_public_buf_l[40]; void disp_gcode_icon(uint8_t file_num) { uint8_t i; - scr = lv_obj_create(NULL, NULL); - - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -319,17 +277,17 @@ void disp_gcode_icon(uint8_t file_num) { if (i >= file_num) break; #ifdef TFT35 - buttonGcode[i] = lv_imgbtn_create(scr, NULL); + buttonGcode[i] = lv_imgbtn_create(scr, nullptr); lv_imgbtn_use_label_style(buttonGcode[i]); lv_obj_clear_protect(buttonGcode[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonGcode[i], LV_LAYOUT_OFF); ZERO(public_buf_m); - cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); + cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); - if (list_file.IsFolder[i] == 1) { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); + if (list_file.IsFolder[i]) { + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); @@ -344,34 +302,33 @@ void disp_gcode_icon(uint8_t file_num) { //lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), list_file.file_name[i], 1); - ZERO(test_public_buf_l); - strcat(test_public_buf_l,"S:"); - strcat(test_public_buf_l,list_file.file_name[i]); - char *temp = strstr(test_public_buf_l,".GCO"); - if (temp) { strcpy(temp,".bin"); } - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); + strcpy(test_public_buf_l, "S:"); + strcat(test_public_buf_l, list_file.file_name[i]); + char *temp = strstr(test_public_buf_l, ".GCO"); + if (temp) strcpy(temp, ".bin"); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l); if (i < 3) { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); - buttonText[i] = lv_btn_create(scr, NULL); + buttonText[i] = lv_btn_create(scr, nullptr); //lv_obj_set_event_cb(buttonText[i], event_handler); lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } else { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET); - buttonText[i] = lv_btn_create(scr, NULL); + buttonText[i] = lv_btn_create(scr, nullptr); //lv_obj_set_event_cb(buttonText[i], event_handler); lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),NULL, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -379,7 +336,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); } else { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), NULL, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); @@ -502,7 +459,7 @@ void lv_gcode_file_seek(uint32_t pos) { card.setIndex(pos); } -void cutFileName(char *path, int len, int bytePerLine, char *outStr) { +void cutFileName(char *path, int len, int bytePerLine, char *outStr) { #if _LFN_UNICODE TCHAR *tmpFile; TCHAR *strIndex1 = 0, *strIndex2 = 0, *beginIndex; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h index 083b3d9acf07..94786ab07013 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -43,7 +43,7 @@ typedef struct { char file_name[FILE_NUM][SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; char curDirPath[SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; char long_name[FILE_NUM][SHORT_NEME_LEN * 2 + 1]; - char IsFolder[FILE_NUM]; + bool IsFolder[FILE_NUM]; char Sd_file_cnt; char sd_file_index; char Sd_file_offset; @@ -55,7 +55,7 @@ extern void lv_draw_print_file(void); extern uint32_t lv_open_gcode_file(char *path); extern void lv_gcode_file_read(uint8_t *data_buf); extern void lv_close_gcode_file(); -extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); +extern void cutFileName(char *path, int len, int bytePerLine, char *outStr); extern int ascii2dec_test(char *ascii); extern void lv_clear_print_file(); extern void lv_gcode_file_seek(uint32_t pos); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 312ce69d0c6b..8191d5fb6552 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -59,78 +59,61 @@ TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2); static lv_obj_t* labelBed; #endif -#define ID_PAUSE 1 -#define ID_STOP 2 -#define ID_OPTION 3 +enum { + ID_PAUSE = 1, + ID_STOP, + ID_OPTION +}; bool once_flag; // = false extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; extern uint32_t To_pre_view; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; + if (gcode_preview_over) return; switch (obj->mks_obj_id) { case ID_PAUSE: - if (event == LV_EVENT_CLICKED) { - // nothing to do + if (uiCfg.print_state == WORKING) { + // #if ENABLED(PARK_HEAD_ON_PAUSE) + // queue.inject_P(PSTR("M25 P\nM24")); + #if ENABLED(SDSUPPORT) + // queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); + card.pauseSDPrint(); + stop_print_time(); + uiCfg.print_state = PAUSING; + #endif + lv_imgbtn_set_src_both(buttonPause, "F:/bmp_resume.bin"); + lv_label_set_text(labelPause, printing_menu.resume); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); } - else if (event == LV_EVENT_RELEASED) { - if (!gcode_preview_over) { - if (uiCfg.print_state == WORKING) { - // #if ENABLED(PARK_HEAD_ON_PAUSE) - // queue.inject_P(PSTR("M25 P\nM24")); - #if ENABLED(SDSUPPORT) - // queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - #endif - lv_imgbtn_set_src_both(buttonPause, "F:/bmp_resume.bin"); - lv_label_set_text(labelPause, printing_menu.resume); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); - } - else if (uiCfg.print_state == PAUSED) { - uiCfg.print_state = RESUMING; - lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); - lv_label_set_text(labelPause, printing_menu.pause); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); - } - #if ENABLED(POWER_LOSS_RECOVERY) - else if (uiCfg.print_state == REPRINTING) { - uiCfg.print_state = REPRINTED; - lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); - lv_label_set_text(labelPause, printing_menu.pause); - lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); - // recovery.resume(); - print_time.minutes = recovery.info.print_job_elapsed / 60; - print_time.seconds = recovery.info.print_job_elapsed % 60; - print_time.hours = print_time.minutes / 60; - } - #endif - } + else if (uiCfg.print_state == PAUSED) { + uiCfg.print_state = RESUMING; + lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); } + #if ENABLED(POWER_LOSS_RECOVERY) + else if (uiCfg.print_state == REPRINTING) { + uiCfg.print_state = REPRINTED; + lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); + lv_label_set_text(labelPause, printing_menu.pause); + lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); + // recovery.resume(); + print_time.minutes = recovery.info.print_job_elapsed / 60; + print_time.seconds = recovery.info.print_job_elapsed % 60; + print_time.hours = print_time.minutes / 60; + } + #endif break; case ID_STOP: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (!gcode_preview_over) { - lv_clear_printing(); - lv_draw_dialog(DIALOG_TYPE_STOP); - } - } + lv_clear_printing(); + lv_draw_dialog(DIALOG_TYPE_STOP); break; case ID_OPTION: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - if (!gcode_preview_over) { - lv_clear_printing(); - lv_draw_operation(); - } - } + lv_clear_printing(); + lv_draw_operation(); break; } } @@ -142,44 +125,38 @@ void lv_draw_printing(void) { disp_state = PRINTING_UI; - scr = lv_obj_create(NULL, NULL); - - // static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create image buttons - lv_obj_t *buttonExt1 = lv_img_create(scr, NULL); + lv_obj_t *buttonExt1 = lv_img_create(scr, nullptr); lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin"); lv_obj_set_pos(buttonExt1, 205, 136); #if HAS_MULTI_EXTRUDER - lv_obj_t *buttonExt2 = lv_img_create(scr, NULL); + lv_obj_t *buttonExt2 = lv_img_create(scr, nullptr); lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin"); lv_obj_set_pos(buttonExt2, 350, 136); #endif #if HAS_HEATED_BED - lv_obj_t *buttonBedstate = lv_img_create(scr, NULL); + lv_obj_t *buttonBedstate = lv_img_create(scr, nullptr); lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin"); lv_obj_set_pos(buttonBedstate, 205, 186); #endif - lv_obj_t *buttonFanstate = lv_img_create(scr, NULL); + lv_obj_t *buttonFanstate = lv_img_create(scr, nullptr); lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin"); lv_obj_set_pos(buttonFanstate, 350, 186); - lv_obj_t *buttonTime = lv_img_create(scr, NULL); + lv_obj_t *buttonTime = lv_img_create(scr, nullptr); lv_img_set_src(buttonTime, "F:/bmp_time_state.bin"); lv_obj_set_pos(buttonTime, 205, 86); - lv_obj_t *buttonZpos = lv_img_create(scr, NULL); + lv_obj_t *buttonZpos = lv_img_create(scr, nullptr); lv_img_set_src(buttonZpos, "F:/bmp_zpos_state.bin"); lv_obj_set_pos(buttonZpos, 350, 86); @@ -209,19 +186,19 @@ void lv_draw_printing(void) { //lv_btn_set_layout(buttonTime, LV_LAYOUT_OFF); //lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); - labelExt1 = lv_label_create(scr, 250, 146, NULL); + labelExt1 = lv_label_create(scr, 250, 146, nullptr); #if HAS_MULTI_EXTRUDER - labelExt2 = lv_label_create(scr, 395, 146, NULL); + labelExt2 = lv_label_create(scr, 395, 146, nullptr); #endif #if HAS_HEATED_BED - labelBed = lv_label_create(scr, 250, 196, NULL); + labelBed = lv_label_create(scr, 250, 196, nullptr); #endif - labelFan = lv_label_create(scr, 395, 196, NULL); - labelTime = lv_label_create(scr, 250, 96, NULL); - labelZpos = lv_label_create(scr, 395, 96, NULL); + labelFan = lv_label_create(scr, 395, 196, nullptr); + labelTime = lv_label_create(scr, 250, 96, nullptr); + labelZpos = lv_label_create(scr, 395, 96, nullptr); labelPause = lv_label_create_empty(buttonPause); labelStop = lv_label_create_empty(buttonStop); @@ -238,7 +215,7 @@ void lv_draw_printing(void) { lv_obj_align(labelOperat, buttonOperat, LV_ALIGN_CENTER, 20, 0); } - bar1 = lv_bar_create(scr, NULL); + bar1 = lv_bar_create(scr, nullptr); lv_obj_set_pos(bar1, 205, 36); lv_obj_set_size(bar1, 270, 40); lv_bar_set_style(bar1, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); @@ -256,12 +233,10 @@ void lv_draw_printing(void) { } void disp_ext_temp() { - ZERO(public_buf_l); sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target); lv_label_set_text(labelExt1, public_buf_l); #if HAS_MULTI_EXTRUDER - ZERO(public_buf_l); sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target); lv_label_set_text(labelExt2, public_buf_l); #endif @@ -269,20 +244,17 @@ void disp_ext_temp() { void disp_bed_temp() { #if HAS_HEATED_BED - ZERO(public_buf_l); sprintf(public_buf_l, printing_menu.bed_temp, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target); lv_label_set_text(labelBed, public_buf_l); #endif } void disp_fan_speed() { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%3d"), thermalManager.fan_speed[0]); lv_label_set_text(labelFan, public_buf_l); } void disp_print_time() { - ZERO(public_buf_l); #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) const uint32_t r = ui.get_remaining_time(); sprintf_P(public_buf_l, PSTR("%02d:%02d R"), r / 3600, (r % 3600) / 60); @@ -293,7 +265,6 @@ void disp_print_time() { } void disp_fan_Zpos() { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("%.3f"), current_position[Z_AXIS]); lv_label_set_text(labelZpos, public_buf_l); } @@ -333,7 +304,6 @@ void setProBarRate() { if (disp_state == PRINTING_UI) { lv_bar_set_value(bar1, rate, LV_ANIM_ON); - ZERO(public_buf_l); sprintf_P(public_buf_l, "%d%%", rate); lv_label_set_text(bar1ValueText,public_buf_l); lv_obj_align(bar1ValueText, bar1, LV_ALIGN_CENTER, 0, 0); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h index b7d464e4f093..466efe01cb40 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -25,14 +25,16 @@ extern "C" { /* C-declarations for C++ */ #endif -#define IDLE 0 -#define WORKING 1 -#define PAUSING 2 -#define PAUSED 3 -#define REPRINTING 4 -#define REPRINTED 5 -#define RESUMING 6 -#define STOP 7 +enum { + IDLE, + WORKING, + PAUSING, + PAUSED, + REPRINTING, + REPRINTED, + RESUMING, + STOP +}; extern void lv_draw_printing(void); extern void lv_clear_printing(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 765570ca3bd5..3e8a9aad5b1a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -43,44 +43,31 @@ //static lv_obj_t *buttonPrint, *buttonTool, *buttonSet; extern lv_group_t* g; -static lv_obj_t * scr; +static lv_obj_t *scr; #if ENABLED(MKS_TEST) uint8_t curent_disp_ui = 0; #endif -#define ID_TOOL 1 -#define ID_SET 2 -#define ID_PRINT 3 +enum { + ID_TOOL = 1, + ID_SET, + ID_PRINT +}; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_TOOL: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - - lv_clear_ready_print(); - lv_draw_tool(); - } + lv_clear_ready_print(); + lv_draw_tool(); break; case ID_SET: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_ready_print(); - lv_draw_set(); - } + lv_clear_ready_print(); + lv_draw_set(); break; case ID_PRINT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_ready_print(); - lv_draw_print_file(); - } + lv_clear_ready_print(); + lv_draw_print_file(); break; } } @@ -114,20 +101,16 @@ void mks_disp_test() { char buf[30] = {0}; //lv_obj_t *label_tool2 = lv_label_create_empty(scr); //lv_obj_set_pos(label_tool, 20, 50); - ZERO(buf); sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius); lv_label_set_text(e1, buf); #if HAS_MULTI_HOTEND - ZERO(buf); sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.temp_hotend[1].celsius); lv_label_set_text(e2, buf); #endif - //ZERO(buf); //sprintf_P(buf, PSTR("e3:%d"), (int)thermalManager.temp_hotend[2].celsius); //lv_label_set_text(e3, buf); #if HAS_HEATED_BED - ZERO(buf); sprintf_P(buf, PSTR("bed:%d"), (int)thermalManager.temp_bed.celsius); lv_label_set_text(bed, buf); #endif @@ -135,7 +118,7 @@ void mks_disp_test() { void lv_draw_ready_print(void) { char buf[30] = {0}; - lv_obj_t *buttonPrint, *buttonTool, *buttonSet; + lv_obj_t *buttonTool; disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); @@ -143,11 +126,7 @@ void lv_draw_ready_print(void) { disp_state = PRINT_READY_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); //lv_obj_set_hidden(scr, true); lv_refr_now(lv_refr_get_disp_refreshing()); @@ -155,12 +134,12 @@ void lv_draw_ready_print(void) { //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); // Create image buttons - //buttonPrint = lv_imgbtn_create(scr, NULL); + //buttonPrint = lv_imgbtn_create(scr, nullptr); buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL); lv_obj_set_pos(buttonTool, 360, 180); - //buttonSet = lv_imgbtn_create(scr, NULL); + //buttonSet = lv_imgbtn_create(scr, nullptr); //lv_obj_set_pos(buttonSet, 180, 90); //lv_obj_set_pos(buttonPrint, 340, 90); @@ -237,34 +216,9 @@ void lv_draw_ready_print(void) { } else { - // Create an Image button - buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", 20, 90, event_handler, ID_TOOL); - lv_obj_t *label_tool = lv_label_create_empty(buttonTool); - - buttonSet = lv_imgbtn_create(scr, "F:/bmp_set.bin", 180, 90, event_handler, ID_SET); - lv_obj_t *label_set = lv_label_create_empty(buttonSet); - - buttonPrint = lv_imgbtn_create(scr, "F:/bmp_printing.bin", 340, 90, event_handler, ID_PRINT); - lv_obj_t *label_print = lv_label_create_empty(buttonPrint); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_print, main_menu.print); - lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_set, main_menu.set); - lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_tool, main_menu.tool); - lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) { - lv_group_add_obj(g, buttonTool); - lv_group_add_obj(g, buttonSet); - lv_group_add_obj(g, buttonPrint); - } - #endif + lv_big_button_create(scr, "F:/bmp_tool.bin", main_menu.tool, 20, 90, event_handler, ID_TOOL); + lv_big_button_create(scr, "F:/bmp_set.bin", main_menu.set, 180, 90, event_handler, ID_SET); + lv_big_button_create(scr, "F:/bmp_printing.bin", main_menu.print, 340, 90, event_handler, ID_PRINT); } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index e4896866cf28..46ea04deafa6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -37,100 +37,58 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" -static lv_obj_t * scr; +static lv_obj_t *scr; extern lv_group_t* g; -#define ID_S_WIFI 1 -#define ID_S_FAN 2 -#define ID_S_ABOUT 3 -#define ID_S_CONTINUE 4 -#define ID_S_MOTOR_OFF 5 -#define ID_S_LANGUAGE 6 -#define ID_S_MACHINE_PARA 7 -#define ID_S_EEPROM_SET 8 -#define ID_S_RETURN 9 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +enum { + ID_S_WIFI = 1, + ID_S_FAN, + ID_S_ABOUT, + ID_S_CONTINUE, + ID_S_MOTOR_OFF, + ID_S_LANGUAGE, + ID_S_MACHINE_PARA, + ID_S_EEPROM_SET, + ID_S_RETURN +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; #if ENABLED(USE_WIFI_FUNCTION) char buf[6] = { 0 }; #endif switch (obj->mks_obj_id) { - case ID_S_FAN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_fan(); - } + lv_clear_set(); + lv_draw_fan(); break; case ID_S_ABOUT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_about(); - } - break; - case ID_S_CONTINUE: - + lv_clear_set(); + lv_draw_about(); break; + case ID_S_CONTINUE: break; case ID_S_MOTOR_OFF: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - #if HAS_SUICIDE - suicide(); - #else - queue.enqueue_now_P(PSTR("M84")); - #endif - } + TERN(HAS_SUICIDE, suicide(), queue.enqueue_now_P(PSTR("M84"))); break; case ID_S_LANGUAGE: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_language(); - } + lv_clear_set(); + lv_draw_language(); break; case ID_S_MACHINE_PARA: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_machine_para(); - } + lv_clear_set(); + lv_draw_machine_para(); break; case ID_S_EEPROM_SET: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_eeprom_settings(); - } + lv_clear_set(); + lv_draw_eeprom_settings(); break; case ID_S_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_set(); - lv_draw_ready_print(); - } + lv_clear_set(); + lv_draw_ready_print(); break; + #if ENABLED(USE_WIFI_FUNCTION) case ID_S_WIFI: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { if (gCfgItems.wifi_mode_sel == STA_MODEL) { if (wifi_link_state == WIFI_CONNECTED) { last_disp_state = SET_UI; @@ -153,7 +111,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { else { last_disp_state = SET_UI; lv_clear_set(); - lv_draw_dialog(WIFI_ENABLE_TIPS); + lv_draw_dialog(DIALOG_WIFI_ENABLE_TIPS); } } } @@ -162,131 +120,36 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { lv_clear_set(); lv_draw_wifi(); } - } - break; + break; #endif } } void lv_draw_set(void) { - lv_obj_t *buttonFan, *buttonAbout; - lv_obj_t *buMotorOff, *buttonBack; - #if HAS_LANG_SELECT_SCREEN - lv_obj_t *buttonLanguage; - #endif - lv_obj_t *buttonMachinePara; - lv_obj_t *buttonEepromSet; - #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_t *buttonWifi; - #endif - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; } disp_state = SET_UI; - scr = lv_obj_create(NULL, NULL); - - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create image buttons - buttonEepromSet = lv_imgbtn_create(scr, "F:/bmp_eeprom_settings.bin", INTERVAL_V, titleHeight, event_handler, ID_S_EEPROM_SET); - //buttonWifi = lv_imgbtn_create(scr, NULL); - buttonFan = lv_imgbtn_create(scr, "F:/bmp_fan.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_S_FAN); - buttonAbout = lv_imgbtn_create(scr, "F:/bmp_about.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_S_ABOUT); - //buttonContinue = lv_imgbtn_create(scr, NULL); - buMotorOff = lv_imgbtn_create(scr, ENABLED(HAS_SUICIDE) ? "F:/bmp_manual_off.bin" : "F:/bmp_function1.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_S_MOTOR_OFF); - buttonMachinePara = lv_imgbtn_create(scr, "F:/bmp_machine_para.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_MACHINE_PARA); + lv_big_button_create(scr, "F:/bmp_eeprom_settings.bin", set_menu.eepromSet, INTERVAL_V, titleHeight, event_handler, ID_S_EEPROM_SET); + lv_big_button_create(scr, "F:/bmp_fan.bin", set_menu.fan, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_S_FAN); + lv_big_button_create(scr, "F:/bmp_about.bin", set_menu.about, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_S_ABOUT); + lv_big_button_create(scr, ENABLED(HAS_SUICIDE) ? "F:/bmp_manual_off.bin" : "F:/bmp_function1.bin", set_menu.TERN(HAS_SUICIDE, shutdown, motoroff), BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_S_MOTOR_OFF); + lv_big_button_create(scr, "F:/bmp_machine_para.bin", set_menu.machine_para, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_MACHINE_PARA); #if HAS_LANG_SELECT_SCREEN - buttonLanguage = lv_imgbtn_create(scr, "F:/bmp_language.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE); + lv_big_button_create(scr, "F:/bmp_language.bin", set_menu.language, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE); #endif #if ENABLED(USE_WIFI_FUNCTION) - buttonWifi = lv_imgbtn_create(scr, "F:/bmp_wifi.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI); - #endif - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN); - - /*lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - lv_obj_set_pos(buttonFan,BTN_X_PIXEL+INTERVAL_V*2,titleHeight); - lv_obj_set_pos(buttonAbout,BTN_X_PIXEL*2+INTERVAL_V*3,titleHeight); - lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - lv_obj_set_pos(buMotorOff,INTERVAL_V, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonLanguage,BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight); - lv_obj_set_pos(buttonBack,BTN_X_PIXEL*3+INTERVAL_V*4, BTN_Y_PIXEL+INTERVAL_H+titleHeight);*/ - - //lv_obj_set_pos(buttonWifi,INTERVAL_V,titleHeight); - //lv_obj_set_pos(buttonContinue,BTN_X_PIXEL*3+INTERVAL_V*4,titleHeight); - - /// Create labels on the buttons - //lv_obj_t *labelWifi= lv_label_create_empty(buttonWifi); - lv_obj_t *label_EepromSet = lv_label_create_empty(buttonEepromSet); - lv_obj_t *labelFan = lv_label_create_empty(buttonFan); - lv_obj_t *label_About = lv_label_create_empty(buttonAbout); - //lv_obj_t *label_Continue = lv_label_create_empty(buttonContinue); - lv_obj_t *label_MotorOff = lv_label_create_empty(buMotorOff); - lv_obj_t *label_MachinePara = lv_label_create_empty(buttonMachinePara); - #if HAS_LANG_SELECT_SCREEN - lv_obj_t *label_Language = lv_label_create_empty(buttonLanguage); - #endif - #if ENABLED(USE_WIFI_FUNCTION) - lv_obj_t *label_Wifi = lv_label_create_empty(buttonWifi); - #endif - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - - lv_label_set_text(label_EepromSet, set_menu.eepromSet); - lv_obj_align(label_EepromSet, buttonEepromSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelFan, set_menu.fan); - lv_obj_align(labelFan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_About, set_menu.about); - lv_obj_align(label_About, buttonAbout, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_Continue, set_menu.breakpoint); - //lv_obj_align(label_Continue, buttonContinue, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - lv_label_set_text(label_MotorOff, set_menu.TERN(HAS_SUICIDE, shutdown, motoroff)); - lv_obj_align(label_MotorOff, buMotorOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_MachinePara, set_menu.machine_para); - lv_obj_align(label_MachinePara, buttonMachinePara, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - #if HAS_LANG_SELECT_SCREEN - lv_label_set_text(label_Language, set_menu.language); - lv_obj_align(label_Language, buttonLanguage, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - #endif - - #if ENABLED(USE_WIFI_FUNCTION) - lv_label_set_text(label_Wifi, set_menu.wifi); - lv_obj_align(label_Wifi, buttonWifi, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - #endif - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonEepromSet); - lv_group_add_obj(g, buttonFan); - lv_group_add_obj(g, buttonAbout); - lv_group_add_obj(g, buMotorOff); - lv_group_add_obj(g, buttonMachinePara); - lv_group_add_obj(g, buttonLanguage); - #if ENABLED(USE_WIFI_FUNCTION) - lv_group_add_obj(g, buttonWifi); - #endif - lv_group_add_obj(g, buttonBack); - } + lv_big_button_create(scr, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI); #endif + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN); } void lv_clear_set() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp index 9f093891460d..b2b1b00c3b44 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -29,243 +29,100 @@ #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_STEP_RETURN 1 -#define ID_STEP_X 2 -#define ID_STEP_Y 3 -#define ID_STEP_Z 4 -#define ID_STEP_E0 5 -#define ID_STEP_E1 6 -#define ID_STEP_DOWN 7 -#define ID_STEP_UP 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_STEP_RETURN = 1, + ID_STEP_X, + ID_STEP_Y, + ID_STEP_Z, + ID_STEP_E0, + ID_STEP_E1, + ID_STEP_DOWN, + ID_STEP_UP +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_STEP_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_step_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_step_settings(); + draw_return_ui(); break; case ID_STEP_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = Xstep; - lv_clear_step_settings(); - lv_draw_number_key(); - } + value = Xstep; + lv_clear_step_settings(); + lv_draw_number_key(); break; case ID_STEP_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = Ystep; - lv_clear_step_settings(); - lv_draw_number_key(); - } + value = Ystep; + lv_clear_step_settings(); + lv_draw_number_key(); break; case ID_STEP_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = Zstep; - lv_clear_step_settings(); - lv_draw_number_key(); - } + value = Zstep; + lv_clear_step_settings(); + lv_draw_number_key(); break; case ID_STEP_E0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E0step; - lv_clear_step_settings(); - lv_draw_number_key(); - } + value = E0step; + lv_clear_step_settings(); + lv_draw_number_key(); break; case ID_STEP_E1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E1step; - lv_clear_step_settings(); - lv_draw_number_key(); - } + value = E1step; + lv_clear_step_settings(); + lv_draw_number_key(); break; case ID_STEP_UP: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_step_settings(); - lv_draw_step_settings(); - } + uiCfg.para_ui_page = 0; + lv_clear_step_settings(); + lv_draw_step_settings(); break; case ID_STEP_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_step_settings(); - lv_draw_step_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_step_settings(); + lv_draw_step_settings(); break; } } void lv_draw_step_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; - lv_obj_t *buttonE1Value = NULL, *labelE1Value = NULL; - lv_obj_t *line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != STEPS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = STEPS_UI; } disp_state = STEPS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.StepsConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); if (uiCfg.para_ui_page != 1) { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Steps); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Steps); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_Y); - labelYValue = lv_label_create_empty(buttonYValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.X_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_X, 0, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Steps); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Y_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_STEP_Y, 1, public_buf_l); - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_Z); - labelZValue = lv_label_create_empty(buttonZValue); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.Z_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_STEP_Z, 2, public_buf_l); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); + lv_screen_menu_item_1_edit(scr, machine_menu.E0_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_STEP_E0, 3, public_buf_l); - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0_Steps); - - buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_E0); - labelE0Value = lv_label_create_empty(buttonE0Value); - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - buttonTurnPage = lv_btn_create(scr, event_handler, ID_STEP_DOWN); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonE0Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_DOWN, true); } else { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1_Steps); - - buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_STEP_E1); - labelE1Value = lv_label_create_empty(buttonE1Value); + sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); + lv_screen_menu_item_1_edit(scr, machine_menu.E1_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_E1, 0, public_buf_l); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_btn_create(scr, event_handler, ID_STEP_UP); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonE1Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_UP, true); } - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - - buttonBack = lv_btn_create(scr, NULL); - lv_btn_set_style_both(buttonBack, &style_para_back); - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_STEP_RETURN, NULL, 0); - label_Back = lv_label_create_empty(buttonBack); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); - lv_label_set_text(labelE0Value, public_buf_l); - lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); - } - else { - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); - lv_label_set_text(labelE1Value, public_buf_l); - lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_STEP_RETURN, true); } void lv_clear_step_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp index a05cc257a8e2..777b93d1f53b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -30,304 +30,138 @@ #include "../../../../feature/tmc_util.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_TMC_CURRENT_RETURN 1 -#define ID_TMC_CURRENT_X 2 -#define ID_TMC_CURRENT_Y 3 -#define ID_TMC_CURRENT_Z 4 -#define ID_TMC_CURRENT_E0 5 -#define ID_TMC_CURRENT_E1 6 -#define ID_TMC_CURRENT_DOWN 7 -#define ID_TMC_CURRENT_UP 8 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_TMC_CURRENT_RETURN = 1, + ID_TMC_CURRENT_X, + ID_TMC_CURRENT_Y, + ID_TMC_CURRENT_Z, + ID_TMC_CURRENT_E0, + ID_TMC_CURRENT_E1, + ID_TMC_CURRENT_DOWN, + ID_TMC_CURRENT_UP +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_TMC_CURRENT_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_tmc_current_settings(); + draw_return_ui(); break; + #if AXIS_IS_TMC(X) case ID_TMC_CURRENT_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = Xcurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); - } + value = Xcurrent; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); break; #endif - #if AXIS_IS_TMC(Y) - case ID_TMC_CURRENT_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { + case ID_TMC_CURRENT_Y: value = Ycurrent; lv_clear_tmc_current_settings(); lv_draw_number_key(); - } - break; + break; #endif - #if AXIS_IS_TMC(Z) - case ID_TMC_CURRENT_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { + case ID_TMC_CURRENT_Z: value = Zcurrent; lv_clear_tmc_current_settings(); lv_draw_number_key(); - } - break; + break; #endif - #if AXIS_IS_TMC(E0) case ID_TMC_CURRENT_E0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E0current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); - } + value = E0current; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); break; #endif - #if AXIS_IS_TMC(E1) case ID_TMC_CURRENT_E1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - value = E1current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); - } + value = E1current; + lv_clear_tmc_current_settings(); + lv_draw_number_key(); break; #endif - case ID_TMC_CURRENT_UP: - if (event == LV_EVENT_CLICKED) { - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); - lv_draw_tmc_current_settings(); - } + case ID_TMC_CURRENT_UP: + uiCfg.para_ui_page = 0; + lv_clear_tmc_current_settings(); + lv_draw_tmc_current_settings(); break; case ID_TMC_CURRENT_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_tmc_current_settings(); - lv_draw_tmc_current_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_tmc_current_settings(); + lv_draw_tmc_current_settings(); break; } } void lv_draw_tmc_current_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXValue = NULL, *labelXValue = NULL; - lv_obj_t *buttonYValue = NULL, *labelYValue = NULL; - lv_obj_t *buttonZValue = NULL, *labelZValue = NULL; - lv_obj_t *buttonE0Value = NULL, *labelE0Value = NULL; - - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; - //#if AXIS_IS_TMC(E1) - lv_obj_t *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *labelE1Text = NULL, *buttonE1Value = NULL, *labelE1Value = NULL; - //#endif - float milliamps; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_CURRENT_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = TMC_CURRENT_UI; } disp_state = TMC_CURRENT_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcCurrentConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + float milliamps; if (uiCfg.para_ui_page != 1) { - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.X_Current); - - buttonXValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_X); - labelXValue = lv_label_create_empty(buttonXValue); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, machine_menu.Y_Current); - - buttonYValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_Y); - labelYValue = lv_label_create_empty(buttonYValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, machine_menu.Z_Current); - - buttonZValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_Z); - labelZValue = lv_label_create_empty(buttonZValue); - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - (void)lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.E0_Current); - - buttonE0Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_E0); - labelE0Value = lv_label_create_empty(buttonE0Value); + #if AXIS_IS_TMC(X) + milliamps = stepperX.getMilliamps(); + #else + milliamps = -1; + #endif + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_screen_menu_item_1_edit(scr, machine_menu.X_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_X, 0, public_buf_l); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonXValue); - lv_group_add_obj(g, buttonYValue); - lv_group_add_obj(g, buttonZValue); - lv_group_add_obj(g, buttonE0Value); - } + #if AXIS_IS_TMC(Y) + milliamps = stepperY.getMilliamps(); + #else + milliamps = -1; #endif + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_screen_menu_item_1_edit(scr, machine_menu.Y_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_TMC_CURRENT_Y, 1, public_buf_l); - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); + #if AXIS_IS_TMC(Z) + milliamps = stepperZ.getMilliamps(); + #else + milliamps = -1; + #endif + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_screen_menu_item_1_edit(scr, machine_menu.Z_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_TMC_CURRENT_Z, 2, public_buf_l); - //#if AXIS_IS_TMC(E1) - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_DOWN, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); + #if AXIS_IS_TMC(E0) + milliamps = stepperE0.getMilliamps(); + #else + milliamps = -1; + #endif + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_screen_menu_item_1_edit(scr, machine_menu.E0_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_TMC_CURRENT_E0, 3, public_buf_l); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTurnPage); - #endif - //#endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_DOWN, true); } else { - //#if AXIS_IS_TMC(E1) - labelE1Text = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.E1_Current); - - buttonE1Value = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_TMC_CURRENT_E1); - labelE1Value = lv_label_create_empty(buttonE1Value); - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_TMC_CURRENT_UP, NULL, 0); - lv_btn_set_style_both(buttonTurnPage, &style_para_back); + #if AXIS_IS_TMC(E1) + milliamps = stepperE1.getMilliamps(); + #else + milliamps = -1; + #endif + sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); + lv_screen_menu_item_1_edit(scr, machine_menu.E1_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_E1, 0, public_buf_l); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonE1Value); - lv_group_add_obj(g, buttonTurnPage); - } - #endif - //#endif + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_UP, true); } - //#if AXIS_IS_TMC(E1) - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - //#endif - buttonBack = lv_btn_create(scr, NULL); - lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_TMC_CURRENT_RETURN, NULL, 0); - lv_btn_set_style_both(buttonBack, &style_para_back); - - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y); - lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE); - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - //#if AXIS_IS_TMC(E1) - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - //#endif - #if AXIS_IS_TMC(X) - milliamps = stepperX.getMilliamps(); - #else - milliamps = -1; - #endif - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); - lv_label_set_text(labelXValue, public_buf_l); - lv_obj_align(labelXValue, buttonXValue, LV_ALIGN_CENTER, 0, 0); - - #if AXIS_IS_TMC(Y) - milliamps = stepperY.getMilliamps(); - #else - milliamps = -1; - #endif - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); - lv_label_set_text(labelYValue, public_buf_l); - lv_obj_align(labelYValue, buttonYValue, LV_ALIGN_CENTER, 0, 0); - - #if AXIS_IS_TMC(Z) - milliamps = stepperZ.getMilliamps(); - #else - milliamps = -1; - #endif - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); - lv_label_set_text(labelZValue, public_buf_l); - lv_obj_align(labelZValue, buttonZValue, LV_ALIGN_CENTER, 0, 0); - - #if AXIS_IS_TMC(E0) - milliamps = stepperE0.getMilliamps(); - #else - milliamps = -1; - #endif - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); - lv_label_set_text(labelE0Value, public_buf_l); - lv_obj_align(labelE0Value, buttonE0Value, LV_ALIGN_CENTER, 0, 0); - } - else { - //#if AXIS_IS_TMC(E1) - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - #if AXIS_IS_TMC(E1) - milliamps = stepperE1.getMilliamps(); - #else - milliamps = -1; - #endif - ZERO(public_buf_l); - sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); - lv_label_set_text(labelE1Value, public_buf_l); - lv_obj_align(labelE1Value, buttonE1Value, LV_ALIGN_CENTER, 0, 0); - //#endif - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_CURRENT_RETURN, true); } void lv_clear_tmc_current_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 2140af079318..3814dacfe109 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -34,185 +34,83 @@ #include "../../../../module/settings.h" #endif -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_TMC_MODE_RETURN 1 -#define ID_TMC_MODE_X 2 -#define ID_TMC_MODE_Y 3 -#define ID_TMC_MODE_Z 4 -#define ID_TMC_MODE_E0 5 -#define ID_TMC_MODE_E1 6 -#define ID_TMC_MODE_DOWN 7 -#define ID_TMC_MODE_UP 8 - -static lv_obj_t *labelXState = NULL, *labelYState = NULL, *labelZState = NULL, *labelE0State = NULL; -static lv_obj_t *buttonXState = NULL, *buttonYState = NULL, *buttonZState = NULL, *buttonE0State = NULL; +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_TMC_MODE_RETURN = 1, + ID_TMC_MODE_X, + ID_TMC_MODE_Y, + ID_TMC_MODE_Z, + ID_TMC_MODE_E0, + ID_TMC_MODE_E1, + ID_TMC_MODE_DOWN, + ID_TMC_MODE_UP +}; + +static lv_obj_t *buttonXState = nullptr, *buttonYState = nullptr, *buttonZState = nullptr, *buttonE0State = nullptr; //#if AXIS_HAS_STEALTHCHOP(E1) - static lv_obj_t *labelE1State = NULL, *buttonE1State = NULL; + static lv_obj_t *buttonE1State = nullptr; //#endif -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; + + auto toggle_chop = [&](auto &stepper, auto &button) { + const bool isena = stepper.toggle_stepping_mode(); + lv_screen_menu_item_onoff_update(button, isena); + TERN_(EEPROM_SETTINGS, (void)settings.save()); + }; + switch (obj->mks_obj_id) { case ID_TMC_MODE_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_tmc_step_mode_settings(); - draw_return_ui(); - } + uiCfg.para_ui_page = 0; + lv_clear_tmc_step_mode_settings(); + draw_return_ui(); break; #if AXIS_HAS_STEALTHCHOP(X) case ID_TMC_MODE_X: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (stepperX.toggle_stepping_mode()) { - lv_imgbtn_set_src_both(buttonXState, "F:/bmp_enable.bin"); - lv_label_set_text(labelXState, machine_menu.enable); - } - else { - lv_imgbtn_set_src_both(buttonXState, "F:/bmp_disable.bin"); - lv_label_set_text(labelXState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - } - TERN_(EEPROM_SETTINGS, (void)settings.save()); - } + toggle_chop(stepperX, buttonXState); break; - #endif // if AXIS_HAS_STEALTHCHOP(X) - + #endif #if AXIS_HAS_STEALTHCHOP(Y) case ID_TMC_MODE_Y: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (stepperY.toggle_stepping_mode()) { - lv_imgbtn_set_src_both(buttonYState, "F:/bmp_enable.bin"); - lv_label_set_text(labelYState, machine_menu.enable); - } - else { - lv_imgbtn_set_src_both(buttonYState, "F:/bmp_disable.bin"); - lv_label_set_text(labelYState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - } - TERN_(EEPROM_SETTINGS, (void)settings.save()); - } + toggle_chop(stepperY, buttonYState); break; - #endif // if AXIS_HAS_STEALTHCHOP(Y) - + #endif #if AXIS_HAS_STEALTHCHOP(Z) case ID_TMC_MODE_Z: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (stepperZ.toggle_stepping_mode()) { - lv_imgbtn_set_src_both(buttonZState, "F:/bmp_enable.bin"); - lv_label_set_text(labelZState, machine_menu.enable); - } - else { - lv_imgbtn_set_src_both(buttonZState, "F:/bmp_disable.bin"); - lv_label_set_text(labelZState, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - } - TERN_(EEPROM_SETTINGS, (void)settings.save()); - } + toggle_chop(stepperZ, buttonZState); break; - #endif // if AXIS_HAS_STEALTHCHOP(Z) - + #endif #if AXIS_HAS_STEALTHCHOP(E0) case ID_TMC_MODE_E0: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (stepperE0.toggle_stepping_mode()) { - lv_imgbtn_set_src_both(buttonE0State, "F:/bmp_enable.bin"); - lv_label_set_text(labelE0State, machine_menu.enable); - } - else { - lv_imgbtn_set_src_both(buttonE0State, "F:/bmp_disable.bin"); - lv_label_set_text(labelE0State, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - } - TERN_(EEPROM_SETTINGS, (void)settings.save()); - } + toggle_chop(stepperE0, buttonE0State); break; - #endif // if AXIS_HAS_STEALTHCHOP(E0) - + #endif #if AXIS_HAS_STEALTHCHOP(E1) case ID_TMC_MODE_E1: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (stepperE1.toggle_stepping_mode()) { - lv_imgbtn_set_src_both(buttonE1State, "F:/bmp_enable.bin"); - lv_label_set_text(labelE1State, machine_menu.enable); - } - else { - lv_imgbtn_set_src_both(buttonE1State, "F:/bmp_disable.bin"); - lv_label_set_text(labelE1State, machine_menu.disable); - //lv_obj_align(labelXState, buttonE1State, LV_ALIGN_IN_LEFT_MID,0, 0); - } - TERN_(EEPROM_SETTINGS, (void)settings.save()); - } + toggle_chop(stepperE1, buttonE1State); break; - #endif // if AXIS_HAS_STEALTHCHOP(E1) - case ID_TMC_MODE_UP: - if (event == LV_EVENT_CLICKED) { + #endif - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 0; - lv_clear_tmc_step_mode_settings(); - lv_draw_tmc_step_mode_settings(); - } + case ID_TMC_MODE_UP: + uiCfg.para_ui_page = 0; + lv_clear_tmc_step_mode_settings(); + lv_draw_tmc_step_mode_settings(); break; case ID_TMC_MODE_DOWN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.para_ui_page = 1; - lv_clear_tmc_step_mode_settings(); - lv_draw_tmc_step_mode_settings(); - } + uiCfg.para_ui_page = 1; + lv_clear_tmc_step_mode_settings(); + lv_draw_tmc_step_mode_settings(); break; } } void lv_draw_tmc_step_mode_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonXText = NULL, *labelXText = NULL; - lv_obj_t *buttonYText = NULL, *labelYText = NULL; - lv_obj_t *buttonZText = NULL, *labelZText = NULL; - lv_obj_t *buttonE0Text = NULL, *labelE0Text = NULL; - - lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL; - //#if AXIS_HAS_STEALTHCHOP(E1) - lv_obj_t *buttonTurnPage = NULL, *labelTurnPage = NULL; - lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL; - //#endif - - labelXState = NULL; - buttonXState = NULL; - labelYState = NULL; - buttonYState = NULL; - labelZState = NULL; - buttonZState = NULL; - labelE0State = NULL; - buttonE0State = NULL; - //#if AXIS_HAS_STEALTHCHOP(E1) - labelE1State = NULL; - buttonE1State = NULL; - //#endif + buttonXState = buttonYState = buttonZState = buttonE0State = buttonE1State = nullptr; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_MODE_UI) { disp_state_stack._disp_index++; @@ -220,14 +118,8 @@ void lv_draw_tmc_step_mode_settings(void) { } disp_state = TMC_MODE_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); - + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcStepModeConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); bool stealth_X = false, stealth_Y = false, stealth_Z = false, stealth_E0 = false, stealth_E1 = false; @@ -248,136 +140,18 @@ void lv_draw_tmc_step_mode_settings(void) { #endif if (uiCfg.para_ui_page != 1) { - buttonXText = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); - labelXText = lv_label_create_empty(buttonXText); /*Add a label to the button*/ - - buttonXState = lv_imgbtn_create(scr, stealth_X ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_X); - labelXState = lv_label_create_empty(buttonXState); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonXState); - #endif - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonYText = lv_btn_create(scr, NULL, PARA_UI_POS_X, PARA_UI_POS_Y * 2, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); - labelYText = lv_label_create_empty(buttonYText); /*Add a label to the button*/ - - buttonYState = lv_imgbtn_create(scr, stealth_Y ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_Y); - labelYState = lv_label_create_empty(buttonYState); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonYState); - #endif - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2, line_points[1]); - - buttonZText = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); - labelZText = lv_label_create_empty(buttonZText); /*Add a label to the button*/ - - buttonZState = lv_imgbtn_create(scr, stealth_Z ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_Z); - labelZState = lv_label_create_empty(buttonZState); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonZState); - #endif - - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3, line_points[2]); - - buttonE0Text = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); - labelE0Text = lv_label_create_empty(buttonE0Text); /*Add a label to the button*/ - - buttonE0State = lv_imgbtn_create(scr, stealth_E0 ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_E0); - labelE0State = lv_label_create_empty(buttonE0State); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonE0State); - #endif - - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4, line_points[3]); - - //#if AXIS_HAS_STEALTHCHOP(E1) - buttonTurnPage = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_TMC_MODE_DOWN); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonTurnPage); - #endif - //#endif + buttonXState = lv_screen_menu_item_onoff(scr, machine_menu.X_StepMode, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_MODE_X, 0, stealth_X); + buttonYState = lv_screen_menu_item_onoff(scr, machine_menu.Y_StepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_TMC_MODE_Y, 1, stealth_Y); + buttonZState = lv_screen_menu_item_onoff(scr, machine_menu.Z_StepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_TMC_MODE_Z, 2, stealth_Z); + buttonE0State = lv_screen_menu_item_onoff(scr, machine_menu.E0_StepMode, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_TMC_MODE_E0, 2, stealth_E0); + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_MODE_DOWN, true); } else { - //#if AXIS_HAS_STEALTHCHOP(E1) - buttonE1Text = lv_btn_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y, PARA_UI_VALUE_SIZE_X, PARA_UI_SIZE_Y, event_handler, 0); - labelE1Text = lv_label_create_empty(buttonE1Text); /*Add a label to the button*/ - - buttonE1State = lv_imgbtn_create(scr, stealth_E1 ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V, event_handler, ID_TMC_MODE_E1); - labelE1State = lv_label_create_empty(buttonE1State); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonE1State); - #endif - - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1, line_points[0]); - - buttonTurnPage = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", event_handler, ID_TMC_MODE_UP); - //#endif + buttonE1State = lv_screen_menu_item_onoff(scr, machine_menu.E1_StepMode, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_MODE_E1, 0, stealth_E1); + lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_MODE_UP, true); } - //#if AXIS_HAS_STEALTHCHOP(E1) - lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y); - lv_btn_set_layout(buttonTurnPage, LV_LAYOUT_OFF); - labelTurnPage = lv_label_create_empty(buttonTurnPage); - //#endif - - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_MODE_RETURN); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - if (uiCfg.para_ui_page != 1) { - lv_label_set_text(labelXText, machine_menu.X_StepMode); - lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelYText, machine_menu.Y_StepMode); - lv_obj_align(labelYText, buttonYText, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelZText, machine_menu.Z_StepMode); - lv_obj_align(labelZText, buttonZText, LV_ALIGN_IN_LEFT_MID, 0, 0); - - lv_label_set_text(labelE0Text, machine_menu.E0_StepMode); - lv_obj_align(labelE0Text, buttonE0Text, LV_ALIGN_IN_LEFT_MID, 0, 0); - lv_label_set_text(labelXState, stealth_X ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelXState, buttonXState, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelYState, stealth_Y ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelYState, buttonYState, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelZState, stealth_Z ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelZState, buttonZState, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelE0State, stealth_E0 ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelE0State, buttonE0State, LV_ALIGN_CENTER, 0, 0); - - //#if AXIS_HAS_STEALTHCHOP(E1) - lv_label_set_text(labelTurnPage, machine_menu.next); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - //#endif - } - else { - //#if AXIS_HAS_STEALTHCHOP(E1) - lv_label_set_text(labelE1Text, machine_menu.E1_StepMode); - lv_obj_align(labelE1Text, buttonE1Text, LV_ALIGN_IN_LEFT_MID, 0, 0); - lv_label_set_text(labelE1State, stealth_E1 ? machine_menu.enable : machine_menu.disable); - lv_obj_align(labelE1State, buttonE1State, LV_ALIGN_CENTER, 0, 0); - - lv_label_set_text(labelTurnPage, machine_menu.previous); - lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0); - //#endif - } - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); - } + lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_MODE_RETURN, true); } void lv_clear_tmc_step_mode_settings() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 8f310729788f..2bbd544cc889 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -34,182 +34,92 @@ #include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" -extern lv_group_t * g; -static lv_obj_t * scr; - -#define ID_T_PRE_HEAT 1 -#define ID_T_EXTRUCT 2 -#define ID_T_MOV 3 -#define ID_T_HOME 4 -#define ID_T_LEVELING 5 -#define ID_T_FILAMENT 6 -#define ID_T_MORE 7 -#define ID_T_RETURN 8 +extern lv_group_t *g; +static lv_obj_t *scr; + +enum { + ID_T_PRE_HEAT = 1, + ID_T_EXTRUCT, + ID_T_MOV, + ID_T_HOME, + ID_T_LEVELING, + ID_T_FILAMENT, + ID_T_MORE, + ID_T_RETURN +}; #if ENABLED(MKS_TEST) extern uint8_t curent_disp_ui; #endif -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_T_PRE_HEAT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_preHeat(); - } + lv_clear_tool(); + lv_draw_preHeat(); break; case ID_T_EXTRUCT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_extrusion(); - } + lv_clear_tool(); + lv_draw_extrusion(); break; case ID_T_MOV: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_move_motor(); - } + lv_clear_tool(); + lv_draw_move_motor(); break; case ID_T_HOME: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_tool(); - lv_draw_home(); - } + lv_clear_tool(); + lv_draw_home(); break; case ID_T_LEVELING: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - //queue.enqueue_one_P(PSTR("G28")); - //queue.enqueue_one_P(PSTR("G29")); - get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m); - public_buf_m[sizeof(public_buf_m)-1] = 0; - queue.inject_P(PSTR(public_buf_m)); - #else - uiCfg.leveling_first_time = 1; - lv_clear_tool(); - lv_draw_manualLevel(); - #endif - } + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + //queue.enqueue_one_P(PSTR("G28")); + //queue.enqueue_one_P(PSTR("G29")); + get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m); + public_buf_m[sizeof(public_buf_m)-1] = 0; + queue.inject_P(PSTR(public_buf_m)); + #else + uiCfg.leveling_first_time = 1; + lv_clear_tool(); + lv_draw_manualLevel(); + #endif break; case ID_T_FILAMENT: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target; - lv_clear_tool(); - lv_draw_filament_change(); - } + uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target; + lv_clear_tool(); + lv_draw_filament_change(); break; case ID_T_MORE: break; case ID_T_RETURN: - if (event == LV_EVENT_CLICKED) { - // nothing to do - } - else if (event == LV_EVENT_RELEASED) { - TERN_(MKS_TEST, curent_disp_ui = 1); - lv_clear_tool(); - lv_draw_ready_print(); - } + TERN_(MKS_TEST, curent_disp_ui = 1); + lv_clear_tool(); + lv_draw_ready_print(); break; } } void lv_draw_tool(void) { - lv_obj_t *buttonPreHeat, *buttonExtrusion, *buttonMove, *buttonHome, *buttonLevel; - lv_obj_t *buttonFilament; - lv_obj_t *buttonBack; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; } disp_state = TOOL_UI; - scr = lv_obj_create(NULL, NULL); - - //static lv_style_t tool_style; - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - // Create image buttons - buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_preHeat.bin", INTERVAL_V, titleHeight, event_handler, ID_T_PRE_HEAT); - buttonExtrusion = lv_imgbtn_create(scr, "F:/bmp_extruct.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_EXTRUCT); - buttonMove = lv_imgbtn_create(scr, "F:/bmp_mov.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_T_MOV); - buttonHome = lv_imgbtn_create(scr, "F:/bmp_zero.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME); - buttonLevel = lv_imgbtn_create(scr, "F:/bmp_leveling.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING); - buttonFilament = lv_imgbtn_create(scr, "F:/bmp_filamentchange.bin",BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT); - //buttonMore = lv_imgbtn_createx(scr, NULL); - //lv_obj_set_pos(buttonMore,BTN_X_PIXEL*2+INTERVAL_V*3, BTN_Y_PIXEL+INTERVAL_H+titleHeight); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_RETURN); - - // Create labels on the image buttons - lv_obj_t *labelPreHeat = lv_label_create_empty(buttonPreHeat); - lv_obj_t *labelExtrusion = lv_label_create_empty(buttonExtrusion); - lv_obj_t *label_Move = lv_label_create_empty(buttonMove); - lv_obj_t *label_Home = lv_label_create_empty(buttonHome); - lv_obj_t *label_Level = lv_label_create_empty(buttonLevel); - lv_obj_t *label_Filament = lv_label_create_empty(buttonFilament); - //lv_obj_t *label_More = lv_label_create_empty(buttonMore); - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(labelPreHeat, tool_menu.preheat); - lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(labelExtrusion, tool_menu.extrude); - lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Move, tool_menu.move); - lv_obj_align(label_Move, buttonMove, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Home, tool_menu.home); - lv_obj_align(label_Home, buttonHome, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Level, tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling)); - lv_obj_align(label_Level, buttonLevel, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Filament, tool_menu.filament); - lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_More, tool_menu.more); - //lv_obj_align(label_More, buttonMore, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonPreHeat); - lv_group_add_obj(g, buttonExtrusion); - lv_group_add_obj(g, buttonMove); - lv_group_add_obj(g, buttonHome); - lv_group_add_obj(g, buttonLevel); - lv_group_add_obj(g, buttonFilament); - lv_group_add_obj(g, buttonBack); - } - #endif + lv_big_button_create(scr, "F:/bmp_preHeat.bin", tool_menu.preheat, INTERVAL_V, titleHeight, event_handler, ID_T_PRE_HEAT); + lv_big_button_create(scr, "F:/bmp_extruct.bin", tool_menu.extrude, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_EXTRUCT); + + lv_big_button_create(scr, "F:/bmp_mov.bin", tool_menu.move, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_T_MOV); + lv_big_button_create(scr, "F:/bmp_zero.bin", tool_menu.home, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME); + + lv_big_button_create(scr, "F:/bmp_leveling.bin", tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling), INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING); + lv_big_button_create(scr, "F:/bmp_filamentchange.bin", tool_menu.filament, BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_RETURN); } void lv_clear_tool() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index ef2330528550..2de5bf25e18e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -61,13 +61,14 @@ uint32_t To_pre_view; bool gcode_preview_over, flash_preview_begin, default_preview_flg; uint32_t size = 809; uint16_t row; -uint8_t temperature_change_frequency; +bool temps_update_flag; uint8_t printing_rate_update_flag; extern bool once_flag; extern uint8_t sel_id; extern uint8_t public_buf[512]; extern uint8_t bmp_public_buf[17 * 1024]; +extern lv_group_t *g; extern void LCD_IO_WriteData(uint16_t RegValue); @@ -282,6 +283,9 @@ lv_style_t style_para_back; lv_style_t lv_bar_style_indic; +lv_style_t style_btn_pr; +lv_style_t style_btn_rel; + void tft_style_init() { lv_style_copy(&tft_style_scr, &lv_style_scr); tft_style_scr.body.main_color = LV_COLOR_BACKGROUND; @@ -399,6 +403,25 @@ void tft_style_init() { style_para_back.text.color = LV_COLOR_WHITE; style_para_back.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); + lv_style_copy(&style_btn_rel, &lv_style_plain); + style_btn_rel.body.border.color = lv_color_hex3(0x269); + style_btn_rel.body.border.width = 1; + style_btn_rel.body.main_color = lv_color_hex3(0xADF); + style_btn_rel.body.grad_color = lv_color_hex3(0x46B); + style_btn_rel.body.shadow.width = 4; + style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; + style_btn_rel.body.radius = LV_RADIUS_CIRCLE; + style_btn_rel.text.color = lv_color_hex3(0xDEF); + style_btn_rel.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); + + lv_style_copy(&style_btn_pr, &style_btn_rel); + style_btn_pr.body.border.color = lv_color_hex3(0x46B); + style_btn_pr.body.main_color = lv_color_hex3(0x8BD); + style_btn_pr.body.grad_color = lv_color_hex3(0x24A); + style_btn_pr.body.shadow.width = 2; + style_btn_pr.text.color = lv_color_hex3(0xBCD); + style_btn_pr.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); + lv_style_copy(&lv_bar_style_indic, &lv_style_pretty_color); lv_bar_style_indic.text.color = lv_color_hex3(0xADF); lv_bar_style_indic.image.color = lv_color_hex3(0xADF); @@ -421,7 +444,6 @@ void titleText_cat(char *str, int strSize, char *addPart) { char *getDispText(int index) { - ZERO(public_buf_l); switch (disp_state_stack._disp_state[index]) { case PRINT_READY_UI: @@ -926,30 +948,30 @@ void print_time_run() { } void GUI_RefreshPage() { - if ((systick_uptime_millis % 1000) == 0) temperature_change_frequency = 1; - if ((systick_uptime_millis % 3000) == 0) printing_rate_update_flag = 1; + if ((systick_uptime_millis % 1000) == 0) temps_update_flag = true; + if ((systick_uptime_millis % 3000) == 0) printing_rate_update_flag = true; switch (disp_state) { case MAIN_UI: //lv_draw_ready_print(); break; case EXTRUSION_UI: - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_hotend_temp(); } break; case PRE_HEAT_UI: - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_desire_temp(); } break; case PRINT_READY_UI: /* if (gCfgItems.display_style == 2) { - if (temperature_change_frequency) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_restro_state(); } } @@ -959,8 +981,8 @@ void GUI_RefreshPage() { case PRINT_FILE_UI: break; case PRINTING_UI: - if (temperature_change_frequency) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_ext_temp(); disp_bed_temp(); disp_fan_speed(); @@ -968,15 +990,15 @@ void GUI_RefreshPage() { disp_fan_Zpos(); } if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) { - printing_rate_update_flag = 0; + printing_rate_update_flag = false; if (!gcode_preview_over) setProBarRate(); } break; case OPERATE_UI: /* - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_temp_operate(); } @@ -986,16 +1008,16 @@ void GUI_RefreshPage() { case PAUSE_UI: /* - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_temp_pause(); } */ break; case FAN_UI: - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_fan_value(); } break; @@ -1003,14 +1025,12 @@ void GUI_RefreshPage() { case MOVE_MOTOR_UI: /* if (mksReprint.mks_printer_state == MKS_IDLE) { - if ((z_high_count==1)&&(temper_error_flg != 1)) { + if (z_high_count == 1 && temper_error_flg != 1) { z_high_count = 0; - { - memset((char *)gCfgItems.move_z_coordinate, ' ', sizeof(gCfgItems.move_z_coordinate)); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); - sprintf_P((char *)gCfgItems.move_z_coordinate, PSTR("Z: %.3f"), current_position[Z_AXIS]); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); - } + memset((char *)gCfgItems.move_z_coordinate, ' ', sizeof(gCfgItems.move_z_coordinate)); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); + sprintf_P((char *)gCfgItems.move_z_coordinate, PSTR("Z: %.3f"), current_position[Z_AXIS]); + GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); } } */ @@ -1018,9 +1038,9 @@ void GUI_RefreshPage() { #if ENABLED(USE_WIFI_FUNCTION) case WIFI_UI: - if (temperature_change_frequency == 1) { + if (temps_update_flag) { disp_wifi_state(); - temperature_change_frequency = 0; + temps_update_flag = false; } break; #endif @@ -1030,8 +1050,8 @@ void GUI_RefreshPage() { break; case FILAMENTCHANGE_UI: - if (temperature_change_frequency) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_filament_temp(); } break; @@ -1046,9 +1066,9 @@ void GUI_RefreshPage() { break; case WIFI_LIST_UI: #if ENABLED(USE_WIFI_FUNCTION) - if (printing_rate_update_flag == 1) { + if (printing_rate_update_flag) { disp_wifi_list(); - printing_rate_update_flag = 0; + printing_rate_update_flag = false; } #endif break; @@ -1103,8 +1123,8 @@ void GUI_RefreshPage() { #endif case BABY_STEP_UI: - if (temperature_change_frequency == 1) { - temperature_change_frequency = 0; + if (temps_update_flag) { + temps_update_flag = false; disp_z_offset_value(); } break; @@ -1589,21 +1609,36 @@ void lv_imgbtn_use_label_style(lv_obj_t *imgbtn) { lv_imgbtn_set_style(imgbtn, LV_BTN_STATE_PR, &tft_style_label_pre); } -// Use label style for the image button +// Use label style for the button void lv_btn_use_label_style(lv_obj_t *btn) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, &tft_style_label_rel); lv_btn_set_style(btn, LV_BTN_STYLE_PR, &tft_style_label_pre); } +// Use button style for the button +void lv_btn_use_button_style(lv_obj_t *btn) { + lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); + lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); +} + // Use a single style for both Released and Pressed void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style) { lv_btn_set_style(btn, LV_BTN_STYLE_REL, style); lv_btn_set_style(btn, LV_BTN_STYLE_PR, style); } +// Create a screen +lv_obj_t* lv_screen_create() { + lv_obj_t *scr = lv_obj_create(nullptr, nullptr); + lv_obj_set_style(scr, &tft_style_scr); + lv_scr_load(scr); + lv_obj_clean(scr); + return scr; +} + // Create an empty label lv_obj_t* lv_label_create_empty(lv_obj_t *par) { - return lv_label_create(par, (lv_obj_t*)NULL); + return lv_label_create(par, (lv_obj_t*)nullptr); } // Create a label with style and text @@ -1621,35 +1656,66 @@ lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char } // Create a button with callback, ID, and Style. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id, lv_style_t *style) { - lv_obj_t *btn = lv_btn_create(par, NULL); +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/, lv_style_t *style/*=&style_para_value*/) { + lv_obj_t *btn = lv_btn_create(par, nullptr); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, NULL, 0); + lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); else lv_obj_set_event_cb(btn, cb); lv_btn_set_style_both(btn, style); return btn; } -// Create a button with callback and ID. Style set to style_para_value. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id) { - return lv_btn_create(par, cb, id, &style_para_value); +// Create a button with callback and ID, with label style. +lv_obj_t* lv_label_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_btn_create(par, cb, id, nullptr); + lv_btn_use_label_style(btn); + return btn; +} + +// Create a button with callback and ID, with button style. +lv_obj_t* lv_button_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_btn_create(par, cb, id, nullptr); + lv_btn_use_button_style(btn); + return btn; +} + +// Create a button with position, size, callback, ID, and style. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id, lv_style_t *style) { + lv_obj_t *btn = lv_btn_create(par, cb, id, style); + lv_obj_set_pos(btn, x, y); + lv_obj_set_size(btn, w, h); + return btn; } // Create a button with position, size, callback, and ID. Style set to style_para_value. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id) { - lv_obj_t *btn = lv_btn_create(par, cb, id); +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_btn_create(par, x, y, w, h, cb, id, &style_para_value); + return btn; +} + +// Create a button with position, size, callback, and ID, with label style. +lv_obj_t* lv_label_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_label_btn_create(par, cb, id); + lv_obj_set_pos(btn, x, y); + lv_obj_set_size(btn, w, h); + return btn; +} + +// Create a button with position, size, callback, and ID, with label style. +lv_obj_t* lv_button_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_button_btn_create(par, cb, id); lv_obj_set_pos(btn, x, y); lv_obj_set_size(btn, w, h); return btn; } // Create a button with callback and ID. Style set to style_para_back. -lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id) { +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/) { return lv_btn_create(par, cb, id, &style_para_back); } // Create a button with position, size, callback, and ID. Style set to style_para_back. -lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id) { +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id/*=0*/) { lv_obj_t *btn = lv_btn_create_back(par, cb, id); lv_obj_set_pos(btn, x, y); lv_obj_set_size(btn, w, h); @@ -1657,11 +1723,11 @@ lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord } // Create an image button with image, callback, and ID. Use label style. -lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id) { - lv_obj_t *btn = lv_imgbtn_create(par, NULL); +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_imgbtn_create(par, nullptr); if (img) lv_imgbtn_set_src_both(btn, img); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, NULL, 0); + lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); else lv_obj_set_event_cb(btn, cb); lv_imgbtn_use_label_style(btn); @@ -1670,12 +1736,96 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, con } // Create an image button with image, position, callback, and ID. Use label style. -lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id) { +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id/*=0*/) { + lv_obj_t *btn = lv_imgbtn_create(par, img, cb, id); + lv_obj_set_pos(btn, x, y); + return btn; +} + +lv_obj_t* lv_big_button_create(lv_obj_t *par, const char *img, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, bool centerLabel) { lv_obj_t *btn = lv_imgbtn_create(par, img, cb, id); lv_obj_set_pos(btn, x, y); + lv_obj_t *label = lv_label_create_empty(btn); + if (gCfgItems.multiple_language) { + lv_label_set_text(label, text); + if (centerLabel) + lv_obj_align(label, btn, LV_ALIGN_CENTER, 0, 0); + else + lv_obj_align(label, btn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable == true) + lv_group_add_obj(g, btn); + #endif + return btn; +} + +lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, bool drawArrow) { + lv_obj_t *btn = lv_btn_create(par, nullptr); /*Add a button the current screen*/ + lv_obj_set_pos(btn, x, y); /*Set its position*/ + lv_obj_set_size(btn, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ + if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + lv_btn_use_label_style(btn); + lv_btn_set_layout(btn, LV_LAYOUT_OFF); + lv_obj_t *label = lv_label_create_empty(btn); /*Add a label to the button*/ + if (gCfgItems.multiple_language) { + lv_label_set_text(label, text); + lv_obj_align(label, btn, LV_ALIGN_IN_LEFT_MID, 0, 0); + } + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable == true) { + lv_group_add_obj(g, btn); + } + #endif + + if (drawArrow) (void)lv_imgbtn_create(par, "F:/bmp_arrow.bin", x + PARA_UI_SIZE_X, y + PARA_UI_ARROW_V, cb, id); + + lv_obj_t *line1 = lv_line_create(par, nullptr); + lv_ex_line(line1, line_points[index]); + return btn; } +lv_obj_t* lv_screen_menu_item_1_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue) { + lv_obj_t* btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false); + lv_obj_t* btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X, y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, id); + lv_obj_t* labelValue = lv_label_create_empty(btnValue); + lv_label_set_text(labelValue, editValue); + lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0); + return btn; +} + +lv_obj_t* lv_screen_menu_item_2_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue, const int idEdit2, const char *editValue2) { + lv_obj_t* btn = lv_screen_menu_item(par, text, x, y, cb, -1, index, false); + + lv_obj_t* btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X_2, y + PARA_UI_VALUE_V_2, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, idEdit2); + lv_obj_t* labelValue = lv_label_create_empty(btnValue); + lv_label_set_text(labelValue, editValue2); + lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0); + + btnValue = lv_btn_create(par, PARA_UI_VALUE_POS_X, y + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, cb, id); + labelValue = lv_label_create_empty(btnValue); + lv_label_set_text(labelValue, editValue); + lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0); + + return btn; +} + +lv_obj_t* lv_screen_menu_item_onoff(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const bool curValue) { + lv_screen_menu_item(par, text, x, y, cb, -1, index, false); + lv_obj_t* btnValue = lv_imgbtn_create(par, curValue ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, y + PARA_UI_STATE_V, cb, id); + lv_obj_t* labelValue = lv_label_create_empty(btnValue); + lv_label_set_text(labelValue, curValue ? machine_menu.enable : machine_menu.disable); + lv_obj_align(labelValue, btnValue, LV_ALIGN_CENTER, 0, 0); + return btnValue; +} + +void lv_screen_menu_item_onoff_update(lv_obj_t *btn, const bool curValue) { + lv_imgbtn_set_src_both(btn, curValue ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin"); + lv_label_set_text((lv_obj_t*)btn->child_ll.head, curValue ? machine_menu.enable : machine_menu.disable); +} + + #if ENABLED(SDSUPPORT) void sd_detection() { @@ -1689,11 +1839,11 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coor #endif -void lv_ex_line(lv_obj_t * line, lv_point_t *points) { +void lv_ex_line(lv_obj_t *line, lv_point_t *points) { // Copy the previous line and apply the new style lv_line_set_points(line, points, 2); // Set the points lv_line_set_style(line, LV_LINE_STYLE_MAIN, &style_line); - lv_obj_align(line, NULL, LV_ALIGN_IN_TOP_MID, 0, 0); + lv_obj_align(line, nullptr, LV_ALIGN_IN_TOP_MID, 0, 0); } extern volatile uint32_t systick_uptime_millis; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 5ad0bd87b561..479166cd8fed 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -164,48 +164,6 @@ #endif // ifdef TFT35 -// Set the same image for both Released and Pressed -void lv_imgbtn_set_src_both(lv_obj_t *imgbtn, const void *src); - -// Set label styles for Released and Pressed -void lv_imgbtn_use_label_style(lv_obj_t *imgbtn); - -// Set label styles for Released and Pressed -void lv_btn_use_label_style(lv_obj_t *btn); - -// Set the same style for both Released and Pressed -void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style); - -// Create an empty label -lv_obj_t* lv_label_create_empty(lv_obj_t *par); - -// Create a label with style and text -lv_obj_t* lv_label_create(lv_obj_t *par, const char *text); - -// Create a label with style, position, and text -lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char *text); - -// Create a button with callback, ID, and Style. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id, lv_style_t *style); - -// Create a button with callback and ID. Style set to style_para_value. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id); - -// Create a button with position, size, callback, and ID. Style set to style_para_value. -lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id); - -// Create a button with callback and ID. Style set to style_para_back. -lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id); - -// Create a button with position, size, callback, and ID. Style set to style_para_back. -lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id); - -// Create an image button with image, callback, and ID. Use label style. -lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id); - -// Create an image button with image, position, callback, and ID. Use label style. -lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id); - #ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif @@ -240,10 +198,10 @@ typedef struct { } CFG_ITMES; typedef struct { - uint8_t curTempType : 1, - curSprayerChoose : 3, - stepHeat : 4; - uint8_t leveling_first_time : 1, + uint8_t curTempType:1, + curSprayerChoose:3, + stepHeat:4; + uint8_t leveling_first_time:1, para_ui_page:1, configWifi:1, command_send:1, @@ -467,6 +425,8 @@ extern lv_style_t style_sel_text; extern lv_style_t style_para_value; extern lv_style_t style_para_back; extern lv_style_t lv_bar_style_indic; +extern lv_style_t style_btn_pr; +extern lv_style_t style_btn_rel; extern lv_point_t line_points[4][2]; @@ -489,8 +449,78 @@ extern void gCfg_to_spiFlah(); extern void print_time_count(); extern void LV_TASK_HANDLER(); -extern void lv_ex_line(lv_obj_t * line, lv_point_t *points); +extern void lv_ex_line(lv_obj_t *line, lv_point_t *points); #ifdef __cplusplus } /* C-declarations for C++ */ #endif + +// Set the same image for both Released and Pressed +void lv_imgbtn_set_src_both(lv_obj_t *imgbtn, const void *src); + +// Set label styles for Released and Pressed +void lv_imgbtn_use_label_style(lv_obj_t *imgbtn); + +// Set label styles for Released and Pressed +void lv_btn_use_label_style(lv_obj_t *btn); + +// Set the same style for both Released and Pressed +void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style); + +// Create a screen +lv_obj_t* lv_screen_create(); + +// Create an empty label +lv_obj_t* lv_label_create_empty(lv_obj_t *par); + +// Create a label with style and text +lv_obj_t* lv_label_create(lv_obj_t *par, const char *text); + +// Create a label with style, position, and text +lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char *text); + +// Create a button with callback, ID, and Style. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id, lv_style_t *style=&style_para_value); + +// Create a button with callback and ID, with label style. +lv_obj_t* lv_label_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id=0); + +// Create a button with callback and ID, with button style. +lv_obj_t* lv_button_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id=0); + +// Create a button with position, size, callback, ID, and style. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id, lv_style_t *style); + +// Create a button with position, size, callback, and ID. Style set to style_para_value. +lv_obj_t* lv_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id=0); + +// Create a button with position, size, callback, and ID, with label style. +lv_obj_t* lv_label_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id=0); + +// Create a button with position, size, callback, and ID, with button style. +lv_obj_t* lv_button_btn_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id=0); + +// Create a button with callback and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_event_cb_t cb, const int id=0); + +// Create a button with position, size, callback, and ID. Style set to style_para_back. +lv_obj_t* lv_btn_create_back(lv_obj_t *par, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, lv_event_cb_t cb, const int id=0); + +// Create an image button with image, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, const int id=0); + +// Create an image button with image, position, callback, and ID. Use label style. +lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id=0); + +// Create a big image button with a label, follow the LVGL UI standard. +lv_obj_t* lv_big_button_create(lv_obj_t *par, const char *img, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, bool centerLabel = false); + +// Create a menu item, follow the LVGL UI standard. +lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, bool drawArrow = true); +lv_obj_t* lv_screen_menu_item_1_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue); +lv_obj_t* lv_screen_menu_item_2_edit(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const char *editValue, const int idEdit2, const char *editValue2); +lv_obj_t* lv_screen_menu_item_onoff(lv_obj_t *par, const char *text, lv_coord_t x, lv_coord_t y, lv_event_cb_t cb, const int id, const int index, const bool curValue); +void lv_screen_menu_item_onoff_update(lv_obj_t *btn, const bool curValue); + +#define _DIA_1(T) (uiCfg.dialogType == DIALOG_##T) +#define DIALOG_IS(V...) DO(DIA,||,V) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 78cf35fd0707..e8214cad3a2b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -30,80 +30,60 @@ #include "draw_ui.h" -extern lv_group_t * g; +extern lv_group_t *g; static lv_obj_t *scr, *wifi_name_text, *wifi_key_text, *wifi_state_text, *wifi_ip_text; -#define ID_W_RETURN 1 -#define ID_W_CLOUD 2 -#define ID_W_RECONNECT 3 +enum { + ID_W_RETURN = 1, + ID_W_CLOUD, + ID_W_RECONNECT +}; -static void event_handler(lv_obj_t * obj, lv_event_t event) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_W_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - lv_draw_set(); - } - break; + clear_cur_ui(); + lv_draw_set(); + break; case ID_W_CLOUD: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - //clear_cur_ui(); - //draw_return_ui(); - } - break; + //clear_cur_ui(); + //draw_return_ui(); + break; case ID_W_RECONNECT: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - lv_draw_wifi_list(); - } - break; + clear_cur_ui(); + lv_draw_wifi_list(); + break; } } void lv_draw_wifi(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL; - lv_obj_t *buttonCloud = NULL, *label_Cloud = NULL; - lv_obj_t *buttonReconnect = NULL, *label_Reconnect=NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_UI; } disp_state = WIFI_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); // Create an Image button - buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_RETURN); - + lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_RETURN); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); #endif + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - if (gCfgItems.wifi_mode_sel == STA_MODEL) { - //buttonCloud = lv_imgbtn_create(scr, NULL); - buttonReconnect = lv_imgbtn_create(scr, NULL); - } + lv_obj_t *buttonReconnect = nullptr, *label_Reconnect = nullptr; if (gCfgItems.wifi_mode_sel == STA_MODEL) { - lv_obj_set_event_cb_mks(buttonReconnect, event_handler,ID_W_RECONNECT, NULL, 0); + buttonReconnect = lv_imgbtn_create(scr, nullptr); + + lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, nullptr, 0); lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin"); lv_imgbtn_use_label_style(buttonReconnect); @@ -113,12 +93,7 @@ void lv_draw_wifi(void) { lv_obj_set_pos(buttonReconnect, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight); lv_btn_set_layout(buttonReconnect, LV_LAYOUT_OFF); - } - label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.wifi_mode_sel == STA_MODEL) { - //label_Cloud = lv_label_create_empty(buttonCloud); label_Reconnect = lv_label_create_empty(buttonReconnect); } @@ -127,9 +102,6 @@ void lv_draw_wifi(void) { lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); if (gCfgItems.wifi_mode_sel == STA_MODEL) { - //lv_label_set_text(label_Cloud, common_menu.text_back); - //lv_obj_align(label_Cloud, buttonCloud, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - lv_label_set_text(label_Reconnect, wifi_menu.reconnect); lv_obj_align(label_Reconnect, buttonReconnect, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -148,38 +120,33 @@ void lv_draw_wifi(void) { } void disp_wifi_state() { - memset(public_buf_m, 0, sizeof(public_buf_m)); - strcpy(public_buf_m,wifi_menu.ip); - strcat(public_buf_m,ipPara.ip_addr); + strcpy(public_buf_m, wifi_menu.ip); + strcat(public_buf_m, ipPara.ip_addr); lv_label_set_text(wifi_ip_text, public_buf_m); - lv_obj_align(wifi_ip_text, NULL, LV_ALIGN_CENTER, 0, -100); + lv_obj_align(wifi_ip_text, nullptr, LV_ALIGN_CENTER, 0, -100); - memset(public_buf_m, 0, sizeof(public_buf_m)); - strcpy(public_buf_m,wifi_menu.wifi); - strcat(public_buf_m,wifiPara.ap_name); + strcpy(public_buf_m, wifi_menu.wifi); + strcat(public_buf_m, wifiPara.ap_name); lv_label_set_text(wifi_name_text, public_buf_m); - lv_obj_align(wifi_name_text, NULL, LV_ALIGN_CENTER, 0, -70); + lv_obj_align(wifi_name_text, nullptr, LV_ALIGN_CENTER, 0, -70); if (wifiPara.mode == AP_MODEL) { - memset(public_buf_m, 0, sizeof(public_buf_m)); - strcpy(public_buf_m,wifi_menu.key); - strcat(public_buf_m,wifiPara.keyCode); + strcpy(public_buf_m, wifi_menu.key); + strcat(public_buf_m, wifiPara.keyCode); lv_label_set_text(wifi_key_text, public_buf_m); - lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER, 0, -40); + lv_obj_align(wifi_key_text, nullptr, LV_ALIGN_CENTER, 0, -40); - memset(public_buf_m, 0, sizeof(public_buf_m)); - strcpy(public_buf_m,wifi_menu.state_ap); + strcpy(public_buf_m, wifi_menu.state_ap); if (wifi_link_state == WIFI_CONNECTED) - strcat(public_buf_m,wifi_menu.connected); + strcat(public_buf_m, wifi_menu.connected); else if (wifi_link_state == WIFI_NOT_CONFIG) - strcat(public_buf_m,wifi_menu.disconnected); + strcat(public_buf_m, wifi_menu.disconnected); else - strcat(public_buf_m,wifi_menu.exception); + strcat(public_buf_m, wifi_menu.exception); lv_label_set_text(wifi_state_text, public_buf_m); - lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER, 0, -10); + lv_obj_align(wifi_state_text, nullptr, LV_ALIGN_CENTER, 0, -10); } else { - ZERO(public_buf_m); strcpy(public_buf_m, wifi_menu.state_sta); if (wifi_link_state == WIFI_CONNECTED) strcat(public_buf_m, wifi_menu.connected); @@ -188,10 +155,10 @@ void disp_wifi_state() { else strcat(public_buf_m, wifi_menu.exception); lv_label_set_text(wifi_state_text, public_buf_m); - lv_obj_align(wifi_state_text, NULL, LV_ALIGN_CENTER, 0, -40); + lv_obj_align(wifi_state_text, nullptr, LV_ALIGN_CENTER, 0, -40); lv_label_set_text(wifi_key_text, ""); - lv_obj_align(wifi_key_text, NULL, LV_ALIGN_CENTER, 0, -10); + lv_obj_align(wifi_key_text, nullptr, LV_ALIGN_CENTER, 0, -10); } } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index b52dbc5e598b..cb72469bd48f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -39,61 +39,48 @@ WIFI_LIST wifi_list; list_menu_def list_menu; -extern lv_group_t * g; -static lv_obj_t * scr; +extern lv_group_t *g; +static lv_obj_t *scr; static lv_obj_t *buttonWifiN[NUMBER_OF_PAGE]; static lv_obj_t *labelWifiText[NUMBER_OF_PAGE]; static lv_obj_t *labelPageText; -#define ID_WL_RETURN 11 -#define ID_WL_DOWN 12 +#define ID_WL_RETURN 11 +#define ID_WL_DOWN 12 -static void event_handler(lv_obj_t * obj, lv_event_t event) { - if (obj->mks_obj_id == ID_WL_RETURN) { - if (event == LV_EVENT_CLICKED) { +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; - } - else if (event == LV_EVENT_RELEASED) { - clear_cur_ui(); - lv_draw_set(); - } + if (obj->mks_obj_id == ID_WL_RETURN) { + clear_cur_ui(); + lv_draw_set(); } else if (obj->mks_obj_id == ID_WL_DOWN) { - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (wifi_list.getNameNum > 0) { - if ((wifi_list.nameIndex + NUMBER_OF_PAGE) >= wifi_list.getNameNum) { - wifi_list.nameIndex = 0; - wifi_list.currentWifipage = 1; - } - else { - wifi_list.nameIndex += NUMBER_OF_PAGE; - wifi_list.currentWifipage++; - } - disp_wifi_list(); + if (wifi_list.getNameNum > 0) { + if ((wifi_list.nameIndex + NUMBER_OF_PAGE) >= wifi_list.getNameNum) { + wifi_list.nameIndex = 0; + wifi_list.currentWifipage = 1; + } + else { + wifi_list.nameIndex += NUMBER_OF_PAGE; + wifi_list.currentWifipage++; } + disp_wifi_list(); } } else { for (uint8_t i = 0; i < NUMBER_OF_PAGE; i++) { if (obj->mks_obj_id == i + 1) { - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - if (wifi_list.getNameNum != 0) { - const bool do_wifi = wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[wifi_list.nameIndex + i]) == 0; - wifi_list.nameIndex += i; - last_disp_state = WIFI_LIST_UI; - lv_clear_wifi_list(); - if (do_wifi) - lv_draw_wifi(); - else { - keyboard_value = wifiConfig; - lv_draw_keyboard(); - } + if (wifi_list.getNameNum != 0) { + const bool do_wifi = wifi_link_state == WIFI_CONNECTED && strcmp((const char *)wifi_list.wifiConnectedName, (const char *)wifi_list.wifiName[wifi_list.nameIndex + i]) == 0; + wifi_list.nameIndex += i; + last_disp_state = WIFI_LIST_UI; + lv_clear_wifi_list(); + if (do_wifi) + lv_draw_wifi(); + else { + keyboard_value = wifiConfig; + lv_draw_keyboard(); } } } @@ -102,34 +89,23 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { } void lv_draw_wifi_list(void) { - lv_obj_t *buttonBack = NULL, *buttonDown = NULL; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_LIST_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_LIST_UI; } disp_state = WIFI_LIST_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); lv_refr_now(lv_refr_get_disp_refreshing()); - buttonDown = lv_imgbtn_create(scr, "F:/bmp_pageDown.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H, event_handler, ID_WL_DOWN); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + (OTHER_BTN_YPIEL + INTERVAL_H) * 2, event_handler, ID_WL_RETURN); + lv_obj_t *buttonDown = lv_imgbtn_create(scr, "F:/bmp_pageDown.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H, event_handler, ID_WL_DOWN); + lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_back.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + (OTHER_BTN_YPIEL + INTERVAL_H) * 2, event_handler, ID_WL_RETURN); for (uint8_t i = 0; i < NUMBER_OF_PAGE; i++) { - buttonWifiN[i] = lv_btn_create(scr, NULL); /*Add a button the current screen*/ - lv_obj_set_pos(buttonWifiN[i], 0, NAME_BTN_Y*i+10+titleHeight); /*Set its position*/ - lv_obj_set_size(buttonWifiN[i], NAME_BTN_X, NAME_BTN_Y); /*Set its size*/ - lv_obj_set_event_cb_mks(buttonWifiN[i], event_handler, (i+1), NULL, 0); - lv_btn_use_label_style(buttonWifiN[i]); - lv_btn_set_layout(buttonWifiN[i], LV_LAYOUT_OFF); + buttonWifiN[i] = lv_label_btn_create(scr, 0, NAME_BTN_Y * i + 10 + titleHeight, NAME_BTN_X, NAME_BTN_Y, event_handler, i + 1); labelWifiText[i] = lv_label_create_empty(buttonWifiN[i]); #if HAS_ROTARY_ENCODER uint8_t j = 0; @@ -147,9 +123,10 @@ void lv_draw_wifi_list(void) { wifi_list.currentWifipage = 1; if (wifi_link_state == WIFI_CONNECTED && wifiPara.mode == STA_MODEL) { - memset(wifi_list.wifiConnectedName, 0, sizeof(&wifi_list.wifiConnectedName)); + ZERO(wifi_list.wifiConnectedName); memcpy(wifi_list.wifiConnectedName, wifiPara.ap_name, sizeof(wifi_list.wifiConnectedName)); } + #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { lv_group_add_obj(g, buttonDown); @@ -166,10 +143,10 @@ void disp_wifi_list(void) { sprintf((char *)tmpStr, list_menu.file_pages, wifi_list.currentWifipage, wifi_list.getPage); lv_label_set_text(labelPageText, (const char *)tmpStr); - lv_obj_align(labelPageText, NULL, LV_ALIGN_CENTER, 50, -100); + lv_obj_align(labelPageText, nullptr, LV_ALIGN_CENTER, 50, -100); for (i = 0; i < NUMBER_OF_PAGE; i++) { - memset(tmpStr, 0, sizeof(tmpStr)); + ZERO(tmpStr); j = wifi_list.nameIndex + i; if (j >= wifi_list.getNameNum) { @@ -187,7 +164,7 @@ void disp_wifi_list(void) { } void wifi_scan_handle() { - if (uiCfg.dialogType != WIFI_ENABLE_TIPS || uiCfg.command_send != 1) return; + if (!DIALOG_IS(WIFI_ENABLE_TIPS) || uiCfg.command_send != 1) return; last_disp_state = DIALOG_UI; lv_clear_dialog(); if (wifi_link_state == WIFI_CONNECTED && wifiPara.mode != AP_MODEL) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp index 0902135835b8..0c4fe6113284 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp @@ -30,161 +30,117 @@ #include "draw_ui.h" -extern lv_group_t * g; -static lv_obj_t *scr, *labelModelValue = NULL, *buttonModelValue = NULL, *labelCloudValue = NULL; - -#define ID_WIFI_RETURN 1 -#define ID_WIFI_MODEL 2 -#define ID_WIFI_NAME 3 -#define ID_WIFI_PASSWORD 4 -#define ID_WIFI_CLOUD 5 -#define ID_WIFI_CONFIG 6 - -static void event_handler(lv_obj_t * obj, lv_event_t event) { +extern lv_group_t *g; +static lv_obj_t *scr, *labelModelValue = nullptr, *buttonModelValue = nullptr, *labelCloudValue = nullptr; + +enum { + ID_WIFI_RETURN = 1, + ID_WIFI_MODEL, + ID_WIFI_NAME, + ID_WIFI_PASSWORD, + ID_WIFI_CLOUD, + ID_WIFI_CONFIG +}; + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_WIFI_RETURN: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_wifi_settings(); - draw_return_ui(); - } - break; + lv_clear_wifi_settings(); + draw_return_ui(); + break; case ID_WIFI_MODEL: - if (event == LV_EVENT_CLICKED) { - + if (gCfgItems.wifi_mode_sel == AP_MODEL) { + gCfgItems.wifi_mode_sel = STA_MODEL; + lv_label_set_text(labelModelValue, WIFI_STA_TEXT); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); + update_spi_flash(); } - else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.wifi_mode_sel == AP_MODEL) { - gCfgItems.wifi_mode_sel = STA_MODEL; - lv_label_set_text(labelModelValue, WIFI_STA_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); - update_spi_flash(); - } - else { - gCfgItems.wifi_mode_sel = AP_MODEL; - lv_label_set_text(labelModelValue, WIFI_AP_TEXT); - lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); - update_spi_flash(); - } + else { + gCfgItems.wifi_mode_sel = AP_MODEL; + lv_label_set_text(labelModelValue, WIFI_AP_TEXT); + lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); + update_spi_flash(); } - break; + break; case ID_WIFI_NAME: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - keyboard_value = wifiName; - lv_clear_wifi_settings(); - lv_draw_keyboard(); - } - break; + keyboard_value = wifiName; + lv_clear_wifi_settings(); + lv_draw_keyboard(); + break; case ID_WIFI_PASSWORD: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { keyboard_value = wifiPassWord; - lv_clear_wifi_settings(); - lv_draw_keyboard(); - } - break; + lv_clear_wifi_settings(); + lv_draw_keyboard(); + break; case ID_WIFI_CLOUD: - if (event == LV_EVENT_CLICKED) { - + if (gCfgItems.cloud_enable) { + gCfgItems.cloud_enable = false; + lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_disable.bin", 0); + lv_label_set_text(labelCloudValue, machine_menu.disable); } - else if (event == LV_EVENT_RELEASED) { - if (gCfgItems.cloud_enable) { - gCfgItems.cloud_enable = false; - lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_disable.bin", 0); - lv_label_set_text(labelCloudValue, machine_menu.disable); - } - else { - gCfgItems.cloud_enable = true; - lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_enable.bin", 0); - lv_label_set_text(labelCloudValue, machine_menu.enable); - } - update_spi_flash(); + else { + gCfgItems.cloud_enable = true; + lv_obj_set_event_cb_mks(obj, event_handler, ID_WIFI_CLOUD, "bmp_enable.bin", 0); + lv_label_set_text(labelCloudValue, machine_menu.enable); } - break; + update_spi_flash(); + break; case ID_WIFI_CONFIG: - if (event == LV_EVENT_CLICKED) { - - } - else if (event == LV_EVENT_RELEASED) { - lv_clear_wifi_settings(); - lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS); - } - break; + lv_clear_wifi_settings(); + lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS); + break; } } void lv_draw_wifi_settings(void) { - lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonConfig = NULL, *labelConfig = NULL; - lv_obj_t *labelModelText = NULL; - lv_obj_t *labelNameText = NULL, *buttonNameValue = NULL, *labelNameValue = NULL; - lv_obj_t *labelPassWordText = NULL, *buttonPassWordValue = NULL, *labelPassWordValue = NULL; - lv_obj_t *labelCloudText = NULL, *buttonCloudValue = NULL; - lv_obj_t * line1 = NULL, *line2 = NULL, *line3 = NULL, *line4 = NULL; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_SETTINGS_UI) { disp_state_stack._disp_index++; disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_SETTINGS_UI; } disp_state = WIFI_SETTINGS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.WifiConfTitle); lv_refr_now(lv_refr_get_disp_refreshing()); - labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); + lv_obj_t *labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); - buttonModelValue = lv_imgbtn_create(scr, NULL); - lv_imgbtn_set_src_both(buttonModelValue, "F:/bmp_blank_sel.bin"); - lv_obj_set_pos(buttonModelValue, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V); - lv_obj_set_event_cb_mks(buttonModelValue, event_handler, ID_WIFI_MODEL, NULL, 0); + lv_obj_t *buttonModelValue = lv_imgbtn_create(scr, "F:/bmp_blank_sel.bin", PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, event_handler, ID_WIFI_MODEL); lv_btn_set_style_both(buttonModelValue, &style_para_value_pre); - lv_btn_set_layout(buttonModelValue, LV_LAYOUT_OFF); labelModelValue = lv_label_create_empty(buttonModelValue); - line1 = lv_line_create(scr, NULL); - lv_ex_line(line1,line_points[0]); - - labelNameText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, NULL); - - buttonNameValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_NAME); - labelNameValue = lv_label_create_empty(buttonNameValue); - - line2 = lv_line_create(scr, NULL); - lv_ex_line(line2,line_points[1]); + lv_obj_t *line1 = lv_line_create(scr, nullptr); + lv_ex_line(line1, line_points[0]); - labelPassWordText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, NULL); + lv_obj_t *labelNameText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10, nullptr); + lv_obj_t *buttonNameValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_NAME); + lv_obj_t *labelNameValue = lv_label_create_empty(buttonNameValue); - buttonPassWordValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_PASSWORD); - labelPassWordValue = lv_label_create_empty(buttonPassWordValue); + lv_obj_t *line2 = lv_line_create(scr, nullptr); + lv_ex_line(line2, line_points[1]); - line3 = lv_line_create(scr, NULL); - lv_ex_line(line3,line_points[2]); + lv_obj_t *labelPassWordText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10, nullptr); + lv_obj_t *buttonPassWordValue = lv_btn_create(scr, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE, event_handler, ID_WIFI_PASSWORD); + lv_obj_t *labelPassWordValue = lv_label_create_empty(buttonPassWordValue); - labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud); + lv_obj_t *line3 = lv_line_create(scr, nullptr); + lv_ex_line(line3, line_points[2]); - buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD); + lv_obj_t *labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud); + lv_obj_t *buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD); labelCloudValue = lv_label_create_empty(buttonCloudValue); - line4 = lv_line_create(scr, NULL); - lv_ex_line(line4,line_points[3]); + lv_obj_t *line4 = lv_line_create(scr, nullptr); + lv_ex_line(line4, line_points[3]); - buttonConfig = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_WIFI_CONFIG); - labelConfig = lv_label_create_empty(buttonConfig); + lv_obj_t *buttonConfig = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_WIFI_CONFIG); + lv_obj_t *labelConfig = lv_label_create_empty(buttonConfig); - buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_WIFI_RETURN); - label_Back = lv_label_create_empty(buttonBack); + lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_WIFI_RETURN); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); if (gCfgItems.multiple_language) { if (gCfgItems.wifi_mode_sel == AP_MODEL) { @@ -195,26 +151,24 @@ void lv_draw_wifi_settings(void) { lv_label_set_text(labelModelValue, WIFI_STA_TEXT); lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); } - memset(public_buf_m,0,sizeof(public_buf_m)); - strcat(public_buf_m,machine_menu.wifiName); - strcat(public_buf_m,(const char *)uiCfg.wifi_name); - lv_label_set_text(labelNameText,public_buf_m); + strcat(public_buf_m, machine_menu.wifiName); + strcat(public_buf_m, (const char *)uiCfg.wifi_name); + lv_label_set_text(labelNameText, public_buf_m); - lv_label_set_text(labelNameValue,machine_menu.wifiEdit); + lv_label_set_text(labelNameValue, machine_menu.wifiEdit); lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER, 0, 0); - memset(public_buf_m,0,sizeof(public_buf_m)); - strcat(public_buf_m,machine_menu.wifiPassWord); - strcat(public_buf_m,(const char *)uiCfg.wifi_key); - lv_label_set_text(labelPassWordText,public_buf_m); + strcat(public_buf_m, machine_menu.wifiPassWord); + strcat(public_buf_m, (const char *)uiCfg.wifi_key); + lv_label_set_text(labelPassWordText, public_buf_m); - lv_label_set_text(labelPassWordValue,machine_menu.wifiEdit); + lv_label_set_text(labelPassWordValue, machine_menu.wifiEdit); lv_obj_align(labelPassWordValue, buttonPassWordValue, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(labelCloudValue, gCfgItems.cloud_enable ? machine_menu.enable : machine_menu.disable); lv_obj_align(labelCloudValue, buttonCloudValue, LV_ALIGN_CENTER, 0, 0); - lv_label_set_text(labelConfig,machine_menu.wifiConfig); + lv_label_set_text(labelConfig, machine_menu.wifiConfig); lv_obj_align(labelConfig, buttonConfig, LV_ALIGN_CENTER, 0, 0); lv_label_set_text(label_Back, common_menu.text_back); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp index 86ac5dffac23..57f2584fa32c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp @@ -30,14 +30,14 @@ #include "draw_ui.h" -static lv_obj_t * scr; +static lv_obj_t *scr; TIPS_TYPE wifi_tips_type; TIPS_DISP tips_disp; tips_menu_def tips_menu; void lv_draw_wifi_tips(void) { - static lv_obj_t * text_tips,*wifi_name; + static lv_obj_t *text_tips,*wifi_name; if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_TIPS_UI) { disp_state_stack._disp_index++; @@ -45,28 +45,24 @@ void lv_draw_wifi_tips(void) { } disp_state = WIFI_TIPS_UI; - scr = lv_obj_create(NULL, NULL); - - lv_obj_set_style(scr, &tft_style_scr); - lv_scr_load(scr); - lv_obj_clean(scr); + scr = lv_screen_create(); lv_refr_now(lv_refr_get_disp_refreshing()); wifi_name = lv_label_create(scr, (const char *)wifi_list.wifiName[wifi_list.nameIndex]); - lv_obj_align(wifi_name, NULL, LV_ALIGN_CENTER, 0, -20); + lv_obj_align(wifi_name, nullptr, LV_ALIGN_CENTER, 0, -20); text_tips = lv_label_create_empty(scr); if (wifi_tips_type == TIPS_TYPE_JOINING) { lv_label_set_text(text_tips, tips_menu.joining); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); + lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60); } else if (wifi_tips_type == TIPS_TYPE_TAILED_JOIN) { lv_label_set_text(text_tips, tips_menu.failedJoin); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); + lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60); } else if (wifi_tips_type == TIPS_TYPE_WIFI_CONECTED) { lv_label_set_text(text_tips, tips_menu.wifiConected); - lv_obj_align(text_tips, NULL, LV_ALIGN_CENTER, 0, -60); + lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60); } tips_disp.timer = TIPS_TIMER_START; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp index 856d645e9ed4..fbc8192ffbc3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -62,7 +62,7 @@ static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t u memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); } if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) - return NULL; + return nullptr; uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); if (p_pos[0] != 0) { @@ -72,7 +72,7 @@ static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t u //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); return __user_font_getdata(pos + 2, sizeof(__g_font_buf)); } - return NULL; + return nullptr; } static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { @@ -81,7 +81,7 @@ static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_ memcpy(&__g_xbf_hd, p, sizeof(x_header_t)); } if (unicode_letter > __g_xbf_hd.max || unicode_letter < __g_xbf_hd.min) - return NULL; + return false; uint32_t unicode_offset = sizeof(x_header_t) + (unicode_letter - __g_xbf_hd.min) * 4; uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); if (p_pos[0] != 0) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index bc329aa82b89..06d6ca6b7234 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -637,7 +637,7 @@ void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor } } -//static lv_obj_t * scr_test; +//static lv_obj_t *scr_test; void disp_assets_update() { SPI_TFT.LCD_clear(0x0000); disp_string(100, 140, "Assets Updating...", 0xFFFF, 0x0000); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp index e6c30b30f822..edd90848d544 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -58,13 +58,11 @@ void printer_state_polling() { if (gCfgItems.pausePosZ != (float)-1) { gcode.process_subcommands_now_P(PSTR("G91")); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("G1 Z%.1f"), gCfgItems.pausePosZ); gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now_P(PSTR("G90")); } if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) { - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("G1 X%.1f Y%.1f"), gCfgItems.pausePosX, gCfgItems.pausePosY); gcode.process_subcommands_now(public_buf_l); } @@ -88,13 +86,11 @@ void printer_state_polling() { if (uiCfg.print_state == RESUMING) { if (IS_SD_PAUSED()) { if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) { - ZERO(public_buf_m); sprintf_P(public_buf_m, PSTR("G1 X%.1f Y%.1f"), uiCfg.current_x_position_bak, uiCfg.current_y_position_bak); gcode.process_subcommands_now(public_buf_m); } if (gCfgItems.pausePosZ != (float)-1) { gcode.process_subcommands_now_P(PSTR("G91")); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ); gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now_P(PSTR("G90")); @@ -109,7 +105,6 @@ void printer_state_polling() { } #if ENABLED(POWER_LOSS_RECOVERY) if (uiCfg.print_state == REPRINTED) { - ZERO(public_buf_m); #if HAS_HOTEND HOTEND_LOOP() { const int16_t et = recovery.info.target_temperature[e]; @@ -128,7 +123,6 @@ void printer_state_polling() { #if 0 // Move back to the saved XY char str_1[16], str_2[16]; - ZERO(public_buf_m); sprintf_P(public_buf_m, PSTR("G1 X%s Y%s F2000"), dtostrf(recovery.info.current_position.x, 1, 3, str_1), dtostrf(recovery.info.current_position.y, 1, 3, str_2) @@ -137,7 +131,6 @@ void printer_state_polling() { if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) { gcode.process_subcommands_now_P(PSTR("G91")); - ZERO(public_buf_l); sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ); gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now_P(PSTR("G90")); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 6143037c2b86..2f1ec48b4417 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -99,7 +99,7 @@ void SysTick_Callback() { uiCfg.filament_unloading_time_cnt = 0; uiCfg.filament_unloading_time_flg = 0; uiCfg.filament_unloading_completed = 1; - uiCfg.filament_rate = 100; + uiCfg.filament_rate = 100; } } } @@ -133,7 +133,7 @@ void tft_lvgl_init() { lv_init(); - lv_disp_buf_init(&disp_buf, bmp_public_buf, NULL, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ lv_disp_drv_init(&disp_drv); /*Basic initialization*/ @@ -199,7 +199,6 @@ void tft_lvgl_init() { uiCfg.print_state = REPRINTING; - ZERO(public_buf_m); strncpy(public_buf_m, recovery.info.sd_filename, sizeof(public_buf_m)); card.printLongPath(public_buf_m); @@ -216,15 +215,14 @@ void tft_lvgl_init() { } void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { - uint16_t i, width, height; - - width = area->x2 - area->x1 + 1; - height = area->y2 - area->y1 + 1; + uint16_t width = area->x2 - area->x1 + 1, + height = area->y2 - area->y1 + 1; SPI_TFT.setWindow((uint16_t)area->x1, (uint16_t)area->y1, width, height); - for (i = 0; i < height; i++) { + + for (uint16_t i = 0; i < height; i++) SPI_TFT.tftio.WriteSequence((uint16_t*)(color_p + width * i), width); - } + lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ W25QXX.init(SPI_QUARTER_SPEED); @@ -310,10 +308,9 @@ extern uint8_t currentFlashPage; uint32_t pic_read_base_addr = 0, pic_read_addr_offset = 0; lv_fs_res_t spi_flash_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) { static char last_path_name[30]; - if (strcasecmp(last_path_name,path) != 0) { + if (strcasecmp(last_path_name, path) != 0) { pic_read_base_addr = lv_get_pic_addr((uint8_t *)path); - ZERO(last_path_name); - strcpy(last_path_name,path); + strcpy(last_path_name, path); } else { W25QXX.init(SPI_QUARTER_SPEED); @@ -362,11 +359,10 @@ uint32_t sd_read_base_addr = 0,sd_read_addr_offset = 0; lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) { //cur_namefff = strrchr(path, '/'); char name_buf[100]; - ZERO(name_buf); - strcat(name_buf,"/"); - strcat(name_buf,path); - char *temp = strstr(name_buf,".bin"); - if (temp) { strcpy(temp,".GCO"); } + *name_buf = '/'; + strcpy(name_buf + 1, path); + char *temp = strstr(name_buf, ".bin"); + if (temp) strcpy(temp, ".GCO"); sd_read_base_addr = lv_open_gcode_file((char *)name_buf); sd_read_addr_offset = sd_read_base_addr; if (sd_read_addr_offset == 0) return LV_FS_RES_NOT_EX; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 087a3b21105c..1ab186a6be79 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -260,7 +260,7 @@ void WriteByteSlip(uint8_t b) { // Wait for a data packet to be returned. If the body of the packet is // non-zero length, return an allocated buffer indirectly containing the // data and return the data length. Note that if the pointer for returning -// the data buffer is NULL, the response is expected to be two bytes of zero. +// the data buffer is nullptr, the response is expected to be two bytes of zero. // // If an error occurs, return a negative value. Otherwise, return the number // of bytes in the response (or zero if the response was not the standard "two bytes of zero"). @@ -533,7 +533,7 @@ EspUploadResult flashFinish(signed char reboot) { // Compute the checksum of a block of data uint16_t checksum(const uint8_t *data, uint16_t dataLen, uint16_t cksum) { - if (data != NULL) { + if (data != nullptr) { while (dataLen--) { cksum ^= (uint16_t)*data++; } diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index ce98f563b9d9..d67fa516b8d5 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -53,5 +53,17 @@ opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" +# +# MKS Robin v2 nano LVGL SPI + TMC +# (Robin v2 nano has no FSMC interface) +# +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 +opt_set X_DRIVER_TYPE TMC2209 +opt_set Y_DRIVER_TYPE TMC2209 +exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" + # cleanup restore_configs From b632b52b11cb116b70b51d15b0ecb17f5e2512b8 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 24 Oct 2020 18:25:14 -0300 Subject: [PATCH 015/443] Update PIO dependencies script --- buildroot/share/PlatformIO/scripts/common-dependencies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index 4b4bba625874..b9cefeab7cf7 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -208,7 +208,8 @@ def search_compiler(): for filepath in os.listdir(pathdir): if not filepath.endswith(gcc): continue - + # Use entire path to not rely on env PATH + filepath = os.path.sep.join([pathdir, filepath]) # Cache the g++ path to no search always if os.path.exists(ENV_BUILD_PATH): blab('Caching g++ for current env') From 311b65b22591d001984f16f6b3210ab922bcadbb Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 24 Oct 2020 22:48:29 +0100 Subject: [PATCH 016/443] Fix Anycubic Chiron "Ready" detection (#19880) Co-authored-by: Scott Lahteine --- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 138 ++++++++---------- .../lib/anycubic_chiron/chiron_tft_defs.h | 2 +- 2 files changed, 63 insertions(+), 77 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index 109d82b2a2cc..99b2559d704e 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -40,6 +40,7 @@ #include "../../../../sd/cardreader.h" #include "../../../../libs/numtostr.h" #include "../../../../MarlinCore.h" + namespace Anycubic { printer_state_t ChironTFT::printer_state; @@ -87,7 +88,7 @@ namespace Anycubic { // Enable levelling and Disable end stops during print // as Z home places nozzle above the bed so we need to allow it past the end stops - injectCommands_P(AC_cmnd_enable_levelling); //M211 S0\n")); + injectCommands_P(AC_cmnd_enable_levelling); // Startup tunes are defined in Tunes.h //PlayTune(BEEPER_PIN, Anycubic_PowerOn, 1); @@ -179,7 +180,7 @@ namespace Anycubic { #endif switch (printer_state) { case AC_printer_pausing: { - if ( (strcmp_P(msg, MARLIN_msg_print_paused) == 0 ) || (strcmp_P(msg, MARLIN_msg_nozzle_parked) == 0 ) ) { + if (strcmp_P(msg, MARLIN_msg_print_paused) == 0 || strcmp_P(msg, MARLIN_msg_nozzle_parked) == 0) { SendtoTFTLN(AC_msg_paused); // enable continue button printer_state = AC_printer_paused; } @@ -189,18 +190,18 @@ namespace Anycubic { case AC_printer_printing: case AC_printer_paused: { // Heater timout, send acknowledgement - if (strcmp_P(msg, MARLIN_msg_heater_timeout) == 0 ) { + if (strcmp_P(msg, MARLIN_msg_heater_timeout) == 0) { pause_state = AC_paused_heater_timed_out; SendtoTFTLN(AC_msg_paused); // enable continue button PlayTune(BEEPER_PIN,Heater_Timedout,1); } // Reheat finished, send acknowledgement - else if (strcmp_P(msg, MARLIN_msg_reheat_done) == 0 ) { + else if (strcmp_P(msg, MARLIN_msg_reheat_done) == 0) { pause_state = AC_paused_idle; SendtoTFTLN(AC_msg_paused); // enable continue button } // Filament Purging, send acknowledgement enter run mode - else if (strcmp_P(msg, MARLIN_msg_filament_purging) == 0 ) { + else if (strcmp_P(msg, MARLIN_msg_filament_purging) == 0) { pause_state = AC_paused_purging_filament; SendtoTFTLN(AC_msg_paused); // enable continue button } @@ -221,14 +222,15 @@ namespace Anycubic { switch (printer_state) { case AC_printer_probing: { // If probing completes ok save the mesh and park - if (strcmp_P(msg, MARLIN_msg_ready) == 0 ) { + // Ignore the custom machine name + if (strcmp_P(msg + strlen(CUSTOM_MACHINE_NAME), MARLIN_msg_ready) == 0) { injectCommands_P(PSTR("M500\nG27")); SendtoTFTLN(AC_msg_probing_complete); printer_state = AC_printer_idle; msg_matched = true; } // If probing fails dont save the mesh raise the probe above the bad point - if (strcmp_P(msg, MARLIN_msg_probing_failed) == 0 ) { + if (strcmp_P(msg, MARLIN_msg_probing_failed) == 0) { PlayTune(BEEPER_PIN, BeepBeepBeeep, 1); injectCommands_P(PSTR("G1 Z50 F500")); SendtoTFTLN(AC_msg_probing_complete); @@ -238,14 +240,14 @@ namespace Anycubic { } break; case AC_printer_printing: { - if (strcmp_P(msg, MARLIN_msg_reheating) == 0 ) { + if (strcmp_P(msg, MARLIN_msg_reheating) == 0) { SendtoTFTLN(AC_msg_paused); // enable continue button msg_matched = true; } } break; case AC_printer_pausing: { - if (strcmp_P(msg, MARLIN_msg_print_paused) == 0 ) { + if (strcmp_P(msg, MARLIN_msg_print_paused) == 0) { SendtoTFTLN(AC_msg_paused); printer_state = AC_printer_paused; pause_state = AC_paused_idle; @@ -254,7 +256,7 @@ namespace Anycubic { } break; case AC_printer_stopping: { - if (strcmp_P(msg, MARLIN_msg_print_aborted) == 0 ) { + if (strcmp_P(msg, MARLIN_msg_print_aborted) == 0) { SendtoTFTLN(AC_msg_stop); printer_state = AC_printer_idle; msg_matched = true; @@ -289,7 +291,7 @@ namespace Anycubic { serialprintPGM(str); #endif while (const char c = pgm_read_byte(str++)) TFTSer.print(c); - } + } void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) { if (str != nullptr) { @@ -300,22 +302,22 @@ namespace Anycubic { #if ACDEBUG(AC_SOME) SERIAL_EOL(); #endif - } - TFTSer.println(""); + } + TFTSer.println(""); } bool ChironTFT::ReadTFTCommand() { bool command_ready = false; - while( (TFTSer.available() > 0) && (command_len < MAX_CMND_LEN) ) { + while(TFTSer.available() > 0 && command_len < MAX_CMND_LEN) { panel_command[command_len] = TFTSer.read(); - if(panel_command[command_len] == '\n') { + if (panel_command[command_len] == '\n') { command_ready = true; break; } command_len++; } - if(command_ready) { + if (command_ready) { panel_command[command_len] = 0x00; #if ACDEBUG(AC_ALL) SERIAL_ECHOLNPAIR("< ", panel_command); @@ -333,56 +335,45 @@ namespace Anycubic { } int8_t ChironTFT::Findcmndpos(const char * buff, char q) { - bool found = false; int8_t pos = 0; - do { - if (buff[pos] == q) { - found = true; - break; - } - pos ++; - } while(pos < MAX_CMND_LEN); - if (found) return pos; + do { if (buff[pos] == q) return pos; } while(++pos < MAX_CMND_LEN); return -1; } void ChironTFT::CheckHeaters() { - uint8_t faultDuration = 0; float temp = 0; + uint8_t faultDuration = 0; + float temp = 0; // if the hotend temp is abnormal, confirm state before signalling panel temp = getActualTemp_celsius(E0); - if ( (temp <= HEATER_0_MINTEMP) || (temp >= HEATER_0_MAXTEMP) ) { - do { - faultDuration ++; - if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) { - SendtoTFTLN(AC_msg_nozzle_temp_abnormal); - SERIAL_ECHOLNPAIR("Extruder temp abnormal! : ", temp); - break; - } - delay_ms(500); - temp = getActualTemp_celsius(E0); - } while ((temp <= HEATER_0_MINTEMP) || (temp >= HEATER_0_MAXTEMP) ); + while (!WITHIN(temp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP)) { + faultDuration++; + if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) { + SendtoTFTLN(AC_msg_nozzle_temp_abnormal); + SERIAL_ECHOLNPAIR("Extruder temp abnormal! : ", temp); + break; + } + delay_ms(500); + temp = getActualTemp_celsius(E0); } - // if the hotbed temp is abnormal, confirm state before signalling panel + // If the hotbed temp is abnormal, confirm state before signaling panel faultDuration = 0; temp = getActualTemp_celsius(BED); - if ( (temp <= BED_MINTEMP) || (temp >= BED_MAXTEMP) ) { - do { - faultDuration ++; - if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) { - SendtoTFTLN(AC_msg_nozzle_temp_abnormal); - SERIAL_ECHOLNPAIR_P("Bed temp abnormal! : ", temp); + while (!WITHIN(temp, BED_MINTEMP, BED_MAXTEMP)) { + faultDuration++; + if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) { + SendtoTFTLN(AC_msg_nozzle_temp_abnormal); + SERIAL_ECHOLNPAIR_P("Bed temp abnormal! : ", temp); break; - } - delay_ms(500); - temp = getActualTemp_celsius(E0); - } while ((temp <= BED_MINTEMP) || (temp >= BED_MAXTEMP) ); + } + delay_ms(500); + temp = getActualTemp_celsius(E0); } // Update panel with hotend heater status if (hotend_state != AC_heater_temp_reached) { - if ( WITHIN( getActualTemp_celsius(E0) - getTargetTemp_celsius(E0), -1, 1 ) ) { + if (WITHIN(getActualTemp_celsius(E0) - getTargetTemp_celsius(E0), -1, 1)) { SendtoTFTLN(AC_msg_nozzle_heating_done); hotend_state = AC_heater_temp_reached; } @@ -390,7 +381,7 @@ namespace Anycubic { // Update panel with bed heater status if (hotbed_state != AC_heater_temp_reached) { - if ( WITHIN( getActualTemp_celsius(BED) - getTargetTemp_celsius(BED), -0.5, 0.5 ) ) { + if (WITHIN(getActualTemp_celsius(BED) - getTargetTemp_celsius(BED), -0.5, 0.5)) { SendtoTFTLN(AC_msg_bed_heating_done); hotbed_state = AC_heater_temp_reached; } @@ -398,7 +389,7 @@ namespace Anycubic { } void ChironTFT::SendFileList(int8_t startindex) { - // respond to panel request for 4 files starting at index + // Respond to panel request for 4 files starting at index #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPAIR("## SendFileList ## ", startindex); #endif @@ -408,8 +399,8 @@ namespace Anycubic { } void ChironTFT::SelectFile() { - strncpy(selectedfile,panel_command+4,command_len-4); - selectedfile[command_len-5] = '\0'; + strncpy(selectedfile, panel_command + 4, command_len - 4); + selectedfile[command_len - 5] = '\0'; #if ACDEBUG(AC_FILE) SERIAL_ECHOLNPAIR_F(" Selected File: ",selectedfile); #endif @@ -493,7 +484,6 @@ namespace Anycubic { if (isPrintingFromMedia()) { SendtoTFT(PSTR("A6V ")); TFTSer.println(ui8tostr2(getProgress_percent())); - } else SendtoTFTLN(PSTR("A6V ---")); @@ -552,7 +542,7 @@ namespace Anycubic { } else { if (printer_state == AC_printer_resuming_from_power_outage) - injectCommands_P(PSTR("M1000 C\n")); // Cancel recovery + injectCommands_P(PSTR("M1000 C")); // Cancel recovery SendtoTFTLN(AC_msg_stop); printer_state = AC_printer_idle; } @@ -569,7 +559,7 @@ namespace Anycubic { case 14: { // A14 Start Printing // Allows printer to restart the job if we dont want to recover if (printer_state == AC_printer_resuming_from_power_outage) { - injectCommands_P(PSTR("M1000 C\n")); // Cancel recovery + injectCommands_P(PSTR("M1000 C")); // Cancel recovery printer_state = AC_printer_idle; } #if ACDebugLevel >= 1 @@ -587,8 +577,7 @@ namespace Anycubic { if (printer_state == AC_printer_resuming_from_power_outage) // Need to home here to restore the Z position injectCommands_P(AC_cmnd_power_loss_recovery); - - injectCommands_P(PSTR("M1000\n")); // home and start recovery + injectCommands_P(PSTR("M1000")); // home and start recovery break; case 16: { // A16 Set HotEnd temp A17 S170 @@ -631,10 +620,10 @@ namespace Anycubic { case 21: // A21 Home Axis A21 X if (!isPrinting()) { switch ((char)panel_command[4]) { - case 'X': injectCommands_P(PSTR("G28 X\n")); break; - case 'Y': injectCommands_P(PSTR("G28 Y\n")); break; - case 'Z': injectCommands_P(PSTR("G28 Z\n")); break; - case 'C': injectCommands_P(PSTR("G28\n")); break; + case 'X': injectCommands_P(PSTR("G28 X")); break; + case 'Y': injectCommands_P(PSTR("G28 Y")); break; + case 'Z': injectCommands_P(PSTR("G28 Z")); break; + case 'C': injectCommands_P(PSTR("G28")); break; } } break; @@ -729,7 +718,7 @@ namespace Anycubic { // If the same meshpoint is selected twice in a row, move the head to that ready for adjustment if ((selectedmeshpoint.x == pos.x) && (selectedmeshpoint.y == pos.y)) { if (!isPositionKnown()) - injectCommands_P(PSTR("G28\n")); // home + injectCommands_P(PSTR("G28")); // home if (isPositionKnown()) { #if ACDEBUG(AC_INFO) @@ -769,17 +758,15 @@ namespace Anycubic { switch (panel_command[3]) { case 'C': // Restore and apply original offsets if (!isPrinting()) { - injectCommands_P(PSTR("M501\nM420 S1\n")); - selectedmeshpoint.x = 99; - selectedmeshpoint.y = 99; + injectCommands_P(PSTR("M501\nM420 S1")); + selectedmeshpoint.x = selectedmeshpoint.y = 99; } break; case 'D': // Save Z Offset tables and restore levelling state if (!isPrinting()) { setAxisPosition_mm(1.0,Z); - injectCommands_P(PSTR("M500\n")); - selectedmeshpoint.x = 99; - selectedmeshpoint.y = 99; + injectCommands_P(PSTR("M500")); + selectedmeshpoint.x = selectedmeshpoint.y = 99; } break; case 'G': // Get current offset @@ -790,8 +777,7 @@ namespace Anycubic { TFTSer.println(live_Zoffset); else { TFTSer.println(getZOffset_mm()); - selectedmeshpoint.x = 99; - selectedmeshpoint.y = 99; + selectedmeshpoint.x = selectedmeshpoint.y = 99; } break; case 'S': { // Set offset (adjusts all points by value) @@ -859,8 +845,7 @@ namespace Anycubic { case 34: { // A34 Adjust single mesh point A34 C/S X1 Y1 V123 if (panel_command[3] == 'C') { // Restore original offsets injectCommands_P(PSTR("M501\nM420 S1")); - selectedmeshpoint.x = 99; - selectedmeshpoint.y = 99; + selectedmeshpoint.x = selectedmeshpoint.y = 99; //printer_state = AC_printer_idle; } else { @@ -876,9 +861,10 @@ namespace Anycubic { #endif // Update Meshpoint setMeshPoint(pos,newval); - if ( (printer_state == AC_printer_idle) || (printer_state == AC_printer_probing) ) {//!isPrinting()) { - // if we are at the current mesh point indicated on the panel Move Z pos +/- 0.05mm ( The panel changes the mesh value by +/- 0.05mm on each button press) - if ((selectedmeshpoint.x == pos.x) && (selectedmeshpoint.y == pos.y)) { + if (printer_state == AC_printer_idle || printer_state == AC_printer_probing /*!isPrinting()*/) { + // if we are at the current mesh point indicated on the panel Move Z pos +/- 0.05mm + // (The panel changes the mesh value by +/- 0.05mm on each button press) + if (selectedmeshpoint.x == pos.x && selectedmeshpoint.y == pos.y) { setSoftEndstopState(false); float currZpos = getAxisPosition_mm(Z); #if ACDEBUG(AC_INFO) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h index 937bdfde33b3..f5000611a7d2 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h @@ -88,7 +88,7 @@ #define MARLIN_msg_start_probing PSTR("Probing Point 1/25") #define MARLIN_msg_probing_failed PSTR("Probing Failed") -#define MARLIN_msg_ready PSTR("3D Printer Ready.") +#define MARLIN_msg_ready PSTR(" Ready.") #define MARLIN_msg_print_paused PSTR("Print Paused") #define MARLIN_msg_print_aborted PSTR("Print Aborted") #define MARLIN_msg_extruder_heating PSTR("E Heating...") From 853d01de683ab3efcbb15ef95db869e279053ee0 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 24 Oct 2020 19:28:31 -0300 Subject: [PATCH 017/443] More LVGL UI code reduction (#19879) --- .../lcd/extui/lib/mks_ui/SPIFlashStorage.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 12 +---------- .../lib/mks_ui/draw_acceleration_settings.cpp | 11 +--------- .../lib/mks_ui/draw_advance_settings.cpp | 13 ++---------- .../draw_auto_level_offset_settings.cpp | 12 +---------- .../extui/lib/mks_ui/draw_baby_stepping.cpp | 13 +----------- .../extui/lib/mks_ui/draw_change_speed.cpp | 13 +----------- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 13 +----------- .../extui/lib/mks_ui/draw_eeprom_settings.cpp | 12 +---------- .../lib/mks_ui/draw_encoder_settings.cpp | 12 +---------- .../extui/lib/mks_ui/draw_error_message.cpp | 9 +-------- .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 13 +----------- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 12 +---------- .../extui/lib/mks_ui/draw_filament_change.cpp | 13 +----------- .../lib/mks_ui/draw_filament_settings.cpp | 12 +---------- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 13 +----------- .../draw_homing_sensitivity_settings.cpp | 10 +--------- .../extui/lib/mks_ui/draw_jerk_settings.cpp | 10 +--------- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 19 +++++------------- .../lcd/extui/lib/mks_ui/draw_language.cpp | 15 +------------- .../extui/lib/mks_ui/draw_level_settings.cpp | 12 ++--------- .../extui/lib/mks_ui/draw_machine_para.cpp | 12 +---------- .../lib/mks_ui/draw_machine_settings.cpp | 13 +----------- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 11 +--------- .../mks_ui/draw_manual_level_pos_settings.cpp | 9 +-------- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 10 +--------- .../extui/lib/mks_ui/draw_motor_settings.cpp | 14 ++----------- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 13 +----------- .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 12 +---------- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 12 +---------- .../extui/lib/mks_ui/draw_pause_position.cpp | 10 +--------- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 12 +---------- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 5 +---- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 10 +--------- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 7 +------ Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 13 +----------- .../extui/lib/mks_ui/draw_step_settings.cpp | 10 +--------- .../lib/mks_ui/draw_tmc_current_settings.cpp | 10 +--------- .../mks_ui/draw_tmc_step_mode_settings.cpp | 10 +--------- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 15 +------------- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 20 ++++++++++++++++++- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 12 +---------- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 12 +---------- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 12 +---------- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 9 +-------- .../src/lcd/extui/lib/mks_ui/wifiSerial.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 8 ++------ 48 files changed, 74 insertions(+), 462 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp index e028b3e6ec04..11c5f816b0b5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp @@ -185,7 +185,7 @@ void SPIFlashStorage::loadPage(uint8_t* buffer) { // char fname[256]; // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); // FILE *fp = fopen(fname, "rb"); - // if (fp != nullptr) { + // if (fp) { // fread(buffer, 1, SPI_FLASH_PageSize, fp); // fclose(fp); // } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index b5e59692fdb2..34168574ec05 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -49,17 +49,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_about(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ABOUT_UI; - } - disp_state = ABOUT_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(ABOUT_UI); // Create an Image button lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp index 9b86929bca3d..ffb6f0157970 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp @@ -108,16 +108,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_acceleration_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ACCELERATION_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ACCELERATION_UI; - } - disp_state = ACCELERATION_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AccelerationConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle); if (uiCfg.para_ui_page != 1) { sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.acceleration); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp index 5c3b067682f4..dd6e484921a4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -40,6 +40,7 @@ enum { }; static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_ADVANCE_RETURN: lv_clear_advance_settings(); @@ -69,17 +70,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_advance_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ADVANCED_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ADVANCED_UI; - } - disp_state = ADVANCED_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.AdvancedConfTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(ADVANCED_UI, machine_menu.AdvancedConfTitle); int index = 0; lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp index 8e40956c0f21..3b39debe578b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.cpp @@ -65,17 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_auto_level_offset_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NOZZLE_PROBE_OFFSET_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = NOZZLE_PROBE_OFFSET_UI; - } - disp_state = NOZZLE_PROBE_OFFSET_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.OffsetConfTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(NOZZLE_PROBE_OFFSET_UI, machine_menu.OffsetConfTitle); sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0)); lv_screen_menu_item_1_edit(scr, machine_menu.Xoffset, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_OFFSET_X, 0, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp index b0a004ed9eaa..5f489162b054 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp @@ -112,18 +112,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_baby_stepping(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != BABY_STEP_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = BABY_STEP_UI; - } - disp_state = BABY_STEP_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(BABY_STEP_UI); lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P); lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N); lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index 05158b181c57..a5100776acec 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -126,18 +126,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_change_speed(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != CHANGE_SPEED_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = CHANGE_SPEED_UI; - } - disp_state = CHANGE_SPEED_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(CHANGE_SPEED_UI); // Create an Image button lv_big_button_create(scr, "F:/bmp_Add.bin", speed_menu.add, INTERVAL_V, titleHeight, event_handler, ID_C_ADD); lv_big_button_create(scr, "F:/bmp_Dec.bin", speed_menu.dec, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_C_DEC); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index a18964919a13..67ed24d8c029 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -211,19 +211,8 @@ static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) { void lv_draw_dialog(uint8_t type) { lv_obj_t *btnOk = nullptr, *btnCancel = nullptr; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; - } - disp_state = DIALOG_UI; - uiCfg.dialogType = type; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(DIALOG_UI); lv_obj_t *labelDialog = lv_label_create_empty(scr); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp index 5e5c6b490793..924c69536af6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp @@ -66,17 +66,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_eeprom_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EEPROM_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = EEPROM_SETTINGS_UI; - } - disp_state = EEPROM_SETTINGS_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(EEPROM_SETTINGS_UI); lv_screen_menu_item(scr, eeprom_menu.revert, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_EEPROM_REVERT, 0); lv_screen_menu_item(scr, eeprom_menu.store, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_EEPROM_STORE, 1); lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN, true); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp index 35bbc6f061f9..c9c2d4f28de2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.cpp @@ -55,18 +55,8 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_encoder_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ENCODER_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ENCODER_SETTINGS_UI; - } - disp_state = ENCODER_SETTINGS_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.EncoderConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(ENCODER_SETTINGS_UI, machine_menu.EncoderConfTitle); buttonEncoderState = lv_screen_menu_item_onoff(scr, machine_menu.EncoderConfText, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ENCODER_STATE, 0, gCfgItems.encoder_enable); - lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN, true); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index e82229c90949..a484f14087b9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -41,15 +41,8 @@ static lv_obj_t *scr; void lv_draw_error_message(PGM_P const msg) { #if 0 static lv_obj_t *message = nullptr, *kill_message = nullptr, *reset_tips = nullptr; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ERROR_MESSAGE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ERROR_MESSAGE_UI; - } - disp_state = ERROR_MESSAGE_UI; - - scr = lv_screen_create(); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(ERROR_MESSAGE_UI, ""); if (msg) { message = lv_label_create(scr, msg); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 9f803afea932..6a1c0c4fb38c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -122,18 +122,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_extrusion(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != EXTRUSION_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = EXTRUSION_UI; - } - disp_state = EXTRUSION_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(EXTRUSION_UI); // Create image buttons lv_obj_t *buttonAdd = lv_big_button_create(scr, "F:/bmp_in.bin", extrude_menu.in, INTERVAL_V, titleHeight, event_handler, ID_E_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 5306ab3a899e..5453bbf86bad 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -89,18 +89,8 @@ void lv_draw_fan(void) { #if HAS_FAN fanSpeed = thermalManager.fan_speed[0]; #endif - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FAN_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = FAN_UI; - } - disp_state = FAN_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(FAN_UI); // Create an Image button buttonAdd = lv_big_button_create(scr, "F:/bmp_Add.bin", fan_menu.add, INTERVAL_V, titleHeight, event_handler, ID_F_ADD); lv_obj_clear_protect(buttonAdd, LV_PROTECT_FOLLOW); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index a3f18cf9cbd3..1db11a20e687 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -112,18 +112,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_filament_change(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FILAMENTCHANGE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = FILAMENTCHANGE_UI; - } - disp_state = FILAMENTCHANGE_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(FILAMENTCHANGE_UI); // Create an Image button lv_obj_t *buttonIn = lv_big_button_create(scr, "F:/bmp_in.bin", filament_menu.in, INTERVAL_V, titleHeight, event_handler, ID_FILAMNT_IN); lv_obj_clear_protect(buttonIn, LV_PROTECT_FOLLOW); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp index ecaeefee569c..2c9c3882f029 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.cpp @@ -89,17 +89,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_filament_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != FILAMENT_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = FILAMENT_SETTINGS_UI; - } - disp_state = FILAMENT_SETTINGS_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.FilamentConfTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(FILAMENT_SETTINGS_UI, machine_menu.FilamentConfTitle); if (uiCfg.para_ui_page != 1) { sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 92510cbc8e5a..646091bd8b4e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -77,18 +77,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_home(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != ZERO_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = ZERO_UI; - } - disp_state = ZERO_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(ZERO_UI); lv_big_button_create(scr, "F:/bmp_zeroAll.bin", home_menu.home_all, INTERVAL_V, titleHeight, event_handler, ID_H_ALL); lv_big_button_create(scr, "F:/bmp_zeroX.bin", home_menu.home_x, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_H_X); lv_big_button_create(scr, "F:/bmp_zeroY.bin", home_menu.home_y, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_H_Y); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp index e01208605fc8..cbd028b60aeb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.cpp @@ -75,15 +75,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_homing_sensitivity_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != HOMING_SENSITIVITY_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = HOMING_SENSITIVITY_UI; - } - disp_state = HOMING_SENSITIVITY_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.HomingSensitivityConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(HOMING_SENSITIVITY_UI, machine_menu.HomingSensitivityConfTitle); sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0)); lv_screen_menu_item_1_edit(scr, machine_menu.X_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_SENSITIVITY_X, 0, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp index 5b8f7b45fdea..f07c2761b6b3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp @@ -71,15 +71,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_jerk_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != JERK_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = JERK_UI; - } - disp_state = JERK_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.JerkConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle); sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index 0debf8fa8f6a..7313ed531f88 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -84,7 +84,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { if (lv_btnm_get_btn_ctrl(kb, btn_id, LV_BTNM_CTRL_NO_REPEAT) && event == LV_EVENT_LONG_PRESSED_REPEAT) return; const char * txt = lv_btnm_get_active_btn_text(kb); - if (txt == nullptr) return; + if (!txt) return; // Do the corresponding action according to the text of the button if (strcmp(txt, "abc") == 0) { @@ -169,14 +169,13 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { default: break; } } - else { - lv_kb_set_ta(kb, nullptr); /*De-assign the text area to hide it cursor if needed*/ - } + else + lv_kb_set_ta(kb, nullptr); // De-assign the text area to hide it cursor if needed return; } /*Add the characters to the text area if set*/ - if (ext->ta == nullptr) return; + if (!ext->ta) return; if (strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) lv_ta_add_char(ext->ta, '\n'); @@ -213,15 +212,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { } void lv_draw_keyboard() { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != KEY_BOARD_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = KEY_BOARD_UI; - } - disp_state = KEY_BOARD_UI; - - scr = lv_screen_create(); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(KEY_BOARD_UI, ""); /*Create styles for the keyboard*/ static lv_style_t rel_style, pr_style; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 1ff60d9b9b93..8f7279f5ddf8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -188,19 +188,7 @@ static void disp_language(uint8_t language, uint8_t state) { } void lv_draw_language(void) { - - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LANGUAGE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = LANGUAGE_UI; - } - disp_state = LANGUAGE_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(LANGUAGE_UI); // Create image buttons buttonCN = lv_big_button_create(scr, "F:/bmp_simplified_cn.bin", language_menu.chinese_s, INTERVAL_V, titleHeight, event_handler, ID_CN); lv_obj_clear_protect(buttonCN, LV_PROTECT_FOLLOW); @@ -211,7 +199,6 @@ void lv_draw_language(void) { buttonFR = lv_big_button_create(scr, "F:/bmp_french.bin", language_menu.french, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_FR); buttonIT = lv_big_button_create(scr, "F:/bmp_italy.bin", language_menu.italy, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_IT); lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_L_RETURN); - disp_language(gCfgItems.language, SELECTED); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp index 7bd2b83ace80..b1ce90f26646 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp @@ -39,6 +39,7 @@ enum { }; static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { case ID_LEVEL_RETURN: lv_clear_level_settings(); @@ -63,16 +64,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_level_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_PARA_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_PARA_UI; - } - disp_state = LEVELING_PARA_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(LEVELING_PARA_UI, machine_menu.LevelingParaConfTitle); lv_screen_menu_item(scr, machine_menu.LevelingManuPosConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_LEVEL_POSITION, 0); lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1); #if HAS_BED_PROBE diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp index 45aabae079a0..5f81d7b3691a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp @@ -66,17 +66,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_machine_para(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_PARA_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_PARA_UI; - } - disp_state = MACHINE_PARA_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(MACHINE_PARA_UI); lv_screen_menu_item(scr, MachinePara_menu.MachineSetting, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PARA_MACHINE, 0); lv_screen_menu_item(scr, MachinePara_menu.MotorSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PARA_MOTOR, 1); lv_screen_menu_item(scr, MachinePara_menu.leveling, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PARA_LEVEL, 2); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp index 000b122b34fe..deeb51ab0fb8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp @@ -63,18 +63,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_machine_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MACHINE_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MACHINE_SETTINGS_UI; - } - disp_state = MACHINE_SETTINGS_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MachineConfigTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(MACHINE_SETTINGS_UI, machine_menu.MachineConfigTitle); lv_screen_menu_item(scr, machine_menu.AccelerationConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MACHINE_ACCELERATION, 0); lv_screen_menu_item(scr, machine_menu.MaxFeedRateConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_MACHINE_FEEDRATE, 1); #if HAS_CLASSIC_JERK diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 0513437353ec..3c8d56291380 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -118,16 +118,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_manualLevel(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != LEVELING_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = LEVELING_UI; - } - disp_state = LEVELING_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(LEVELING_UI); // Create an Image button lv_obj_t *buttonPoint1 = lv_big_button_create(scr, "F:/bmp_leveling1.bin", leveling_menu.position1, INTERVAL_V, titleHeight, event_handler, ID_M_POINT1); lv_obj_clear_protect(buttonPoint1, LV_PROTECT_FOLLOW); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp index 8dedcd4c7b7a..6f64badf8be3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp @@ -121,15 +121,8 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_manual_level_pos_settings(void) { char buf2[50]; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MANUAL_LEVELING_POSIGION_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MANUAL_LEVELING_POSIGION_UI; - } - disp_state = MANUAL_LEVELING_POSIGION_UI; - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.LevelingParaConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(MANUAL_LEVELING_POSIGION_UI, machine_menu.LevelingParaConfTitle); if (uiCfg.para_ui_page != 1) { sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp index 5088e859c093..60efda8b271d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -90,15 +90,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_max_feedrate_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MAXFEEDRATE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MAXFEEDRATE_UI; - } - disp_state = MAXFEEDRATE_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MaxFeedRateConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(MAXFEEDRATE_UI, machine_menu.MaxFeedRateConfTitle); if (uiCfg.para_ui_page != 1) { sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp index 697b7de34532..61cefd761537 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -73,19 +73,9 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_motor_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOTOR_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MOTOR_SETTINGS_UI; - } - disp_state = MOTOR_SETTINGS_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.MotorConfTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); - int index = 0; + + scr = lv_screen_create(MOTOR_SETTINGS_UI, machine_menu.MotorConfTitle); lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index++); #if USE_SENSORLESS lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 0718ffd86e11..30f2a00422aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -115,18 +115,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_move_motor(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MOVE_MOTOR_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = MOVE_MOTOR_UI; - } - disp_state = MOVE_MOTOR_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(MOVE_MOTOR_UI); lv_obj_t *buttonXI = lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_M_X_P); lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_X_N); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp index 9ed4d60139b9..0989b95f82ad 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -662,17 +662,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_number_key(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != NUMBER_KEY_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = NUMBER_KEY_UI; - } - disp_state = NUMBER_KEY_UI; - - scr = lv_screen_create(); - - //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(NUMBER_KEY_UI, ""); buttonValue = lv_btn_create(scr, 92, 40, 296, 40, event_handler, ID_NUM_KEY1, &style_num_text); labelValue = lv_label_create_empty(buttonValue); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index 16f50c16c5cf..07df598d8fc9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -129,17 +129,7 @@ void lv_draw_operation(void) { *buttonBabyStep = nullptr, *label_BabyStep = nullptr, *label_Filament = nullptr; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != OPERATE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = OPERATE_UI; - } - disp_state = OPERATE_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(OPERATE_UI); // Create image buttons lv_obj_t *buttonPreHeat = lv_imgbtn_create(scr, "F:/bmp_temp.bin", INTERVAL_V, titleHeight, event_handler, ID_O_PRE_HEAT); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp index 930773b129d9..a324aef7933e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -65,15 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_pause_position(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PAUSE_POS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PAUSE_POS_UI; - } - disp_state = PAUSE_POS_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.PausePosText); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(PAUSE_POS_UI, machine_menu.PausePosText); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); lv_screen_menu_item_1_edit(scr, machine_menu.xPos, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_X, 0, public_buf_l); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index a222c7adbfe8..0e869e67c420 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -158,17 +158,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_preHeat(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRE_HEAT_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRE_HEAT_UI; - } - disp_state = PRE_HEAT_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(PRE_HEAT_UI); // Create image buttons lv_big_button_create(scr, "F:/bmp_Add.bin", preheat_menu.add, INTERVAL_V, titleHeight, event_handler, ID_P_ADD); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 141ea4cd6fd6..cfd06cf09f21 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -252,10 +252,7 @@ static char test_public_buf_l[40]; void disp_gcode_icon(uint8_t file_num) { uint8_t i; - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(MAIN_UI, ""); // Create image buttons buttonPageUp = lv_imgbtn_create(scr, "F:/bmp_pageUp.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_UP); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 8191d5fb6552..7614f1e99d16 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -121,15 +121,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_printing(void) { disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI; - - disp_state = PRINTING_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(PRINTING_UI); // Create image buttons lv_obj_t *buttonExt1 = lv_img_create(scr, nullptr); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 3e8a9aad5b1a..cee02cc47a6d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -122,13 +122,8 @@ void lv_draw_ready_print(void) { disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_READY_UI; - - disp_state = PRINT_READY_UI; - - scr = lv_screen_create(); + scr = lv_screen_create(PRINT_READY_UI, ""); //lv_obj_set_hidden(scr, true); - lv_refr_now(lv_refr_get_disp_refreshing()); if (mks_test_flag == 0x1E) { //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 46ea04deafa6..b2211e563140 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -126,18 +126,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_set(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != SET_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = SET_UI; - } - disp_state = SET_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(SET_UI); lv_big_button_create(scr, "F:/bmp_eeprom_settings.bin", set_menu.eepromSet, INTERVAL_V, titleHeight, event_handler, ID_S_EEPROM_SET); lv_big_button_create(scr, "F:/bmp_fan.bin", set_menu.fan, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_S_FAN); lv_big_button_create(scr, "F:/bmp_about.bin", set_menu.about, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_S_ABOUT); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp index b2b1b00c3b44..022c4d30f9d6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -90,15 +90,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_step_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != STEPS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = STEPS_UI; - } - disp_state = STEPS_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.StepsConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(STEPS_UI, machine_menu.StepsConfTitle); if (uiCfg.para_ui_page != 1) { sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp index 777b93d1f53b..aaf3073e3d24 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -103,15 +103,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_tmc_current_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_CURRENT_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = TMC_CURRENT_UI; - } - disp_state = TMC_CURRENT_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcCurrentConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(TMC_CURRENT_UI, machine_menu.TmcCurrentConfTitle); float milliamps; if (uiCfg.para_ui_page != 1) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 3814dacfe109..53d7e35382a1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -112,15 +112,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_tmc_step_mode_settings(void) { buttonXState = buttonYState = buttonZState = buttonE0State = buttonE1State = nullptr; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TMC_MODE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = TMC_MODE_UI; - } - disp_state = TMC_MODE_UI; - - scr = lv_screen_create(); - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.TmcStepModeConfTitle); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(TMC_MODE_UI, machine_menu.TmcStepModeConfTitle); bool stealth_X = false, stealth_Y = false, stealth_Z = false, stealth_E0 = false, stealth_E1 = false; #if AXIS_HAS_STEALTHCHOP(X) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 2bbd544cc889..3a9d78741a8b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -99,24 +99,11 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_tool(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != TOOL_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = TOOL_UI; - } - disp_state = TOOL_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); - + scr = lv_screen_create(TOOL_UI); lv_big_button_create(scr, "F:/bmp_preHeat.bin", tool_menu.preheat, INTERVAL_V, titleHeight, event_handler, ID_T_PRE_HEAT); lv_big_button_create(scr, "F:/bmp_extruct.bin", tool_menu.extrude, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_T_EXTRUCT); - lv_big_button_create(scr, "F:/bmp_mov.bin", tool_menu.move, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_T_MOV); lv_big_button_create(scr, "F:/bmp_zero.bin", tool_menu.home, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME); - lv_big_button_create(scr, "F:/bmp_leveling.bin", tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling), INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING); lv_big_button_create(scr, "F:/bmp_filamentchange.bin", tool_menu.filament, BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT); lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_RETURN); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 2de5bf25e18e..50c49999afe7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1628,11 +1628,29 @@ void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style) { } // Create a screen -lv_obj_t* lv_screen_create() { +lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) { lv_obj_t *scr = lv_obj_create(nullptr, nullptr); lv_obj_set_style(scr, &tft_style_scr); lv_scr_load(scr); lv_obj_clean(scr); + + // breadcrumbs + if (disp_state_stack._disp_state[disp_state_stack._disp_index] != newScreenType) { + disp_state_stack._disp_index++; + disp_state_stack._disp_state[disp_state_stack._disp_index] = newScreenType; + } + disp_state = newScreenType; + lv_refr_now(lv_refr_get_disp_refreshing()); + + // title + lv_obj_t *titleLabel = nullptr; + if (!title) + titleLabel = lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); + else if (title[0] != '\0') + titleLabel = lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, title); + if (titleLabel) + lv_obj_set_style(titleLabel, &tft_style_label_rel); + return scr; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 479166cd8fed..3e3a4073d36c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -468,7 +468,7 @@ void lv_btn_use_label_style(lv_obj_t *btn); void lv_btn_set_style_both(lv_obj_t *btn, lv_style_t *style); // Create a screen -lv_obj_t* lv_screen_create(); +lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title = nullptr); // Create an empty label lv_obj_t* lv_label_create_empty(lv_obj_t *par); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index e8214cad3a2b..313abd45453a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -58,17 +58,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_wifi(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_UI; - } - disp_state = WIFI_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(WIFI_UI); // Create an Image button lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_RETURN); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index cb72469bd48f..c826e36d428d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -89,17 +89,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_wifi_list(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_LIST_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_LIST_UI; - } - disp_state = WIFI_LIST_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(WIFI_LIST_UI); lv_obj_t *buttonDown = lv_imgbtn_create(scr, "F:/bmp_pageDown.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + OTHER_BTN_YPIEL + INTERVAL_H, event_handler, ID_WL_DOWN); lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_back.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight + (OTHER_BTN_YPIEL + INTERVAL_H) * 2, event_handler, ID_WL_RETURN); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp index 0c4fe6113284..441720df8223 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp @@ -94,17 +94,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } void lv_draw_wifi_settings(void) { - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_SETTINGS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_SETTINGS_UI; - } - disp_state = WIFI_SETTINGS_UI; - - scr = lv_screen_create(); - - (void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, machine_menu.WifiConfTitle); - - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(WIFI_SETTINGS_UI, machine_menu.WifiConfTitle); lv_obj_t *labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp index 57f2584fa32c..a9e562499679 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp @@ -39,14 +39,7 @@ tips_menu_def tips_menu; void lv_draw_wifi_tips(void) { static lv_obj_t *text_tips,*wifi_name; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != WIFI_TIPS_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = WIFI_TIPS_UI; - } - disp_state = WIFI_TIPS_UI; - - scr = lv_screen_create(); - lv_refr_now(lv_refr_get_disp_refreshing()); + scr = lv_screen_create(WIFI_TIPS_UI, ""); wifi_name = lv_label_create(scr, (const char *)wifi_list.wifiName[wifi_list.nameIndex]); lv_obj_align(wifi_name, nullptr, LV_ALIGN_CENTER, 0, -20); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp index 6e15deffaea0..16b65c7ea3d8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp @@ -53,7 +53,7 @@ WifiSerial::WifiSerial(usart_dev *usart_device, uint8 tx_pin, uint8 rx_pin) { /* F1 MCUs have no GPIO_AFR[HL], so turn off PWM if there's a conflict * on this GPIO bit. */ static void disable_timer_if_necessary(timer_dev *dev, uint8 ch) { - if (dev != nullptr) timer_set_mode(dev, ch, TIMER_DISABLED); + if (dev) timer_set_mode(dev, ch, TIMER_DISABLED); } #elif STM32_MCU_SERIES == STM32_SERIES_F2 || STM32_MCU_SERIES == STM32_SERIES_F4 #define disable_timer_if_necessary(dev, ch) ((void)0) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 1ab186a6be79..097263a655f7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -533,12 +533,8 @@ EspUploadResult flashFinish(signed char reboot) { // Compute the checksum of a block of data uint16_t checksum(const uint8_t *data, uint16_t dataLen, uint16_t cksum) { - if (data != nullptr) { - while (dataLen--) { - cksum ^= (uint16_t)*data++; - } - } - return(cksum); + if (data) while (dataLen--) cksum ^= (uint16_t)*data++; + return cksum; } EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { From b6508c4bd1107e26f2aee45be6a15257839aa575 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 25 Oct 2020 00:16:51 +0000 Subject: [PATCH 018/443] [cron] Bump distribution date (2020-10-25) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4a57749cf059..d1d88912fd55 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-24" + #define STRING_DISTRIBUTION_DATE "2020-10-25" #endif /** From 62ba799d72daabb585da5b2b4ff67d45130c7061 Mon Sep 17 00:00:00 2001 From: Gurmeet Athwal Date: Sun, 25 Oct 2020 06:11:52 +0530 Subject: [PATCH 019/443] Add 'BTN_ENC_EN' for SKR V1.4 with DOGM (#19796) --- Marlin/src/lcd/marlinui.cpp | 12 ++++++++++-- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 5 +++++ Marlin/src/pins/pinsDebug_list.h | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 487678eccfc1..9c456c25c942 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -337,6 +337,10 @@ void MarlinUI::init() { SET_INPUT_PULLUP(BTN_ENC); #endif + #if BUTTON_EXISTS(ENC_EN) + SET_INPUT_PULLUP(BTN_ENC_EN); + #endif + #if BUTTON_EXISTS(BACK) SET_INPUT_PULLUP(BTN_BACK); #endif @@ -957,7 +961,10 @@ void MarlinUI::update() { #endif // ENCODER_RATE_MULTIPLIER - encoderPosition += (encoderDiff * encoderMultiplier) / epps; + // Update position only when ENC_EN is HIGH + if (TERN1(BTN_ENC_EN, !BUTTON_PRESSED(ENC_EN))) + encoderPosition += (encoderDiff * encoderMultiplier) / epps; + encoderDiff = 0; } @@ -1175,7 +1182,8 @@ void MarlinUI::update() { if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; #endif #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; + // Update button only when ENC_EN is HIGH + if (TERN1(BTN_ENC_EN, !BUTTON_PRESSED(ENC_EN)) && BUTTON_PRESSED(ENC)) newbutton |= EN_C; #endif #if BUTTON_EXISTS(BACK) if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; 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 f2afc23bc2e6..2b8682aac7ba 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -399,6 +399,11 @@ #define LCD_PINS_D5 P1_21 #define LCD_PINS_D6 P1_22 #define LCD_PINS_D7 P1_23 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !FYSETC_MINI_12864 diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 704f2a487fb1..cf839e2abd98 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -147,6 +147,9 @@ #if defined(BTN_EN2) && BTN_EN2 >= 0 REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) #endif +#if defined(BTN_ENC_EN) && BTN_ENC_EN >= 0 + REPORT_NAME_DIGITAL(__LINE__, BTN_ENC_EN) +#endif #if defined(BTN_ENC) && BTN_ENC >= 0 REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) #endif From ea0afd0b4d918b9afe09f38a97c977151851d770 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sat, 24 Oct 2020 17:43:42 -0700 Subject: [PATCH 020/443] Ignore NativeEthernet on AT90USB1286 (#19885) --- .github/workflows/test-builds.yml | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index f7ba348cc002..0030dceb2add 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -39,6 +39,7 @@ jobs: - esp32 - linux_native - mega2560 + - at90usb1286_dfu - teensy31 - teensy35 - teensy41 @@ -95,7 +96,6 @@ jobs: # Non-working environment tests #- at90usb1286_cdc - #- at90usb1286_dfu #- STM32F103CB_malyan #- mks_robin_mini diff --git a/platformio.ini b/platformio.ini index 326dca172ff5..56ace1b6e244 100644 --- a/platformio.ini +++ b/platformio.ini @@ -560,7 +560,7 @@ build_unflags = -g -ggdb platform = teensy extends = common_avr8 board = at90usb1286 -lib_ignore = ${env:common_avr8.lib_ignore} Teensy_ADC +lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet # # AT90USB1286 boards using DFU bootloader From f7cdc05937851de9b8270ca3b25a972ede7952e4 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sat, 24 Oct 2020 17:44:46 -0700 Subject: [PATCH 021/443] Update ZMIB_V2 env names (#19886) --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9ea35371a404..4f3397b98d87 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -318,7 +318,7 @@ #elif MB(AZTEEG_X1) #include "sanguino/pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(ZMIB_V2) - #include "sanguino/pins_ZMIB_V2.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_ZMIB_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p // // Other ATmega644P, ATmega644, ATmega1284P From 8cc0369d97fc762f2fd0ede31635de9f2ab9dd2b Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 25 Oct 2020 13:46:27 +1300 Subject: [PATCH 022/443] Use LiquidCrystal_I2C@1.1.4 for RA_CONTROL_PANEL (#19875) --- buildroot/share/PlatformIO/scripts/common-dependencies.h | 4 +++- platformio.ini | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index c96907bb3ff1..f5b36c407ed4 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -37,7 +37,9 @@ // Feature checks for SR_LCD_3W_NL #elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) #define USES_LIQUIDTWI2 -#elif ANY(HAS_MARLINUI_HD44780, LCD_I2C_TYPE_PCF8575, LCD_I2C_TYPE_PCA8574, SR_LCD_2W_NL, LCM1602) +#elif ENABLED(LCD_I2C_TYPE_PCA8574) + #define USES_LIQUIDCRYSTAL_I2C +#elif ANY(HAS_MARLINUI_HD44780, LCD_I2C_TYPE_PCF8575, SR_LCD_2W_NL , LCM1602) #define USES_LIQUIDCRYSTAL #endif diff --git a/platformio.ini b/platformio.ini index 56ace1b6e244..3e565e6c4eba 100644 --- a/platformio.ini +++ b/platformio.ini @@ -222,6 +222,7 @@ NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 src_filter=+ MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 USES_LIQUIDCRYSTAL = LiquidCrystal@1.5.0 +USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 HAS_WIRED_LCD = src_filter=+ HAS_MARLINUI_HD44780 = src_filter=+ From ec04517710b83852fe907e72e672e34b77f7e409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pasold?= Date: Sun, 25 Oct 2020 09:43:21 +0100 Subject: [PATCH 023/443] Support Fysetc Mini 12864 + GT2560 A(+) (#19878) --- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index f481db2b9670..2db030804c43 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -116,6 +116,20 @@ #define DOGLCD_CS 21 #define BTN_EN1 40 #define BTN_EN2 42 + #elif ENABLED(FYSETC_MINI_12864) + // Disconnect EXP2-1 and EXP2-2, otherwise future firmware upload won't work. + #define DOGLCD_A0 20 + #define DOGLCD_CS 17 + + #define NEOPIXEL_PIN 21 + #define BTN_EN1 42 + #define BTN_EN2 40 + + #define LCD_RESET_PIN 16 + + #define DEFAULT_LCD_CONTRAST 220 + + #define LCD_BACKLIGHT_PIN -1 #else #define LCD_PINS_RS 20 #define LCD_PINS_ENABLE 17 From 2e48d6cf7006111feb9b80af55f74116de7f92c7 Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 25 Oct 2020 21:46:21 +1300 Subject: [PATCH 024/443] Fix PASSWORD compile w/out LCD (#19888) --- Marlin/src/feature/password/password.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/password/password.h b/Marlin/src/feature/password/password.h index 3c223b6a824b..97c31745578a 100644 --- a/Marlin/src/feature/password/password.h +++ b/Marlin/src/feature/password/password.h @@ -31,10 +31,10 @@ class Password { Password() { is_locked = false; } static void lock_machine(); + static void authentication_check(); #if HAS_LCD_MENU static void access_menu_password(); - static void authentication_check(); static void authentication_done(); static void media_gatekeeper(); From 00fbe50bbec40969cecbcbc011137297a7419640 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 25 Oct 2020 04:07:00 -0500 Subject: [PATCH 025/443] Format Nucleo F767ZI pins --- Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 25 ++++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 0a00e03612aa..90dcfc46e424 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -57,9 +57,8 @@ * TIM14 - TEMP_TIMER (Marlin) * */ -#define STEP_TIMER 4 -#define TEMP_TIMER 14 - +#define STEP_TIMER 4 +#define TEMP_TIMER 14 /** * These pin assignments are arbitrary and intending for testing purposes. @@ -78,7 +77,7 @@ * GND | · · | PD2 (SERVO0_PIN) PB4 | · · | PF12 (LCD_RS) * GND | · · | PG2  ̄ ̄ ̄ * VIN | · · | PG3 -_*  ̄ ̄ ̄ _CN10 + *  ̄ ̄ ̄ _CN10 * AVDD | · · | PF13 (BTN_EN1) * _CN9_ AGND | · · | PE9 (BTN_EN2) * (TEMP_0) PA3 | · · | PD7 GND | · · | PE11 (BTN_ENC) @@ -152,13 +151,13 @@ _*  ̄ ̄ ̄ _CN10 // // Heaters / Fans // -#define HEATER_0_PIN PA15 // PWM Capable, TIM2_CH1 -#define HEATER_BED_PIN PB3 // PWM Capable, TIM2_CH2 +#define HEATER_0_PIN PA15 // PWM Capable, TIM2_CH1 +#define HEATER_BED_PIN PB3 // PWM Capable, TIM2_CH2 #ifndef FAN_PIN - #define FAN_PIN PB10 // PWM Capable, TIM2_CH3 + #define FAN_PIN PB10 // PWM Capable, TIM2_CH3 #endif -#define FAN1_PIN PB11 // PWM Capable, TIM2_CH4 +#define FAN1_PIN PB11 // PWM Capable, TIM2_CH4 #ifndef E0_AUTO_FAN_PIN #define E0_AUTO_FAN_PIN FAN1_PIN @@ -167,8 +166,8 @@ _*  ̄ ̄ ̄ _CN10 // // Servos // -#define SERVO0_PIN PB4 // PWM Capable, TIM3_CH1 -#define SERVO1_PIN PB5 // PWM Capable, TIM3_CH2 +#define SERVO0_PIN PB4 // PWM Capable, TIM3_CH1 +#define SERVO1_PIN PB5 // PWM Capable, TIM3_CH2 // SPI for external SD Card (Not entirely sure this will work) #define SCK_PIN PA5 @@ -177,13 +176,13 @@ _*  ̄ ̄ ̄ _CN10 #define SS_PIN PA4 #define SDSS PA4 -#define LED_PIN LED_BLUE +#define LED_PIN LED_BLUE // // LCD / Controller // #if IS_RRD_FG_SC - #define BEEPER_PIN PC7 // LCD_BEEPER + #define BEEPER_PIN PC7 // LCD_BEEPER #define BTN_ENC PE11 // BTN_ENC #define SD_DETECT_PIN PD14 #define LCD_PINS_RS PF12 // LCD_RS @@ -193,7 +192,7 @@ _*  ̄ ̄ ̄ _CN10 // #define LCD_PINS_D6 // #define LCD_PINS_D7 #define BTN_EN1 PF13 // BTN_EN1 - #define BTN_EN2 PE9 // BTN_EN2 + #define BTN_EN2 PE9 // BTN_EN2 #define BOARD_ST7920_DELAY_1 DELAY_NS(125) #define BOARD_ST7920_DELAY_2 DELAY_NS(63) From ec23e37a4a31d12febc06922d3fa68446f58d7fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 24 Oct 2020 17:13:10 -0500 Subject: [PATCH 026/443] Clean up comments, USB flash, NULLs --- Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp | 4 +- Marlin/src/HAL/ESP32/i2s.cpp | 4 +- Marlin/src/HAL/LINUX/eeprom.cpp | 4 +- Marlin/src/HAL/LINUX/hardware/Gpio.h | 12 +- Marlin/src/HAL/SAMD51/HAL.cpp | 4 +- Marlin/src/HAL/SAMD51/QSPIFlash.cpp | 4 +- Marlin/src/HAL/STM32/tft/xpt2046.cpp | 2 +- Marlin/src/HAL/STM32/timers.cpp | 2 +- Marlin/src/HAL/STM32F1/HAL.h | 2 +- Marlin/src/HAL/STM32F1/SPI.cpp | 2 +- Marlin/src/HAL/STM32F1/fastio.h | 2 +- Marlin/src/gcode/parser.h | 2 +- Marlin/src/gcode/queue.cpp | 4 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 2 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 2 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 2 +- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 2 +- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 2 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 13 +- .../ftdi_eve_lib/extended/unicode/unicode.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 12 +- Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/tft/canvas.cpp | 2 +- Marlin/src/lcd/tft/tft_image.cpp | 2 +- Marlin/src/lcd/tft/tft_queue.cpp | 20 +- Marlin/src/lcd/tft/tft_string.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 9 +- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 4 +- .../libs/heatshrink/heatshrink_decoder.cpp | 8 +- Marlin/src/libs/vector_3.cpp | 2 +- Marlin/src/pins/mega/pins_CNCONTROLS_11.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 +- Marlin/src/sd/SdBaseFile.cpp | 4 +- Marlin/src/sd/SdBaseFile.h | 7 +- Marlin/src/sd/SdFatConfig.h | 3 +- Marlin/src/sd/SdFatStructs.h | 7 +- Marlin/src/sd/SdFatUtil.cpp | 2 + Marlin/src/sd/SdFatUtil.h | 2 + Marlin/src/sd/SdFile.cpp | 2 + Marlin/src/sd/SdFile.h | 9 +- Marlin/src/sd/SdVolume.cpp | 2 + Marlin/src/sd/SdVolume.h | 7 +- Marlin/src/sd/cardreader.cpp | 4 +- Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp | 274 +++++++++--------- 45 files changed, 231 insertions(+), 238 deletions(-) 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 ea2936359d81..db5e82ec5502 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -84,7 +84,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { card.getSd2Card().readData(sector_buf); // RAM -> USB - if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) { + if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) { card.getSd2Card().readStop(); return CTRL_FAIL; } @@ -120,7 +120,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { while (nb_sector--) { // USB -> RAM - if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) { + if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) { card.getSd2Card().writeStop(); return CTRL_FAIL; } diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index 99b2f755e578..e8f380654314 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -184,7 +184,7 @@ int i2s_init() { // Allocate the array of pointers to the buffers dma.buffers = (uint32_t **)malloc(sizeof(uint32_t*) * DMA_BUF_COUNT); - if (dma.buffers == nullptr) return -1; + if (!dma.buffers) return -1; // Allocate each buffer that can be used by the DMA controller for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) { @@ -194,7 +194,7 @@ int i2s_init() { // Allocate the array of DMA descriptors dma.desc = (lldesc_t**) malloc(sizeof(lldesc_t*) * DMA_BUF_COUNT); - if (dma.desc == nullptr) return -1; + if (!dma.desc) return -1; // Allocate each DMA descriptor that will be used by the DMA controller for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) { diff --git a/Marlin/src/HAL/LINUX/eeprom.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp index 967ca851abc1..68fff9c433b6 100644 --- a/Marlin/src/HAL/LINUX/eeprom.cpp +++ b/Marlin/src/HAL/LINUX/eeprom.cpp @@ -40,7 +40,7 @@ size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } bool PersistentStore::access_start() { const char eeprom_erase_value = 0xFF; FILE * eeprom_file = fopen(filename, "rb"); - if (eeprom_file == nullptr) return false; + if (!eeprom_file) return false; fseek(eeprom_file, 0L, SEEK_END); std::size_t file_size = ftell(eeprom_file); @@ -59,7 +59,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { FILE * eeprom_file = fopen(filename, "wb"); - if (eeprom_file == nullptr) return false; + if (!eeprom_file) return false; fwrite(buffer, sizeof(uint8_t), sizeof(buffer), eeprom_file); fclose(eeprom_file); return true; diff --git a/Marlin/src/HAL/LINUX/hardware/Gpio.h b/Marlin/src/HAL/LINUX/hardware/Gpio.h index 9255ec1dfc91..2d9b1f29ebad 100644 --- a/Marlin/src/HAL/LINUX/hardware/Gpio.h +++ b/Marlin/src/HAL/LINUX/hardware/Gpio.h @@ -86,10 +86,10 @@ class Gpio { GpioEvent::Type evt_type = value > 1 ? GpioEvent::SET_VALUE : value > pin_map[pin].value ? GpioEvent::RISE : value < pin_map[pin].value ? GpioEvent::FALL : GpioEvent::NOP; pin_map[pin].value = value; GpioEvent evt(Clock::nanos(), pin, evt_type); - if (pin_map[pin].cb != nullptr) { + if (pin_map[pin].cb) { pin_map[pin].cb->interrupt(evt); } - if (Gpio::logger != nullptr) Gpio::logger->log(evt); + if (Gpio::logger) Gpio::logger->log(evt); } static uint16_t get(pin_type pin) { @@ -105,8 +105,8 @@ class Gpio { if (!valid_pin(pin)) return; pin_map[pin].mode = value; GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETM); - if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt); - if (Gpio::logger != nullptr) Gpio::logger->log(evt); + if (pin_map[pin].cb) pin_map[pin].cb->interrupt(evt); + if (Gpio::logger) Gpio::logger->log(evt); } static uint8_t getMode(pin_type pin) { @@ -118,8 +118,8 @@ class Gpio { if (!valid_pin(pin)) return; pin_map[pin].dir = value; GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETD); - if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt); - if (Gpio::logger != nullptr) Gpio::logger->log(evt); + if (pin_map[pin].cb) pin_map[pin].cb->interrupt(evt); + if (Gpio::logger) Gpio::logger->log(evt); } static uint8_t getDir(pin_type pin) { diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 9f24d30071a6..d985ef37871f 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -300,7 +300,7 @@ uint16_t HAL_adc_result; DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE DMA_STEPSEL_SRC // STEPSEL ); - if (descriptor != nullptr) + if (descriptor) descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; adc0DMAProgram.startJob(); } @@ -337,7 +337,7 @@ uint16_t HAL_adc_result; DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE DMA_STEPSEL_SRC // STEPSEL ); - if (descriptor != nullptr) + if (descriptor) descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; adc1DMAProgram.startJob(); } diff --git a/Marlin/src/HAL/SAMD51/QSPIFlash.cpp b/Marlin/src/HAL/SAMD51/QSPIFlash.cpp index 307eb3fd45f2..fc21a1ad8c80 100644 --- a/Marlin/src/HAL/SAMD51/QSPIFlash.cpp +++ b/Marlin/src/HAL/SAMD51/QSPIFlash.cpp @@ -35,10 +35,10 @@ uint8_t QSPIFlash::_buf[SFLASH_SECTOR_SIZE]; uint32_t QSPIFlash::_addr = INVALID_ADDR; void QSPIFlash::begin() { - if (_flashBase != nullptr) return; + if (_flashBase) return; _flashBase = new Adafruit_SPIFlashBase(new Adafruit_FlashTransport_QSPI()); - _flashBase->begin(NULL); + _flashBase->begin(nullptr); } size_t QSPIFlash::size() { diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index 921e377a9f4e..8c8d28f66a50 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -99,7 +99,7 @@ void XPT2046::Init() { #endif } else { - SPIx.Instance = NULL; + SPIx.Instance = nullptr; SET_INPUT(TOUCH_MISO_PIN); SET_OUTPUT(TOUCH_MOSI_PIN); SET_OUTPUT(TOUCH_SCK_PIN); diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index c0ba19abe545..b708c4bdab5b 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -109,7 +109,7 @@ // Private Variables // ------------------------ -HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { NULL }; +HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { nullptr }; // ------------------------ // Public functions diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index c10dea0eafd1..eaf6494dfa92 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -124,7 +124,7 @@ void HAL_idletask(); #endif #ifndef digitalPinHasPWM - #define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr) + #define digitalPinHasPWM(P) !!PIN_MAP[P].timer_device #define NO_COMPILE_TIME_PWM #endif diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index 0452cf629390..ef00b407a883 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -656,7 +656,7 @@ static const spi_pins* dev_to_spi_pins(spi_dev *dev) { #if BOARD_NR_SPI >= 3 case RCC_SPI3: return board_spi_pins + 2; #endif - default: return NULL; + default: return nullptr; } } diff --git a/Marlin/src/HAL/STM32F1/fastio.h b/Marlin/src/HAL/STM32F1/fastio.h index e0e2e03a1c47..a618fccc578e 100644 --- a/Marlin/src/HAL/STM32F1/fastio.h +++ b/Marlin/src/HAL/STM32F1/fastio.h @@ -51,7 +51,7 @@ #define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD) #define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP || _GET_MODE(IO) == GPIO_OUTPUT_OD) -#define PWM_PIN(IO) (PIN_MAP[IO].timer_device != nullptr) +#define PWM_PIN(IO) !!PIN_MAP[IO].timer_device // digitalRead/Write wrappers #define extDigitalRead(IO) digitalRead(IO) diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 42b85ca27195..17fb08438890 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -245,7 +245,7 @@ class GCodeParser { #endif // The code value pointer was set - FORCE_INLINE static bool has_value() { return value_ptr != nullptr; } + 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(); } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 6139e3e2b8db..f481052cbf4f 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -180,7 +180,7 @@ bool GCodeQueue::enqueue_one(const char* cmd) { * Return 'true' if any commands were processed. */ bool GCodeQueue::process_injected_command_P() { - if (injected_commands_P == nullptr) return false; + if (!injected_commands_P) return false; char c; size_t i = 0; @@ -480,7 +480,7 @@ void GCodeQueue::get_serial_commands() { if (npos) { - bool M110 = strstr_P(command, PSTR("M110")) != nullptr; + const bool M110 = !!strstr_P(command, PSTR("M110")); if (M110) { char* n2pos = strchr(command + 4, 'N'); diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 3c7993e375e9..4b8245839805 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1036,7 +1036,7 @@ void MarlinUI::draw_status_screen() { void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { ui.encoder_direction_normal(); uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, LCD_WIDTH - 1); - if (value != nullptr) { + if (value) { lcd_put_wchar(':'); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 83ebe111ae3d..c21c2ceb5864 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -863,7 +863,7 @@ void MarlinUI::draw_status_screen() { lcd.setCursor(0, MIDDLE_Y); lcd.write(COLOR_EDIT); lcd_put_u8str_P(pstr); - if (value != nullptr) { + if (value) { lcd.write(':'); lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), MIDDLE_Y); // Right-justified, padded by spaces lcd.write(' '); // Overwrite char if value gets shorter diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 53a20476e9c5..0aba49d56452 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -423,7 +423,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex, itemString); // If a value is included, print a colon, then print the value right-justified - if (value != nullptr) { + if (value) { lcd_put_wchar(':'); if (extra_row) { // Assume that value is numeric (with no descender) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 2599b1ad2267..106c18cf06f7 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -346,7 +346,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u switch (msg) { case U8G_DEV_MSG_INIT: - dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, NULL); + dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, nullptr); tftio.Init(); tftio.InitTFT(); diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index 99b2559d704e..a1d1217d6ec0 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -294,7 +294,7 @@ namespace Anycubic { } void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) { - if (str != nullptr) { + if (str) { #if ACDEBUG(AC_SOME) SERIAL_ECHOPGM("> "); #endif diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index efbc57e68a80..2aaa0d0e336f 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -218,12 +218,12 @@ void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) { } float AnycubicTFTClass::CodeValue() { - return (strtod(&TFTcmdbuffer[TFTbufindr][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindr] + 1], NULL)); + return (strtod(&TFTcmdbuffer[TFTbufindr][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindr] + 1], nullptr)); } bool AnycubicTFTClass::CodeSeen(char code) { TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindr], code); - return (TFTstrchr_pointer != NULL); // Return True if a character was found + return !!TFTstrchr_pointer; // Return True if a character was found } bool AnycubicTFTClass::IsNozzleHomed() { @@ -536,7 +536,7 @@ void AnycubicTFTClass::OnPrintTimerStopped() { } void AnycubicTFTClass::GetCommandFromTFT() { - char *starpos = NULL; + char *starpos = nullptr; while (LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) { serial3_char = LCD_SERIAL.read(); if (serial3_char == '\n' || @@ -549,10 +549,10 @@ void AnycubicTFTClass::GetCommandFromTFT() { TFTcmdbuffer[TFTbufindw][serial3_count] = 0; // terminate string - if ((strchr(TFTcmdbuffer[TFTbufindw], 'A') != NULL)) { + if ((strchr(TFTcmdbuffer[TFTbufindw], 'A') != nullptr)) { int16_t a_command; TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindw], 'A'); - a_command = ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], NULL)))); + a_command = ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], nullptr)))); #if ENABLED(ANYCUBIC_LCD_DEBUG) if ((a_command > 7) && (a_command != 20)) { // No debugging of status polls, please! @@ -682,8 +682,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { else { SelectedDirectory[0] = 0; - if (starpos != NULL) - *(starpos - 1) = '\0'; + if (starpos) *(starpos - 1) = '\0'; strcpy(SelectedFile, TFTstrchr_pointer + 4); SENDLINE_DBG_PGM_VAL("J20", "TFT Serial Debug: File Selected... J20 ", SelectedFile); // J20 File Selected diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index 09473c1c263d..bee3f74cab4f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -146,9 +146,9 @@ uint16_t FTDI::get_utf8_char_width(utf8_char_t c, font_size_t fs) { int x = 0, y = 0; #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET - WesternCharSet::render_glyph(NULL, x, y, fs, c) || + WesternCharSet::render_glyph(nullptr, x, y, fs, c) || #endif - StandardCharSet::render_glyph(NULL, x, y, fs, c); + StandardCharSet::render_glyph(nullptr, x, y, fs, c); return x; } @@ -165,7 +165,7 @@ */ uint16_t FTDI::get_utf8_text_width(const char *str, font_size_t fs) { - return render_utf8_text(NULL, 0, 0, str, fs); + return render_utf8_text(nullptr, 0, 0, str, fs); } uint16_t FTDI::get_utf8_text_width(progmem_str pstr, font_size_t fs) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index 7313ed531f88..acf1d153253f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -110,7 +110,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { draw_return_ui(); } else { - lv_kb_set_ta(kb, nullptr); /*De-assign the text area to hide it cursor if needed*/ + lv_kb_set_ta(kb, nullptr); // De-assign the text area to hide it cursor if needed lv_obj_del(kb); return; } @@ -174,7 +174,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { return; } - /*Add the characters to the text area if set*/ + // Add the characters to the text area if set if (!ext->ta) return; if (strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) @@ -214,7 +214,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { void lv_draw_keyboard() { scr = lv_screen_create(KEY_BOARD_UI, ""); - /*Create styles for the keyboard*/ + // Create styles for the keyboard static lv_style_t rel_style, pr_style; lv_style_copy(&rel_style, &lv_style_btn_rel); @@ -229,7 +229,7 @@ void lv_draw_keyboard() { pr_style.body.main_color = lv_color_make(0x72, 0x42, 0x15); pr_style.body.grad_color = lv_color_make(0x6A, 0x3A, 0x0C); - /*Create a keyboard and apply the styles*/ + // Create a keyboard and apply the styles lv_obj_t *kb = lv_kb_create(scr, nullptr); lv_obj_set_event_cb(kb, lv_kb_event_cb); lv_kb_set_cursor_manage(kb, true); @@ -243,7 +243,7 @@ void lv_draw_keyboard() { } #endif - /*Create a text area. The keyboard will write here*/ + // Create a text area. The keyboard will write here lv_obj_t *ta = lv_ta_create(scr, nullptr); lv_obj_align(ta, nullptr, LV_ALIGN_IN_TOP_MID, 0, 10); if (keyboard_value == gcodeCommand) { @@ -255,7 +255,7 @@ void lv_draw_keyboard() { lv_ta_set_text(ta, ""); } - /*Assign the text area to the keyboard*/ + // Assign the text area to the keyboard lv_kb_set_ta(kb, ta); } diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 5d67410351f6..cd949270497a 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -129,7 +129,7 @@ void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { if (ui.should_draw()) draw_edit_screen(strfunc(ui.encoderPosition + minEditValue)); if (ui.lcd_clicked || (liveEdit && ui.should_draw())) { - if (editValue != nullptr) loadfunc(editValue, ui.encoderPosition + minEditValue); + if (editValue) loadfunc(editValue, ui.encoderPosition + minEditValue); if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)(); if (ui.use_click()) ui.goto_previous_screen(); } diff --git a/Marlin/src/lcd/tft/canvas.cpp b/Marlin/src/lcd/tft/canvas.cpp index f6a5046b8d04..061f078b92bd 100644 --- a/Marlin/src/lcd/tft/canvas.cpp +++ b/Marlin/src/lcd/tft/canvas.cpp @@ -79,7 +79,7 @@ void CANVAS::AddText(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, ui void CANVAS::AddImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { uint16_t *data = (uint16_t *)Images[image].data; - if (data == NULL) return; + if (!data) return; uint16_t image_width = Images[image].width, image_height = Images[image].height; diff --git a/Marlin/src/lcd/tft/tft_image.cpp b/Marlin/src/lcd/tft/tft_image.cpp index 27749cb7f3ae..8f8b6106996a 100644 --- a/Marlin/src/lcd/tft/tft_image.cpp +++ b/Marlin/src/lcd/tft/tft_image.cpp @@ -23,7 +23,7 @@ #include "tft_image.h" #include -const tImage NoLogo = { (void *)NULL, 0, 0, NOCOLORS }; +const tImage NoLogo = { nullptr, 0, 0, NOCOLORS }; const tImage MarlinLogo112x38x1 = { (void *)marlin_logo_112x38x1, 112, 38, GREYSCALE1 }; const tImage MarlinLogo228x255x2 = { (void *)marlin_logo_228x255x2, 228, 255, GREYSCALE2 }; diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index e77afaf716bf..e178a59a2dbe 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -30,19 +30,19 @@ uint8_t TFT_Queue::queue[]; uint8_t *TFT_Queue::end_of_queue = queue; -uint8_t *TFT_Queue::current_task = NULL; -uint8_t *TFT_Queue::last_task = NULL; +uint8_t *TFT_Queue::current_task = nullptr; +uint8_t *TFT_Queue::last_task = nullptr; void TFT_Queue::reset() { tft.abort(); end_of_queue = queue; - current_task = NULL; - last_task = NULL; + current_task = nullptr; + last_task = nullptr; } void TFT_Queue::async() { - if (current_task == NULL) return; + if (!current_task) return; queueTask_t *task = (queueTask_t *)current_task; // Check IO busy status @@ -63,7 +63,7 @@ void TFT_Queue::async() { } void TFT_Queue::finish_sketch() { - if (last_task == NULL) return; + if (!last_task) return; queueTask_t *task = (queueTask_t *)last_task; if (task->state == TASK_STATE_SKETCH) { @@ -71,7 +71,7 @@ void TFT_Queue::finish_sketch() { task->nextTask = end_of_queue; task->state = TASK_STATE_READY; - if (current_task == NULL) current_task = (uint8_t *)task; + if (!current_task) current_task = (uint8_t *)task; } } @@ -184,7 +184,7 @@ void TFT_Queue::fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, ui task->state = TASK_STATE_READY; task->type = TASK_FILL; - if (current_task == NULL) current_task = (uint8_t *)task; + if (!current_task) current_task = (uint8_t *)task; } void TFT_Queue::canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { @@ -195,7 +195,7 @@ void TFT_Queue::canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) task->state = TASK_STATE_SKETCH; task->type = TASK_CANVAS; - task->nextTask = NULL; + task->nextTask = nullptr; end_of_queue += sizeof(queueTask_t); parametersCanvas_t *task_parameters = (parametersCanvas_t *)end_of_queue; @@ -207,7 +207,7 @@ void TFT_Queue::canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) task_parameters->height = height; task_parameters->count = 0; - if (current_task == NULL) current_task = (uint8_t *)task; + if (!current_task) current_task = (uint8_t *)task; } void TFT_Queue::set_background(uint16_t color) { diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 663ed97c36c8..b707596bb314 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -42,7 +42,7 @@ void TFT_String::set_font(const uint8_t *font) { font_header = (font_t *)font; uint32_t glyph; - for (glyph = 0; glyph < 256; glyph++) glyphs[glyph] = NULL; + for (glyph = 0; glyph < 256; glyph++) glyphs[glyph] = nullptr; DEBUG_ECHOLNPAIR("Format: ", font_header->Format); DEBUG_ECHOLNPAIR("BBXWidth: ", font_header->BBXWidth); diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 3e0945b22740..93f8f64a2ddf 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -119,9 +119,8 @@ void Touch::idle() { NOMORE(y, current_control->y + current_control->height); touch(current_control); } - else { - current_control = NULL; - } + else + current_control = nullptr; } else { for (i = 0; i < controls_count; i++) { @@ -133,7 +132,7 @@ void Touch::idle() { } } - if (current_control == NULL) + if (!current_control) touch_time = last_touch_ms; } x = _x; @@ -141,7 +140,7 @@ void Touch::idle() { } else { x = y = 0; - current_control = NULL; + current_control = nullptr; touch_time = 0; touch_control_type = NONE; time_to_hold = 0; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 339c26cca27d..45eab346653e 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -452,7 +452,7 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { uint16_t line = 1; - if (string == NULL) line++; + if (!string) line++; menu_line(line++); tft_string.set(pref); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index b67e041349b2..1003f32e7cb5 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -457,7 +457,7 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { uint16_t line = 1; - if (string == NULL) line++; + if (!string) line++; menu_line(line++); tft_string.set(pref); @@ -945,7 +945,7 @@ static void drawBtn(int x, int y, const char* label, int32_t data, MarlinImage i tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); // TODO: Make an add_text() taking a font arg - if (label != NULL) { + if (label) { tft_string.set(label); tft_string.trim(); tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); diff --git a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp index 3f0f828cd78b..073a7ed0b6ec 100644 --- a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp +++ b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp @@ -89,7 +89,7 @@ heatshrink_decoder *heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t size_t buffers_sz = (1 << window_sz2) + input_buffer_size; size_t sz = sizeof(heatshrink_decoder) + buffers_sz; heatshrink_decoder *hsd = HEATSHRINK_MALLOC(sz); - if (hsd == nullptr) return nullptr; + if (!hsd) return nullptr; hsd->input_buffer_size = input_buffer_size; hsd->window_sz2 = window_sz2; hsd->lookahead_sz2 = lookahead_sz2; @@ -124,7 +124,7 @@ void heatshrink_decoder_reset(heatshrink_decoder *hsd) { /* Copy SIZE bytes into the decoder's input buffer, if it will fit. */ HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, uint8_t *in_buf, size_t size, size_t *input_size) { - if (hsd == nullptr || in_buf == nullptr || input_size == nullptr) + if (!hsd || !in_buf || !input_size) return HSDR_SINK_ERROR_NULL; size_t rem = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd) - hsd->input_size; @@ -160,7 +160,7 @@ static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd); static HSD_state st_yield_backref(heatshrink_decoder *hsd, output_info *oi); HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size) { - if (hsd == nullptr || out_buf == nullptr || output_size == nullptr) + if (!hsd || !out_buf || !output_size) return HSDR_POLL_ERROR_NULL; *output_size = 0; @@ -351,7 +351,7 @@ static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count) { } HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd) { - if (hsd == nullptr) { return HSDR_FINISH_ERROR_NULL; } + if (!hsd) return HSDR_FINISH_ERROR_NULL; switch (hsd->state) { case HSDS_TAG_BIT: return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 75a30aef8222..fd93ba09adb1 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -141,7 +141,7 @@ matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) { } void matrix_3x3::debug(PGM_P const title) { - if (title != nullptr) { + if (title) { serialprintPGM(title); SERIAL_EOL(); } diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 675d4b7262f8..0e75aa4a3734 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -141,7 +141,7 @@ // Pins for DOGM SPI LCD Support #define DOGLCD_A0 26 #define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 +#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 #define BTN_EN1 23 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 86dab411212c..7f2ae61aae37 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -171,7 +171,7 @@ // Shared FSMC Configs #if HAS_FSMC_TFT - #define DOGLCD_MOSI -1 // prevent redefine Conditionals_post.h + #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 #define FSMC_CS_PIN PD7 // NE4 diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 2bc9f96e8c92..46ed9372ab69 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -21,12 +21,12 @@ */ #if __GNUC__ > 8 - // The NXP platform updated GCC from 7.2.1 to 9.2.1 - // and this new warning apparently can be ignored. #pragma GCC diagnostic ignored "-Waddress-of-packed-member" #endif /** + * sd/SdBaseFile.cpp + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 13a1be863d0f..2f7dfb9f3b13 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -22,11 +22,8 @@ #pragma once /** - * \file - * \brief SdBaseFile class - */ - -/** + * sd/SdBaseFile.h + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdFatConfig.h b/Marlin/src/sd/SdFatConfig.h index 2e03a4181f7e..8f0596c5ddb5 100644 --- a/Marlin/src/sd/SdFatConfig.h +++ b/Marlin/src/sd/SdFatConfig.h @@ -22,7 +22,8 @@ #pragma once /** - * SdFatConfig.h + * sd/SdFatConfig.h + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdFatStructs.h b/Marlin/src/sd/SdFatStructs.h index 484d4e50c6c9..ac81f1d64e5e 100644 --- a/Marlin/src/sd/SdFatStructs.h +++ b/Marlin/src/sd/SdFatStructs.h @@ -22,11 +22,8 @@ #pragma once /** - * \file - * \brief FAT file structures - */ - -/** + * sd/SdFatStructs.h + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdFatUtil.cpp b/Marlin/src/sd/SdFatUtil.cpp index e2c467c5b6d4..7d9f33dc5050 100644 --- a/Marlin/src/sd/SdFatUtil.cpp +++ b/Marlin/src/sd/SdFatUtil.cpp @@ -21,6 +21,8 @@ */ /** + * sd/SdFatUtil.cpp + * * Arduino SdFat Library * Copyright (c) 2008 by William Greiman * diff --git a/Marlin/src/sd/SdFatUtil.h b/Marlin/src/sd/SdFatUtil.h index 7afed2ede06b..f1bb65747e76 100644 --- a/Marlin/src/sd/SdFatUtil.h +++ b/Marlin/src/sd/SdFatUtil.h @@ -22,6 +22,8 @@ #pragma once /** + * sd/SdFatUtil.h + * * Arduino SdFat Library * Copyright (c) 2008 by William Greiman * diff --git a/Marlin/src/sd/SdFile.cpp b/Marlin/src/sd/SdFile.cpp index c82fe2c5ed77..cba67e2bba81 100644 --- a/Marlin/src/sd/SdFile.cpp +++ b/Marlin/src/sd/SdFile.cpp @@ -21,6 +21,8 @@ */ /** + * sd/SdFile.cpp + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdFile.h b/Marlin/src/sd/SdFile.h index 52c8f1f0dbbc..17256b47c8f1 100644 --- a/Marlin/src/sd/SdFile.h +++ b/Marlin/src/sd/SdFile.h @@ -22,11 +22,8 @@ #pragma once /** - * \file - * \brief SdFile class - */ - -/** + * sd/SdFile.h + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * @@ -42,7 +39,7 @@ * \class SdFile * \brief SdBaseFile with Print. */ -class SdFile : public SdBaseFile/*, public Print*/ { +class SdFile : public SdBaseFile { public: SdFile() {} SdFile(const char* name, uint8_t oflag); diff --git a/Marlin/src/sd/SdVolume.cpp b/Marlin/src/sd/SdVolume.cpp index 63731f728c60..e262c8867ab4 100644 --- a/Marlin/src/sd/SdVolume.cpp +++ b/Marlin/src/sd/SdVolume.cpp @@ -21,6 +21,8 @@ */ /** + * sd/SdVolume.cpp + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index 1ffa888468be..2d57c681c494 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -22,11 +22,8 @@ #pragma once /** - * \file - * \brief SdVolume class - */ - -/** + * sd/SdVolume.h + * * Arduino SdFat Library * Copyright (c) 2009 by William Greiman * diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index b809b2c10fec..a633440ff668 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -639,7 +639,7 @@ bool CardReader::fileExists(const char * const path) { selectByName(*diveDir, fname); diveDir->close(); } - return fname != nullptr; + return !!fname; } // @@ -684,7 +684,7 @@ void CardReader::write_command(char * const buf) { char* end = buf + strlen(buf) - 1; file.writeError = false; - if ((npos = strchr(buf, 'N')) != nullptr) { + if ((npos = strchr(buf, 'N'))) { begin = strchr(npos, ' ') + 1; end = strchr(npos, '*') - 1; } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index 8a989157b40a..f26e82b9c77b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -22,7 +22,10 @@ * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com */ -/* USB functions */ + +// +// USB functions supporting Flash Drive +// #include "../../../inc/MarlinConfigPre.h" @@ -35,7 +38,7 @@ static uint8_t usb_task_state; /* constructor */ USB::USB() : bmHubPre(0) { - usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; //set up state machine + usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; // Set up state machine init(); } @@ -45,13 +48,8 @@ void USB::init() { bmHubPre = 0; } -uint8_t USB::getUsbTaskState() { - return usb_task_state; -} - -void USB::setUsbTaskState(uint8_t state) { - usb_task_state = state; -} +uint8_t USB::getUsbTaskState() { return usb_task_state; } +void USB::setUsbTaskState(uint8_t state) { usb_task_state = state; } EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) { UsbDevice *p = addrPool.GetUsbDevicePtr(addr); @@ -70,9 +68,11 @@ EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) { return nullptr; } -/* set device table entry */ - -/* each device is different and has different number of endpoints. This function plugs endpoint record structure, defined in application, to devtable */ +/** + * Set device table entry + * Each device is different and has different number of endpoints. + * This function plugs endpoint record structure, defined in application, to devtable + */ uint8_t USB::setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo* eprecord_ptr) { if (!eprecord_ptr) return USB_ERROR_INVALID_ARGUMENT; @@ -112,7 +112,7 @@ uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_l USBTRACE2(" NAK Limit: ", nak_limit); USBTRACE("\r\n"); */ - regWr(rPERADDR, addr); //set peripheral address + regWr(rPERADDR, addr); // Set peripheral address uint8_t mode = regRd(rMODE); @@ -121,8 +121,6 @@ uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_l //Serial.print("\r\nLS: "); //Serial.println(p->lowspeed, HEX); - - // Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise regWr(rMODE, (p->lowspeed) ? mode | bmLOWSPEED | bmHubPre : mode & ~(bmHUBPRE | bmLOWSPEED)); @@ -133,11 +131,10 @@ uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, EpInfo **ppep, uint16_t *nak_l /* depending on request. Actual requests are defined as inlines */ /* return codes: */ /* 00 = success */ - /* 01-0f = non-zero HRSLT */ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, USBReadParser *p) { - bool direction = false; //request direction, IN or OUT + bool direction = false; // Request direction, IN or OUT uint8_t rcode; SETUP_PKT setup_pkt; @@ -157,15 +154,15 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque setup_pkt.wIndex = wInd; setup_pkt.wLength = total; - bytesWr(rSUDFIFO, 8, (uint8_t*) & setup_pkt); //transfer to setup packet FIFO + bytesWr(rSUDFIFO, 8, (uint8_t*) & setup_pkt); // Transfer to setup packet FIFO - rcode = dispatchPkt(tokSETUP, ep, nak_limit); //dispatch packet + rcode = dispatchPkt(tokSETUP, ep, nak_limit); // Dispatch packet if (rcode) return rcode; // Return HRSLT if not zero - if (dataptr != nullptr) { //data stage, if present - if (direction) { //IN transfer + if (dataptr) { // Data stage, if present + if (direction) { // IN transfer uint16_t left = total; - pep->bmRcvToggle = 1; //bmRCVTOG1; + pep->bmRcvToggle = 1; // BmRCVTOG1; while (left) { // Bytes read into buffer @@ -174,7 +171,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque rcode = InTransfer(pep, nak_limit, &read, dataptr); if (rcode == hrTOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! + // Yes, we flip it wrong here so that next time it is actually correct! pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; continue; } @@ -189,21 +186,21 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque if (read < nbytes) break; } } - else { //OUT transfer - pep->bmSndToggle = 1; //bmSNDTOG1; + else { // OUT transfer + pep->bmSndToggle = 1; // BmSNDTOG1; rcode = OutTransfer(pep, nak_limit, nbytes, dataptr); } - if (rcode) return rcode; // return error + if (rcode) return rcode; // Return error } // Status stage - return dispatchPkt((direction) ? tokOUTHS : tokINHS, ep, nak_limit); //GET if direction + return dispatchPkt((direction) ? tokOUTHS : tokINHS, ep, nak_limit); // GET if direction } -/* IN transfer to arbitrary endpoint. Assumes PERADDR is set. Handles multiple packets if necessary. Transfers 'nbytes' bytes. */ -/* Keep sending INs and writes data to memory area pointed by 'data' */ - -/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error, - fe USB xfer timeout */ +/** + * IN transfer to arbitrary endpoint. Assumes PERADDR is set. Handles multiple packets if necessary. Transfers 'nbytes' bytes. + * Keep sending INs and writes data to memory area pointed by 'data' + * rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error, fe = USB xfer timeout + */ uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) { EpInfo *pep = nullptr; uint16_t nak_limit = 0; @@ -227,29 +224,29 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui uint8_t maxpktsize = pep->maxPktSize; *nbytesptr = 0; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value + regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); // Set toggle value - // use a 'break' to exit this loop + // Use a 'break' to exit this loop for (;;) { - rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS. + rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); // IN packet to EP-'endpoint'. Function takes care of NAKS. if (rcode == hrTOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! + // Yes, we flip it wrong here so that next time it is actually correct! pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value + regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); // Set toggle value continue; } if (rcode) { //printf(">>>>>>>> Problem! dispatchPkt %2.2x\r\n", rcode); - break; //should be 0, indicating ACK. Else return error code. + break; // Should be 0, indicating ACK. Else return error code. } /* check for RCVDAVIRQ and generate error if not present */ /* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */ if ((regRd(rHIRQ) & bmRCVDAVIRQ) == 0) { //printf(">>>>>>>> Problem! NO RCVDAVIRQ!\r\n"); - rcode = 0xF0; //receive error + rcode = 0xF0; // Receive error break; } - pktsize = regRd(rRCVBC); //number of received bytes + pktsize = regRd(rRCVBC); // Number of received bytes //printf("Got %i bytes \r\n", pktsize); // This would be OK, but... //assert(pktsize <= nbytes); @@ -266,7 +263,7 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui data = bytesRd(rRCVFIFO, ((pktsize > mem_left) ? mem_left : pktsize), data); regWr(rHIRQ, bmRCVDAVIRQ); // Clear the IRQ & free the buffer - *nbytesptr += pktsize; // add this packet's byte count to total transfer length + *nbytesptr += pktsize; // Add this packet's byte count to total transfer length /* The transfer is complete under two conditions: */ /* 1. The device sent a short packet (L.T. maxPacketSize) */ @@ -284,10 +281,11 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui return rcode; } -/* OUT transfer to arbitrary endpoint. Handles multiple packets if necessary. Transfers 'nbytes' bytes. */ -/* Handles NAK bug per Maxim Application Note 4000 for single buffer transfer */ - -/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */ +/** + * OUT transfer to arbitrary endpoint. Handles multiple packets if necessary. Transfers 'nbytes' bytes. + * Handles NAK bug per Maxim Application Note 4000 for single buffer transfer + * rcode 0 if no errors. rcode 01-0f is relayed from HRSL + */ uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { EpInfo *pep = nullptr; uint16_t nak_limit = 0; @@ -300,7 +298,7 @@ uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dat uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data) { uint8_t rcode = hrSUCCESS, retry_count; - uint8_t *data_p = data; //local copy of the data pointer + uint8_t *data_p = data; // Local copy of the data pointer uint16_t bytes_tosend, nak_count; uint16_t bytes_left = nbytes; @@ -311,17 +309,17 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8 uint32_t timeout = (uint32_t)millis() + USB_XFER_TIMEOUT; - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value + regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); // Set toggle value while (bytes_left) { retry_count = 0; nak_count = 0; bytes_tosend = (bytes_left >= maxpktsize) ? maxpktsize : bytes_left; - bytesWr(rSNDFIFO, bytes_tosend, data_p); //filling output FIFO - regWr(rSNDBC, bytes_tosend); //set number of bytes - regWr(rHXFR, (tokOUT | pep->epAddr)); //dispatch packet - while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ + bytesWr(rSNDFIFO, bytes_tosend, data_p); // Filling output FIFO + regWr(rSNDBC, bytes_tosend); // Set number of bytes + regWr(rHXFR, (tokOUT | pep->epAddr)); // Dispatch packet + while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); // Wait for the completion IRQ + regWr(rHIRQ, bmHXFRDNIRQ); // Clear IRQ rcode = (regRd(rHRSL) & 0x0F); while (rcode && ((int32_t)((uint32_t)millis() - timeout) < 0L)) { @@ -330,18 +328,18 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8 nak_count++; if (nak_limit && (nak_count == nak_limit)) goto breakout; - //return ( rcode); + //return rcode; break; case hrTIMEOUT: retry_count++; if (retry_count == USB_RETRY_LIMIT) goto breakout; - //return ( rcode); + //return rcode; break; case hrTOGERR: - // yes, we flip it wrong here so that next time it is actually correct! + // Yes, we flip it wrong here so that next time it is actually correct! pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value + regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); // Set toggle value break; default: goto breakout; @@ -351,26 +349,27 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8 regWr(rSNDBC, 0); regWr(rSNDFIFO, *data_p); regWr(rSNDBC, bytes_tosend); - regWr(rHXFR, (tokOUT | pep->epAddr)); //dispatch packet - while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ - regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ + regWr(rHXFR, (tokOUT | pep->epAddr)); // Dispatch packet + while (!(regRd(rHIRQ) & bmHXFRDNIRQ)); // Wait for the completion IRQ + regWr(rHIRQ, bmHXFRDNIRQ); // Clear IRQ rcode = (regRd(rHRSL) & 0x0F); - } // while rcode && .... + } // While rcode && .... bytes_left -= bytes_tosend; data_p += bytes_tosend; - } // while bytes_left... + } // While bytes_left... breakout: - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; //bmSNDTOG1 : bmSNDTOG0; //update toggle - return ( rcode); //should be 0 in all cases + pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; // BmSNDTOG1 : bmSNDTOG0; // Update toggle + return ( rcode); // Should be 0 in all cases } -/* dispatch USB packet. Assumes peripheral address is set and relevant buffer is loaded/empty */ -/* If NAK, tries to re-send up to nak_limit times */ -/* If nak_limit == 0, do not count NAKs, exit after timeout */ -/* If bus timeout, re-sends up to USB_RETRY_LIMIT times */ - -/* return codes 0x00-0x0F are HRSLT( 0x00 being success ), 0xFF means timeout */ +/** + * Dispatch USB packet. Assumes peripheral address is set and relevant buffer is loaded/empty + * If NAK, tries to re-send up to nak_limit times + * If nak_limit == 0, do not count NAKs, exit after timeout + * If bus timeout, re-sends up to USB_RETRY_LIMIT times + * return codes 0x00-0x0F are HRSLT( 0x00 being success ), 0xFF means timeout + */ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { uint32_t timeout = (uint32_t)millis() + USB_XFER_TIMEOUT; uint8_t tmpdata; @@ -380,29 +379,28 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { while ((int32_t)((uint32_t)millis() - timeout) < 0L) { #if defined(ESP8266) || defined(ESP32) - yield(); // needed in order to reset the watchdog timer on the ESP8266 + yield(); // Needed in order to reset the watchdog timer on the ESP8266 #endif - regWr(rHXFR, (token | ep)); //launch the transfer + regWr(rHXFR, (token | ep)); // Launch the transfer rcode = USB_ERROR_TRANSFER_TIMEOUT; - while ((int32_t)((uint32_t)millis() - timeout) < 0L) { //wait for transfer completion + while ((int32_t)((uint32_t)millis() - timeout) < 0L) { // Wait for transfer completion #if defined(ESP8266) || defined(ESP32) - yield(); // needed to reset the watchdog timer on the ESP8266 + yield(); // Needed to reset the watchdog timer on the ESP8266 #endif tmpdata = regRd(rHIRQ); if (tmpdata & bmHXFRDNIRQ) { - regWr(rHIRQ, bmHXFRDNIRQ); //clear the interrupt + regWr(rHIRQ, bmHXFRDNIRQ); // Clear the interrupt rcode = 0x00; break; } - } // while millis() < timeout + } // While millis() < timeout - //if (rcode != 0x00) //exit if timeout - // return ( rcode); + //if (rcode != 0x00) return rcode; // Exit if timeout - rcode = (regRd(rHRSL) & 0x0F); //analyze transfer result + rcode = (regRd(rHRSL) & 0x0F); // Analyze transfer result switch (rcode) { case hrNAK: @@ -419,12 +417,12 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { return (rcode); } - } // while timeout > millis() + } // While timeout > millis() return rcode; } -/* USB main task. Performs enumeration/cleanup */ -void USB::Task() { //USB state machine +// USB main task. Performs enumeration/cleanup +void USB::Task() { // USB state machine uint8_t rcode; uint8_t tmpdata; static uint32_t delay = 0; @@ -437,19 +435,19 @@ void USB::Task() { //USB state machine /* modify USB task state if Vbus changed */ switch (tmpdata) { - case SE1: //illegal state + case SE1: // Illegal state usb_task_state = USB_DETACHED_SUBSTATE_ILLEGAL; lowspeed = false; break; - case SE0: //disconnected + case SE0: // Disconnected if ((usb_task_state & USB_STATE_MASK) != USB_STATE_DETACHED) usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE; lowspeed = false; break; case LSHOST: lowspeed = true; - //intentional fallthrough - case FSHOST: //attached + // Intentional fallthrough + case FSHOST: // Attached if ((usb_task_state & USB_STATE_MASK) == USB_STATE_DETACHED) { delay = (uint32_t)millis() + USB_SETTLE_DELAY; usb_task_state = USB_ATTACHED_SUBSTATE_SETTLE; @@ -470,31 +468,31 @@ void USB::Task() { //USB state machine usb_task_state = USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE; break; - case USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE: //just sit here + case USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE: // Just sit here break; - case USB_DETACHED_SUBSTATE_ILLEGAL: //just sit here + case USB_DETACHED_SUBSTATE_ILLEGAL: // Just sit here break; - case USB_ATTACHED_SUBSTATE_SETTLE: //settle time for just attached device + case USB_ATTACHED_SUBSTATE_SETTLE: // Settle time for just attached device if ((int32_t)((uint32_t)millis() - delay) >= 0L) usb_task_state = USB_ATTACHED_SUBSTATE_RESET_DEVICE; - else break; // don't fall through + else break; // Don't fall through case USB_ATTACHED_SUBSTATE_RESET_DEVICE: - regWr(rHCTL, bmBUSRST); //issue bus reset + regWr(rHCTL, bmBUSRST); // Issue bus reset usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE; break; case USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE: if ((regRd(rHCTL) & bmBUSRST) == 0) { - tmpdata = regRd(rMODE) | bmSOFKAENAB; //start SOF generation + tmpdata = regRd(rMODE) | bmSOFKAENAB; // Start SOF generation regWr(rMODE, tmpdata); usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_SOF; - //delay = (uint32_t)millis() + 20; //20ms wait after reset per USB spec + //delay = (uint32_t)millis() + 20; // 20ms wait after reset per USB spec } break; - case USB_ATTACHED_SUBSTATE_WAIT_SOF: //todo: change check order + case USB_ATTACHED_SUBSTATE_WAIT_SOF: // Todo: change check order if (regRd(rHIRQ) & bmFRAMEIRQ) { - //when first SOF received _and_ 20ms has passed we can continue + // When first SOF received _and_ 20ms has passed we can continue /* - if (delay < (uint32_t)millis()) //20ms passed + if (delay < (uint32_t)millis()) // 20ms passed usb_task_state = USB_STATE_CONFIGURING; */ usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_RESET; @@ -503,7 +501,7 @@ void USB::Task() { //USB state machine break; case USB_ATTACHED_SUBSTATE_WAIT_RESET: if ((int32_t)((uint32_t)millis() - delay) >= 0L) usb_task_state = USB_STATE_CONFIGURING; - else break; // don't fall through + else break; // Don't fall through case USB_STATE_CONFIGURING: //Serial.print("\r\nConf.LS: "); @@ -565,11 +563,11 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo if (rcode == USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET) { if (parent == 0) { // Send a bus reset on the root interface. - regWr(rHCTL, bmBUSRST); //issue bus reset - delay(102); // delay 102ms, compensate for clock inaccuracy. + regWr(rHCTL, bmBUSRST); // Issue bus reset + delay(102); // Delay 102ms, compensate for clock inaccuracy. } else { - // reset parent port + // Reset parent port devConfig[parent]->ResetHubPort(port); } } @@ -592,11 +590,11 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo // Issue a bus reset, because the device may be in a limbo state if (parent == 0) { // Send a bus reset on the root interface. - regWr(rHCTL, bmBUSRST); //issue bus reset - delay(102); // delay 102ms, compensate for clock inaccuracy. + regWr(rHCTL, bmBUSRST); // Issue bus reset + delay(102); // Delay 102ms, compensate for clock inaccuracy. } else { - // reset parent port + // Reset parent port devConfig[parent]->ResetHubPort(port); } } @@ -623,19 +621,19 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo * 4: set address * 5: pUsb->setEpInfoEntry(bAddress, 1, epInfo), exit on fail * 6: while (configurations) { - * for (each configuration) { - * for (each driver) { - * 6a: Ask device if it likes configuration. Returns 0 on OK. - * If successful, the driver configured device. - * The driver now owns the endpoints, and takes over managing them. - * The following will need codes: - * Everything went well, instance consumed, exit with success. - * Instance already in use, ignore it, try next driver. - * Not a supported device, ignore it, try next driver. - * Not a supported configuration for this device, ignore it, try next driver. - * Could not configure device, fatal, exit with fail. - * } - * } + * for (each configuration) { + * for (each driver) { + * 6a: Ask device if it likes configuration. Returns 0 on OK. + * If successful, the driver configured device. + * The driver now owns the endpoints, and takes over managing them. + * The following will need codes: + * Everything went well, instance consumed, exit with success. + * Instance already in use, ignore it, try next driver. + * Not a supported device, ignore it, try next driver. + * Not a supported configuration for this device, ignore it, try next driver. + * Could not configure device, fatal, exit with fail. + * } + * } * } * 7: for (each driver) { * 7a: Ask device if it knows this VID/PID. Acts exactly like 6a, but using VID/PID @@ -671,7 +669,7 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { oldep_ptr = p->epinfo; // Temporary assign new pointer to epInfo to p->epinfo in order to - // avoid toggle inconsistence + // Avoid toggle inconsistence p->epinfo = &epInfo; @@ -687,7 +685,7 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { return rcode; } - // to-do? + // To-do? // Allocate new address according to device class //bAddress = addrPool.AllocAddress(parent, false, port); @@ -698,11 +696,11 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { // Qualify with subclass too. // // VID/PID & class tests default to false for drivers not yet ported - // subclass defaults to true, so you don't have to define it if you don't have to. + // Subclass defaults to true, so you don't have to define it if you don't have to. // for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) { - if (!devConfig[devConfigIndex]) continue; // no driver - if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed + if (!devConfig[devConfigIndex]) continue; // No driver + if (devConfig[devConfigIndex]->GetAddress()) continue; // Consumed if (devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) { rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed); if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED) @@ -712,20 +710,20 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { if (devConfigIndex < USB_NUMDEVICES) return rcode; - // blindly attempt to configure + // Blindly attempt to configure for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) { if (!devConfig[devConfigIndex]) continue; - if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed + if (devConfig[devConfigIndex]->GetAddress()) continue; // Consumed if (devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) continue; // If this is true it means it must have returned USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED above rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed); //printf("ERROR ENUMERATING %2.2x\r\n", rcode); if (!(rcode == USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED || rcode == USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE)) { - // in case of an error dev_index should be reset to 0 - // in order to start from the very beginning the - // next time the program gets here + // In case of an error dev_index should be reset to 0 + // in order to start from the very beginning the + // next time the program gets here //if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE) - // devConfigIndex = 0; + //devConfigIndex = 0; return rcode; } } @@ -744,20 +742,22 @@ uint8_t USB::ReleaseDevice(uint8_t addr) { return 0; } -#if 1 //!defined(USB_METHODS_INLINE) -//get device descriptor - +// Get device descriptor uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, nullptr); } -//get configuration descriptor +// Get configuration descriptor uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, nullptr); } -/* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this - total length. The length of the first request can be shorter ( 4 bytes ), however, there are devices which won't work unless this length is set to 9 */ +/** + * Requests Configuration Descriptor. Sends two Get Conf Descr requests. + * The first one gets the total length of all descriptors, then the second one requests this + * total length. The length of the first request can be shorter (4 bytes), however, there are + * devices which won't work unless this length is set to 9. + */ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) { const uint8_t bufSize = 64; uint8_t buf[bufSize]; @@ -773,25 +773,23 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, total, bufSize, buf, p); } -//get string descriptor - +// Get string descriptor uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, nullptr); } -//set address +// Set address uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) { uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); - //delay(2); //per USB 2.0 sect.9.2.6.3 + //delay(2); // Per USB 2.0 sect.9.2.6.3 delay(300); // Older spec says you should wait at least 200ms return rcode; //return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); } -//set configuration +// Set configuration uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) { return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr); } -#endif // defined(USB_METHODS_INLINE) #endif // USB_FLASH_DRIVE_SUPPORT From c4f3f67537c65c446cdc8ecf3a46a7a7a32211de Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 25 Oct 2020 04:19:51 -0500 Subject: [PATCH 027/443] Followup for BTN_ENC_EN --- Marlin/src/lcd/marlinui.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 9c456c25c942..0a87965721af 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -808,6 +808,14 @@ millis_t next_lcd_update_ms; millis_t MarlinUI::return_to_status_ms = 0; #endif +inline bool can_encode() { + #if BUTTON_EXISTS(ENC_EN) + return !BUTTON_PRESSED(ENC_EN); // Update position only when ENC_EN is HIGH + #else + return true; + #endif +} + void MarlinUI::update() { static uint16_t max_display_update_time = 0; @@ -961,9 +969,7 @@ void MarlinUI::update() { #endif // ENCODER_RATE_MULTIPLIER - // Update position only when ENC_EN is HIGH - if (TERN1(BTN_ENC_EN, !BUTTON_PRESSED(ENC_EN))) - encoderPosition += (encoderDiff * encoderMultiplier) / epps; + if (can_encode()) encoderPosition += (encoderDiff * encoderMultiplier) / epps; encoderDiff = 0; } @@ -1182,8 +1188,7 @@ void MarlinUI::update() { if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; #endif #if BUTTON_EXISTS(ENC) - // Update button only when ENC_EN is HIGH - if (TERN1(BTN_ENC_EN, !BUTTON_PRESSED(ENC_EN)) && BUTTON_PRESSED(ENC)) newbutton |= EN_C; + if (can_encode() && BUTTON_PRESSED(ENC)) newbutton |= EN_C; #endif #if BUTTON_EXISTS(BACK) if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; From 8bdde8d7a0b944bdf78421000c30d7eae68778d1 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 26 Oct 2020 00:16:36 +0000 Subject: [PATCH 028/443] [cron] Bump distribution date (2020-10-26) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d1d88912fd55..e96abdb40f32 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-25" + #define STRING_DISTRIBUTION_DATE "2020-10-26" #endif /** From 8cf672104efb8f7093c2e85a00b5d98993d368fc Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 27 Oct 2020 00:16:29 +0000 Subject: [PATCH 029/443] [cron] Bump distribution date (2020-10-27) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e96abdb40f32..2a85c02428ee 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-26" + #define STRING_DISTRIBUTION_DATE "2020-10-27" #endif /** From a74e82fbaef9887d7f4e341288d0b3df0cd5f83b Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Tue, 27 Oct 2020 11:13:05 -0600 Subject: [PATCH 030/443] Fix NO_WORKSPACE_OFFSETS compile --- Marlin/src/module/probe.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 98e6aff1b5ed..63229242b5da 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -145,25 +145,25 @@ class Probe { return TERN(IS_KINEMATIC, (X_CENTER) - probe_radius(), _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x) - ) - TERN0(NOZZLE_AS_PROBE, home_offset.x); + ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); } static inline float max_x() { return TERN(IS_KINEMATIC, (X_CENTER) + probe_radius(), _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x) - ) - TERN0(NOZZLE_AS_PROBE, home_offset.x); + ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); } static inline float min_y() { return TERN(IS_KINEMATIC, (Y_CENTER) - probe_radius(), _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y) - ) - TERN0(NOZZLE_AS_PROBE, home_offset.y); + ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); } static inline float max_y() { return TERN(IS_KINEMATIC, (Y_CENTER) + probe_radius(), _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y) - ) - TERN0(NOZZLE_AS_PROBE, home_offset.y); + ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); } #if NEEDS_THREE_PROBE_POINTS From 75b0e3246a00c04c5bf04607d030775f1d8d1e0c Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 27 Oct 2020 17:09:19 -0300 Subject: [PATCH 031/443] Fix some LVGL bugs (#19904) --- Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp | 15 +-------------- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/draw_print_file.cpp | 7 +------ Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 7 +++++-- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 2 +- .../extui/lib/mks_ui/tft_lvgl_configuration.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h | 2 +- 8 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h index 696bc16974be..f3be3dc0baaa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #if HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 34168574ec05..01f64e8fc6e4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -50,20 +50,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_about(void) { scr = lv_screen_create(ABOUT_UI); - - // Create an Image button - lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - // Create a label on the image button - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); //fw_version = lv_label_create(scr, SHORT_BUILD_VERSION); //lv_obj_align(fw_version, nullptr, LV_ALIGN_CENTER, 0, -60); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 67ed24d8c029..0a36b09ce767 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -214,7 +214,7 @@ void lv_draw_dialog(uint8_t type) { uiCfg.dialogType = type; scr = lv_screen_create(DIALOG_UI); - lv_obj_t *labelDialog = lv_label_create_empty(scr); + lv_obj_t *labelDialog = lv_label_create(scr, ""); if (DIALOG_IS(TYPE_FINISH_PRINT, PAUSE_MESSAGE_RESUME)) { btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index cfd06cf09f21..f513ea4d0b09 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -208,11 +208,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_print_file(void) { //uint8_t i; uint8_t file_count; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; - } - disp_state = PRINT_FILE_UI; curDirLever = 0; dir_offset[curDirLever].curPage = 0; @@ -252,7 +247,7 @@ static char test_public_buf_l[40]; void disp_gcode_icon(uint8_t file_num) { uint8_t i; - scr = lv_screen_create(MAIN_UI, ""); + scr = lv_screen_create(PRINT_FILE_UI, ""); // Create image buttons buttonPageUp = lv_imgbtn_create(scr, "F:/bmp_pageUp.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_UP); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 50c49999afe7..c7f5f418f5b8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1640,7 +1640,6 @@ lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) { disp_state_stack._disp_state[disp_state_stack._disp_index] = newScreenType; } disp_state = newScreenType; - lv_refr_now(lv_refr_get_disp_refreshing()); // title lv_obj_t *titleLabel = nullptr; @@ -1651,18 +1650,22 @@ lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) { if (titleLabel) lv_obj_set_style(titleLabel, &tft_style_label_rel); + lv_refr_now(lv_refr_get_disp_refreshing()); + return scr; } // Create an empty label lv_obj_t* lv_label_create_empty(lv_obj_t *par) { - return lv_label_create(par, (lv_obj_t*)nullptr); + lv_obj_t *label = lv_label_create(par, (lv_obj_t*)nullptr); + return label; } // Create a label with style and text lv_obj_t* lv_label_create(lv_obj_t *par, const char *text) { lv_obj_t *label = lv_label_create_empty(par); if (text) lv_label_set_text(label, text); + lv_obj_set_style(label, &tft_style_label_rel); return label; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 3e3a4073d36c..eb54b3e4ea3b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -86,7 +86,7 @@ #include "draw_wifi_tips.h" #endif -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #define FILE_SYS_USB 0 #define FILE_SYS_SD 1 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 2f1ec48b4417..26f6301763ae 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -43,7 +43,7 @@ #include "../../../../MarlinCore.h" #include "../../../../inc/MarlinConfig.h" -#include HAL_PATH(../../HAL, tft/xpt2046.h) +#include HAL_PATH(../../../../HAL, tft/xpt2046.h) #include "../../../marlinui.h" XPT2046 touch; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h index 0b402a3adb10..656e440bc237 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #include #include From c60696dbae3696006cb24bfe1d51254977f4f65b Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 27 Oct 2020 17:16:35 -0300 Subject: [PATCH 032/443] Keep watchdog refreshed in LVGL init (#19900) --- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp | 1 + .../extui/lib/mks_ui/tft_lvgl_configuration.cpp | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 70c48f5c8e34..5ba7722f5509 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -488,6 +488,7 @@ uint8_t public_buf[512]; } void UpdateAssets() { + if (!card.isMounted()) return; SdFile dir, root = card.getroot(); if (dir.open(&root, assetsPath, O_RDONLY)) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 26f6301763ae..21e3040c2e65 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -116,17 +116,20 @@ void tft_lvgl_init() { ui_cfg_init(); disp_language_init(); - //init tft first! + watchdog_refresh(); // LVGL init takes time + + // Init TFT first! SPI_TFT.spi_init(SPI_FULL_SPEED); SPI_TFT.LCD_init(); + watchdog_refresh(); // LVGL init takes time + //spi_flash_read_test(); #if ENABLED(SDSUPPORT) - watchdog_refresh(); UpdateAssets(); + watchdog_refresh(); // LVGL init takes time #endif - watchdog_refresh(); mks_test_get(); touch.Init(); @@ -189,9 +192,11 @@ void tft_lvgl_init() { lv_encoder_pin_init(); + bool ready = true; #if ENABLED(POWER_LOSS_RECOVERY) recovery.load(); if (recovery.valid()) { + ready = false; if (gCfgItems.from_flash_pic) flash_preview_begin = true; else @@ -201,14 +206,12 @@ void tft_lvgl_init() { strncpy(public_buf_m, recovery.info.sd_filename, sizeof(public_buf_m)); card.printLongPath(public_buf_m); - strncpy(list_file.long_name[sel_id], card.longFilename, sizeof(list_file.long_name[sel_id])); - lv_draw_printing(); } - else #endif - lv_draw_ready_print(); + + if (ready) lv_draw_ready_print(); if (mks_test_flag == 0x1E) mks_gpio_test(); From 82ac8a1e76ee54ae0bf2ba7f65cad26adcecd45e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 27 Oct 2020 16:21:03 -0500 Subject: [PATCH 033/443] Fix Archim 1, add Archim 1&2 tests --- Marlin/src/HAL/DUE/fastio.h | 2 +- Marlin/src/pins/pins.h | 2 +- buildroot/tests/DUE-tests | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/DUE/fastio.h b/Marlin/src/HAL/DUE/fastio.h index 286319302dd2..119d0005af9b 100644 --- a/Marlin/src/HAL/DUE/fastio.h +++ b/Marlin/src/HAL/DUE/fastio.h @@ -477,7 +477,7 @@ #define DIO91_PIN 15 #define DIO91_WPORT PIOB -#if ARDUINO_SAM_ARCHIM +#ifdef ARDUINO_SAM_ARCHIM #define DIO92_PIN 11 #define DIO92_WPORT PIOC diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 4f3397b98d87..c4dbe60e99ef 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -483,7 +483,7 @@ #elif MB(ULTRATRONICS_PRO) #include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ARCHIM1) - #include "sam/pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ARCHIM1.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug #elif MB(ARCHIM2) #include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug #elif MB(ALLIGATOR) diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index 7f488f6126cb..91fba12a3e65 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -35,6 +35,9 @@ opt_add TEMP_CHAMBER_PIN 6 opt_set HEATER_CHAMBER_PIN 45 exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options." +# +# RADDS with BLTouch, ABL(B), 3 x Z auto-align +# restore_configs opt_set MOTHERBOARD BOARD_RADDS opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ @@ -60,3 +63,15 @@ opt_set EXTRUDERS 2 opt_set NUM_SERVOS 1 opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE POWER_LOSS_RECOVERY exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, POWER_LOSS_RECOVERY" + +# +# Test Archim 1 +# +use_example_configs UltiMachine/Archim1 +exec_test $1 $2 "Archim 1 base configuration" + +# +# Test Archim 2 +# +use_example_configs UltiMachine/Archim2 +exec_test $1 $2 "Archim 2 base configuration" From 83aa3dbfa658f9258d17f9860540586664fb111c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 27 Oct 2020 17:21:38 -0500 Subject: [PATCH 034/443] Archim test matching env --- .github/workflows/test-builds.yml | 1 + buildroot/tests/DUE-tests | 12 ------------ buildroot/tests/DUE_archim-tests | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100755 buildroot/tests/DUE_archim-tests diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 0030dceb2add..962473383892 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -36,6 +36,7 @@ jobs: # Base Environments - DUE + - DUE_archim - esp32 - linux_native - mega2560 diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index 91fba12a3e65..0da0d798d04f 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -63,15 +63,3 @@ opt_set EXTRUDERS 2 opt_set NUM_SERVOS 1 opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE POWER_LOSS_RECOVERY exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, POWER_LOSS_RECOVERY" - -# -# Test Archim 1 -# -use_example_configs UltiMachine/Archim1 -exec_test $1 $2 "Archim 1 base configuration" - -# -# Test Archim 2 -# -use_example_configs UltiMachine/Archim2 -exec_test $1 $2 "Archim 2 base configuration" diff --git a/buildroot/tests/DUE_archim-tests b/buildroot/tests/DUE_archim-tests new file mode 100755 index 000000000000..4d9eb364198b --- /dev/null +++ b/buildroot/tests/DUE_archim-tests @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Build tests for DUE (Atmel SAM3X8E ARM Cortex-M3) +# + +# exit on first failure +set -e + +# +# Test Archim 1 +# +use_example_configs UltiMachine/Archim1 +exec_test $1 $2 "Archim 1 base configuration" + +# +# Test Archim 2 +# +use_example_configs UltiMachine/Archim2 +exec_test $1 $2 "Archim 2 base configuration" + +restore_configs From 2cae26ee352ef1cb499bca1a5feb6dffe85b6df9 Mon Sep 17 00:00:00 2001 From: Speaka <48431623+Speaka@users.noreply.github.com> Date: Tue, 27 Oct 2020 23:25:01 +0100 Subject: [PATCH 035/443] Fix G35 PROGMEM strings (#19926) --- Marlin/src/gcode/bedlevel/G35.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index f6ae2db2c709..b39a7b9ed8c4 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -129,15 +129,19 @@ void GcodeSuite::G35() { const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true); if (isnan(z_probed_height)) { - SERIAL_ECHOPAIR("G35 failed at point ", int(i), " (", tramming_point_name[i], ")"); + SERIAL_ECHOPAIR("G35 failed at point ", int(i), " ("); + SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i])); + SERIAL_CHAR(')'); SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y); err_break = true; break; } if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("Probing point ", int(i), " (", tramming_point_name[i], ")"); - SERIAL_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height); + DEBUG_ECHOPAIR("Probing point ", int(i), " ("); + DEBUG_PRINT_P((char *)pgm_read_ptr(&tramming_point_name[i])); + DEBUG_CHAR(')'); + DEBUG_ECHOLNPAIR_P(SP_X_STR, screws_tilt_adjust_pos[i].x, SP_Y_STR, screws_tilt_adjust_pos[i].y, SP_Z_STR, z_probed_height); } z_measured[i] = z_probed_height; @@ -155,9 +159,9 @@ void GcodeSuite::G35() { const float decimal_part = adjust - float(full_turns); const int minutes = trunc(decimal_part * 60.0f); - SERIAL_ECHOPAIR("Turn ", tramming_point_name[i], - " ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", - " by ", abs(full_turns), " turns"); + SERIAL_ECHOPGM("Turn "); + SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i])); + SERIAL_ECHOPAIR(" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", abs(full_turns), " turns"); if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes"); if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)"); SERIAL_EOL(); From 68ef3ac675b484c92c5acd728b38b97a608a6fad Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 28 Oct 2020 00:16:40 +0000 Subject: [PATCH 036/443] [cron] Bump distribution date (2020-10-28) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2a85c02428ee..da221bed3bd6 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-27" + #define STRING_DISTRIBUTION_DATE "2020-10-28" #endif /** From c0b4f4eb47ee9d657581035737383d15b3706b79 Mon Sep 17 00:00:00 2001 From: Lucas Seiki Oshiro Date: Tue, 27 Oct 2020 22:41:12 -0300 Subject: [PATCH 037/443] "Sound: ON/OFF" menu item (#19901) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/inc/Conditionals_post.h | 16 ++++++----- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 1 + Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 1 + Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/marlinui.cpp | 5 ++++ Marlin/src/lcd/marlinui.h | 6 +++++ Marlin/src/lcd/menu/menu_configuration.cpp | 8 ++++++ Marlin/src/libs/buzzer.cpp | 8 +++--- Marlin/src/module/settings.cpp | 30 +++++++++++++++++++++ buildroot/tests/LPC1768-tests | 2 +- buildroot/tests/mega2560-tests | 4 +-- buildroot/tests/teensy35-tests | 2 +- 13 files changed, 74 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 31661a582e5e..951aab7804a5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1090,6 +1090,9 @@ // BACK menu items keep the highlight at the top //#define TURBO_BACK_MENU_ITEM + // Add a mute option to the LCD menu + //#define SOUND_MENU_ITEM + /** * LED Control Menu * Add LED Control to the LCD menu diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index bb717ba097ef..bbbcf6fb2fea 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2505,11 +2505,11 @@ /** * Buzzer/Speaker */ -#if PIN_EXISTS(BEEPER) || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) +#if PIN_EXISTS(BEEPER) + #define USE_BEEPER 1 +#endif +#if USE_BEEPER || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) #define HAS_BUZZER 1 - #if PIN_EXISTS(BEEPER) - #define USE_BEEPER 1 - #endif #endif #if ENABLED(LCD_USE_I2C_BUZZER) @@ -2528,8 +2528,12 @@ #endif #endif -#if HAS_BUZZER && LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ - #define HAS_CHIRP 1 +#if HAS_BUZZER + #if LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ + #define HAS_CHIRP 1 + #endif +#else + #undef SOUND_MENU_ITEM // No buzzer menu item without a buzzer #endif /** diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 4b8245839805..81862e1ddf11 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -113,6 +113,7 @@ static void createChar_P(const char c, const byte * const ptr) { #if ENABLED(LCD_USE_I2C_BUZZER) void MarlinUI::buzz(const long duration, const uint16_t freq) { + if (!buzzer_enabled) return; lcd.buzz(duration, freq); } #endif diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index c21c2ceb5864..571d576bbc1f 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -289,6 +289,7 @@ uint8_t MarlinUI::read_slow_buttons(void) { // Duration in ms, freq in Hz void MarlinUI::buzz(const long duration, const uint16_t freq) { if (!PanelDetected) return; + if (!buzzer_enabled) return; #if ENABLED(TFTGLCD_PANEL_SPI) WRITE(TFTGLCD_CS, LOW); SPI_SEND_ONE(BUZZER); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index e8b4769cc216..8bf4fa6b7ecb 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -659,6 +659,7 @@ namespace Language_en { PROGMEM Language_Str MSG_REHEATING = _UxGT("Reheating..."); PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z Probe Wizard"); + PROGMEM Language_Str MSG_SOUND = _UxGT("Sound"); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 0a87965721af..1994e4094bc3 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -74,12 +74,17 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #endif +#if ENABLED(SOUND_MENU_ITEM) + bool MarlinUI::buzzer_enabled = true; +#endif + #if EITHER(PCA9632_BUZZER, USE_BEEPER) #include "../libs/buzzer.h" // for BUZZ() macro #if ENABLED(PCA9632_BUZZER) #include "../feature/leds/pca9632.h" #endif void MarlinUI::buzz(const long duration, const uint16_t freq) { + if (!buzzer_enabled) return; #if ENABLED(PCA9632_BUZZER) PCA9632_buzz(duration, freq); #elif USE_BEEPER diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index bf9e47e0c845..d0b66aee457c 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -292,6 +292,12 @@ class MarlinUI { TERN_(HAS_LCD_MENU, currentScreen = status_screen); } + #if ENABLED(SOUND_MENU_ITEM) + static bool buzzer_enabled; // Initialized by settings.load() + #else + static constexpr bool buzzer_enabled = true; + #endif + #if HAS_BUZZER static void buzz(const long duration, const uint16_t freq); #endif diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 22947ee5149a..f667242bc171 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -45,6 +45,10 @@ #endif #endif +#if ENABLED(SOUND_MENU_ITEM) + #include "../../libs/buzzer.h" +#endif + #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) void menu_advanced_settings(); @@ -412,6 +416,10 @@ void menu_configuration() { SUBMENU_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings); #endif + #if ENABLED(SOUND_MENU_ITEM) + EDIT_ITEM(bool, MSG_SOUND, &ui.buzzer_enabled, []{ ui.chirp(); }); + #endif + #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); diff --git a/Marlin/src/libs/buzzer.cpp b/Marlin/src/libs/buzzer.cpp index 84596953596c..57ed5fb41910 100644 --- a/Marlin/src/libs/buzzer.cpp +++ b/Marlin/src/libs/buzzer.cpp @@ -26,6 +26,7 @@ #include "buzzer.h" #include "../module/temperature.h" +#include "../lcd/marlinui.h" #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" @@ -44,6 +45,7 @@ Buzzer buzzer; * @param frequency Frequency of the tone in hertz */ void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) { + if (!ui.buzzer_enabled) return; while (buffer.isFull()) { tick(); thermalManager.manage_heater(); @@ -53,6 +55,7 @@ void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) { } void Buzzer::tick() { + if (!ui.buzzer_enabled) return; const millis_t now = millis(); if (!state.endtime) { @@ -62,12 +65,11 @@ void Buzzer::tick() { state.endtime = now + state.tone.duration; if (state.tone.frequency > 0) { - #if ENABLED(EXTENSIBLE_UI) + #if ENABLED(EXTENSIBLE_UI) && DISABLED(EXTUI_LOCAL_BEEPER) CRITICAL_SECTION_START(); ExtUI::onPlayTone(state.tone.frequency, state.tone.duration); CRITICAL_SECTION_END(); - #endif - #if ENABLED(SPEAKER) && (DISABLED(EXTENSIBLE_UI) || ENABLED(EXTUI_LOCAL_BEEPER)) + #elif ENABLED(SPEAKER) CRITICAL_SECTION_START(); ::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration); CRITICAL_SECTION_END(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index d01486a80dac..5c646c85dd1f 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -153,6 +153,10 @@ #include "../feature/ethernet.h" #endif +#if ENABLED(SOUND_MENU_ITEM) + #include "../libs/buzzer.h" +#endif + #pragma pack(push, 1) // No padding between variables #if HAS_ETHERNET @@ -451,6 +455,12 @@ typedef struct SettingsDataStruct { ethernet_subnet; // M554 P #endif + // + // Buzzer enable/disable + // + #if ENABLED(SOUND_MENU_ITEM) + bool buzzer_enabled; + #endif } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -1422,6 +1432,13 @@ void MarlinSettings::postprocess() { } #endif + // + // Buzzer enable/disable + // + #if ENABLED(SOUND_MENU_ITEM) + EEPROM_WRITE(ui.buzzer_enabled); + #endif + // // Report final CRC and Data Size // @@ -2293,6 +2310,14 @@ void MarlinSettings::postprocess() { EEPROM_READ(ethernet_subnet); ethernet.subnet = ethernet_subnet; #endif + // + // Buzzer enable/disable + // + #if ENABLED(SOUND_MENU_ITEM) + _FIELD_TEST(buzzer_enabled); + EEPROM_READ(ui.buzzer_enabled); + #endif + // // Validate Final Size and CRC // @@ -2603,6 +2628,11 @@ void MarlinSettings::reset() { // TERN_(TOUCH_SCREEN_CALIBRATION, touch.calibration_reset()); + // + // Buzzer enable/disable + // + TERN_(SOUND_MENU_ITEM, ui.buzzer_enabled = true); + // // Magnetic Parking Extruder // diff --git a/buildroot/tests/LPC1768-tests b/buildroot/tests/LPC1768-tests index 2f206f02f2e6..7877b60721a7 100755 --- a/buildroot/tests/LPC1768-tests +++ b/buildroot/tests/LPC1768-tests @@ -38,7 +38,7 @@ opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 -1 opt_set TEMP_SENSOR_BED 5 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ - FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING \ + FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \ NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index d3fd5c0192b9..a6902b9d144b 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -27,7 +27,7 @@ opt_set TEMP_SENSOR_4 1000 opt_set TEMP_SENSOR_BED 1 opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \ - SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS \ + SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS SOUND_MENU_ITEM \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \ MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE EXTRA_LIN_ADVANCE_K QUICK_HOME \ LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ @@ -82,7 +82,7 @@ restore_configs opt_set MOTHERBOARD BOARD_MEGACONTROLLER opt_set LCD_LANGUAGE de opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ - MINIPANEL SDSUPPORT PCA9632 LCD_INFO_MENU \ + MINIPANEL SDSUPPORT PCA9632 LCD_INFO_MENU SOUND_MENU_ITEM \ AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS M100_FREE_MEMORY_WATCHER \ diff --git a/buildroot/tests/teensy35-tests b/buildroot/tests/teensy35-tests index 20a0c1972643..39ee4faf4988 100755 --- a/buildroot/tests/teensy35-tests +++ b/buildroot/tests/teensy35-tests @@ -20,7 +20,7 @@ opt_set TEMP_SENSOR_0 1 opt_set TEMP_SENSOR_1 5 opt_set TEMP_SENSOR_BED 1 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LCD_INFO_MENU SDSUPPORT SDCARD_SORT_ALPHA \ - FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE \ + FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE SOUND_MENU_ITEM \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ From e3f1f7cd857f9fbfdbf6d0872324cb37d069b3f6 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Wed, 28 Oct 2020 03:37:10 +0100 Subject: [PATCH 038/443] Fix DAC-related bugs (#19921) Co-authored-by: Scott Lahteine --- Marlin/src/feature/dac/dac_mcp4728.cpp | 2 +- Marlin/src/gcode/calibrate/G34.cpp | 4 ++-- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/module/settings.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin/src/feature/dac/dac_mcp4728.cpp index 81c465cf29e4..c7a6370e1742 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.cpp +++ b/Marlin/src/feature/dac/dac_mcp4728.cpp @@ -124,7 +124,7 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v * DAC Values array and calls fastwrite to update the DAC. */ void MCP4728::setDrvPct(xyze_uint8_t &pct) { - dac_values *= 0.01 * pct * (DAC_STEPPER_MAX); + dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX); fastWrite(); } diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index 0ca4490eb6c1..315b2d7333dd 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -80,7 +80,7 @@ void GcodeSuite::G34() { const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS]; stepper.set_digipot_current(1, target_current); - #elif HAS_MOTOR_CURRENT_DAC + #elif ENABLED(HAS_MOTOR_CURRENT_DAC) const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT); const float previous_current = dac_amps(Z_AXIS, target_current); stepper_dac.set_current_value(Z_AXIS, target_current); @@ -126,7 +126,7 @@ void GcodeSuite::G34() { stepper.set_digipot_current(Z_AXIS, previous_current); #elif HAS_MOTOR_CURRENT_PWM stepper.set_digipot_current(1, previous_current); - #elif HAS_MOTOR_CURRENT_DAC + #elif ENABLED(HAS_MOTOR_CURRENT_DAC) stepper_dac.set_current_value(Z_AXIS, previous_current); #elif ENABLED(HAS_MOTOR_CURRENT_I2C) digipot_i2c.set_current(Z_AXIS, previous_current) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 642d9d84d94f..0e207ffc55aa 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -72,7 +72,7 @@ void menu_backlash(); EDIT_DAC_PERCENT(Y); EDIT_DAC_PERCENT(Z); EDIT_DAC_PERCENT(E); - ACTION_ITEM(MSG_DAC_EEPROM_WRITE, dac_commit_eeprom); + ACTION_ITEM(MSG_DAC_EEPROM_WRITE, stepper_dac.commit_eeprom); END_MENU(); } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 5c646c85dd1f..2ae4be5f49b2 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3821,7 +3821,7 @@ void MarlinSettings::reset() { #elif HAS_MOTOR_CURRENT_I2C // i2c-based has any number of values // Values sent over i2c are not stored. // Indexes map directly to drivers, not axes. - #elif HAS_MOTOR_CURRENT_DAC // DAC-based has 4 values, for X Y Z E + #elif ENABLED(HAS_MOTOR_CURRENT_DAC) // DAC-based has 4 values, for X Y Z E // Values sent over i2c are not stored. Uses indirect mapping. #endif From bdb3f1ae2fc48fd3f190d33b6dd84184e99f581c Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 27 Oct 2020 19:40:12 -0700 Subject: [PATCH 039/443] Fix LCD menus + DAC (#19907) --- Marlin/src/module/settings.cpp | 6 +++--- buildroot/tests/at90usb1286_dfu-tests | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 2ae4be5f49b2..fc432b7e9b57 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3800,7 +3800,7 @@ void MarlinSettings::reset() { #endif #endif - #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM + #if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM) CONFIG_ECHO_HEADING("Stepper motor currents:"); CONFIG_ECHO_START(); #if HAS_MOTOR_CURRENT_PWM @@ -3818,10 +3818,10 @@ void MarlinSettings::reset() { SERIAL_CHAR(' ', 'B'); // B (maps to E1 by default) SERIAL_ECHOLN(stepper.motor_current_setting[4]); #endif - #elif HAS_MOTOR_CURRENT_I2C // i2c-based has any number of values + #elif ENABLED(HAS_MOTOR_CURRENT_I2C) // i2c-based has any number of values // Values sent over i2c are not stored. // Indexes map directly to drivers, not axes. - #elif ENABLED(HAS_MOTOR_CURRENT_DAC) // DAC-based has 4 values, for X Y Z E + #elif ENABLED(HAS_MOTOR_CURRENT_DAC) // DAC-based has 4 values, for X Y Z E // Values sent over i2c are not stored. Uses indirect mapping. #endif diff --git a/buildroot/tests/at90usb1286_dfu-tests b/buildroot/tests/at90usb1286_dfu-tests index 7571994ec47e..a9b7e2bbb094 100644 --- a/buildroot/tests/at90usb1286_dfu-tests +++ b/buildroot/tests/at90usb1286_dfu-tests @@ -11,7 +11,12 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_PRINTRBOARD -exec_test $1 $2 "Default Configuration" +exec_test $1 $2 "Printrboard Configuration" + +restore_configs +opt_set MOTHERBOARD BOARD_PRINTRBOARD_REVF +opt_enable MINIPANEL +exec_test $1 $2 "Printrboard RevF with MiniPanel and Stepper DAC (in pins file)" # clean up restore_configs From 94a68445215ee2a90afb7fedde1e522318824a6d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 27 Oct 2020 23:54:30 -0300 Subject: [PATCH 040/443] Color UI circular task queue (#19918) --- Marlin/src/lcd/tft/tft_queue.cpp | 52 ++++++++++++++++++-------------- Marlin/src/lcd/tft/tft_queue.h | 7 +++++ 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index e178a59a2dbe..43628706a9a4 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -32,6 +32,7 @@ uint8_t TFT_Queue::queue[]; uint8_t *TFT_Queue::end_of_queue = queue; uint8_t *TFT_Queue::current_task = nullptr; uint8_t *TFT_Queue::last_task = nullptr; +uint8_t *TFT_Queue::last_parameter = nullptr; void TFT_Queue::reset() { tft.abort(); @@ -39,6 +40,7 @@ void TFT_Queue::reset() { end_of_queue = queue; current_task = nullptr; last_task = nullptr; + last_parameter = nullptr; } void TFT_Queue::async() { @@ -113,49 +115,28 @@ void TFT_Queue::canvas(queueTask_t *task) { switch (*item) { case CANVAS_SET_BACKGROUND: Canvas.SetBackground(((parametersCanvasBackground_t *)item)->color); - item += sizeof(parametersCanvasBackground_t); break; case CANVAS_ADD_TEXT: Canvas.AddText(((parametersCanvasText_t *)item)->x, ((parametersCanvasText_t *)item)->y, ((parametersCanvasText_t *)item)->color, item + sizeof(parametersCanvasText_t), ((parametersCanvasText_t *)item)->maxWidth); - item += sizeof(parametersCanvasText_t) + ((parametersCanvasText_t *)item)->stringLength; break; case CANVAS_ADD_IMAGE: MarlinImage image; uint16_t *colors; - colorMode_t color_mode; image = ((parametersCanvasImage_t *)item)->image; colors = (uint16_t *)(item + sizeof(parametersCanvasImage_t)); Canvas.AddImage(((parametersCanvasImage_t *)item)->x, ((parametersCanvasImage_t *)item)->y, image, colors); - - item = (uint8_t *)colors; - color_mode = Images[image].colorMode; - - switch (color_mode) { - case GREYSCALE1: - item += sizeof(uint16_t); - break; - case GREYSCALE2: - item += sizeof(uint16_t) * 3; - break; - case GREYSCALE4: - item += sizeof(uint16_t) * 15; - break; - default: - break; - } break; case CANVAS_ADD_BAR: Canvas.AddBar(((parametersCanvasBar_t *)item)->x, ((parametersCanvasBar_t *)item)->y, ((parametersCanvasBar_t *)item)->width, ((parametersCanvasBar_t *)item)->height, ((parametersCanvasBar_t *)item)->color); - item += sizeof(parametersCanvasBar_t); break; case CANVAS_ADD_RECTANGLE: Canvas.AddRectangle(((parametersCanvasRectangle_t *)item)->x, ((parametersCanvasRectangle_t *)item)->y, ((parametersCanvasRectangle_t *)item)->width, ((parametersCanvasRectangle_t *)item)->height, ((parametersCanvasRectangle_t *)item)->color); - item += sizeof(parametersCanvasRectangle_t); break; } + item = ((parametersCanvasBackground_t *)item)->nextParameter; } if (Canvas.ToScreen()) task->state = TASK_STATE_COMPLETED; @@ -172,6 +153,7 @@ void TFT_Queue::fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, ui parametersFill_t *task_parameters = (parametersFill_t *)end_of_queue; end_of_queue += sizeof(parametersFill_t); + last_parameter = end_of_queue; task_parameters->x = x; task_parameters->y = y; task_parameters->width = width; @@ -201,6 +183,7 @@ void TFT_Queue::canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) parametersCanvas_t *task_parameters = (parametersCanvas_t *)end_of_queue; end_of_queue += sizeof(parametersCanvas_t); + last_parameter = end_of_queue; task_parameters->x = x; task_parameters->y = y; task_parameters->width = width; @@ -211,19 +194,33 @@ void TFT_Queue::canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) } void TFT_Queue::set_background(uint16_t color) { + handle_queue_overflow(sizeof(parametersCanvasBackground_t)); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasBackground_t *parameters = (parametersCanvasBackground_t *)end_of_queue; + last_parameter = end_of_queue; parameters->type = CANVAS_SET_BACKGROUND; parameters->color = color; end_of_queue += sizeof(parametersCanvasBackground_t); task_parameters->count++; + parameters->nextParameter = end_of_queue; +} + +#define QUEUE_SAFETY_FREE_SPACE 100 + +void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) { + if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= QUEUE_SIZE) { + end_of_queue = queue; + ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue; + } } void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, uint16_t maxWidth) { + handle_queue_overflow(sizeof(parametersCanvasText_t) + maxWidth); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasText_t *parameters = (parametersCanvasText_t *)end_of_queue; + last_parameter = end_of_queue; uint8_t *pointer = string; @@ -239,13 +236,16 @@ void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string /* TODO: Deal with maxWidth */ while ((*(end_of_queue++) = *pointer++) != 0x00); + parameters->nextParameter = end_of_queue; parameters->stringLength = pointer - string; task_parameters->count++; } void TFT_Queue::add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { + handle_queue_overflow(sizeof(parametersCanvasImage_t)); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasImage_t *parameters = (parametersCanvasImage_t *)end_of_queue; + last_parameter = end_of_queue; parameters->type = CANVAS_ADD_IMAGE; parameters->x = x; @@ -254,6 +254,7 @@ void TFT_Queue::add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *col end_of_queue += sizeof(parametersCanvasImage_t); task_parameters->count++; + parameters->nextParameter = end_of_queue; colorMode_t color_mode = Images[image].colorMode; @@ -275,6 +276,7 @@ void TFT_Queue::add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *col } end_of_queue = (uint8_t *)color; + parameters->nextParameter = end_of_queue; } uint16_t gradient(uint16_t colorA, uint16_t colorB, uint16_t factor) { @@ -314,8 +316,10 @@ void TFT_Queue::add_image(int16_t x, int16_t y, MarlinImage image, uint16_t colo } void TFT_Queue::add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { + handle_queue_overflow(sizeof(parametersCanvasBar_t)); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasBar_t *parameters = (parametersCanvasBar_t *)end_of_queue; + last_parameter = end_of_queue; parameters->type = CANVAS_ADD_BAR; parameters->x = x; @@ -326,11 +330,14 @@ void TFT_Queue::add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, end_of_queue += sizeof(parametersCanvasBar_t); task_parameters->count++; + parameters->nextParameter = end_of_queue; } void TFT_Queue::add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { + handle_queue_overflow(sizeof(parametersCanvasRectangle_t)); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasRectangle_t *parameters = (parametersCanvasRectangle_t *)end_of_queue; + last_parameter = end_of_queue; parameters->type = CANVAS_ADD_RECTANGLE; parameters->x = x; @@ -341,6 +348,7 @@ void TFT_Queue::add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t h end_of_queue += sizeof(parametersCanvasRectangle_t); task_parameters->count++; + parameters->nextParameter = end_of_queue; } #endif // HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/tft/tft_queue.h b/Marlin/src/lcd/tft/tft_queue.h index 9aa0d5b6c91d..6cb3caf4a2b2 100644 --- a/Marlin/src/lcd/tft/tft_queue.h +++ b/Marlin/src/lcd/tft/tft_queue.h @@ -73,11 +73,13 @@ typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) { CanvasSubtype type; + uint8_t *nextParameter; uint16_t color; } parametersCanvasBackground_t; typedef struct __attribute__((__packed__)) { CanvasSubtype type; + uint8_t *nextParameter; uint16_t x; uint16_t y; uint16_t color; @@ -88,6 +90,7 @@ typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) { CanvasSubtype type; + uint8_t *nextParameter; int16_t x; int16_t y; MarlinImage image; @@ -95,6 +98,7 @@ typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) { CanvasSubtype type; + uint8_t *nextParameter; uint16_t x; uint16_t y; uint16_t width; @@ -104,6 +108,7 @@ typedef struct __attribute__((__packed__)) { typedef struct __attribute__((__packed__)) { CanvasSubtype type; + uint8_t *nextParameter; uint16_t x; uint16_t y; uint16_t width; @@ -117,10 +122,12 @@ class TFT_Queue { static uint8_t *end_of_queue; static uint8_t *current_task; static uint8_t *last_task; + static uint8_t *last_parameter; static void finish_sketch(); static void fill(queueTask_t *task); static void canvas(queueTask_t *task); + static void handle_queue_overflow(uint16_t sizeNeeded); public: static void reset(); From 90fcb82a3e5959a4c8ea86876c3b530e86f5c4da Mon Sep 17 00:00:00 2001 From: Gurmeet Athwal Date: Wed, 28 Oct 2020 08:25:49 +0530 Subject: [PATCH 041/443] Update ExtUI path in config comment (#19908) --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5ec41c596bda..054e90d8d970 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2196,7 +2196,7 @@ // // Third-party or vendor-customized controller interfaces. -// Sources should be installed in 'src/lcd/extensible_ui'. +// Sources should be installed in 'src/lcd/extui'. // //#define EXTENSIBLE_UI From 603e4d66ac2fa9d8906356ce24202d6d731e0d79 Mon Sep 17 00:00:00 2001 From: ellensp Date: Wed, 28 Oct 2020 15:57:32 +1300 Subject: [PATCH 042/443] AZTEEG X5 mini LED pins (#19909) --- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index ad792447ea73..6fddc162248e 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -38,6 +38,9 @@ // LED // #define LED_PIN P1_18 +#define LED2_PIN P1_20 +#define LED3_PIN P1_19 +#define LED4_PIN P1_21 // // Servos @@ -79,14 +82,13 @@ #define E0_ENABLE_PIN P0_04 // -// DIGIPOT slave addresses +// DIGIPOT slave addresses (7-bit unshifted) // #ifndef DIGIPOT_I2C_ADDRESS_A - #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_A 0x2C #endif - #ifndef DIGIPOT_I2C_ADDRESS_B - #define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2E #endif // From 12dec2563afcc0f92333ce3ddbba28979bc0f865 Mon Sep 17 00:00:00 2001 From: Alexander Fomichev Date: Wed, 28 Oct 2020 05:59:22 +0300 Subject: [PATCH 043/443] Generalize BTT SKR E3-DIP version (#19910) --- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 63b97b666faf..c151b44bb705 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -25,7 +25,7 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_INFO_NAME "BTT SKR E3 DIP V1.0" +#define BOARD_INFO_NAME "BTT SKR E3 DIP V1.x" // Release PB3/PB4 (TMC_SW Pins) from JTAG pins #define DISABLE_JTAG From 21674b28799d297f3499d87d8fd29cbfed780551 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 29 Oct 2020 00:16:59 +0000 Subject: [PATCH 044/443] [cron] Bump distribution date (2020-10-29) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index da221bed3bd6..b6660e88667e 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-28" + #define STRING_DISTRIBUTION_DATE "2020-10-29" #endif /** From 18a5000718478a51ebde8955d7707d2f9cabd362 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 29 Oct 2020 01:45:10 -0300 Subject: [PATCH 045/443] Permit spaces in dependencies g++ path (#19929) --- buildroot/share/PlatformIO/scripts/common-dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index b9cefeab7cf7..f3bc2b9b0283 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -234,7 +234,7 @@ def load_marlin_features(): build_flags = env.ParseFlagsExtended(build_flags) cxx = search_compiler() - cmd = [cxx] + cmd = ['"' + cxx + '"'] # Build flags from board.json #if 'BOARD' in env: From 838220e4b371aad20356bf328605a6dd038cfcfe Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 29 Oct 2020 01:47:12 -0300 Subject: [PATCH 046/443] Keep SPI active on LPC176x (#19932) --- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index b3d2908ac93e..cb0d54c0036f 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -263,8 +263,9 @@ uint16_t SPIClass::transfer16(const uint16_t data) { } void SPIClass::end() { - // SSP_Cmd(_currentSetting->spi_d, DISABLE); // stop device or SSP_DeInit? - SSP_DeInit(_currentSetting->spi_d); + // Neither is needed for Marlin + //SSP_Cmd(_currentSetting->spi_d, DISABLE); + //SSP_DeInit(_currentSetting->spi_d); } void SPIClass::send(uint8_t data) { From 3f644b6275f8596a43cdaff2daa722308e8aa006 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Oct 2020 00:14:55 -0500 Subject: [PATCH 047/443] Add a note about substitution chars --- Marlin/src/lcd/language/language_en.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 8bf4fa6b7ecb..42954d79e5b9 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -26,6 +26,13 @@ * * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html + * + * Substitutions are applied for the following characters when used + * in menu items that call lcd_put_u8str_ind_P with an index: + * + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) */ #define en 1234 From be0c9ff7058235c94256845795ca05c669f51973 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Oct 2020 00:48:50 -0500 Subject: [PATCH 048/443] Fix comments, spacing --- Marlin/src/HAL/LINUX/pinsDebug.h | 12 ++++++------ Marlin/src/HAL/shared/backtrace/unwarm.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwarm.h | 2 +- Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwarmbytab.h | 2 +- Marlin/src/HAL/shared/backtrace/unwarmmem.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwarmmem.h | 2 +- Marlin/src/HAL/shared/backtrace/unwinder.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwinder.h | 2 +- Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp | 2 +- Marlin/src/HAL/shared/backtrace/unwmemaccess.h | 2 +- .../share/sublime/MarlinFirmware.sublime-project | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Marlin/src/HAL/LINUX/pinsDebug.h b/Marlin/src/HAL/LINUX/pinsDebug.h index a93ceddc61c3..8f8543ef5984 100644 --- a/Marlin/src/HAL/LINUX/pinsDebug.h +++ b/Marlin/src/HAL/LINUX/pinsDebug.h @@ -26,15 +26,15 @@ */ #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define pwm_details(pin) pin = pin // do nothing // print PWM details -#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin. -#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0) +#define pwm_details(pin) NOOP // (do nothing) +#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin. +#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0) #define digitalRead_mod(p) digitalRead(p) #define PRINT_PORT(p) -#define GET_ARRAY_PIN(p) pin_array[p].pin +#define GET_ARRAY_PIN(p) pin_array[p].pin #define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) +#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin // active ADC function/mode/code values for PINSEL registers constexpr int8_t ADC_pin_mode(pin_t pin) { diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp index cdc9c06c615e..adbcca69cc58 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commercially or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Utility functions and glue for ARM unwinding sub-modules. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.h b/Marlin/src/HAL/shared/backtrace/unwarm.h index 3128e354cc72..86dc98c073e1 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.h +++ b/Marlin/src/HAL/shared/backtrace/unwarm.h @@ -6,7 +6,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Internal interface between the ARM unwinding sub-modules. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp index 0ec9bd56af7d..59734bfbfe1e 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commercially or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Abstract interpreter for ARM mode. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp index 26ca8b2604e9..be4abd090fa8 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commercially or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Abstract interpretation for Thumb mode. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.h b/Marlin/src/HAL/shared/backtrace/unwarmbytab.h index 77a1c82dbddb..e2f80db2a5b8 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.h +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.h @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Interface to the memory tracking sub-system. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp b/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp index cf9ac414c4e0..a40d8540ec38 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Implementation of the memory tracking sub-system. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwarmmem.h b/Marlin/src/HAL/shared/backtrace/unwarmmem.h index 588618b34f0a..1340bbdf0a25 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmmem.h +++ b/Marlin/src/HAL/shared/backtrace/unwarmmem.h @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Interface to the memory tracking sub-system. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwinder.cpp b/Marlin/src/HAL/shared/backtrace/unwinder.cpp index e63af1ed25a8..0f88e2a7f75b 100644 --- a/Marlin/src/HAL/shared/backtrace/unwinder.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwinder.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commercially or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Implementation of the interface into the ARM unwinder. **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwinder.h b/Marlin/src/HAL/shared/backtrace/unwinder.h index cae137951372..157808d540da 100644 --- a/Marlin/src/HAL/shared/backtrace/unwinder.h +++ b/Marlin/src/HAL/shared/backtrace/unwinder.h @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. **************************************************************************/ /** \file * Interface to the ARM stack unwinding module. diff --git a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp index c93494d485c3..e74953064592 100644 --- a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commercially or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liability for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Utility functions to access memory **************************************************************************/ diff --git a/Marlin/src/HAL/shared/backtrace/unwmemaccess.h b/Marlin/src/HAL/shared/backtrace/unwmemaccess.h index fe42bd9485e7..562ab3f05da9 100644 --- a/Marlin/src/HAL/shared/backtrace/unwmemaccess.h +++ b/Marlin/src/HAL/shared/backtrace/unwmemaccess.h @@ -7,7 +7,7 @@ * for free and use it as they wish, with or without modifications, and in * any context, commerically or otherwise. The only limitation is that I * don't guarantee that the software is fit for any purpose or accept any - * liablity for it's use or misuse - this software is without warranty. + * liability for its use or misuse - this software is without warranty. *************************************************************************** * File Description: Utility functions to access memory **************************************************************************/ diff --git a/buildroot/share/sublime/MarlinFirmware.sublime-project b/buildroot/share/sublime/MarlinFirmware.sublime-project index 9b5234f7a13c..1e9275f64623 100644 --- a/buildroot/share/sublime/MarlinFirmware.sublime-project +++ b/buildroot/share/sublime/MarlinFirmware.sublime-project @@ -11,7 +11,7 @@ ".vscode" ], "binary_file_patterns": - [ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg" ], + [ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff" ], "file_exclude_patterns": [ "Marlin/platformio.ini", From 7473241438f3c9b7c7e701d6d2e3128d31ba2058 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Oct 2020 00:49:03 -0500 Subject: [PATCH 049/443] .bin and .woff are binary --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index 2588229e0544..83897cba6ed3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,3 +17,5 @@ *.png binary *.jpg binary *.fon binary +*.bin binary +*.woff binary From dca7c5d1adf642848b8ec9ccb140525f7faa2838 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 29 Oct 2020 02:52:50 -0300 Subject: [PATCH 050/443] Color UI for MKS SGen-L V2 (#19919) --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 52 +++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) 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 1a558075b60e..0719752399d8 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -251,7 +251,7 @@ * _____ _____ * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · ·| 0.17 (LCD_D5) (BTN_EN2) 3.26 | · ·| 0.9 (SD_MOSI) + * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- @@ -299,6 +299,56 @@ #define LCD_PINS_D7 P1_22 #define KILL_PIN -1 // NC + #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI + #define TFT_CS_PIN P1_00 + #define TFT_A0_PIN P1_22 + #define TFT_DC_PIN P1_22 + #define TFT_MISO_PIN P0_08 + #define TFT_BACKLIGHT_PIN P0_18 + #define TFT_RESET_PIN P0_16 + + #define LCD_USE_DMA_SPI + + #define TOUCH_INT_PIN P0_17 + #define TOUCH_CS_PIN P0_15 + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 + + // Disable any LCD related PINs config + #define LCD_PINS_ENABLE -1 + #define LCD_PINS_RS -1 + + // XPT2046 Touch Screen calibration + #if ENABLED(TFT_CLASSIC_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -11386 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 8684 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 689 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -273 + #endif + #elif ENABLED(TFT_COLOR_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -17089 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 11424 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 1044 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -365 + #endif + + #define TFT_BUFFER_SIZE 2400 + #endif + #else // !MKS_12864OLED_SSD1306 #define LCD_PINS_RS P0_16 From 54ec6a0ce2dd5f0a3eecf9d76040fc33cfb95b5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Oct 2020 01:14:02 -0500 Subject: [PATCH 051/443] Tweak code formatting --- Marlin/src/module/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 3468a4c1c5d3..d119a72a646e 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1233,9 +1233,9 @@ void Temperature::manage_heater() { #ifndef MIN_COOLING_SLOPE_DEG_CHAMBER_VENT #define MIN_COOLING_SLOPE_DEG_CHAMBER_VENT 1.5 #endif - if( (temp_chamber.celsius - temp_chamber.target >= HIGH_EXCESS_HEAT_LIMIT) && !flag_chamber_excess_heat) { - // open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds - // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT + if (!flag_chamber_excess_heat && temp_chamber.celsius - temp_chamber.target >= HIGH_EXCESS_HEAT_LIMIT) { + // Open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds if the + // temperature didn't drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT if (next_cool_check_ms_2 == 0 || ELAPSED(ms, next_cool_check_ms_2)) { if (old_temp - temp_chamber.celsius < float(MIN_COOLING_SLOPE_DEG_CHAMBER_VENT)) flag_chamber_excess_heat = true; //the bed is heating the chamber too much next_cool_check_ms_2 = ms + 1000UL * MIN_COOLING_SLOPE_TIME_CHAMBER_VENT; From b6856dcb999b51077c89eb30c5ec102c507152c0 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Wed, 28 Oct 2020 11:23:46 -0600 Subject: [PATCH 052/443] Improvement and fixes to FTDI touch UI - Fixed incorrect LCD text string - Fixed incorrect refresh of filament change screens - Allow host control via touch UI - Updates to leveling menu - Modified ExtUI::isPrinting() to check if the job timer is running - Added ExtUI method to check whether a host print is paused --- .../ftdi_eve_touch_ui/language/language_en.h | 2 +- .../screens/change_filament_screen.cpp | 1 + .../confirm_abort_print_dialog_box.cpp | 8 +- .../screens/leveling_menu.cpp | 73 +++++++++---------- .../lib/ftdi_eve_touch_ui/screens/screens.h | 3 + .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 55 ++++++++++---- Marlin/src/lcd/extui/ui_api.cpp | 6 +- Marlin/src/lcd/extui/ui_api.h | 1 + 8 files changed, 90 insertions(+), 59 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index cc96c8b9cda7..ce60ab5090dd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -119,7 +119,7 @@ namespace Language_en { PROGMEM Language_Str MSG_CAUTION = u8"Caution:"; PROGMEM Language_Str MSG_HOT = u8"Hot!"; PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; - PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extruder"; + PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extrude"; PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; PROGMEM Language_Str MSG_PLEASE_WAIT = u8"Please wait..."; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 589da9b21055..60394d06dfb5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -84,6 +84,7 @@ void ChangeFilamentScreen::drawTempGradient(uint16_t x, uint16_t y, uint16_t w, } void ChangeFilamentScreen::onEntry() { + BaseScreen::onEntry(); screen_data.ChangeFilamentScreen.e_tag = ExtUI::getActiveTool() + 10; screen_data.ChangeFilamentScreen.t_tag = 0; screen_data.ChangeFilamentScreen.repeat_tag = 0; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp index e23592a46e9f..eb3e2a3e01e7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp @@ -26,6 +26,8 @@ #include "screens.h" +#include "../../../../../feature/host_actions.h" + using namespace ExtUI; void ConfirmAbortPrintDialogBox::onRedraw(draw_mode_t) { @@ -37,7 +39,11 @@ bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); - stopPrint(); + if (ExtUI::isPrintingFromMedia()) + ExtUI::stopPrint(); + #ifdef ACTION_ON_CANCEL + else host_action_cancel(); + #endif return true; default: return DialogBoxBaseClass::onTouchEnd(tag); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp index 763403d28722..a91d48c0376c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp @@ -35,29 +35,27 @@ using namespace ExtUI; using namespace Theme; #ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 10 + #define GRID_ROWS 9 #define GRID_COLS 2 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) - #define LEVEL_BED_POS BTN_POS(1,2), BTN_SIZE(2,1) - #define LEVEL_AXIS_POS BTN_POS(1,3), BTN_SIZE(2,1) - #define Z_AUTO_ALIGN_POS BTN_POS(1,4), BTN_SIZE(2,1) - #define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(2,1) - #define BLTOUCH_TITLE_POS BTN_POS(1,7), BTN_SIZE(2,1) - #define BLTOUCH_RESET_POS BTN_POS(1,8), BTN_SIZE(1,1) - #define BLTOUCH_TEST_POS BTN_POS(2,8), BTN_SIZE(1,1) - #define BACK_POS BTN_POS(1,10), BTN_SIZE(2,1) -#else - #define GRID_ROWS 8 - #define GRID_COLS 2 - #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) - #define LEVEL_BED_POS BTN_POS(1,2), BTN_SIZE(2,1) - #define LEVEL_AXIS_POS BTN_POS(1,3), BTN_SIZE(2,1) - #define Z_AUTO_ALIGN_POS BTN_POS(1,4), BTN_SIZE(2,1) - #define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(2,1) + #define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1) + #define LEVEL_BED_POS BTN_POS(1,3), BTN_SIZE(2,1) + #define SHOW_MESH_POS BTN_POS(1,4), BTN_SIZE(2,1) #define BLTOUCH_TITLE_POS BTN_POS(1,6), BTN_SIZE(2,1) #define BLTOUCH_RESET_POS BTN_POS(1,7), BTN_SIZE(1,1) #define BLTOUCH_TEST_POS BTN_POS(2,7), BTN_SIZE(1,1) - #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) + #define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1) +#else + #define GRID_ROWS 7 + #define GRID_COLS 2 + #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) + #define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1) + #define LEVEL_BED_POS BTN_POS(1,3), BTN_SIZE(2,1) + #define SHOW_MESH_POS BTN_POS(1,4), BTN_SIZE(2,1) + #define BLTOUCH_TITLE_POS BTN_POS(1,5), BTN_SIZE(2,1) + #define BLTOUCH_RESET_POS BTN_POS(1,6), BTN_SIZE(1,1) + #define BLTOUCH_TEST_POS BTN_POS(2,6), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,7), BTN_SIZE(2,1) #endif void LevelingMenu::onRedraw(draw_mode_t what) { @@ -73,21 +71,16 @@ void LevelingMenu::onRedraw(draw_mode_t what) { cmd.font(font_large) .text(TITLE_POS, GET_TEXT_F(MSG_LEVELING)) .font(font_medium).colors(normal_btn) - .tag(2).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED)) - .enabled( - #ifdef AXIS_LEVELING_COMMANDS - 1 - #endif - ) - .tag(3).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) - .enabled(ENABLED(Z_STEPPER_AUTO_ALIGN)) - .tag(4).button(Z_AUTO_ALIGN_POS, GET_TEXT_F(MSG_AUTO_Z_ALIGN)) + #if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION) + .tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) + #endif + .tag(3).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED)) .enabled(ENABLED(HAS_MESH)) - .tag(5).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH)); + .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH)); #if ENABLED(BLTOUCH) cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) - .tag(6).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) - .tag(7).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)); + .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) + .tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)); #endif cmd.colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); @@ -97,25 +90,25 @@ void LevelingMenu::onRedraw(draw_mode_t what) { bool LevelingMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; - case 2: + #if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION) + case 2: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break; + #endif + case 3: + #ifndef BED_LEVELING_COMMANDS + #define BED_LEVELING_COMMANDS "G29" + #endif #if HAS_MESH BedMeshScreen::startMeshProbe(); #else SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS)); #endif break; - #ifdef AXIS_LEVELING_COMMANDS - case 3: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break; - #endif - #if ENABLED(Z_STEPPER_AUTO_ALIGN) - case 4: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break; - #endif #if HAS_MESH - case 5: GOTO_SCREEN(BedMeshScreen); break; + case 4: GOTO_SCREEN(BedMeshScreen); break; #endif #if ENABLED(BLTOUCH) - case 6: injectCommands_P(PSTR("M280 P0 S60")); break; - case 7: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break; + case 5: injectCommands_P(PSTR("M280 P0 S60")); break; + case 6: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break; #endif default: return false; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 2108cff8df2a..71fc7d9ee30d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -365,6 +365,9 @@ class MainMenu : public BaseScreen, public CachedScreen { }; class TuneMenu : public BaseScreen, public CachedScreen { + private: + static void pausePrint(); + static void resumePrint(); public: static void onRedraw(draw_mode_t); static bool onTouchEnd(uint8_t tag); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 9fe2f1e9cbcb..258ee4b04fb0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -26,6 +26,8 @@ #include "screens.h" +#include "../../../../../feature/host_actions.h" + using namespace FTDI; using namespace Theme; @@ -63,23 +65,24 @@ void TuneMenu::onRedraw(draw_mode_t what) { #endif if (what & FOREGROUND) { - using namespace ExtUI; + const bool sdOrHostPrinting = ExtUI::isPrinting(); + const bool sdOrHostPaused = ExtUI::isPrintingPaused(); CommandProcessor cmd; cmd.colors(normal_btn) .font(font_medium) .tag(2).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) - .enabled(!isPrinting() || isPrintingFromMediaPaused()) + .enabled(!sdOrHostPrinting || sdOrHostPaused) .tag(3).button( FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) .tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) .enabled(EITHER(HAS_BED_PROBE, BABYSTEPPING)) .tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET))) .tag(5).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(isPrintingFromMediaPaused() ? 7 : 6) - .enabled(TERN0(SDSUPPORT, isPrintingFromMedia())) - .button( PAUSE_POS, isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) - .enabled(TERN0(SDSUPPORT, isPrintingFromMedia())) + .enabled(sdOrHostPrinting) + .tag(sdOrHostPaused ? 7 : 6) + .button( PAUSE_POS, sdOrHostPaused ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) + .enabled(sdOrHostPrinting) .tag(8).button( STOP_POS, GET_TEXT_F(MSG_STOP_PRINT)) .enabled(ENABLED(CASE_LIGHT_ENABLE)) .tag(10).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) @@ -94,26 +97,26 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { using namespace Theme; using namespace ExtUI; switch (tag) { - case 1: GOTO_PREVIOUS(); break; - case 2: GOTO_SCREEN(TemperatureScreen); break; - case 3: GOTO_SCREEN(ChangeFilamentScreen); break; - case 4: + case 1: GOTO_PREVIOUS(); break; + case 2: GOTO_SCREEN(TemperatureScreen); break; + case 3: GOTO_SCREEN(ChangeFilamentScreen); break; + case 4: #if ENABLED(BABYSTEPPING) GOTO_SCREEN(NudgeNozzleScreen); #elif HAS_BED_PROBE GOTO_SCREEN(ZOffsetScreen); #endif break; - case 5: GOTO_SCREEN(FeedratePercentScreen); break; - case 6: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::pausePrint(); GOTO_SCREEN(StatusScreen); break; - case 7: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::resumePrint(); GOTO_SCREEN(StatusScreen); break; - case 8: + case 5: GOTO_SCREEN(FeedratePercentScreen); break; + case 6: pausePrint(); break; + case 7: resumePrint(); break; + case 8: GOTO_SCREEN(ConfirmAbortPrintDialogBox); current_screen.forget(); PUSH_SCREEN(StatusScreen); break; #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - case 9: GOTO_SCREEN(FilamentMenu); break; + case 9: GOTO_SCREEN(FilamentMenu); break; #endif #if ENABLED(CASE_LIGHT_ENABLE) case 10: GOTO_SCREEN(CaseLightScreen); break; @@ -124,4 +127,24 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // TOUCH_UI_FTDI_EVE +void TuneMenu::pausePrint() { + sound.play(twinkle, PLAY_ASYNCHRONOUS); + if (ExtUI::isPrintingFromMedia()) + ExtUI::pausePrint(); + #ifdef ACTION_ON_PAUSE + else host_action_pause(); + #endif + GOTO_SCREEN(StatusScreen); +} + +void TuneMenu::resumePrint() { + sound.play(twinkle, PLAY_ASYNCHRONOUS); + if (ExtUI::isPrintingFromMedia()) + ExtUI::resumePrint(); + #ifdef ACTION_ON_RESUME + else host_action_resume(); + #endif + GOTO_SCREEN(StatusScreen); +} + +#endif // TOUCH_UI_FTDI_EVE && !TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 33b5d5458eda..80033e911ba3 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -972,7 +972,11 @@ namespace ExtUI { } bool isPrinting() { - return (commandsInQueue() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)); + return (commandsInQueue() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)) || print_job_timer.isRunning() || print_job_timer.isPaused(); + } + + bool isPrintingPaused() { + return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused()); } bool isMediaInserted() { diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 15122ec69e15..48d0e9722060 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -302,6 +302,7 @@ namespace ExtUI { bool isPrintingFromMediaPaused(); bool isPrintingFromMedia(); bool isPrinting(); + bool isPrintingPaused(); void printFile(const char *filename); void stopPrint(); From 50ba20fe1f27cdcb0f0f98f11cb42248dbc186f7 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 29 Oct 2020 04:01:25 -0300 Subject: [PATCH 053/443] PIO env for MKS Nano boards in STM32 (#19905) --- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 2 +- platformio.ini | 32 ++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index b1e49f4d9fd2..fbd12fb59ca1 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -25,7 +25,7 @@ * MKS Robin nano (STM32F130VET6) board pin assignments */ -#if NOT_TARGET(__STM32F1__) +#if NOT_TARGET(__STM32F1__, STM32F1) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 2 || E_STEPPERS > 2 #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue." diff --git a/platformio.ini b/platformio.ini index 3e565e6c4eba..b052a26b5878 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1310,17 +1310,39 @@ build_flags = ${lerdge_common.build_flags} # RUMBA32 # [env:rumba32] -platform = ${common_stm32.platform} -extends = common_stm32 -build_flags = ${common_stm32.build_flags} +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DTIMER_SERIAL=TIM9 -board = rumba32_f446ve +board = rumba32_f446ve upload_protocol = dfu -monitor_speed = 500000 +monitor_speed = 500000 + +# +# MKS Robin Nano V1.2 and V2 using hal STM32 +# +[env:mks_robin_nano35_stm32] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +board = genericSTM32F103VE +board_build.core = stm32 +board_build.variant = MARLIN_F103Vx +board_build.ldscript = ldscript.ld +board_build.offset = 0x7000 +board_build.firmware = Robin_nano35.bin +board_upload.offset_address = 0x08007000 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC +debug_tool = jlink +upload_protocol = jlink +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/mks_encrypt.py ################################# # # From 1247f7375402809034843088617d30fb79985cee Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Thu, 29 Oct 2020 22:27:01 +0100 Subject: [PATCH 054/443] Update Italian language (#19953) --- Marlin/src/lcd/language/language_it.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 38fffcb73b8c..73639c27900b 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -26,6 +26,13 @@ * * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html + * + * Substitutions are applied for the following characters when used + * in menu items that call lcd_put_u8str_ind_P with an index: + * + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) */ #define DISPLAY_CHARSET_ISO10646_1 @@ -65,6 +72,9 @@ namespace Language_it { PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Tramming assistito"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("Iterazione G34: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Precis.in calo!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precis.raggiunta"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home assi XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo"); @@ -652,4 +662,5 @@ namespace Language_it { PROGMEM Language_Str MSG_REHEATING = _UxGT("Riscaldando..."); PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Proc.guid.sonda Z"); + PROGMEM Language_Str MSG_SOUND = _UxGT("Suono"); } From de315c97b1d11449c1091e5b93f27f8b4c48645a Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 30 Oct 2020 00:17:04 +0200 Subject: [PATCH 055/443] FAST_PWM for STM32F1 (#19952) --- Marlin/src/HAL/STM32F1/HAL.h | 17 ++++++ Marlin/src/HAL/STM32F1/fast_pwm.cpp | 68 ++++++++++++++++++++++ Marlin/src/HAL/STM32F1/inc/SanityCheck.h | 4 -- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 6 +- 4 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 Marlin/src/HAL/STM32F1/fast_pwm.cpp diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index eaf6494dfa92..b77539d7b6c3 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -244,3 +244,20 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? #define PLATFORM_M997_SUPPORT void flashFirmware(const int16_t); + +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + +/** + * set_pwm_frequency + * Set the frequency of the timer corresponding to the provided pin + * All Timer PWM pins run at the same frequency + */ +void set_pwm_frequency(const pin_t pin, int f_desired); + +/** + * set_pwm_duty + * Set the PWM duty cycle of the provided pin to the provided value + * Optionally allows inverting the duty cycle [default = false] + * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] + */ +void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); diff --git a/Marlin/src/HAL/STM32F1/fast_pwm.cpp b/Marlin/src/HAL/STM32F1/fast_pwm.cpp new file mode 100644 index 000000000000..884d482af5f1 --- /dev/null +++ b/Marlin/src/HAL/STM32F1/fast_pwm.cpp @@ -0,0 +1,68 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#ifdef __STM32F1__ + +#include "../../inc/MarlinConfigPre.h" + +#if NEEDS_HARDWARE_PWM + +#include +#include "HAL.h" +#include "timers.h" + +void set_pwm_frequency(const pin_t pin, int f_desired) { + if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer + + timer_dev *timer = PIN_MAP[pin].timer_device; + uint8_t channel = PIN_MAP[pin].timer_channel; + + // Protect used timers + if (timer == get_timer_dev(TEMP_TIMER_NUM)) return; + if (timer == get_timer_dev(STEP_TIMER_NUM)) return; + #if PULSE_TIMER_NUM != STEP_TIMER_NUM + if (timer == get_timer_dev(PULSE_TIMER_NUM)) return; + #endif + + if (!(timer->regs.bas->SR & TIMER_CR1_CEN)) // Ensure the timer is enabled + timer_init(timer); + + timer_set_mode(timer, channel, TIMER_PWM); + uint16_t preload = 255; // Lock 255 PWM resolution for high frequencies + int32_t prescaler = (HAL_TIMER_RATE) / (preload + 1) / f_desired - 1; + if (prescaler > 65535) { // For low frequencies increase prescaler + prescaler = 65535; + preload = (HAL_TIMER_RATE) / (prescaler + 1) / f_desired - 1; + } + if (prescaler < 0) return; // Too high frequency + timer_set_reload(timer, preload); + timer_set_prescaler(timer, prescaler); +} + +void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { + timer_dev *timer = PIN_MAP[pin].timer_device; + uint16_t max_val = timer->regs.bas->ARR * v / v_size; + if (invert) max_val = v_size - max_val; + pwmWrite(pin, max_val); +} + +#endif // NEEDS_HARDWARE_PWM +#endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index a0381ea8c8d5..937bef8803ea 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -25,10 +25,6 @@ * Test STM32F1-specific configuration values for errors at compile-time. */ -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY - #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F1." -#endif - #if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER." #error "Missing SoftwareSerial implementation." diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index 04b999eaf620..f1bf433c21ef 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -55,10 +55,8 @@ #endif } - #if ENABLED(MARLIN_DEV_MODE) - #if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) - EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency); - #endif + #if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) + EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency); #endif END_MENU(); } From f8d57370d00867df6a4fb7c934982d503be48c4b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Oct 2020 17:33:59 -0500 Subject: [PATCH 056/443] gcode_D EEPROM size, cleanup Fixes #19920 Co-Authored-By: Orel <37673727+0r31@users.noreply.github.com> --- Marlin/src/HAL/AVR/eeprom.cpp | 2 +- Marlin/src/HAL/DUE/eeprom_flash.cpp | 2 +- Marlin/src/HAL/DUE/eeprom_wired.cpp | 2 +- Marlin/src/HAL/ESP32/eeprom.cpp | 2 +- Marlin/src/HAL/LINUX/eeprom.cpp | 2 +- Marlin/src/HAL/LPC1768/eeprom_flash.cpp | 2 +- Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp | 2 +- Marlin/src/HAL/LPC1768/eeprom_wired.cpp | 2 +- Marlin/src/HAL/SAMD51/eeprom_flash.cpp | 2 +- Marlin/src/HAL/SAMD51/eeprom_qspi.cpp | 2 +- Marlin/src/HAL/SAMD51/eeprom_wired.cpp | 2 +- Marlin/src/HAL/STM32/eeprom_flash.cpp | 2 +- Marlin/src/HAL/STM32/eeprom_sdcard.cpp | 2 +- Marlin/src/HAL/STM32/eeprom_sram.cpp | 2 +- Marlin/src/HAL/STM32/eeprom_wired.cpp | 2 +- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 2 +- Marlin/src/HAL/STM32F1/eeprom_flash.cpp | 2 +- Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp | 2 +- Marlin/src/HAL/STM32F1/eeprom_wired.cpp | 2 +- Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp | 2 +- Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp | 2 +- Marlin/src/HAL/TEENSY31_32/eeprom.cpp | 2 +- Marlin/src/HAL/TEENSY35_36/eeprom.cpp | 2 +- Marlin/src/HAL/TEENSY40_41/eeprom.cpp | 2 +- Marlin/src/gcode/gcode_d.cpp | 46 ++++++++------------- 25 files changed, 42 insertions(+), 52 deletions(-) diff --git a/Marlin/src/HAL/AVR/eeprom.cpp b/Marlin/src/HAL/AVR/eeprom.cpp index c7906985eb60..ee2a73e410ad 100644 --- a/Marlin/src/HAL/AVR/eeprom.cpp +++ b/Marlin/src/HAL/AVR/eeprom.cpp @@ -59,7 +59,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index 6f38da0967cb..209a5161ae02 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -996,7 +996,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = ee_Read(uint32_t(pos)); if (writing) *value = c; diff --git a/Marlin/src/HAL/DUE/eeprom_wired.cpp b/Marlin/src/HAL/DUE/eeprom_wired.cpp index 4599d6a7cd44..b488c36f1666 100644 --- a/Marlin/src/HAL/DUE/eeprom_wired.cpp +++ b/Marlin/src/HAL/DUE/eeprom_wired.cpp @@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/ESP32/eeprom.cpp b/Marlin/src/HAL/ESP32/eeprom.cpp index 1bf687c6fe09..cb5f881284ec 100644 --- a/Marlin/src/HAL/ESP32/eeprom.cpp +++ b/Marlin/src/HAL/ESP32/eeprom.cpp @@ -44,7 +44,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { for (size_t i = 0; i < size; i++) { uint8_t c = EEPROM.read(pos++); if (writing) value[i] = c; diff --git a/Marlin/src/HAL/LINUX/eeprom.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp index 68fff9c433b6..532f323c6edb 100644 --- a/Marlin/src/HAL/LINUX/eeprom.cpp +++ b/Marlin/src/HAL/LINUX/eeprom.cpp @@ -78,7 +78,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return (bytes_written != size); // return true for any error } -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { std::size_t bytes_read = 0; if (writing) { for (std::size_t i = 0; i < size; i++) { diff --git a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp index 255848637520..3c0c3c8ec30e 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp @@ -119,7 +119,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; // return true for any error } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; crc16(crc, buff, size); diff --git a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp index 9f2475f490ef..54a64ccd72f1 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp @@ -143,7 +143,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return bytes_written != size; // return true for any error } -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { if (!eeprom_file_open) return true; UINT bytes_read = 0; FRESULT s; diff --git a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp index 16c15eaf0063..d94aba6119f1 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp @@ -64,7 +64,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from external EEPROM const uint8_t c = eeprom_read_byte((uint8_t*)pos); diff --git a/Marlin/src/HAL/SAMD51/eeprom_flash.cpp b/Marlin/src/HAL/SAMD51/eeprom_flash.cpp index 429ef1c2d4f7..871bf22b7fc4 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_flash.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_flash.cpp @@ -79,7 +79,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { SYNC(NVMCTRL->SEESTAT.bit.BUSY); uint8_t c = ((volatile uint8_t *)SEEPROM_ADDR)[pos]; diff --git a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp index b403f7939fb9..faa763719707 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp @@ -56,7 +56,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { uint8_t c = qspi.readByte(pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp index 3283195897b0..d9a0225a7ae4 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp @@ -59,7 +59,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index 0933b9f4e8cb..c83376d2658a 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -261,7 +261,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos)); if (writing) *value = c; diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index 711a83ed5b6a..c9180bf09b22 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -78,7 +78,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { for (size_t i = 0; i < size; i++) { uint8_t c = HAL_eeprom_data[pos + i]; if (writing) value[i] = c; diff --git a/Marlin/src/HAL/STM32/eeprom_sram.cpp b/Marlin/src/HAL/STM32/eeprom_sram.cpp index 5f6f26f9c61b..135bcabde9aa 100644 --- a/Marlin/src/HAL/STM32/eeprom_sram.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sram.cpp @@ -52,7 +52,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from either external EEPROM, program flash or Backup SRAM const uint8_t c = ( *(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)) ); diff --git a/Marlin/src/HAL/STM32/eeprom_wired.cpp b/Marlin/src/HAL/STM32/eeprom_wired.cpp index 8c46e45f0324..ad54c12c471f 100644 --- a/Marlin/src/HAL/STM32/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32/eeprom_wired.cpp @@ -65,7 +65,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from either external EEPROM, program flash or Backup SRAM const uint8_t c = eeprom_read_byte((uint8_t*)pos); diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 658b7cd4a654..94b5e099bd58 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -68,7 +68,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t * const p = (uint8_t * const)pos; uint8_t c = eeprom_read_byte(p); diff --git a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp index 8db8c8638bb8..dfcaaaf29ff3 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp @@ -101,7 +101,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; // return true for any error } -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; crc16(crc, buff, size); diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp index 11959191f6dd..d608ccee1441 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp @@ -79,7 +79,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { for (size_t i = 0; i < size; i++) { uint8_t c = HAL_eeprom_data[pos + i]; if (writing) value[i] = c; diff --git a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp index fffd6ccaf01e..6e992a22a32d 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp @@ -72,7 +72,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing && value) *value = c; diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp index 00b808fd4824..8c5795b6853b 100644 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp @@ -96,7 +96,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = ee_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp index c0d82dbd0754..2bf386bec505 100644 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp @@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp index cc5c56f7d550..f2ae5dd534ec 100644 --- a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp @@ -57,7 +57,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp index ccbdc6b11600..8cd6b4ff41d7 100644 --- a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp @@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp index 030a8c38af3f..fe2de388a7a0 100644 --- a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp @@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 2fd03144c594..0bd295587531 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -54,9 +54,7 @@ size_t total = persistentStore.capacity(); int pos = 0; const uint8_t value = 0x0; - while(total--) { - persistentStore.write_data(pos, &value, 1); - } + while (total--) persistentStore.write_data(pos, &value, 1); persistentStore.access_finish(); #else settings.reset(); @@ -70,7 +68,7 @@ uint8_t *pointer = parser.hex_adr_val('A'); uint16_t len = parser.ushortval('C', 1); uintptr_t addr = (uintptr_t)pointer; - NOMORE(addr, (size_t)(SRAM_SIZE - 1)); + NOMORE(addr, size_t(SRAM_SIZE - 1)); NOMORE(len, SRAM_SIZE - addr); if (parser.seenval('X')) { // Write the hex bytes after the X @@ -91,16 +89,13 @@ uint8_t *pointer = parser.hex_adr_val('A'); uint16_t len = parser.ushortval('C', 1); uintptr_t addr = (uintptr_t)pointer; - #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE size_t(E2END + 1) - #endif - NOMORE(addr, (size_t)(MARLIN_EEPROM_SIZE - 1)); - NOMORE(len, MARLIN_EEPROM_SIZE - addr); + NOMORE(addr, size_t(persistentStore.capacity() - 1)); + NOMORE(len, persistentStore.capacity() - addr); if (parser.seenval('X')) { uint16_t val = parser.hex_val('X'); #if ENABLED(EEPROM_SETTINGS) persistentStore.access_start(); - while(len--) { + while (len--) { int pos = 0; persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val)); } @@ -111,23 +106,18 @@ #endif } else { - while (len--) { - // Read bytes from EEPROM - #if ENABLED(EEPROM_SETTINGS) - persistentStore.access_start(); - uint8_t val; - while(len--) { - int pos = 0; - if (!persistentStore.read_data(pos, (uint8_t *)&val, sizeof(val))) { - print_hex_byte(val); - } - } - SERIAL_EOL(); - persistentStore.access_finish(); - #else - SERIAL_ECHOLNPGM("NO EEPROM"); - #endif - } + // Read bytes from EEPROM + #if ENABLED(EEPROM_SETTINGS) + persistentStore.access_start(); + int pos = 0; + uint8_t val; + while (len--) if (!persistentStore.read_data(pos, &val, 1)) print_hex_byte(val); + SERIAL_EOL(); + persistentStore.access_finish(); + #else + SERIAL_ECHOLNPGM("NO EEPROM"); + len = 0; + #endif SERIAL_EOL(); } } break; @@ -156,7 +146,7 @@ uint8_t *pointer = parser.hex_adr_val('A'); uint16_t len = parser.ushortval('C', 1); uintptr_t addr = (uintptr_t)pointer; - NOMORE(addr, (size_t)(FLASH_SIZE - 1)); + NOMORE(addr, size_t(FLASH_SIZE - 1)); NOMORE(len, FLASH_SIZE - addr); if (parser.seenval('X')) { // TODO: Write the hex bytes after the X From dde86a4179b3ca44d267a1fe675316f8f7740a72 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 30 Oct 2020 00:10:04 +0000 Subject: [PATCH 057/443] [cron] Bump distribution date (2020-10-30) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b6660e88667e..fa7f52cb8b4a 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-29" + #define STRING_DISTRIBUTION_DATE "2020-10-30" #endif /** From a272c019f99af579ee5e68c9ee4d9ccb69712d69 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Fri, 30 Oct 2020 02:02:29 +0100 Subject: [PATCH 058/443] Rename, adjust Dagoma F5 (#19947) --- Marlin/src/core/boards.h | 2 +- Marlin/src/module/thermistor/thermistor_17.h | 78 +++++++++++++++++++ Marlin/src/module/thermistor/thermistors.h | 3 + Marlin/src/pins/pins.h | 8 +- .../{pins_RAMPS_DAGOMA.h => pins_DAGOMA_F5.h} | 36 +++++++-- 5 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 Marlin/src/module/thermistor/thermistor_17.h rename Marlin/src/pins/ramps/{pins_RAMPS_DAGOMA.h => pins_DAGOMA_F5.h} (61%) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e11590334299..a1e39f9ae81d 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -92,7 +92,7 @@ #define BOARD_TRIGORILLA_14_11 1136 // ... Rev 1.1 (new servo pin order) #define BOARD_RAMPS_ENDER_4 1137 // Creality: Ender-4, CR-8 #define BOARD_RAMPS_CREALITY 1138 // Creality: CR10S, CR20, CR-X -#define BOARD_RAMPS_DAGOMA 1139 // Dagoma F5 +#define BOARD_DAGOMA_F5 1139 // Dagoma F5 #define BOARD_FYSETC_F6_13 1140 // FYSETC F6 1.3 #define BOARD_FYSETC_F6_14 1141 // FYSETC F6 1.4 #define BOARD_DUPLICATOR_I3_PLUS 1142 // Wanhao Duplicator i3 Plus diff --git a/Marlin/src/module/thermistor/thermistor_17.h b/Marlin/src/module/thermistor/thermistor_17.h new file mode 100644 index 000000000000..32b5bb77a888 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_17.h @@ -0,0 +1,78 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// Dagoma NTC 100k white thermistor +const temp_entry_t temptable_17[] PROGMEM = { + { OV( 16), 309 }, + { OV( 18), 307 }, + { OV( 20), 300 }, + { OV( 22), 293 }, + { OV( 26), 284 }, + { OV( 29), 272 }, + { OV( 33), 266 }, + { OV( 36), 260 }, + { OV( 42), 252 }, + { OV( 46), 247 }, + { OV( 48), 244 }, + { OV( 51), 241 }, + { OV( 62), 231 }, + { OV( 73), 222 }, + { OV( 78), 219 }, + { OV( 87), 212 }, + { OV( 98), 207 }, + { OV( 109), 201 }, + { OV( 118), 197 }, + { OV( 131), 191 }, + { OV( 145), 186 }, + { OV( 160), 181 }, + { OV( 177), 175 }, + { OV( 203), 169 }, + { OV( 222), 164 }, + { OV( 256), 156 }, + { OV( 283), 151 }, + { OV( 312), 145 }, + { OV( 343), 140 }, + { OV( 377), 131 }, + { OV( 413), 125 }, + { OV( 454), 119 }, + { OV( 496), 113 }, + { OV( 537), 108 }, + { OV( 578), 102 }, + { OV( 619), 97 }, + { OV( 658), 92 }, + { OV( 695), 87 }, + { OV( 735), 81 }, + { OV( 773), 75 }, + { OV( 808), 70 }, + { OV( 844), 64 }, + { OV( 868), 59 }, + { OV( 892), 54 }, + { OV( 914), 49 }, + { OV( 935), 42 }, + { OV( 951), 38 }, + { OV( 967), 32 }, + { OV( 975), 28 }, + { OV(1000), 20 }, + { OV(1010), 10 }, + { OV(1024), -273 } // for safety +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 0b0419c52034..f90361d9a346 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -105,6 +105,9 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration #include "thermistor_15.h" #endif +#if ANY_THERMISTOR_IS(17) // Dagoma NTC 100k white thermistor + #include "thermistor_17.h" +#endif #if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 #include "thermistor_18.h" #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index c4dbe60e99ef..62749a3f6e28 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -179,8 +179,8 @@ #include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:mega2560 #elif MB(RAMPS_CREALITY) #include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:mega2560 -#elif MB(RAMPS_DAGOMA) - #include "ramps/pins_RAMPS_DAGOMA.h" // ATmega2560 env:mega2560 +#elif MB(DAGOMA_F5) + #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6_13 #elif MB(FYSETC_F6_14) @@ -713,6 +713,7 @@ #define BOARD_BIGTREE_SKR_E3_DIP -1017 #define BOARD_RUMBA32 -1018 #define BOARD_RUMBA32_AUS3D -1019 + #define BOARD_RAMPS_DAGOMA -1020 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." @@ -756,6 +757,8 @@ #error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_V1_0. Please update your configuration." #elif MB(RUMBA32_AUS3D) #error "BOARD_RUMBA32_AUS3D is now BOARD_RUMBA32_V1_0. Please update your configuration." + #elif MB(RAMPS_DAGOMA) + #error "BOARD_RAMPS_DAGOMA is now BOARD_DAGOMA_F5. Please update your configuration." #else #error "Unknown MOTHERBOARD value set in Configuration.h" #endif @@ -780,6 +783,7 @@ #undef BOARD_BIGTREE_SKR_E3_DIP #undef BOARD_RUMBA32 #undef BOARD_RUMBA32_AUS3D + #undef BOARD_RAMPS_DAGOMA #endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h similarity index 61% rename from Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h rename to Marlin/src/pins/ramps/pins_DAGOMA_F5.h index ad56b7f9d1e9..667ae47f7098 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h @@ -22,21 +22,47 @@ #pragma once #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Dagoma3D F5 RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." + #error "Dagoma3D F5 supports only 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_INFO_NAME "Dagoma3D F5 RAMPS" +#define BOARD_INFO_NAME "Dagoma3D F5" +// +// Endstops +// #define X_STOP_PIN 2 #define Y_STOP_PIN 3 #define Z_STOP_PIN 15 + #define FIL_RUNOUT_PIN 39 +#if EXTRUDERS > 1 + #define FIL_RUNOUT2_PIN 14 +#endif -#ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 7 +// +// LCD delays +// +#if HAS_MARLINUI_U8GLIB + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS(250) #endif // -// Import RAMPS 1.4 pins +// DAC steppers +// +#define HAS_MOTOR_CURRENT_DAC + +#define DAC_STEPPER_ORDER { 0, 1, 2, 3 } + +#define DAC_STEPPER_SENSE 0.11 +#define DAC_STEPPER_ADDRESS 0 +#define DAC_STEPPER_MAX 4096 +#define DAC_STEPPER_VREF 1 +#define DAC_STEPPER_GAIN 0 +#define DAC_OR_ADDRESS 0x00 + +// +// Import default RAMPS 1.4 pins // #include "pins_RAMPS.h" From 6071a0835ad063ae7bdf1853ba2ca27b78493f64 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 30 Oct 2020 00:10:04 +0000 Subject: [PATCH 059/443] Fix bilinear_line_to_destination definition See #19431 --- Marlin/src/feature/bedlevel/abl/abl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index a585c1e1553d..39d8815fad98 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -348,7 +348,7 @@ float bilinear_z_offset(const xy_pos_t &raw) { * Prepare a bilinear-leveled linear move on Cartesian, * splitting the move where it crosses grid borders. */ - void bilinear_line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { + void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { // Get current and destination cells for this line xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) }, c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) }; From a4a487b0cc0a431c01ac07c8170b8a5f19cffd2e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 31 Oct 2020 00:09:17 +0000 Subject: [PATCH 060/443] [cron] Bump distribution date (2020-10-31) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index fa7f52cb8b4a..fe61720265b9 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-30" + #define STRING_DISTRIBUTION_DATE "2020-10-31" #endif /** From 211073913873b18edd209ed9569d157c931d5497 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 31 Oct 2020 16:12:35 -0500 Subject: [PATCH 061/443] Cutter enable inline at full power Co-Authored-By: Luu Lac <45380455+shitcreek@users.noreply.github.com> --- Marlin/src/feature/spindle_laser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 15ff661c73e6..e8db3aa6087b 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -235,7 +235,7 @@ class SpindleLaser { // Inline modes of all other functions; all enable planner inline power control static inline void set_inline_enabled(const bool enable) { if (enable) - inline_power(cpwr_to_upwr(SPEED_POWER_STARTUP)); + inline_power(255); else { isReady = false; unitPower = menuPower = 0; From 24c525900500b164b5165af127c6f39accf69c3a Mon Sep 17 00:00:00 2001 From: Julien Lirochon Date: Sat, 31 Oct 2020 19:45:10 +0100 Subject: [PATCH 062/443] Fix SpindleLaser::cpwr_to_pct() maths (#19970) --- Marlin/src/feature/spindle_laser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index e8db3aa6087b..9d21c96fb929 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -46,14 +46,14 @@ class SpindleLaser { public: static constexpr float - min_pct = round(TERN(CUTTER_POWER_RELATIVE, 0, (100 * float(SPEED_POWER_MIN) / TERN(SPINDLE_FEATURE, float(SPEED_POWER_MAX), 100)))), - max_pct = round(TERN(SPINDLE_FEATURE, 100, float(SPEED_POWER_MAX))); + 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); static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); } // cpower = configured values (ie SPEED_POWER_MAX) static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { // configured value to pct - return unitPower ? round(100 * (cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0; + return unitPower ? round(100.0f * (cpwr - (SPEED_POWER_FLOOR)) / (SPEED_POWER_MAX - (SPEED_POWER_FLOOR))) : 0; } // Convert a configured value (cpower)(ie SPEED_POWER_STARTUP) to unit power (upwr, upower), From 368a581de94c1dfc249a841db76aeb998cbcc977 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 31 Oct 2020 16:28:33 -0500 Subject: [PATCH 063/443] Cutter power cleanup --- Marlin/src/feature/spindle_laser.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 9d21c96fb929..50e92fe663a1 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -39,24 +39,27 @@ #ifndef SPEED_POWER_INTERCEPT #define SPEED_POWER_INTERCEPT 0 #endif -#define SPEED_POWER_FLOOR TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0) // #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1)) class SpindleLaser { public: 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))), + 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); static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); } - // cpower = configured values (ie SPEED_POWER_MAX) - static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { // configured value to pct - return unitPower ? round(100.0f * (cpwr - (SPEED_POWER_FLOOR)) / (SPEED_POWER_MAX - (SPEED_POWER_FLOOR))) : 0; + // cpower = configured values (e.g., SPEED_POWER_MAX) + + // Convert configured power range to a percentage + static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { + constexpr cutter_cpower_t power_floor = TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0), + power_range = SPEED_POWER_MAX - power_floor; + return unitPower ? round(100.0f * (cpwr - power_floor) / power_range) : 0; } - // Convert a configured value (cpower)(ie SPEED_POWER_STARTUP) to unit power (upwr, upower), + // Convert a cpower (e.g., SPEED_POWER_STARTUP) to unit power (upwr, upower), // which can be PWM, Percent, or RPM (rel/abs). static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power const cutter_power_t upwr = ( From da60dcbf2ef50f41aa1afca24a44da30b0101150 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 31 Oct 2020 21:54:31 +0000 Subject: [PATCH 064/443] Fix Chiron probe low point (#19962) --- Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h index f5000611a7d2..af030df580ad 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h @@ -54,7 +54,7 @@ #define MAX_PATH_LEN 16 * MAX_FOLDER_DEPTH // Maximum number of characters in a SD file path #define AC_HEATER_FAULT_VALIDATION_TIME 5 // number of 1/2 second loops before signalling a heater fault -#define AC_LOWEST_MESHPOINT_VAL -7.00 // The lowest value you can set for a single mesh point offset +#define AC_LOWEST_MESHPOINT_VAL Z_PROBE_LOW_POINT // The lowest value you can set for a single mesh point offset // TFT panel commands #define AC_msg_sd_card_inserted PSTR("J00") From 76f4dd34e0ea87dc1cb403a4d7880c82ecc6fe21 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 31 Oct 2020 19:14:10 -0300 Subject: [PATCH 065/443] Put PIO "debug" build in the corner (#19975) --- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 3e75434ee78c..ee2afb1d26ee 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -10,3 +10,13 @@ #"-Wno-maybe-uninitialized", #"-Wno-sign-compare" ]) + +# Useful for JTAG debugging +# +# It will separe release and debug build folders. +# It useful when we need keep two live versions: one debug, for debugging, +# other release, for flashing. +# Without this, PIO will recompile everything twice for any small change. +# +if env.GetBuildType() == "debug": + env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' From cd89fa141b45dd84644543321994b9b83f159ec4 Mon Sep 17 00:00:00 2001 From: Alexander Semion Date: Sun, 1 Nov 2020 01:42:05 +0300 Subject: [PATCH 066/443] Add SPINDLE_SERVO option (#19971) --- Marlin/Configuration_adv.h | 7 +++++++ Marlin/src/feature/spindle_laser.cpp | 12 +++++++++++- Marlin/src/feature/spindle_laser.h | 5 ++++- Marlin/src/gcode/control/M3-M5.cpp | 8 +++++++- Marlin/src/inc/Conditionals_adv.h | 6 +++++- Marlin/src/inc/SanityCheck.h | 8 ++++---- 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 951aab7804a5..b39e9e17226c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2943,11 +2943,18 @@ #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC) + //#define SPINDLE_SERVO // A servo converting an angle to spindle power + #ifdef SPINDLE_SERVO + #define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control + #define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle + #endif + /** * Speed / Power can be set ('M3 S') and displayed in terms of: * - PWM255 (S0 - S255) * - PERCENT (S0 - S100) * - RPM (S0 - S50000) Best for use with a spindle + * - SERVO (S0 - S180) */ #define CUTTER_POWER_UNIT PWM255 diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index bc387a93348d..3b28b61b4944 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -30,6 +30,10 @@ #include "spindle_laser.h" +#if ENABLED(SPINDLE_SERVO) + #include "../module/servo.h" +#endif + SpindleLaser cutter; uint8_t SpindleLaser::power; bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR @@ -45,7 +49,11 @@ cutter_power_t SpindleLaser::menuPower, // Power s // Init the cutter to a safe OFF state // void SpindleLaser::init() { - OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off + #if ENABLED(SPINDLE_SERVO) + MOVE_SERVO(SPINDLE_SERVO_NR, SPINDLE_SERVO_MIN); + #else + OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off + #endif #if ENABLED(SPINDLE_CHANGE_DIR) OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3) #endif @@ -97,6 +105,8 @@ void SpindleLaser::apply_power(const uint8_t opwr) { ocr_off(); isReady = false; } + #elif ENABLED(SPINDLE_SERVO) + MOVE_SERVO(SPINDLE_SERVO_NR, power); #else WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE); isReady = true; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 50e92fe663a1..74d06634a0ba 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -35,6 +35,7 @@ #endif #define PCT_TO_PWM(X) ((X) * 255 / 100) +#define PCT_TO_SERVO(X) ((X) * 180 / 100) #ifndef SPEED_POWER_INTERCEPT #define SPEED_POWER_INTERCEPT 0 @@ -60,7 +61,7 @@ class SpindleLaser { } // Convert a cpower (e.g., SPEED_POWER_STARTUP) to unit power (upwr, upower), - // which can be PWM, Percent, or RPM (rel/abs). + // which can be PWM, Percent, Servo angle, or RPM (rel/abs). static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power const cutter_power_t upwr = ( #if ENABLED(SPINDLE_FEATURE) @@ -69,6 +70,8 @@ class SpindleLaser { cpwr // to RPM #elif CUTTER_UNIT_IS(PERCENT) // to PCT cpwr_to_pct(cpwr) + #elif CUTTER_UNIT_IS(SERVO) // to SERVO angle + PCT_TO_SERVO(cpwr_to_pct(cpwr)) #else // to PWM PCT_TO_PWM(cpwr_to_pct(cpwr)) #endif diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 1326c30669a2..6f2409f69f23 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -69,9 +69,13 @@ void GcodeSuite::M3_M4(const bool is_M4) { auto get_s_power = [] { if (parser.seenval('S')) { const float spwr = parser.value_float(); - cutter.unitPower = TERN(SPINDLE_LASER_PWM, + #if ENABLED(SPINDLE_SERVO) + cutter.unitPower = spwr; + #else + cutter.unitPower = TERN(SPINDLE_LASER_PWM, cutter.power_to_range(cutter_power_t(round(spwr))), spwr > 0 ? 255 : 0); + #endif } else cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP); @@ -108,6 +112,8 @@ void GcodeSuite::M3_M4(const bool is_M4) { } else cutter.set_power(cutter.upower_to_ocr(get_s_power())); + #elif ENABLED(SPINDLE_SERVO) + cutter.set_power(get_s_power()); #else cutter.set_enabled(true); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 05935be5491e..2a898d608439 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -33,7 +33,7 @@ // Determine NUM_SERVOS if none was supplied #ifndef NUM_SERVOS #define NUM_SERVOS 0 - #if ANY(CHAMBER_VENT, HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) + #if ANY(HAS_Z_SERVO_PROBE, CHAMBER_VENT, SWITCHING_TOOLHEAD, SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SPINDLE_SERVO) #if NUM_SERVOS <= Z_PROBE_SERVO_NR #undef NUM_SERVOS #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1) @@ -62,6 +62,10 @@ #undef NUM_SERVOS #define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1) #endif + #if NUM_SERVOS <= SPINDLE_SERVO_NR + #undef NUM_SERVOS + #define NUM_SERVOS (SPINDLE_SERVO_NR + 1) + #endif #endif #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 657e055241cc..cadf84abd1b0 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3007,8 +3007,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if HAS_CUTTER #ifndef CUTTER_POWER_UNIT #error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h." - #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) - #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, or RPM. Please update your Configuration_adv.h." + #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO) + #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO. Please update your Configuration_adv.h." #endif #if ENABLED(LASER_POWER_INLINE) @@ -3047,8 +3047,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN) #if BOTH(SPINDLE_FEATURE, LASER_FEATURE) #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE." - #elif !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN." + #elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO) + #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power." #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR) #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR." #elif ENABLED(SPINDLE_LASER_PWM) From c05beb74a935c4147bdd37409d80ee8aac32d01c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 1 Nov 2020 00:10:34 +0000 Subject: [PATCH 067/443] [cron] Bump distribution date (2020-11-01) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index fe61720265b9..66e02dcacfe8 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-31" + #define STRING_DISTRIBUTION_DATE "2020-11-01" #endif /** From 4a39c8cd53eb1509e5b39d45f18220d3ae0d3410 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 1 Nov 2020 01:39:30 -0700 Subject: [PATCH 068/443] Get STM32 clock rates from framework (#19978) Co-authored-by: Scott Lahteine --- Marlin/src/HAL/STM32/timers.cpp | 14 +++++++++----- Marlin/src/HAL/STM32/timers.h | 3 ++- Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 1 - 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index b708c4bdab5b..442aa74d1c37 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -68,26 +68,23 @@ #endif #ifdef STM32F0xx - #define MCU_TIMER_RATE (F_CPU) // Frequency of timer peripherals #define MCU_STEP_TIMER 16 #define MCU_TEMP_TIMER 17 #elif defined(STM32F1xx) - #define MCU_TIMER_RATE (F_CPU) #define MCU_STEP_TIMER 4 #define MCU_TEMP_TIMER 2 #elif defined(STM32F401xC) || defined(STM32F401xE) - #define MCU_TIMER_RATE (F_CPU / 2) #define MCU_STEP_TIMER 9 #define MCU_TEMP_TIMER 10 #elif defined(STM32F4xx) || defined(STM32F7xx) - #define MCU_TIMER_RATE (F_CPU / 2) #define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8 #define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. #endif #ifndef HAL_TIMER_RATE - #define HAL_TIMER_RATE MCU_TIMER_RATE + #define HAL_TIMER_RATE GetStepperTimerClkFreq() #endif + #ifndef STEP_TIMER #define STEP_TIMER MCU_STEP_TIMER #endif @@ -115,6 +112,13 @@ HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { nullptr }; // Public functions // ------------------------ +uint32_t GetStepperTimerClkFreq() { + // Timer input clocks vary between devices, and in some cases between timers on the same device. + // Retrieve at runtime to ensure device compatibility. Cache result to avoid repeated overhead. + static uint32_t clkfreq = timer_instance[STEP_TIMER_NUM]->getTimerClkFreq(); + return clkfreq; +} + // frequency is in Hertz void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { if (!HAL_timer_initialized(timer_num)) { diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index 5515219ead00..de762794eee6 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -57,7 +57,8 @@ // TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp #define STEPPER_TIMER_RATE 2000000 // 2 Mhz -#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE)) +extern uint32_t GetStepperTimerClkFreq(); +#define STEPPER_TIMER_PRESCALE (GetStepperTimerClkFreq() / (STEPPER_TIMER_RATE)) #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs #define PULSE_TIMER_RATE STEPPER_TIMER_RATE diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 9a6a16516cac..eee0094ea894 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -47,7 +47,6 @@ #define STEP_TIMER 10 #define TEMP_TIMER 14 -#define HAL_TIMER_RATE F_CPU // // Limit Switches From 22bf2b49c64ad1e767a9fa9249c40e7ca33f032d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 1 Nov 2020 04:40:59 -0600 Subject: [PATCH 069/443] Clean up SPI and ST7920 defines (#19956) --- Marlin/src/HAL/STM32F1/spi_pins.h | 6 +-- .../dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp | 32 +++++++++++++++ .../lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h | 41 +------------------ Marlin/src/pins/pins_postprocess.h | 3 ++ .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 3 +- .../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 1 - Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 2 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 2 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 2 +- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 3 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 7 +++- .../src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 27 ++++++------ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 3 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 4 +- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 2 +- Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h | 2 - 21 files changed, 68 insertions(+), 82 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/spi_pins.h b/Marlin/src/HAL/STM32F1/spi_pins.h index 8f2b324f6457..59ac446410da 100644 --- a/Marlin/src/HAL/STM32F1/spi_pins.h +++ b/Marlin/src/HAL/STM32F1/spi_pins.h @@ -49,10 +49,6 @@ #undef SDSS #define SDSS SS_PIN -#if ENABLED(ENABLE_SPI3) - #define SPI_DEVICE 3 -#elif ENABLED(ENABLE_SPI2) - #define SPI_DEVICE 2 -#else +#ifndef SPI_DEVICE #define SPI_DEVICE 1 #endif diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index e6bd80c2c2fd..8542424d7efd 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -33,6 +33,38 @@ #include "ultralcd_st7920_u8glib_rrd_AVR.h" +#if F_CPU >= 20000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(50) +#elif MB(3DRAG, K8200, K8400) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(188) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(250) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(RAMBO) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(BQ_ZUM_MEGA_3D) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(189) +#elif defined(ARDUINO_ARCH_STM32) + #define CPU_ST7920_DELAY_1 DELAY_NS(300) + #define CPU_ST7920_DELAY_2 DELAY_NS(40) + #define CPU_ST7920_DELAY_3 DELAY_NS(340) +#elif F_CPU == 16000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(63) +#else + #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" +#endif + #ifndef ST7920_DELAY_1 #ifdef BOARD_ST7920_DELAY_1 #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h index 70be70eab79a..e8a48299cb19 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h @@ -37,43 +37,6 @@ #include -// If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) - -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG, K8200, K8400) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif defined(ARDUINO_ARCH_STM32) - #define CPU_ST7920_DELAY_1 DELAY_NS(300) - #define CPU_ST7920_DELAY_2 DELAY_NS(40) - #define CPU_ST7920_DELAY_3 DELAY_NS(340) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" -#endif - void ST7920_SWSPI_SND_8BIT(uint8_t val); #if DOGM_SPI_DELAY_US > 0 @@ -82,8 +45,8 @@ void ST7920_SWSPI_SND_8BIT(uint8_t val); #define U8G_DELAY() DELAY_US(10) #endif -#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } -#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } +#define ST7920_CS() { WRITE(ST7920_CS_PIN, HIGH); U8G_DELAY(); } +#define ST7920_NCS() { WRITE(ST7920_CS_PIN, LOW); } #define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } #define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); } #define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4U)); U8G_DELAY(); } diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index fdf9f095cbcc..788f2093c117 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -871,6 +871,9 @@ #undef ST7920_DELAY_1 #undef ST7920_DELAY_2 #undef ST7920_DELAY_3 + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 #endif #undef HAS_FREE_AUX2_PINS 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 ce43e677e285..16c247cc8770 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 @@ -210,14 +210,13 @@ #endif #if SD_CONNECTION_IS(LCD) - #define ENABLE_SPI3 + #define SPI_DEVICE 3 #define SD_DETECT_PIN PB9 #define SCK_PIN PB3 #define MISO_PIN PB4 #define MOSI_PIN PB5 #define SS_PIN PA15 #elif SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI1 #define SD_DETECT_PIN PA3 #define SCK_PIN PA5 #define MISO_PIN PA6 diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 66930a2ea5a6..0e94249a993c 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -165,7 +165,6 @@ // SD-NAND // #if SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI1 #define SD_DETECT_PIN -1 #define SCK_PIN PA5 #define MISO_PIN PA6 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 6d87e6b14fdc..d89cfc6da83d 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -185,7 +185,7 @@ // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available // Needs to use SPI2 -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #define SCK_PIN PB13 #define MISO_PIN PB14 #define MOSI_PIN PB15 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index bdce2358419e..262a9a241b8f 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -200,7 +200,7 @@ // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available // so SPI2 is required. -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #define SCK_PIN PB13 #define MISO_PIN PB14 #define MOSI_PIN PB15 diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 7f3ab036540a..bf3389492a88 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -56,7 +56,7 @@ // SPI // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // SPI Flash #define HAS_SPI_FLASH 1 diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 55a809efab91..4f555c373f0c 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -132,7 +132,7 @@ // // LCD / Controller // -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #define SS_PIN PB12 #define SCK_PIN PB13 #define MISO_PIN PB14 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 63c0da476dfc..e6c8098f2a25 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -166,7 +166,7 @@ #endif // SPI1(PA7) & SPI3(PB5) not available -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #if ENABLED(SDIO_SUPPORT) #define SCK_PIN PB13 // SPI2 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 4998c92dc5be..2b7417c29ffb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -55,8 +55,7 @@ // // Note: MKS Robin board is using SPI2 interface. // -//#define SPI_MODULE 2 -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // // Limit Switches 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 af2908545bd9..ffcdc3cfdf03 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -167,7 +167,7 @@ // // SD Card // -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #define SD_DETECT_PIN PC10 #define SCK_PIN PB13 #define MISO_PIN PB14 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index ffd21917dd66..ab5350e4de28 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -34,7 +34,6 @@ //#define DISABLE_DEBUG #define DISABLE_JTAG -#define ENABLE_SPI2 // // Limit Switches @@ -135,8 +134,12 @@ // // SD Card // -#define ENABLE_SPI2 #define SD_DETECT_PIN PC10 + +// +// SPI +// +#define SPI_DEVICE 2 #define SCK_PIN PB13 #define MISO_PIN P1B4 #define MOSI_PIN P1B5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 493efc5c7b81..4c1299fe02ab 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -38,7 +38,6 @@ //#define DISABLE_DEBUG #define DISABLE_JTAG -#define ENABLE_SPI2 // // Servos @@ -87,9 +86,9 @@ // // Temperature Sensors // -#define TEMP_BED_PIN PA1 //TB -#define TEMP_0_PIN PA0 //TH1 -#define TEMP_1_PIN PA2 //TH2 +#define TEMP_BED_PIN PA1 // TB +#define TEMP_0_PIN PA0 // TH1 +#define TEMP_1_PIN PA2 // TH2 #define FIL_RUNOUT_PIN PB10 // MT_DET @@ -132,24 +131,22 @@ #endif // !MKS_MINI_12864 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif // HAS_WIRED_LCD // // SD Card // -#define ENABLE_SPI2 #define SD_DETECT_PIN PC10 + +// +// SPI +// +#define SPI_DEVICE 2 #define SCK_PIN PB13 #define MISO_PIN PB14 #define MOSI_PIN PB15 #define SS_PIN PA15 - -#ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 14f9c3b6260b..8c63f7973207 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -48,7 +48,7 @@ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB #endif -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // // Limit Switches diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 7f2ae61aae37..ff381b3753bc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -48,7 +48,7 @@ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB #endif -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // // Limit Switches diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index fbd12fb59ca1..0630c0f3cb8d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -55,8 +55,7 @@ // // Note: MKS Robin board is using SPI2 interface. // -//#define SPI_MODULE 2 -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // // Limit Switches diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index db6bc9320506..639a8f05791d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -41,8 +41,7 @@ // // Note: MKS Robin board is using SPI2 interface. // -//#define SPI_MODULE 2 -#define ENABLE_SPI2 +#define SPI_DEVICE 2 // // Servos @@ -191,7 +190,6 @@ #endif #if SD_CONNECTION_IS(LCD) - #define ENABLE_SPI2 #define SD_DETECT_PIN PG3 #define SCK_PIN PB13 #define MISO_PIN PB14 diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index bfd1f2abdcbd..818dbb5f7ebb 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -173,7 +173,7 @@ #endif // SPI1(PA7) & SPI3(PB5) not available -#define ENABLE_SPI2 +#define SPI_DEVICE 2 #if ENABLED(SDIO_SUPPORT) #define SCK_PIN PB13 // SPI2 ok diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h index ab277d43722a..4dce7b79c019 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h @@ -46,8 +46,6 @@ #define FLASH_EEPROM_LEVELING #endif -#define ENABLE_SPI1 - #include "pins_RUMBA32_common.h" #if HAS_TMC_UART From 12e8861a1cb838f53cc8f71e3c91f83127eebd82 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 1 Nov 2020 07:42:53 -0300 Subject: [PATCH 070/443] Reset calibration screen touch timer on click (#19951) --- Marlin/src/lcd/tft/touch.cpp | 4 ++-- Marlin/src/lcd/tft/touch.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 93f8f64a2ddf..d54506442dec 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -61,7 +61,7 @@ void Touch::init() { enable(); } -void Touch::add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, int32_t data) { +void Touch::add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, intptr_t data) { if (controls_count == MAX_CONTROLS) return; controls[controls_count].type = type; @@ -306,7 +306,7 @@ bool MarlinUI::touch_pressed() { return touch.is_clicked(); } -void add_control(uint16_t x, uint16_t y, TouchControlType control_type, int32_t data, MarlinImage image, bool is_enabled, uint16_t color_enabled, uint16_t color_disabled) { +void add_control(uint16_t x, uint16_t y, TouchControlType control_type, intptr_t data, MarlinImage image, bool is_enabled, uint16_t color_enabled, uint16_t color_disabled) { uint16_t width = Images[image].width; uint16_t height = Images[image].height; tft.canvas(x, y, width, height); diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 17aa5bdd97b9..4ba3e22c8e22 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -85,9 +85,9 @@ enum TouchControlType : uint16_t { typedef void (*screenFunc_t)(); -void add_control(uint16_t x, uint16_t y, TouchControlType control_type, int32_t data, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED); +void add_control(uint16_t x, uint16_t y, TouchControlType control_type, intptr_t data, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED); inline void add_control(uint16_t x, uint16_t y, TouchControlType control_type, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, control_type, 0, image, is_enabled, color_enabled, color_disabled); } -inline void add_control(uint16_t x, uint16_t y, screenFunc_t screen, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, MENU_SCREEN, (int32_t)screen, image, is_enabled, color_enabled, color_disabled); } +inline void add_control(uint16_t x, uint16_t y, screenFunc_t screen, MarlinImage image, bool is_enabled = true, uint16_t color_enabled = COLOR_CONTROL_ENABLED, uint16_t color_disabled = COLOR_CONTROL_DISABLED) { add_control(x, y, MENU_SCREEN, (intptr_t)screen, image, is_enabled, color_enabled, color_disabled); } typedef struct __attribute__((__packed__)) { TouchControlType type; @@ -95,7 +95,7 @@ typedef struct __attribute__((__packed__)) { uint16_t y; uint16_t width; uint16_t height; - int32_t data; + intptr_t data; } touch_control_t; typedef struct __attribute__((__packed__)) { @@ -158,7 +158,7 @@ class Touch { public: static void init(); - static void reset() { controls_count = 0; touch_time = -1; current_control = NULL; } + static void reset() { controls_count = 0; touch_time = 0; current_control = NULL; } static void clear() { controls_count = 0; } static void idle(); static bool is_clicked() { @@ -171,7 +171,7 @@ class Touch { static void disable() { enabled = false; } static void enable() { enabled = true; } - static void add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, int32_t data = 0); + static void add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, intptr_t data = 0); static touch_calibration_t calibration; static void calibration_reset() { calibration = {TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION}; } From 83097657d5fffc0051778a72cf39e7ba3a23212b Mon Sep 17 00:00:00 2001 From: "Alexander D. Kanevskiy" Date: Mon, 2 Nov 2020 01:44:46 +0200 Subject: [PATCH 071/443] Y-center GLCD status logo, reorganize (#19954) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/dogm/dogm_Statusscreen.h | 1236 +---------------------- Marlin/src/lcd/dogm/status/bed.h | 110 ++ Marlin/src/lcd/dogm/status/chamber.h | 89 ++ Marlin/src/lcd/dogm/status/combined.h | 236 +++++ Marlin/src/lcd/dogm/status/cutter.h | 123 +++ Marlin/src/lcd/dogm/status/fan.h | 443 ++++++++ Marlin/src/lcd/dogm/status/hotend.h | 336 ++++++ 7 files changed, 1365 insertions(+), 1208 deletions(-) create mode 100644 Marlin/src/lcd/dogm/status/bed.h create mode 100644 Marlin/src/lcd/dogm/status/chamber.h create mode 100644 Marlin/src/lcd/dogm/status/combined.h create mode 100644 Marlin/src/lcd/dogm/status/cutter.h create mode 100644 Marlin/src/lcd/dogm/status/fan.h create mode 100644 Marlin/src/lcd/dogm/status/hotend.h diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index e76b7da59834..15578e21d92d 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -57,805 +57,43 @@ // Default Status Screen Heater or Hotends bitmaps // #if !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH - #if ENABLED(STATUS_COMBINE_HEATERS) - - #undef STATUS_HOTEND_ANIM - #undef STATUS_BED_ANIM - #define STATUS_HEATERS_XSPACE 24 - - // - // Status Screen Combined Heater bitmaps - // - #if HAS_HEATED_BED && HOTENDS <= 4 - - #if HOTENDS == 0 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #elif HOTENDS == 1 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #elif HOTENDS == 2 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #elif HOTENDS == 3 - - #define STATUS_HEATERS_WIDTH 96 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #else // HOTENDS > 3 - - #define STATUS_HEATERS_WIDTH 120 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 - }; - - #endif // HOTENDS - - #define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10) - - #else // !HAS_HEATED_BED || HOTENDS > 3 - - #if HOTENDS == 0 - - #define STATUS_HEATERS_WIDTH 0 - - #elif HOTENDS == 1 - - #define STATUS_HEATERS_WIDTH 12 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00011111,B11100000, - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #elif HOTENDS == 2 - - #define STATUS_HEATERS_WIDTH 36 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000, - B00111110,B11110000,B00000000,B00111011,B11110000, - B00111110,B11110000,B00000000,B00111000,B01110000, - B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #elif HOTENDS == 3 - - #define STATUS_HEATERS_WIDTH 60 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #elif HOTENDS == 4 - - #define STATUS_HEATERS_WIDTH 84 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #else // HOTENDS > 4 - - #define STATUS_HEATERS_WIDTH 108 - - const unsigned char status_heaters_bmp[] PROGMEM = { - B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, - B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, - B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, - B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, - B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 - }; - - #endif // HOTENDS - - #endif // !HAS_HEATED_BED || HOTENDS > 3 - - #else // !STATUS_COMBINE_HEATERS - - // - // Status Screen Hotends bitmaps - // + #include "status/combined.h" + #else #if HAS_HOTEND - - #define STATUS_HOTEND1_WIDTH 16 - - #define MAX_HOTEND_BITMAPS 5 - #if HOTENDS > MAX_HOTEND_BITMAPS - #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS - #else - #define STATUS_HOTEND_BITMAPS HOTENDS - #endif - - #if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS) - - const unsigned char status_hotend_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00011111,B11100000, - B00011111,B11100000, - B00111111,B11110000, - B00111111,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100000,B00010000, - B00100000,B00010000, - B00010000,B00100000, - B00010000,B00100000, - B00100000,B00010000, - B00100000,B00010000, - B00110000,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #endif - - #elif HOTENDS >= 2 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111110,B11110000, - B00111100,B11110000, - B00011010,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111110,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend1_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100001,B00010000, - B00100011,B00010000, - B00010101,B00100000, - B00010001,B00100000, - B00100001,B00010000, - B00100001,B00010000, - B00110001,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011110,B11100000, - B00111101,B11110000, - B00111011,B11110000, - B00111000,B01110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend2_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010001,B00100000, - B00100010,B00010000, - B00100100,B00010000, - B00110111,B10110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111110,B11110000, - B00111100,B11110000, - B00111010,B11110000, - B00011110,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011110,B11100000, - B00011101,B11100000, - B00111011,B11110000, - B00111000,B01110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #if STATUS_HOTEND_BITMAPS >= 3 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend3_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011100,B11100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend3_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010011,B00100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend3_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011100,B11100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #if STATUS_HOTEND_BITMAPS >= 4 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend4_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011011,B01100000, - B00111000,B00110000, - B00111111,B01110000, - B00111111,B01110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend4_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100100,B10010000, - B00100100,B10010000, - B00010100,B10100000, - B00010100,B10100000, - B00100111,B11010000, - B00100000,B10010000, - B00110000,B10110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend4_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111011,B01110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011000,B00100000, - B00111111,B01110000, - B00111111,B01110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #if STATUS_HOTEND_BITMAPS >= 5 - - #ifdef STATUS_HOTEND_ANIM - - const unsigned char status_hotend5_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111000,B01110000, - B00111011,B11110000, - B00011000,B11100000, - B00011111,B01100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend5_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100111,B10010000, - B00100100,B00010000, - B00010111,B00100000, - B00010000,B10100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; - - #else - - const unsigned char status_hotend5_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111000,B01110000, - B00111011,B11110000, - B00111000,B11110000, - B00011111,B01100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif - - #endif - - #endif - + #include "status/hotend.h" #else #define STATUS_HEATERS_HEIGHT 20 #endif - #endif +#endif -#endif // !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH - -// LASER / SPINDLE +// +// Laser / Spindle +// #if !STATUS_CUTTER_WIDTH && HAS_CUTTER - #define STATUS_CUTTER_WIDTH 24 - #define STATUS_CUTTER_X 80 - #if ENABLED(LASER_FEATURE) - #ifdef STATUS_CUTTER_ANIM - const unsigned char status_cutter_on_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B11000011,B00000000, - B00000001,B10011001,B10000000, - B00000011,B00100100,B11000000, - B00000000,B01000010,B00000000, - B00000000,B01000010,B00000000, - B00000011,B00100100,B11000000, - B00000001,B10011001,B10000000, - B00000000,B11000011,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00000000,B00000000, - B00000001,B00000000,B10000000, - B00000011,B00000000,B11000000, - B00000000,B00011000,B00000000, - B00000000,B00011000,B00000000, - B00000011,B00000000,B11000000, - B00000001,B00000000,B10000000, - B00000000,B00000000,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - #else - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000000,B00100100,B00000000, - B00000000,B01100110,B00000000, - B00000000,B11000011,B00000000, - B00000001,B10000001,B10000000, - B00000011,B00000000,B11000000, - B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000, - B00000011,B00000000,B11000000, - B00000001,B10000001,B10000000, - B00000000,B11000011,B00000000, - B00000000,B01100110,B00000000, - B00000000,B00100100,B00000000 - }; - #endif - #else - #ifdef STATUS_CUTTER_ANIM - const unsigned char status_cutter_on_bmp[] PROGMEM = { - B00000001,B11111110,B10000000, - B00000000,B11000000,B00000000, - B00000001,B10000000,B10000000, - B00000001,B00000000,B10000000, - B00000001,B11111100,B10000000, - B00000000,B11100000,B00000000, - B00000001,B11000000,B10000000, - B00000000,B10000001,B00000000, - B00000000,B01111010,B00000000, - B00000000,B00110100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000001,B11111110,B10000000, - B00000000,B11000000,B00000000, - B00000001,B10000000,B10000000, - B00000001,B00000000,B10000000, - B00000001,B11111100,B10000000, - B00000000,B11100000,B00000000, - B00000001,B11000000,B10000000, - B00000000,B10000001,B00000000, - B00000000,B01111010,B00000000, - B00000000,B00110100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - #else - const unsigned char status_cutter_bmp[] PROGMEM = { - B00000001,B11000010,B10000000, - B00000001,B00011100,B10000000, - B00000000,B11100001,B00000000, - B00000001,B00001110,B10000000, - B00000001,B01110000,B10000000, - B00000000,B10000111,B10000000, - B00000001,B00111111,B10000000, - B00000000,B11111111,B00000000, - B00000000,B01111110,B00000000, - B00000000,B00111100,B00000000, - B00000000,B00011000,B00000000, - B00000000,B00000000,B00000000 - }; - #endif - #endif -#endif // LASER / SPINDLE + #include "status/cutter.h" +#endif +#ifndef STATUS_CUTTER_WIDTH + #define STATUS_CUTTER_WIDTH 0 +#endif // -// Default Status Screen Bed bitmaps +// Bed // #if !STATUS_BED_WIDTH && HAS_HEATED_BED && DISABLED(STATUS_COMBINE_HEATERS) - - #if ENABLED(STATUS_ALT_BED_BITMAP) - - #define STATUS_BED_ANIM - #define STATUS_BED_WIDTH 24 - #ifndef STATUS_BED_X - #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #endif - #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) - - const unsigned char status_bed_bmp[] PROGMEM = { - B11111111,B11111111,B11000000, - B01000000,B00000000,B00100000, - B00100000,B00000000,B00010000, - B00010000,B00000000,B00001000, - B00001000,B00000000,B00000100, - B00000100,B00000000,B00000010, - B00000011,B11111111,B11111111 - }; - - const unsigned char status_bed_on_bmp[] PROGMEM = { - B00000010,B00100010,B00000000, - B00000100,B01000100,B00000000, - B00000100,B01000100,B00000000, - B00000010,B00100010,B00000000, - B00000001,B00010001,B00000000, - B11111111,B11111111,B11000000, - B01000000,B10001000,B10100000, - B00100001,B00010001,B00010000, - B00010010,B00100010,B00001000, - B00001000,B00000000,B00000100, - B00000100,B00000000,B00000010, - B00000011,B11111111,B11111111 - }; - - #else - - #define STATUS_BED_WIDTH 21 - #ifndef STATUS_BED_X - #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #endif - - #ifdef STATUS_BED_ANIM - - const unsigned char status_bed_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - const unsigned char status_bed_on_bmp[] PROGMEM = { - B00000100,B00010000,B01000000, - B00000010,B00001000,B00100000, - B00000010,B00001000,B00100000, - B00000100,B00010000,B01000000, - B00001000,B00100000,B10000000, - B00010000,B01000001,B00000000, - B00010000,B01000001,B00000000, - B00001000,B00100000,B10000000, - B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - #else - - const unsigned char status_bed_bmp[] PROGMEM = { - B00000100,B00010000,B01000000, - B00000010,B00001000,B00100000, - B00000010,B00001000,B00100000, - B00000100,B00010000,B01000000, - B00001000,B00100000,B10000000, - B00010000,B01000001,B00000000, - B00010000,B01000001,B00000000, - B00001000,B00100000,B10000000, - B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - #endif - - #endif + #include "status/bed.h" #endif - #ifndef STATUS_BED_WIDTH #define STATUS_BED_WIDTH 0 #endif +// +// Chamber +// #if !STATUS_CHAMBER_WIDTH && HAS_TEMP_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED)) - #define STATUS_CHAMBER_WIDTH 21 - #if STATUS_HEATERS_WIDTH - #if ENABLED(STATUS_COMBINE_HEATERS) - #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8) - #elif HAS_FAN0 && HAS_HEATED_BED && HOTENDS <= 2 - #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_HEATERS_BYTEWIDTH - STATUS_CHAMBER_BYTEWIDTH) * 8) - #elif HAS_FAN0 && !HAS_HEATED_BED - #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) - #else - #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH) * 8) - #endif - #endif - - #ifdef STATUS_CHAMBER_ANIM - - const unsigned char status_chamber_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - const unsigned char status_chamber_on_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00010000,B00000000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B01000010,B00001000, - B00010000,B01000010,B00001000, - B00010000,B10000100,B00001000, - B00010001,B00001000,B00001000, - B00010001,B00001000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B00000000,B00001000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - #else - - const unsigned char status_chamber_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00010000,B00000000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B01000010,B00001000, - B00010000,B01000010,B00001000, - B00010000,B10000100,B00001000, - B00010001,B00001000,B00001000, - B00010001,B00001000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B00000000,B00001000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 - }; - - #endif + #include "status/chamber.h" #endif - #ifndef STATUS_CHAMBER_WIDTH #define STATUS_CHAMBER_WIDTH 0 #endif @@ -881,427 +119,7 @@ // Provide default Fan Bitmaps // #if !STATUS_FAN_WIDTH && STATUS_FAN_FRAMES > 0 - - // Provide a fan animation if none exists - - #if STATUS_FAN_FRAMES <= 2 - - #define STATUS_FAN_Y 2 - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111110,B00000000, - B00000110,B00000001,B10000000, - B00001000,B11111100,B01000000, - B00010000,B11111100,B00100000, - B00010000,B01111000,B00100000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00010000,B01111000,B00100000, - B00010000,B11111100,B00100000, - B00001000,B11111100,B01000000, - B00000110,B00000001,B10000000, - B00000001,B11111110,B00000000 - }; - - #if STATUS_FAN_FRAMES == 2 - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111110,B00000000, - B00000110,B00000001,B10000000, - B00001001,B10000110,B01000000, - B00010011,B10000111,B00100000, - B00010111,B10000111,B10100000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00010111,B10000111,B10100000, - B00010011,B10000111,B00100000, - B00001001,B10000110,B01000000, - B00000110,B00000001,B10000000, - B00000001,B11111110,B00000000 - }; - #endif - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000 - }; - - #if STATUS_FAN_FRAMES == 2 - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000 - }; - #endif - - #endif // !STATUS_ALT_FAN_BITMAP - - #elif STATUS_FAN_FRAMES == 3 - - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001001,B00000001,B00100000, - B00010111,B10000011,B11010000, - B00010111,B10000011,B11010000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00010111,B10000011,B11010000, - B00010111,B10000011,B11010000, - B00001001,B00000001,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00110000,B11000000, - B00001001,B11110000,B00100000, - B00010001,B11110000,B00010000, - B00010000,B11110000,B00010000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00010000,B00011110,B00010000, - B00010000,B00011111,B00010000, - B00001000,B00011111,B00100000, - B00000110,B00011000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00011000,B11000000, - B00001000,B00011111,B00100000, - B00010000,B00011111,B10010000, - B00010100,B00011111,B00010000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00010001,B11110000,B01010000, - B00010011,B11110000,B00010000, - B00001001,B11110000,B00100000, - B00000110,B00110000,B11000000, - B00000001,B11111111,B00000000 - }; - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - - #endif // !STATUS_ALT_FAN_BITMAP - - #elif STATUS_FAN_FRAMES == 4 - - #define STATUS_FAN_WIDTH 20 - - #if ENABLED(STATUS_ALT_FAN_BITMAP) - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001000,B00111111,B00100000, - B00010000,B01111110,B00010000, - B00010000,B01111100,B00010000, - B00101000,B01111100,B00001000, - B00101100,B00111000,B00001000, - B00101111,B00111001,B11001000, - B00101111,B11111111,B11101000, - B00101111,B11000111,B11101000, - B00101111,B11111111,B11101000, - B00100111,B00111001,B11101000, - B00100000,B00111000,B01101000, - B00100000,B01111100,B00101000, - B00010000,B01111100,B00010000, - B00010000,B11111100,B00010000, - B00001001,B11111000,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001000,B00001111,B00100000, - B00010100,B00011111,B11010000, - B00010110,B00011111,B10010000, - B00101111,B00011111,B00001000, - B00101111,B10011110,B00001000, - B00101111,B11111100,B00001000, - B00101111,B11011100,B00001000, - B00100111,B11101111,B11001000, - B00100000,B01110111,B11101000, - B00100000,B01111111,B11101000, - B00100000,B11110011,B11101000, - B00100001,B11110001,B11101000, - B00010011,B11110000,B11010000, - B00010111,B11110000,B01010000, - B00001001,B11100000,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B10000000,B11000000, - B00001001,B10000000,B00100000, - B00010111,B10000001,B11010000, - B00010111,B11000011,B11010000, - B00100111,B11000111,B11101000, - B00100011,B11000111,B11111000, - B00100001,B11111111,B10001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100011,B11111111,B00001000, - B00111111,B11000111,B10001000, - B00101111,B11000111,B11001000, - B00010111,B10000111,B11010000, - B00010111,B00000011,B11010000, - B00001000,B00000011,B00100000, - B00000110,B00000010,B11000000, - B00000001,B11111111,B00000000 - }; - const unsigned char status_fan3_bmp[] PROGMEM = { - B00000001,B11111111,B00000000, - B00000110,B00000000,B11000000, - B00001001,B11110000,B00100000, - B00010001,B11100000,B00010000, - B00010001,B11100000,B00010000, - B00100001,B11100001,B11101000, - B00100000,B11110011,B11101000, - B00100000,B01111111,B11101000, - B00100000,B01110111,B11101000, - B00101000,B11101110,B00101000, - B00101111,B11011100,B00001000, - B00101111,B11111100,B00001000, - B00101111,B10011110,B00001000, - B00101111,B00001111,B00001000, - B00010000,B00001111,B00010000, - B00010000,B00001111,B00010000, - B00001000,B00011111,B00100000, - B00000110,B00000000,B11000000, - B00000001,B11111111,B00000000 - }; - - #else // !STATUS_ALT_FAN_BITMAP - - const unsigned char status_fan0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111000,B00111111,B00111000, - B00110000,B01111110,B00011000, - B00110000,B01111100,B00011000, - B00101000,B01111100,B00001000, - B00101100,B00111000,B00001000, - B00101111,B00111001,B11001000, - B00101111,B11111111,B11101000, - B00101111,B11000111,B11101000, - B00101111,B11111111,B11101000, - B00100111,B00111001,B11101000, - B00100000,B00111000,B01101000, - B00100000,B01111100,B00101000, - B00110000,B01111100,B00011000, - B00110000,B11111100,B00011000, - B00111001,B11111000,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111000,B00001111,B00111000, - B00110100,B00011111,B11011000, - B00110110,B00011111,B10011000, - B00101111,B00011111,B00001000, - B00101111,B10011110,B00001000, - B00101111,B11111100,B00001000, - B00101111,B11011100,B00001000, - B00100111,B11101111,B11001000, - B00100000,B01110111,B11101000, - B00100000,B01111111,B11101000, - B00100000,B11110011,B11101000, - B00100001,B11110001,B11101000, - B00110011,B11110000,B11011000, - B00110111,B11110000,B01011000, - B00111001,B11100000,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B10000000,B11111000, - B00111001,B10000000,B00111000, - B00110111,B10000001,B11011000, - B00110111,B11000011,B11011000, - B00100111,B11000111,B11101000, - B00100011,B11000111,B11111000, - B00100001,B11111111,B10001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100000,B01101100,B00001000, - B00100011,B11111111,B00001000, - B00111111,B11000111,B10001000, - B00101111,B11000111,B11001000, - B00110111,B10000111,B11011000, - B00110111,B00000011,B11011000, - B00111000,B00000011,B00111000, - B00111110,B00000010,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_fan3_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11100000,B00011000, - B00110001,B11100000,B00011000, - B00100001,B11100001,B11101000, - B00100000,B11110011,B11101000, - B00100000,B01111111,B11101000, - B00100000,B01110111,B11101000, - B00101000,B11101110,B00101000, - B00101111,B11011100,B00001000, - B00101111,B11111100,B00001000, - B00101111,B10011110,B00001000, - B00101111,B00001111,B00001000, - B00110000,B00001111,B00011000, - B00110000,B00001111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - - #endif // !STATUS_ALT_FAN_BITMAP - - #endif + #include "status/fan.h" #else #undef STATUS_FAN_FRAMES #define STATUS_FAN_WIDTH 0 @@ -1325,7 +143,6 @@ #endif #if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) - // // Disable the logo bitmap if insufficient space // @@ -1341,7 +158,7 @@ #undef STATUS_LOGO_WIDTH #endif - #if !defined(STATUS_HEATERS_X) && ((HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)) + #if !defined(STATUS_HEATERS_X) && ((HAS_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)) #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2) #if STATUS_HOTEND1_WIDTH #if HOTENDS > 2 @@ -1353,7 +170,6 @@ #define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4) #endif #endif - #endif // @@ -1367,14 +183,18 @@ #endif #if STATUS_LOGO_WIDTH #ifndef STATUS_LOGO_X - #define STATUS_LOGO_X 0 - #endif - #ifndef STATUS_LOGO_Y - #define STATUS_LOGO_Y _MIN(0U, (20 - (STATUS_LOGO_HEIGHT)) / 2) + #ifdef STATUS_HEATERS_X + #define STATUS_LOGO_X ((STATUS_HEATERS_X - (STATUS_LOGO_WIDTH) - 1) / 2) + #else + #define STATUS_LOGO_X 0 + #endif #endif #ifndef STATUS_LOGO_HEIGHT #define STATUS_LOGO_HEIGHT (sizeof(status_logo_bmp) / (STATUS_LOGO_BYTEWIDTH)) #endif + #ifndef STATUS_LOGO_Y + #define STATUS_LOGO_Y _MAX(0L, (28L - _MIN(28L, STATUS_LOGO_HEIGHT)) / 2L) + #endif static_assert( sizeof(status_logo_bmp) == (STATUS_LOGO_BYTEWIDTH) * (STATUS_LOGO_HEIGHT), "Status logo bitmap (status_logo_bmp) dimensions don't match data." diff --git a/Marlin/src/lcd/dogm/status/bed.h b/Marlin/src/lcd/dogm/status/bed.h new file mode 100644 index 000000000000..c484a129293e --- /dev/null +++ b/Marlin/src/lcd/dogm/status/bed.h @@ -0,0 +1,110 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/bed.h - Status Screen Bed bitmaps +// + +#if ENABLED(STATUS_ALT_BED_BITMAP) + + #define STATUS_BED_ANIM + #define STATUS_BED_WIDTH 24 + #ifndef STATUS_BED_X + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) + #endif + #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) + + const unsigned char status_bed_bmp[] PROGMEM = { + B11111111,B11111111,B11000000, + B01000000,B00000000,B00100000, + B00100000,B00000000,B00010000, + B00010000,B00000000,B00001000, + B00001000,B00000000,B00000100, + B00000100,B00000000,B00000010, + B00000011,B11111111,B11111111 + }; + + const unsigned char status_bed_on_bmp[] PROGMEM = { + B00000010,B00100010,B00000000, + B00000100,B01000100,B00000000, + B00000100,B01000100,B00000000, + B00000010,B00100010,B00000000, + B00000001,B00010001,B00000000, + B11111111,B11111111,B11000000, + B01000000,B10001000,B10100000, + B00100001,B00010001,B00010000, + B00010010,B00100010,B00001000, + B00001000,B00000000,B00000100, + B00000100,B00000000,B00000010, + B00000011,B11111111,B11111111 + }; + +#else + + #define STATUS_BED_WIDTH 21 + #ifndef STATUS_BED_X + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) + #endif + + #ifdef STATUS_BED_ANIM + + const unsigned char status_bed_bmp[] PROGMEM = { + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + + const unsigned char status_bed_on_bmp[] PROGMEM = { + B00000100,B00010000,B01000000, + B00000010,B00001000,B00100000, + B00000010,B00001000,B00100000, + B00000100,B00010000,B01000000, + B00001000,B00100000,B10000000, + B00010000,B01000001,B00000000, + B00010000,B01000001,B00000000, + B00001000,B00100000,B10000000, + B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + + #else + + const unsigned char status_bed_bmp[] PROGMEM = { + B00000100,B00010000,B01000000, + B00000010,B00001000,B00100000, + B00000010,B00001000,B00100000, + B00000100,B00010000,B01000000, + B00001000,B00100000,B10000000, + B00010000,B01000001,B00000000, + B00010000,B01000001,B00000000, + B00001000,B00100000,B10000000, + B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + + #endif + +#endif diff --git a/Marlin/src/lcd/dogm/status/chamber.h b/Marlin/src/lcd/dogm/status/chamber.h new file mode 100644 index 000000000000..787a90884ae8 --- /dev/null +++ b/Marlin/src/lcd/dogm/status/chamber.h @@ -0,0 +1,89 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/chamber.h - Status Screen Chamber bitmaps +// + +#define STATUS_CHAMBER_WIDTH 21 +#if STATUS_HEATERS_WIDTH + #if ENABLED(STATUS_COMBINE_HEATERS) + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && HAS_HEATED_BED && HOTENDS <= 2 + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_HEATERS_BYTEWIDTH - STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && !HAS_HEATED_BED + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) + #else + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #endif +#endif + +#ifdef STATUS_CHAMBER_ANIM + + const unsigned char status_chamber_bmp[] PROGMEM = { + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + const unsigned char status_chamber_on_bmp[] PROGMEM = { + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + +#else + + const unsigned char status_chamber_bmp[] PROGMEM = { + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 + }; + +#endif diff --git a/Marlin/src/lcd/dogm/status/combined.h b/Marlin/src/lcd/dogm/status/combined.h new file mode 100644 index 000000000000..69aad5b00e53 --- /dev/null +++ b/Marlin/src/lcd/dogm/status/combined.h @@ -0,0 +1,236 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/combined.h - Status Screen Combined Heater bitmaps +// + +#undef STATUS_HOTEND_ANIM +#undef STATUS_BED_ANIM +#define STATUS_HEATERS_XSPACE 24 + +#if HAS_HEATED_BED && HOTENDS <= 4 + + #if HOTENDS == 0 + + #define STATUS_HEATERS_WIDTH 96 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + + #elif HOTENDS == 1 + + #define STATUS_HEATERS_WIDTH 96 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + + #elif HOTENDS == 2 + + #define STATUS_HEATERS_WIDTH 96 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + + #elif HOTENDS == 3 + + #define STATUS_HEATERS_WIDTH 96 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + + #else // HOTENDS > 3 + + #define STATUS_HEATERS_WIDTH 120 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + + #endif // HOTENDS + + #define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10) + +#else // !HAS_HEATED_BED || HOTENDS > 3 + + #if HOTENDS == 0 + + #define STATUS_HEATERS_WIDTH 0 + + #elif HOTENDS == 1 + + #define STATUS_HEATERS_WIDTH 12 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00011111,B11100000, + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #elif HOTENDS == 2 + + #define STATUS_HEATERS_WIDTH 36 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000, + B00111110,B11110000,B00000000,B00111011,B11110000, + B00111110,B11110000,B00000000,B00111000,B01110000, + B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #elif HOTENDS == 3 + + #define STATUS_HEATERS_WIDTH 60 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #elif HOTENDS == 4 + + #define STATUS_HEATERS_WIDTH 84 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #else // HOTENDS > 4 + + #define STATUS_HEATERS_WIDTH 108 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #endif // HOTENDS + +#endif // !HAS_HEATED_BED || HOTENDS > 3 diff --git a/Marlin/src/lcd/dogm/status/cutter.h b/Marlin/src/lcd/dogm/status/cutter.h new file mode 100644 index 000000000000..0e3b9dd18851 --- /dev/null +++ b/Marlin/src/lcd/dogm/status/cutter.h @@ -0,0 +1,123 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/cutter.h - Status Screen Laser / Spindle bitmaps +// + +#define STATUS_CUTTER_WIDTH 24 +#define STATUS_CUTTER_X 80 + +#if ENABLED(LASER_FEATURE) + #ifdef STATUS_CUTTER_ANIM + const unsigned char status_cutter_on_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B11000011,B00000000, + B00000001,B10011001,B10000000, + B00000011,B00100100,B11000000, + B00000000,B01000010,B00000000, + B00000000,B01000010,B00000000, + B00000011,B00100100,B11000000, + B00000001,B10011001,B10000000, + B00000000,B11000011,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00000000,B00000000, + B00000001,B00000000,B10000000, + B00000011,B00000000,B11000000, + B00000000,B00011000,B00000000, + B00000000,B00011000,B00000000, + B00000011,B00000000,B11000000, + B00000001,B00000000,B10000000, + B00000000,B00000000,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + #else + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B11000011,B00000000, + B00000001,B10000001,B10000000, + B00000011,B00000000,B11000000, + B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000, + B00000011,B00000000,B11000000, + B00000001,B10000001,B10000000, + B00000000,B11000011,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + #endif +#else + #ifdef STATUS_CUTTER_ANIM + const unsigned char status_cutter_on_bmp[] PROGMEM = { + B00000001,B11111110,B10000000, + B00000000,B11000000,B00000000, + B00000001,B10000000,B10000000, + B00000001,B00000000,B10000000, + B00000001,B11111100,B10000000, + B00000000,B11100000,B00000000, + B00000001,B11000000,B10000000, + B00000000,B10000001,B00000000, + B00000000,B01111010,B00000000, + B00000000,B00110100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000001,B11111110,B10000000, + B00000000,B11000000,B00000000, + B00000001,B10000000,B10000000, + B00000001,B00000000,B10000000, + B00000001,B11111100,B10000000, + B00000000,B11100000,B00000000, + B00000001,B11000000,B10000000, + B00000000,B10000001,B00000000, + B00000000,B01111010,B00000000, + B00000000,B00110100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + #else + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000001,B11000010,B10000000, + B00000001,B00011100,B10000000, + B00000000,B11100001,B00000000, + B00000001,B00001110,B10000000, + B00000001,B01110000,B10000000, + B00000000,B10000111,B10000000, + B00000001,B00111111,B10000000, + B00000000,B11111111,B00000000, + B00000000,B01111110,B00000000, + B00000000,B00111100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + #endif +#endif diff --git a/Marlin/src/lcd/dogm/status/fan.h b/Marlin/src/lcd/dogm/status/fan.h new file mode 100644 index 000000000000..65f8e9c2300d --- /dev/null +++ b/Marlin/src/lcd/dogm/status/fan.h @@ -0,0 +1,443 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/fan.h - Status Screen Fan bitmaps +// + +#undef STATUS_FAN_WIDTH +#define STATUS_FAN_WIDTH 20 + +#if STATUS_FAN_FRAMES <= 2 + + #define STATUS_FAN_Y 2 + + #if ENABLED(STATUS_ALT_FAN_BITMAP) + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00000001,B11111110,B00000000, + B00000110,B00000001,B10000000, + B00001000,B11111100,B01000000, + B00010000,B11111100,B00100000, + B00010000,B01111000,B00100000, + B00100000,B00110000,B00010000, + B00101100,B00000000,B11010000, + B00101110,B00110001,B11010000, + B00101111,B01111011,B11010000, + B00101111,B01111011,B11010000, + B00101110,B00110001,B11010000, + B00101100,B00000000,B11010000, + B00100000,B00110000,B00010000, + B00010000,B01111000,B00100000, + B00010000,B11111100,B00100000, + B00001000,B11111100,B01000000, + B00000110,B00000001,B10000000, + B00000001,B11111110,B00000000 + }; + + #if STATUS_FAN_FRAMES == 2 + const unsigned char status_fan1_bmp[] PROGMEM = { + B00000001,B11111110,B00000000, + B00000110,B00000001,B10000000, + B00001001,B10000110,B01000000, + B00010011,B10000111,B00100000, + B00010111,B10000111,B10100000, + B00101111,B10000111,B11010000, + B00101111,B00000011,B11010000, + B00100000,B00110000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B00110000,B00010000, + B00101111,B00000011,B11010000, + B00101111,B10000111,B11010000, + B00010111,B10000111,B10100000, + B00010011,B10000111,B00100000, + B00001001,B10000110,B01000000, + B00000110,B00000001,B10000000, + B00000001,B11111110,B00000000 + }; + #endif + + #else // !STATUS_ALT_FAN_BITMAP + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11110000, + B00111000,B00000000,B01110000, + B00110000,B11111100,B00110000, + B00100000,B11111100,B00010000, + B00100000,B01111000,B00010000, + B00100000,B00110000,B00010000, + B00101100,B00000000,B11010000, + B00101110,B00110001,B11010000, + B00101111,B01111011,B11010000, + B00101111,B01111011,B11010000, + B00101110,B00110001,B11010000, + B00101100,B00000000,B11010000, + B00100000,B00110000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B11111100,B00010000, + B00110000,B11111100,B00110000, + B00111000,B00000000,B01110000, + B00111111,B11111111,B11110000 + }; + + #if STATUS_FAN_FRAMES == 2 + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11110000, + B00111000,B00000000,B01110000, + B00110001,B10000110,B00110000, + B00100011,B10000111,B00010000, + B00100111,B10000111,B10010000, + B00101111,B10000111,B11010000, + B00101111,B00000011,B11010000, + B00100000,B00110000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B00110000,B00010000, + B00101111,B00000011,B11010000, + B00101111,B10000111,B11010000, + B00100111,B10000111,B10010000, + B00100011,B10000111,B00010000, + B00110001,B10000110,B00110000, + B00111000,B00000000,B01110000, + B00111111,B11111111,B11110000 + }; + #endif + + #endif // !STATUS_ALT_FAN_BITMAP + +#elif STATUS_FAN_FRAMES == 3 + + #if ENABLED(STATUS_ALT_FAN_BITMAP) + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00000000,B11000000, + B00001001,B00000001,B00100000, + B00010111,B10000011,B11010000, + B00010111,B10000011,B11010000, + B00101111,B11000111,B11101000, + B00100111,B11000111,B11001000, + B00100001,B11111111,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100001,B11111111,B00001000, + B00100111,B11000111,B11001000, + B00101111,B11000111,B11101000, + B00010111,B10000011,B11010000, + B00010111,B10000011,B11010000, + B00001001,B00000001,B00100000, + B00000110,B00000000,B11000000, + B00000001,B11111111,B00000000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00110000,B11000000, + B00001001,B11110000,B00100000, + B00010001,B11110000,B00010000, + B00010000,B11110000,B00010000, + B00100000,B11110000,B01101000, + B00100000,B00110001,B11101000, + B00100000,B00111001,B11101000, + B00100000,B01111111,B11111000, + B00111111,B11111111,B11111000, + B00111111,B11111100,B00001000, + B00101111,B00111000,B00001000, + B00101110,B00011000,B00001000, + B00101100,B00011110,B00001000, + B00010000,B00011110,B00010000, + B00010000,B00011111,B00010000, + B00001000,B00011111,B00100000, + B00000110,B00011000,B11000000, + B00000001,B11111111,B00000000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00011000,B11000000, + B00001000,B00011111,B00100000, + B00010000,B00011111,B10010000, + B00010100,B00011111,B00010000, + B00101110,B00011110,B00001000, + B00101111,B00011100,B00001000, + B00101111,B10111000,B00001000, + B00111111,B11111100,B00001000, + B00111111,B11111111,B11111000, + B00100000,B01111111,B11111000, + B00100000,B00111011,B11101000, + B00100000,B01110001,B11101000, + B00100000,B11110000,B11101000, + B00010001,B11110000,B01010000, + B00010011,B11110000,B00010000, + B00001001,B11110000,B00100000, + B00000110,B00110000,B11000000, + B00000001,B11111111,B00000000 + }; + + #else // !STATUS_ALT_FAN_BITMAP + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111001,B00000001,B00111000, + B00110111,B10000011,B11011000, + B00110111,B10000011,B11011000, + B00101111,B11000111,B11101000, + B00100111,B11000111,B11001000, + B00100001,B11111111,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100001,B11111111,B00001000, + B00100111,B11000111,B11001000, + B00101111,B11000111,B11101000, + B00110111,B10000011,B11011000, + B00110111,B10000011,B11011000, + B00111001,B00000001,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00110000,B11111000, + B00111001,B11110000,B00111000, + B00110001,B11110000,B00011000, + B00110000,B11110000,B00011000, + B00100000,B11110000,B01101000, + B00100000,B00110001,B11101000, + B00100000,B00111001,B11101000, + B00100000,B01111111,B11111000, + B00111111,B11111111,B11111000, + B00111111,B11111100,B00001000, + B00101111,B00111000,B00001000, + B00101110,B00011000,B00001000, + B00101100,B00011110,B00001000, + B00110000,B00011110,B00011000, + B00110000,B00011111,B00011000, + B00111000,B00011111,B00111000, + B00111110,B00011000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00011000,B11111000, + B00111000,B00011111,B00111000, + B00110000,B00011111,B10011000, + B00110100,B00011111,B00011000, + B00101110,B00011110,B00001000, + B00101111,B00011100,B00001000, + B00101111,B10111000,B00001000, + B00111111,B11111100,B00001000, + B00111111,B11111111,B11111000, + B00100000,B01111111,B11111000, + B00100000,B00111011,B11101000, + B00100000,B01110001,B11101000, + B00100000,B11110000,B11101000, + B00110001,B11110000,B01011000, + B00110011,B11110000,B00011000, + B00111001,B11110000,B00111000, + B00111110,B00110000,B11111000, + B00111111,B11111111,B11111000 + }; + + #endif // !STATUS_ALT_FAN_BITMAP + +#elif STATUS_FAN_FRAMES == 4 + + #if ENABLED(STATUS_ALT_FAN_BITMAP) + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00000000,B11000000, + B00001000,B00111111,B00100000, + B00010000,B01111110,B00010000, + B00010000,B01111100,B00010000, + B00101000,B01111100,B00001000, + B00101100,B00111000,B00001000, + B00101111,B00111001,B11001000, + B00101111,B11111111,B11101000, + B00101111,B11000111,B11101000, + B00101111,B11111111,B11101000, + B00100111,B00111001,B11101000, + B00100000,B00111000,B01101000, + B00100000,B01111100,B00101000, + B00010000,B01111100,B00010000, + B00010000,B11111100,B00010000, + B00001001,B11111000,B00100000, + B00000110,B00000000,B11000000, + B00000001,B11111111,B00000000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00000000,B11000000, + B00001000,B00001111,B00100000, + B00010100,B00011111,B11010000, + B00010110,B00011111,B10010000, + B00101111,B00011111,B00001000, + B00101111,B10011110,B00001000, + B00101111,B11111100,B00001000, + B00101111,B11011100,B00001000, + B00100111,B11101111,B11001000, + B00100000,B01110111,B11101000, + B00100000,B01111111,B11101000, + B00100000,B11110011,B11101000, + B00100001,B11110001,B11101000, + B00010011,B11110000,B11010000, + B00010111,B11110000,B01010000, + B00001001,B11100000,B00100000, + B00000110,B00000000,B11000000, + B00000001,B11111111,B00000000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B10000000,B11000000, + B00001001,B10000000,B00100000, + B00010111,B10000001,B11010000, + B00010111,B11000011,B11010000, + B00100111,B11000111,B11101000, + B00100011,B11000111,B11111000, + B00100001,B11111111,B10001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100011,B11111111,B00001000, + B00111111,B11000111,B10001000, + B00101111,B11000111,B11001000, + B00010111,B10000111,B11010000, + B00010111,B00000011,B11010000, + B00001000,B00000011,B00100000, + B00000110,B00000010,B11000000, + B00000001,B11111111,B00000000 + }; + const unsigned char status_fan3_bmp[] PROGMEM = { + B00000001,B11111111,B00000000, + B00000110,B00000000,B11000000, + B00001001,B11110000,B00100000, + B00010001,B11100000,B00010000, + B00010001,B11100000,B00010000, + B00100001,B11100001,B11101000, + B00100000,B11110011,B11101000, + B00100000,B01111111,B11101000, + B00100000,B01110111,B11101000, + B00101000,B11101110,B00101000, + B00101111,B11011100,B00001000, + B00101111,B11111100,B00001000, + B00101111,B10011110,B00001000, + B00101111,B00001111,B00001000, + B00010000,B00001111,B00010000, + B00010000,B00001111,B00010000, + B00001000,B00011111,B00100000, + B00000110,B00000000,B11000000, + B00000001,B11111111,B00000000 + }; + + #else // !STATUS_ALT_FAN_BITMAP + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111000,B00111111,B00111000, + B00110000,B01111110,B00011000, + B00110000,B01111100,B00011000, + B00101000,B01111100,B00001000, + B00101100,B00111000,B00001000, + B00101111,B00111001,B11001000, + B00101111,B11111111,B11101000, + B00101111,B11000111,B11101000, + B00101111,B11111111,B11101000, + B00100111,B00111001,B11101000, + B00100000,B00111000,B01101000, + B00100000,B01111100,B00101000, + B00110000,B01111100,B00011000, + B00110000,B11111100,B00011000, + B00111001,B11111000,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111000,B00001111,B00111000, + B00110100,B00011111,B11011000, + B00110110,B00011111,B10011000, + B00101111,B00011111,B00001000, + B00101111,B10011110,B00001000, + B00101111,B11111100,B00001000, + B00101111,B11011100,B00001000, + B00100111,B11101111,B11001000, + B00100000,B01110111,B11101000, + B00100000,B01111111,B11101000, + B00100000,B11110011,B11101000, + B00100001,B11110001,B11101000, + B00110011,B11110000,B11011000, + B00110111,B11110000,B01011000, + B00111001,B11100000,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B10000000,B11111000, + B00111001,B10000000,B00111000, + B00110111,B10000001,B11011000, + B00110111,B11000011,B11011000, + B00100111,B11000111,B11101000, + B00100011,B11000111,B11111000, + B00100001,B11111111,B10001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100011,B11111111,B00001000, + B00111111,B11000111,B10001000, + B00101111,B11000111,B11001000, + B00110111,B10000111,B11011000, + B00110111,B00000011,B11011000, + B00111000,B00000011,B00111000, + B00111110,B00000010,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan3_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111001,B11110000,B00111000, + B00110001,B11100000,B00011000, + B00110001,B11100000,B00011000, + B00100001,B11100001,B11101000, + B00100000,B11110011,B11101000, + B00100000,B01111111,B11101000, + B00100000,B01110111,B11101000, + B00101000,B11101110,B00101000, + B00101111,B11011100,B00001000, + B00101111,B11111100,B00001000, + B00101111,B10011110,B00001000, + B00101111,B00001111,B00001000, + B00110000,B00001111,B00011000, + B00110000,B00001111,B00011000, + B00111000,B00011111,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + + #endif // !STATUS_ALT_FAN_BITMAP + +#endif diff --git a/Marlin/src/lcd/dogm/status/hotend.h b/Marlin/src/lcd/dogm/status/hotend.h new file mode 100644 index 000000000000..559fa50018e3 --- /dev/null +++ b/Marlin/src/lcd/dogm/status/hotend.h @@ -0,0 +1,336 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// lcd/dogm/status/hotend.h - Status Screen Hotends bitmaps +// + +#define STATUS_HOTEND1_WIDTH 16 + +#define MAX_HOTEND_BITMAPS 5 +#if HOTENDS > MAX_HOTEND_BITMAPS + #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS +#else + #define STATUS_HOTEND_BITMAPS HOTENDS +#endif + +#if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS) + + const unsigned char status_hotend_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00011111,B11100000, + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100000,B00010000, + B00100000,B00010000, + B00010000,B00100000, + B00010000,B00100000, + B00100000,B00010000, + B00100000,B00010000, + B00110000,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #endif + +#elif HOTENDS >= 2 + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend1_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #if STATUS_HOTEND_BITMAPS >= 3 + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend3_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011100,B11100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend3_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010011,B00100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend3_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011100,B11100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + + #if STATUS_HOTEND_BITMAPS >= 4 + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend4_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111000,B00110000, + B00111111,B01110000, + B00111111,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend4_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100100,B10010000, + B00100100,B10010000, + B00010100,B10100000, + B00010100,B10100000, + B00100111,B11010000, + B00100000,B10010000, + B00110000,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend4_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111011,B01110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011000,B00100000, + B00111111,B01110000, + B00111111,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + + #if STATUS_HOTEND_BITMAPS >= 5 + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend5_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111000,B01110000, + B00111011,B11110000, + B00011000,B11100000, + B00011111,B01100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend5_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100111,B10010000, + B00100100,B00010000, + B00010111,B00100000, + B00010000,B10100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend5_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111000,B01110000, + B00111011,B11110000, + B00111000,B11110000, + B00011111,B01100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + +#endif From 05033bb9d6ca4156e127dadd16cd5af3c3b3d3b2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 2 Nov 2020 00:09:42 +0000 Subject: [PATCH 072/443] [cron] Bump distribution date (2020-11-02) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 66e02dcacfe8..1768d2da93d7 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-01" + #define STRING_DISTRIBUTION_DATE "2020-11-02" #endif /** From 5deca5a18f9f51f1e9e34863a28f167974c451d8 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 1 Nov 2020 23:15:06 -0300 Subject: [PATCH 073/443] Increase SPI Speed on LPC. Color and Classic UI for MKS SGEN L. (#19945) --- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 4 +- Marlin/src/HAL/LPC1768/include/SPI.h | 15 ++++--- Marlin/src/HAL/LPC1768/tft/tft_spi.cpp | 4 +- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 53 +++++++++++++++++++++++ 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index cb0d54c0036f..b800721c5abc 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -357,8 +357,8 @@ void SPIClass::setDataSize(uint32_t ds) { void SPIClass::updateSettings() { //SSP_DeInit(_currentSetting->spi_d); //todo: need force de init?! - // divide PCLK by 2 for SSP0 - CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2); + // Divide PCLK by 2 for SSP0 + //CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2); SSP_CFG_Type HW_SPI_init; // data structure to hold init values SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index 9da2a32556e7..ffcd87fe9665 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -37,13 +37,14 @@ #define DATA_SIZE_8BIT SSP_DATABIT_8 #define DATA_SIZE_16BIT SSP_DATABIT_16 -#define SPI_CLOCK_DIV2 8333333 //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED -#define SPI_CLOCK_DIV4 4166667 //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED -#define SPI_CLOCK_DIV8 2083333 //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED -#define SPI_CLOCK_DIV16 1000000 //(SCR: 24) desired: 1,000,000 actual: 1,000,000 SPI_EIGHTH_SPEED -#define SPI_CLOCK_DIV32 500000 //(SCR: 49) desired: 500,000 actual: 500,000 SPI_SPEED_5 -#define SPI_CLOCK_DIV64 250000 //(SCR: 99) desired: 250,000 actual: 250,000 SPI_SPEED_6 -#define SPI_CLOCK_DIV128 125000 //(SCR:199) desired: 125,000 actual: 125,000 Default from HAL.h +#define SPI_CLOCK_MAX_TFT 30000000UL +#define SPI_CLOCK_DIV2 8333333 //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED +#define SPI_CLOCK_DIV4 4166667 //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED +#define SPI_CLOCK_DIV8 2083333 //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED +#define SPI_CLOCK_DIV16 1000000 //(SCR: 24) desired: 1,000,000 actual: 1,000,000 SPI_EIGHTH_SPEED +#define SPI_CLOCK_DIV32 500000 //(SCR: 49) desired: 500,000 actual: 500,000 SPI_SPEED_5 +#define SPI_CLOCK_DIV64 250000 //(SCR: 99) desired: 250,000 actual: 250,000 SPI_SPEED_6 +#define SPI_CLOCK_DIV128 125000 //(SCR:199) desired: 125,000 actual: 125,000 Default from HAL.h #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 diff --git a/Marlin/src/HAL/LPC1768/tft/tft_spi.cpp b/Marlin/src/HAL/LPC1768/tft/tft_spi.cpp index 84907acd0702..a2cb66ab5bfd 100644 --- a/Marlin/src/HAL/LPC1768/tft/tft_spi.cpp +++ b/Marlin/src/HAL/LPC1768/tft/tft_spi.cpp @@ -89,7 +89,7 @@ void TFT_SPI::Init() { #elif TFT_MISO_PIN == BOARD_SPI2_MISO_PIN SPIx.setModule(2); #endif - SPIx.setClock(SPI_CLOCK_MAX); + SPIx.setClock(SPI_CLOCK_MAX_TFT); SPIx.setBitOrder(MSBFIRST); SPIx.setDataMode(SPI_MODE0); } @@ -125,7 +125,7 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { } DataTransferEnd(); - SPIx.setClock(SPI_CLOCK_MAX); + SPIx.setClock(SPI_CLOCK_MAX_TFT); #endif return data >> 7; diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 0a8f3a6da8af..f948c32f923a 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -249,6 +249,59 @@ #define LCD_PINS_ENABLE P1_22 #define LCD_PINS_D4 P0_17 + #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI + #define TFT_CS_PIN P1_00 + #define TFT_A0_PIN P1_22 + #define TFT_DC_PIN P1_22 + #define TFT_MISO_PIN P0_08 + #define TFT_BACKLIGHT_PIN P0_18 + #define TFT_RESET_PIN P0_16 + + #define LCD_USE_DMA_SPI + + #define TOUCH_INT_PIN P0_17 + #define TOUCH_CS_PIN P0_15 + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 + + // Disable any LCD related PINs config + #define LCD_PINS_ENABLE -1 + #define LCD_PINS_RS -1 + + // XPT2046 Touch Screen calibration + #if ENABLED(TFT_CLASSIC_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -11386 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 8684 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 689 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -273 + #endif + #elif ENABLED(TFT_COLOR_UI) + #ifndef XPT2046_X_CALIBRATION + #define XPT2046_X_CALIBRATION -16741 + #endif + #ifndef XPT2046_Y_CALIBRATION + #define XPT2046_Y_CALIBRATION 11258 + #endif + #ifndef XPT2046_X_OFFSET + #define XPT2046_X_OFFSET 1024 + #endif + #ifndef XPT2046_Y_OFFSET + #define XPT2046_Y_OFFSET -367 + #endif + + #define TFT_BUFFER_SIZE 2400 + #endif + + #define BTN_EN1 P3_25 + #define BTN_EN2 P3_26 + #elif IS_TFTGLCD_PANEL #undef BEEPER_PIN From e7ebb6620055353e1d33d877e36146d69e159849 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 1 Nov 2020 23:38:10 -0300 Subject: [PATCH 074/443] Fix STM32 HW Serial + EP compile (#19990) --- Marlin/src/HAL/STM32/HAL.cpp | 10 ++++++++-- Marlin/src/HAL/STM32/HAL.h | 1 + Marlin/src/HAL/STM32/usb_serial.cpp | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 83604b1104bb..c886f9c0b988 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -81,7 +81,9 @@ void HAL_init() { SetTimerInterruptPriorities(); - TERN_(EMERGENCY_PARSER, USB_Hook_init()); + #if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC + USB_Hook_init(); + #endif } void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } @@ -128,8 +130,12 @@ uint16_t HAL_adc_get_result() { return HAL_adc_result; } void flashFirmware(const int16_t) { NVIC_SystemReset(); } // Maple Compatibility +volatile uint32_t systick_uptime_millis = 0; systickCallback_t systick_user_callback; void systick_attach_callback(systickCallback_t cb) { systick_user_callback = cb; } -void HAL_SYSTICK_Callback() { if (systick_user_callback) systick_user_callback(); } +void HAL_SYSTICK_Callback() { + systick_uptime_millis++; + if (systick_user_callback) systick_user_callback(); +} #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index a1f7515d6b98..3cd138ba618c 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -184,3 +184,4 @@ void flashFirmware(const int16_t); typedef void (*systickCallback_t)(void); void systick_attach_callback(systickCallback_t cb); void HAL_SYSTICK_Callback(); +extern volatile uint32_t systick_uptime_millis; diff --git a/Marlin/src/HAL/STM32/usb_serial.cpp b/Marlin/src/HAL/STM32/usb_serial.cpp index 2dd1bef12c43..25c47d694fbd 100644 --- a/Marlin/src/HAL/STM32/usb_serial.cpp +++ b/Marlin/src/HAL/STM32/usb_serial.cpp @@ -21,7 +21,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) +#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC #include "usb_serial.h" #include "../../feature/e_parser.h" From 5a4a6285bb3323fe6e28752dd3cf6c8a9943a03e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 3 Nov 2020 00:09:58 +0000 Subject: [PATCH 075/443] [cron] Bump distribution date (2020-11-03) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 1768d2da93d7..921fcf736286 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-02" + #define STRING_DISTRIBUTION_DATE "2020-11-03" #endif /** From f131f58124c6f720ed6e9004ce0aa48cebb28aac Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 2 Nov 2020 23:22:14 -0300 Subject: [PATCH 076/443] Add a filament runout note (#19973) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 054e90d8d970..f2884c75cbbb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1170,6 +1170,12 @@ * Filament Runout Sensors * Mechanical or opto endstops are used to check for the presence of filament. * + * IMPORTANT: Runout will only trigger if Marlin is aware that a print job is running. + * Marlin knows a print job is running when: + * 1. Running a print job from media started with M24. + * 2. The Print Job Timer has been started with M75. + * 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled. + * * RAMPS-based boards use SERVO3_PIN for the first runout sensor. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. */ From 7e55cbf79820b6741d91194b6252623f85c57c1e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Nov 2020 17:17:37 -0600 Subject: [PATCH 077/443] DWIN cleanup, preserve Z offset --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 60 ++++++++++++------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 45704d5724f8..5c6022d09e4e 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -594,7 +594,7 @@ inline void Item_Prepare_Home(const uint8_t row) { if (HMI_IsChinese()) { #if HAS_BED_PROBE DWIN_Frame_AreaCopy(1, 174, 164, 223, 177, LBLX, MBASE(row)); - DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), BABY_Z_VAR * 100); + DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), probe.offset.z * 100); #else DWIN_Frame_AreaCopy(1, 43, 89, 98, 101, LBLX, MBASE(row)); #endif @@ -602,7 +602,7 @@ inline void Item_Prepare_Home(const uint8_t row) { else { #if HAS_BED_PROBE DWIN_Frame_AreaCopy(1, 93, 179, 141, 189, LBLX, MBASE(row)); // "Z-Offset" - DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), BABY_Z_VAR * 100); + DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), probe.offset.z * 100); #else DWIN_Frame_AreaCopy(1, 1, 76, 106, 86, LBLX, MBASE(row)); // "..." #endif @@ -1271,14 +1271,8 @@ void HMI_Move_Z() { probe.offset.z = dwin_zoffset; TERN_(EEPROM_SETTINGS, settings.save()); #endif - if (HMI_ValueStruct.show_mode == -4) { - checkkey = Prepare; - DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(zoff_line), TERN(HAS_BED_PROBE, BABY_Z_VAR * 100, HMI_ValueStruct.offset_value)); - } - else { - checkkey = Tune; - DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(zoff_line), TERN(HAS_BED_PROBE, BABY_Z_VAR * 100, HMI_ValueStruct.offset_value)); - } + checkkey = HMI_ValueStruct.show_mode == -4 ? Prepare : Tune; + DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(zoff_line), TERN(HAS_BED_PROBE, BABY_Z_VAR * 100, HMI_ValueStruct.offset_value)); DWIN_UpdateLCD(); return; } @@ -1311,11 +1305,7 @@ void HMI_Move_Z() { } if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.E_Temp)) { EncoderRate.enabled = false; - if (HMI_ValueStruct.show_mode == -1) { // temperature - checkkey = TemperatureID; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp); - } - else if (HMI_ValueStruct.show_mode == -2) { + if (HMI_ValueStruct.show_mode == -2) { checkkey = PLAPreheat; ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp; DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), ui.material_preset[0].hotend_temp); @@ -1327,10 +1317,11 @@ void HMI_Move_Z() { DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), ui.material_preset[1].hotend_temp); return; } - else { // tune + else if (HMI_ValueStruct.show_mode == -1) // Temperature + checkkey = TemperatureID; + else checkkey = Tune; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp); - } + DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp); thermalManager.setTargetHotend(HMI_ValueStruct.E_Temp, 0); return; } @@ -1358,11 +1349,7 @@ void HMI_Move_Z() { } if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Bed_Temp)) { EncoderRate.enabled = false; - if (HMI_ValueStruct.show_mode == -1) { - checkkey = TemperatureID; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), HMI_ValueStruct.Bed_Temp); - } - else if (HMI_ValueStruct.show_mode == -2) { + if (HMI_ValueStruct.show_mode == -2) { checkkey = PLAPreheat; ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp; DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), ui.material_preset[0].bed_temp); @@ -1374,10 +1361,11 @@ void HMI_Move_Z() { DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), ui.material_preset[1].bed_temp); return; } - else { + else if (HMI_ValueStruct.show_mode == -1) + checkkey = TemperatureID; + else checkkey = Tune; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), HMI_ValueStruct.Bed_Temp); - } + DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), HMI_ValueStruct.Bed_Temp); thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp); return; } @@ -1406,11 +1394,7 @@ void HMI_Move_Z() { if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Fan_speed)) { EncoderRate.enabled = false; - if (HMI_ValueStruct.show_mode == -1) { - checkkey = TemperatureID; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), HMI_ValueStruct.Fan_speed); - } - else if (HMI_ValueStruct.show_mode == -2) { + if (HMI_ValueStruct.show_mode == -2) { checkkey = PLAPreheat; ui.material_preset[0].fan_speed = HMI_ValueStruct.Fan_speed; DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), ui.material_preset[0].fan_speed); @@ -1422,10 +1406,11 @@ void HMI_Move_Z() { DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), ui.material_preset[1].fan_speed); return; } - else { + else if (HMI_ValueStruct.show_mode == -1) + checkkey = TemperatureID; + else checkkey = Tune; - DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), HMI_ValueStruct.Fan_speed); - } + DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), HMI_ValueStruct.Fan_speed); thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed); return; } @@ -1844,7 +1829,8 @@ void Draw_Status_Area(const bool with_update) { #if HAS_ZOFFSET_ITEM DWIN_ICON_Show(ICON, ICON_Zoffset, 158, 428); - DWIN_Draw_Signed_Float(DWIN_FONT_STAT, Color_Bg_Black, 2, 2, 178, 429, BABY_Z_VAR * 100); + dwin_zoffset = BABY_Z_VAR; + DWIN_Draw_Signed_Float(DWIN_FONT_STAT, Color_Bg_Black, 2, 2, 178, 429, dwin_zoffset * 100); #endif if (with_update) { @@ -3573,7 +3559,7 @@ void EachMomentUpdate() { else if (dwin_abort_flag && !HMI_flag.home_flag) { // Print Stop dwin_abort_flag = false; HMI_ValueStruct.print_speed = feedrate_percentage = 100; - dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); + dwin_zoffset = BABY_Z_VAR; select_page.set(0); Goto_MainMenu(); } @@ -3681,6 +3667,7 @@ void DWIN_HandleScreen() { void DWIN_CompletedHoming() { HMI_flag.home_flag = false; + dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); if (checkkey == Last_Prepare) { checkkey = Prepare; select_prepare.now = PREPARE_CASE_HOME; @@ -3689,7 +3676,6 @@ void DWIN_CompletedHoming() { } else if (checkkey == Back_Main) { HMI_ValueStruct.print_speed = feedrate_percentage = 100; - dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); planner.finish_and_disable(); Goto_MainMenu(); } From 0be276482ebd5545dc11d97fd7a50c7673ad584d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 3 Nov 2020 20:21:15 -0300 Subject: [PATCH 078/443] Show un-mounted media slot (#20005) --- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 45eab346653e..4e2cd8acc484 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -336,7 +336,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(TOUCH_SCREEN) add_control(256, 130, menu_main, imgSettings); - TERN_(SDSUPPORT, add_control(0, 130, menu_media, imgSD, card.isMounted() && !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); + TERN_(SDSUPPORT, add_control(0, 130, menu_media, imgSD, !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); #endif } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 1003f32e7cb5..0c44a3151b58 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -341,7 +341,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(TOUCH_SCREEN) add_control(404, 180, menu_main, imgSettings); - TERN_(SDSUPPORT, add_control(12, 180, menu_media, imgSD, card.isMounted() && !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); + TERN_(SDSUPPORT, add_control(12, 180, menu_media, imgSD, !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); #endif } From e9053654a73830bb8d242784bb864b3305633636 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 3 Nov 2020 20:25:33 -0300 Subject: [PATCH 079/443] Better Classic UI touch resolution (#20004) --- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 35 ++-------- Marlin/src/lcd/touch/touch_buttons.cpp | 64 +++++-------------- Marlin/src/lcd/touch/touch_buttons.h | 30 +++++++++ Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 15 +---- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 15 +---- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 17 +---- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 15 +---- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 15 +---- 8 files changed, 59 insertions(+), 147 deletions(-) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 106c18cf06f7..8698dbb017db 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -73,10 +73,8 @@ TFT_IO tftio; #define HEIGHT LCD_PIXEL_HEIGHT #define PAGE_HEIGHT 8 -#include "../scaled_tft.h" +#include "../touch/touch_buttons.h" -#define UPSCALE0(M) ((M) * (GRAPHICAL_TFT_UPSCALE)) -#define UPSCALE(A,M) (UPSCALE0(M) + (A)) #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1) #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1) @@ -276,29 +274,10 @@ static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, B01111111,B11111111,B11111111,B11111110, }; - #define BUTTON_SIZE_X 32 - #define BUTTON_SIZE_Y 20 - - // 14, 90, 166, 242, 185 are the original values upscaled 2x. - #define BUTTOND_X_LO UPSCALE0(14 / 2) - #define BUTTOND_X_HI (UPSCALE(BUTTOND_X_LO, BUTTON_SIZE_X) - 1) - - #define BUTTONA_X_LO UPSCALE0(90 / 2) - #define BUTTONA_X_HI (UPSCALE(BUTTONA_X_LO, BUTTON_SIZE_X) - 1) - - #define BUTTONB_X_LO UPSCALE0(166 / 2) - #define BUTTONB_X_HI (UPSCALE(BUTTONB_X_LO, BUTTON_SIZE_X) - 1) - - #define BUTTONC_X_LO UPSCALE0(242 / 2) - #define BUTTONC_X_HI (UPSCALE(BUTTONC_X_LO, BUTTON_SIZE_X) - 1) - - #define BUTTON_Y_LO UPSCALE0(140 / 2) + 44 // 184 2x, 254 3x - #define BUTTON_Y_HI (UPSCALE(BUTTON_Y_LO, BUTTON_SIZE_Y) - 1) - void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) { - uint16_t buffer[BUTTON_SIZE_X * sq(GRAPHICAL_TFT_UPSCALE)]; + uint16_t buffer[BUTTON_WIDTH * sq(GRAPHICAL_TFT_UPSCALE)]; - if (length > BUTTON_SIZE_X) return; + if (length > BUTTON_WIDTH) return; for (uint16_t i = 0; i < height; i++) { uint16_t k = 0; @@ -368,16 +347,16 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u // Bottom buttons #if HAS_TOUCH_XPT2046 setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI); - drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR); + drawImage(buttonD, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTCANCEL_COLOR); setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI); - drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); + drawImage(buttonA, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI); - drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); + drawImage(buttonB, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI); - drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR); + drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR); #endif // HAS_TOUCH_XPT2046 return 0; diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index eeb22aae6eee..4e984869692a 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -29,45 +29,13 @@ XPT2046 touchIO; #include "../../lcd/marlinui.h" // For EN_C bit mask -/** - * Draw and Touch processing - * - * LCD_PIXEL_WIDTH/HEIGHT (128x64) is the (emulated DOGM) Pixel Drawing resolution. - * TOUCH_SENSOR_WIDTH/HEIGHT (320x240) is the Touch Area resolution. - * TFT_WIDTH/HEIGHT (320x240 or 480x320) is the Actual (FSMC) Display resolution. - * - * - All native (u8g) drawing is done in LCD_PIXEL_* (128x64) - * - The DOGM pixels are is upscaled 2-3x (as needed) for display. - * - Touch coordinates use TOUCH_SENSOR_* resolution and are converted to - * click and scroll-wheel events (emulating of a common DOGM display). - * - * TOUCH_SCREEN resolution exists to fit our calibration values. The original touch code was made - * and originally calibrated for 320x240. If you decide to change the resolution of the touch code, - * new calibration values will be needed. - * - * The Marlin menus are drawn scaled in the upper region of the screen. The bottom region (in a - * fixed location in TOUCH_SCREEN* coordinate space) is used for 4 general-purpose buttons to - * navigate and select menu items. Both regions are touchable. - * - * The Marlin screen touchable area starts at TFT_PIXEL_OFFSET_X/Y (translated to SCREEN_PCT_LEFT/TOP) - * and spans LCD_PIXEL_WIDTH/HEIGHT (scaled to SCREEN_PCT_WIDTH/HEIGHT). - */ - -// Touch sensor resolution independent of display resolution -#define TOUCH_SENSOR_WIDTH 320 -#define TOUCH_SENSOR_HEIGHT 240 - -#define SCREEN_PCT_WIDE(X) ((X) * (TOUCH_SENSOR_WIDTH) / (TFT_WIDTH)) -#define SCREEN_PCT_HIGH(Y) ((Y) * (TOUCH_SENSOR_HEIGHT) / (TFT_HEIGHT)) - -#define SCREEN_PCT_LEFT SCREEN_PCT_WIDE(TFT_PIXEL_OFFSET_X) -#define SCREEN_PCT_TOP SCREEN_PCT_HIGH(TFT_PIXEL_OFFSET_Y) -#define SCREEN_PCT_WIDTH SCREEN_PCT_WIDE((GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_WIDTH)) -#define SCREEN_PCT_HEIGHT SCREEN_PCT_HIGH((GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_HEIGHT)) +#define DOGM_AREA_LEFT TFT_PIXEL_OFFSET_X +#define DOGM_AREA_TOP TFT_PIXEL_OFFSET_Y +#define DOGM_AREA_WIDTH (GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_WIDTH) +#define DOGM_AREA_HEIGHT (GRAPHICAL_TFT_UPSCALE) * (LCD_PIXEL_HEIGHT) -// Coordinates in terms of 240-unit-tall touch area -#define BUTTON_AREA_TOP 175 -#define BUTTON_AREA_BOT 234 +#define BUTTON_AREA_TOP BUTTON_Y_LO +#define BUTTON_AREA_BOT BUTTON_Y_HI TouchButtons touch; @@ -83,25 +51,25 @@ uint8_t TouchButtons::read_buttons() { y = uint16_t((uint32_t(y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; #if (TFT_ROTATION & TFT_ROTATE_180) - x = TOUCH_SENSOR_WIDTH - x; - y = TOUCH_SENSOR_HEIGHT - y; + x = TFT_WIDTH - x; + y = TFT_HEIGHT - y; #endif // Touch within the button area simulates an encoder button if (y > BUTTON_AREA_TOP && y < BUTTON_AREA_BOT) - return WITHIN(x, 14, 77) ? EN_D - : WITHIN(x, 90, 153) ? EN_A - : WITHIN(x, 166, 229) ? EN_B - : WITHIN(x, 242, 305) ? EN_C + return WITHIN(x, BUTTOND_X_LO, BUTTOND_X_HI) ? EN_D + : WITHIN(x, BUTTONA_X_LO, BUTTONA_X_HI) ? EN_A + : WITHIN(x, BUTTONB_X_LO, BUTTONB_X_HI) ? EN_B + : WITHIN(x, BUTTONC_X_LO, BUTTONC_X_HI) ? EN_C : 0; - if ( !WITHIN(x, SCREEN_PCT_LEFT, SCREEN_PCT_LEFT + SCREEN_PCT_WIDTH) - || !WITHIN(y, SCREEN_PCT_TOP, SCREEN_PCT_TOP + SCREEN_PCT_HEIGHT) + if ( !WITHIN(x, DOGM_AREA_LEFT, DOGM_AREA_LEFT + DOGM_AREA_WIDTH) + || !WITHIN(y, DOGM_AREA_TOP, DOGM_AREA_TOP + DOGM_AREA_HEIGHT) ) return 0; // Column and row above BUTTON_AREA_TOP - int8_t col = (x - (SCREEN_PCT_LEFT)) * (LCD_WIDTH) / (SCREEN_PCT_WIDTH), - row = (y - (SCREEN_PCT_TOP)) * (LCD_HEIGHT) / (SCREEN_PCT_HEIGHT); + int8_t col = (x - (DOGM_AREA_LEFT)) * (LCD_WIDTH) / (DOGM_AREA_WIDTH), + row = (y - (DOGM_AREA_TOP)) * (LCD_HEIGHT) / (DOGM_AREA_HEIGHT); // Send the touch to the UI (which will simulate the encoder wheel) MarlinUI::screen_click(row, col, x, y); diff --git a/Marlin/src/lcd/touch/touch_buttons.h b/Marlin/src/lcd/touch/touch_buttons.h index 451e5a5a37ca..bf05d2bae591 100644 --- a/Marlin/src/lcd/touch/touch_buttons.h +++ b/Marlin/src/lcd/touch/touch_buttons.h @@ -20,6 +20,36 @@ #include +#include "../../inc/MarlinConfig.h" +#include "../scaled_tft.h" + +#define UPSCALE0(M) ((M) * (GRAPHICAL_TFT_UPSCALE)) +#define UPSCALE(A,M) (UPSCALE0(M) + (A)) + +#define BUTTON_DRAW_WIDTH 32 +#define BUTTON_DRAW_HEIGHT 20 + +#define BUTTON_WIDTH UPSCALE0(BUTTON_DRAW_WIDTH) +#define BUTTON_HEIGHT UPSCALE0(BUTTON_DRAW_HEIGHT) + +// calc the space between buttons +#define BUTTON_SPACING (((TFT_WIDTH) - (BUTTON_WIDTH * 4)) / 5) + +#define BUTTOND_X_LO BUTTON_SPACING +#define BUTTOND_X_HI BUTTOND_X_LO + BUTTON_WIDTH - 1 + +#define BUTTONA_X_LO BUTTOND_X_HI + BUTTON_SPACING +#define BUTTONA_X_HI BUTTONA_X_LO + BUTTON_WIDTH - 1 + +#define BUTTONB_X_LO BUTTONA_X_HI + BUTTON_SPACING +#define BUTTONB_X_HI BUTTONB_X_LO + BUTTON_WIDTH - 1 + +#define BUTTONC_X_LO BUTTONB_X_HI + BUTTON_SPACING +#define BUTTONC_X_HI BUTTONC_X_LO + BUTTON_WIDTH - 1 + +#define BUTTON_Y_HI (TFT_HEIGHT) - (BUTTON_SPACING / 2) +#define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT + class TouchButtons { public: static void init(); diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index d89cfc6da83d..181872737276 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -155,7 +155,7 @@ #endif // XPT2046 Touch Screen calibration -#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) +#if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17181 #endif @@ -168,19 +168,6 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -9 #endif -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -12316 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8981 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 340 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -20 - #endif #endif // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index 262a9a241b8f..1d6e6b3983d8 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -170,7 +170,7 @@ #endif // XPT2046 Touch Screen calibration -#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) +#if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17181 #endif @@ -183,19 +183,6 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -9 #endif -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -12316 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8981 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 340 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -20 - #endif #endif // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index ff381b3753bc..5c3dfc2ad8c1 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -198,7 +198,7 @@ #endif // XPT2046 Touch Screen calibration -#if EITHER(HAS_TFT_LVGL_UI_FSMC, TFT_480x320) +#if ANY(HAS_TFT_LVGL_UI_FSMC, TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_480x320) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION 17880 #endif @@ -211,20 +211,7 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET 349 #endif -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12149 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -8746 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -35 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 256 - #endif -#elif ENABLED(TFT_320x240) +#elif EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_320x240) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -12246 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 0630c0f3cb8d..e009d34d9414 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -284,7 +284,7 @@ #endif // XPT2046 Touch Screen calibration -#if EITHER(TFT_LVGL_UI, TFT_COLOR_UI) +#if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17253 #endif @@ -297,19 +297,6 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -24 #endif -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 339 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -18 - #endif #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 818dbb5f7ebb..8314858d1351 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -137,7 +137,7 @@ #endif // XPT2046 Touch Screen calibration -#if ENABLED(TFT_COLOR_UI) || ENABLED(TFT_LVGL_UI) +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #ifndef XPT2046_X_CALIBRATION #define XPT2046_X_CALIBRATION -17181 #endif @@ -150,19 +150,6 @@ #ifndef XPT2046_Y_OFFSET #define XPT2046_Y_OFFSET -9 #endif -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -12316 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8981 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 340 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -20 - #endif #endif #if NEED_TOUCH_PINS From ea5886c77d303ed6074fbc33239a83ec2a792b0a Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 3 Nov 2020 15:27:09 -0800 Subject: [PATCH 080/443] Add note about TMC2225/6 (#20002) --- Marlin/Configuration.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f2884c75cbbb..0b6234bbccd0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -674,6 +674,8 @@ * * A4988 is assumed for unspecified drivers. * + * Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers. + * * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, From 2a78fe0f814f6f20008b13faa888de99b8b531fc Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 4 Nov 2020 00:09:52 +0000 Subject: [PATCH 081/443] [cron] Bump distribution date (2020-11-04) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 921fcf736286..fa505310efb9 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-03" + #define STRING_DISTRIBUTION_DATE "2020-11-04" #endif /** From 4fe1adc383283b10a4baa60ad4e4d3306b0957c6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 Nov 2020 15:08:31 -0600 Subject: [PATCH 082/443] HAL support for 8s watchdog --- Marlin/src/HAL/DUE/watchdog.cpp | 2 +- Marlin/src/HAL/ESP32/watchdog.cpp | 2 ++ Marlin/src/HAL/LINUX/watchdog.cpp | 2 ++ Marlin/src/HAL/LINUX/watchdog.h | 2 -- Marlin/src/HAL/LPC1768/watchdog.cpp | 4 ++- Marlin/src/HAL/LPC1768/watchdog.h | 2 -- Marlin/src/HAL/SAMD51/watchdog.cpp | 34 +++++++++--------- Marlin/src/HAL/STM32/watchdog.cpp | 31 +++++++++-------- Marlin/src/HAL/STM32F1/watchdog.cpp | 7 ++++ Marlin/src/HAL/STM32F1/watchdog.h | 7 ---- Marlin/src/HAL/STM32_F4_F7/watchdog.cpp | 46 +++++++++++++------------ Marlin/src/HAL/TEENSY31_32/watchdog.cpp | 4 ++- Marlin/src/HAL/TEENSY35_36/watchdog.cpp | 4 ++- Marlin/src/HAL/TEENSY40_41/watchdog.cpp | 10 ++---- 14 files changed, 83 insertions(+), 74 deletions(-) diff --git a/Marlin/src/HAL/DUE/watchdog.cpp b/Marlin/src/HAL/DUE/watchdog.cpp index 0f4697183056..e144db8291e3 100644 --- a/Marlin/src/HAL/DUE/watchdog.cpp +++ b/Marlin/src/HAL/DUE/watchdog.cpp @@ -36,7 +36,7 @@ void watchdogSetup() { #if ENABLED(USE_WATCHDOG) // 4 seconds timeout - uint32_t timeout = 4000; + uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000); // Calculate timeout value in WDT counter ticks: This assumes // the slow clock is running at 32.768 kHz watchdog diff --git a/Marlin/src/HAL/ESP32/watchdog.cpp b/Marlin/src/HAL/ESP32/watchdog.cpp index f6fcfa3182c4..5ec03c46079b 100644 --- a/Marlin/src/HAL/ESP32/watchdog.cpp +++ b/Marlin/src/HAL/ESP32/watchdog.cpp @@ -25,6 +25,8 @@ #if ENABLED(USE_WATCHDOG) +#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + #include "watchdog.h" void watchdogSetup() { diff --git a/Marlin/src/HAL/LINUX/watchdog.cpp b/Marlin/src/HAL/LINUX/watchdog.cpp index c15b0e311c56..84202e48b6c5 100644 --- a/Marlin/src/HAL/LINUX/watchdog.cpp +++ b/Marlin/src/HAL/LINUX/watchdog.cpp @@ -27,6 +27,8 @@ #include "watchdog.h" +#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + void watchdog_init() {} void HAL_watchdog_refresh() {} diff --git a/Marlin/src/HAL/LINUX/watchdog.h b/Marlin/src/HAL/LINUX/watchdog.h index 472624cc7845..49a0d9c631d8 100644 --- a/Marlin/src/HAL/LINUX/watchdog.h +++ b/Marlin/src/HAL/LINUX/watchdog.h @@ -21,7 +21,5 @@ */ #pragma once -#define WDT_TIMEOUT 4000000 // 4 second timeout - void watchdog_init(); void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/LPC1768/watchdog.cpp b/Marlin/src/HAL/LPC1768/watchdog.cpp index 3cd22d665168..f23ccf5b512d 100644 --- a/Marlin/src/HAL/LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/LPC1768/watchdog.cpp @@ -28,6 +28,8 @@ #include #include "watchdog.h" +#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + void watchdog_init() { #if ENABLED(WATCHDOG_RESET_MANUAL) // We enable the watchdog timer, but only for the interrupt. @@ -52,7 +54,7 @@ void watchdog_init() { #else WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); #endif - WDT_Start(WDT_TIMEOUT); + WDT_Start(WDT_TIMEOUT_US); } void HAL_watchdog_refresh() { diff --git a/Marlin/src/HAL/LPC1768/watchdog.h b/Marlin/src/HAL/LPC1768/watchdog.h index cc170881f375..c843f0ed5571 100644 --- a/Marlin/src/HAL/LPC1768/watchdog.h +++ b/Marlin/src/HAL/LPC1768/watchdog.h @@ -21,8 +21,6 @@ */ #pragma once -#define WDT_TIMEOUT 4000000 // 4 second timeout - void watchdog_init(); void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/SAMD51/watchdog.cpp b/Marlin/src/HAL/SAMD51/watchdog.cpp index ebc8dffe1300..9de451836aeb 100644 --- a/Marlin/src/HAL/SAMD51/watchdog.cpp +++ b/Marlin/src/HAL/SAMD51/watchdog.cpp @@ -24,28 +24,30 @@ #if ENABLED(USE_WATCHDOG) - #include "watchdog.h" +#include "watchdog.h" - void watchdog_init() { - // The low-power oscillator used by the WDT runs at 32,768 Hz with - // a 1:32 prescale, thus 1024 Hz, though probably not super precise. +#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout - // Setup WDT clocks - MCLK->APBAMASK.bit.OSC32KCTRL_ = true; - MCLK->APBAMASK.bit.WDT_ = true; - OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) +void watchdog_init() { + // The low-power oscillator used by the WDT runs at 32,768 Hz with + // a 1:32 prescale, thus 1024 Hz, though probably not super precise. - WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config - SYNC(WDT->SYNCBUSY.bit.ENABLE); + // Setup WDT clocks + MCLK->APBAMASK.bit.OSC32KCTRL_ = true; + MCLK->APBAMASK.bit.WDT_ = true; + OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) - WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt - WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset + WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config + SYNC(WDT->SYNCBUSY.bit.ENABLE); - HAL_watchdog_refresh(); + WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt + WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset - WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode - SYNC(WDT->SYNCBUSY.bit.ENABLE); - } + HAL_watchdog_refresh(); + + WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode + SYNC(WDT->SYNCBUSY.bit.ENABLE); +} #endif // USE_WATCHDOG diff --git a/Marlin/src/HAL/STM32/watchdog.cpp b/Marlin/src/HAL/STM32/watchdog.cpp index cc1855314968..3d8340831118 100644 --- a/Marlin/src/HAL/STM32/watchdog.cpp +++ b/Marlin/src/HAL/STM32/watchdog.cpp @@ -25,23 +25,26 @@ #if ENABLED(USE_WATCHDOG) - #include "../../inc/MarlinConfig.h" +#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout - #include "watchdog.h" - #include +#include "../../inc/MarlinConfig.h" - void watchdog_init() { - #if DISABLED(DISABLE_WATCHDOG_INIT) - IWatchdog.begin(4000000); // 4 sec timeout - #endif - } +#include "watchdog.h" +#include - void HAL_watchdog_refresh() { - IWatchdog.reload(); - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } +void watchdog_init() { + #if DISABLED(DISABLE_WATCHDOG_INIT) + IWatchdog.begin(WDT_TIMEOUT_US); + #endif +} + +void HAL_watchdog_refresh() { + IWatchdog.reload(); + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif +} #endif // USE_WATCHDOG + #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32F1/watchdog.cpp b/Marlin/src/HAL/STM32F1/watchdog.cpp index ca91a6fe4350..d37fe7dfc7fc 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.cpp +++ b/Marlin/src/HAL/STM32F1/watchdog.cpp @@ -33,6 +33,13 @@ #include #include "watchdog.h" +/** + * The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and + * 625 reload value (counts down to 0) + * use 1250 for 8 seconds + */ +#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout + void HAL_watchdog_refresh() { #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) TOGGLE(LED_PIN); // heartbeat indicator diff --git a/Marlin/src/HAL/STM32F1/watchdog.h b/Marlin/src/HAL/STM32F1/watchdog.h index 7185d6977521..72513d476c11 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.h +++ b/Marlin/src/HAL/STM32F1/watchdog.h @@ -27,13 +27,6 @@ #include -/** - * The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and - * 625 reload value (counts down to 0) - * use 1250 for 8 seconds - */ -#define STM32F1_WD_RELOAD 625 - // Arduino STM32F1 core now has watchdog support // Initialize watchdog with a 4 second countdown time diff --git a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp b/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp index cb12ec7aac3c..c0afd0cd58fb 100644 --- a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp @@ -25,31 +25,33 @@ #if ENABLED(USE_WATCHDOG) - #include "watchdog.h" - - IWDG_HandleTypeDef hiwdg; - - void watchdog_init() { - hiwdg.Instance = IWDG; - hiwdg.Init.Prescaler = IWDG_PRESCALER_32; //32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock - hiwdg.Init.Reload = 4095; //4095 counts = 4 seconds at 1024Hz - if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { - //Error_Handler(); - } - else { - #if PIN_EXISTS(LED) && DISABLED(PINS_DEBUGGING) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } +#include "watchdog.h" + +#define WDT_TIMEOUT_COUNT TERN(WATCHDOG_DURATION_8S, 8192, 4096) // 4 or 8 second timeout + +IWDG_HandleTypeDef hiwdg; + +void watchdog_init() { + hiwdg.Instance = IWDG; + hiwdg.Init.Prescaler = IWDG_PRESCALER_32; // 32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock + hiwdg.Init.Reload = WDT_TIMEOUT_COUNT - 1; + if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { + //Error_Handler(); + } + else { + #if PIN_EXISTS(LED) && DISABLED(PINS_DEBUGGING) + TOGGLE(LED_PIN); // heartbeat indicator + #endif } +} - void HAL_watchdog_refresh() { - /* Refresh IWDG: reload counter */ - if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { - /* Refresh Error */ - //Error_Handler(); - } +void HAL_watchdog_refresh() { + /* Refresh IWDG: reload counter */ + if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { + /* Refresh Error */ + //Error_Handler(); } +} #endif // USE_WATCHDOG #endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp b/Marlin/src/HAL/TEENSY31_32/watchdog.cpp index 9f7b70d9f961..5e21236129db 100644 --- a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY31_32/watchdog.cpp @@ -27,9 +27,11 @@ #include "watchdog.h" +#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout + void watchdog_init() { WDOG_TOVALH = 0; - WDOG_TOVALL = 4000; + WDOG_TOVALL = WDT_TIMEOUT_MS; WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; } diff --git a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp b/Marlin/src/HAL/TEENSY35_36/watchdog.cpp index e735ee79238f..3825e2792869 100644 --- a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY35_36/watchdog.cpp @@ -27,9 +27,11 @@ #include "watchdog.h" +#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout + void watchdog_init() { WDOG_TOVALH = 0; - WDOG_TOVALL = 4000; + WDOG_TOVALL = WDT_TIMEOUT_MS; WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; } diff --git a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp b/Marlin/src/HAL/TEENSY40_41/watchdog.cpp index 8b05ddb153eb..dd7c0aa92f09 100644 --- a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY40_41/watchdog.cpp @@ -19,31 +19,27 @@ * along with this program. If not, see . * */ +#ifdef __IMXRT1062__ /** * HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ -#ifdef __IMXRT1062__ - #include "../../inc/MarlinConfig.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" -// 4 seconds timeout -#define WDTO 4 //seconds +#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout -uint8_t timeoutval = (WDTO - 0.5f) / 0.5f; +constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f; void watchdog_init() { - CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks WDOG1_WMCR = 0; // disable power down PDE WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval); WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE; - } void HAL_watchdog_refresh() { From a1cce36c1ed4d551ce699f13ba49d7fb3c2ce328 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 4 Nov 2020 23:15:19 +0200 Subject: [PATCH 083/443] FAST_PWM for STM32 (#20025) --- Marlin/src/HAL/STM32/HAL.h | 17 ++++++++ Marlin/src/HAL/STM32/fast_pwm.cpp | 57 ++++++++++++++++++++++++++ Marlin/src/HAL/STM32/inc/SanityCheck.h | 3 -- Marlin/src/HAL/STM32/timers.cpp | 1 - Marlin/src/HAL/STM32/timers.h | 2 + 5 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 Marlin/src/HAL/STM32/fast_pwm.cpp diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 3cd138ba618c..c92c8890ea96 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -185,3 +185,20 @@ typedef void (*systickCallback_t)(void); void systick_attach_callback(systickCallback_t cb); void HAL_SYSTICK_Callback(); extern volatile uint32_t systick_uptime_millis; + +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + +/** + * set_pwm_frequency + * Set the frequency of the timer corresponding to the provided pin + * All Timer PWM pins run at the same frequency + */ +void set_pwm_frequency(const pin_t pin, int f_desired); + +/** + * set_pwm_duty + * Set the PWM duty cycle of the provided pin to the provided value + * Optionally allows inverting the duty cycle [default = false] + * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] + */ +void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp new file mode 100644 index 000000000000..cf8e16e4b132 --- /dev/null +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfigPre.h" + +#if NEEDS_HARDWARE_PWM + +#include "HAL.h" +#include "timers.h" + +void set_pwm_frequency(const pin_t pin, int f_desired) { + if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer + + PinName pin_name = digitalPinToPinName(pin); + TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance + + LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers + if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance) + return; + + pwm_start(pin_name, f_desired, 0, RESOLUTION_8B_COMPARE_FORMAT); +} + +void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { + PinName pin_name = digitalPinToPinName(pin); + TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); + uint16_t adj_val = Instance->ARR * v / v_size; + if (invert) adj_val = Instance->ARR - adj_val; + + switch (get_pwm_channel(pin_name)) { + case TIM_CHANNEL_1: LL_TIM_OC_SetCompareCH1(Instance, adj_val); break; + case TIM_CHANNEL_2: LL_TIM_OC_SetCompareCH2(Instance, adj_val); break; + case TIM_CHANNEL_3: LL_TIM_OC_SetCompareCH3(Instance, adj_val); break; + case TIM_CHANNEL_4: LL_TIM_OC_SetCompareCH4(Instance, adj_val); break; + } +} + +#endif // NEEDS_HARDWARE_PWM diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index 30d0750d90e0..c51fecc7bdb9 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -28,9 +28,6 @@ // #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" //#endif -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY - #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32." -#endif #if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index 442aa74d1c37..90f8c3dc94fa 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -27,7 +27,6 @@ // Local defines // ------------------------ -#define NUM_HARDWARE_TIMERS 2 // Default timer priorities. Override by specifying alternate priorities in the board pins file. // The TONE timer is not present here, as it currently cannot be set programmatically. It is set diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index de762794eee6..2bf70fc0facf 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -43,6 +43,8 @@ #define hal_timer_t uint32_t #define HAL_TIMER_TYPE_MAX UINT16_MAX +#define NUM_HARDWARE_TIMERS 2 + #ifndef STEP_TIMER_NUM #define STEP_TIMER_NUM 0 // Timer Index for Stepper #endif From 040782802778e1af9773e6114d487ccc84f0431c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 5 Nov 2020 00:10:28 +0000 Subject: [PATCH 084/443] [cron] Bump distribution date (2020-11-05) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index fa505310efb9..d4b3e4c27147 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-04" + #define STRING_DISTRIBUTION_DATE "2020-11-05" #endif /** From c43ca39ec214705e059fed9d7290909161541dc6 Mon Sep 17 00:00:00 2001 From: Josh Schroeder Date: Wed, 4 Nov 2020 22:15:25 -0500 Subject: [PATCH 085/443] Wiring warning for ANET_FULL_GRAPHICS_LCD on SKR 1.4 (#20011) --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 24 ++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 2b8682aac7ba..2fcf42d9bb6a 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -234,7 +234,29 @@ */ #if HAS_WIRED_LCD #if ENABLED(ANET_FULL_GRAPHICS_LCD) - + #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." + + /** + * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. + * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.) + * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board. + * + * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! + * + * The ANET_FULL_GRAPHICS_LCD connector plug: + * + * 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 + * ----- ----- + * LCD LCD + */ + #define LCD_PINS_RS P1_23 #define BTN_EN1 P1_20 From 1f6612dfc411d777c1e12df153b6f35703e54213 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 5 Nov 2020 17:16:27 -0600 Subject: [PATCH 086/443] Comment, spacing cleanup --- Marlin/src/HAL/STM32/eeprom_flash.cpp | 2 +- Marlin/src/HAL/STM32/fast_pwm.cpp | 2 +- Marlin/src/HAL/STM32F1/watchdog.cpp | 6 ++---- Marlin/src/HAL/STM32F1/watchdog.h | 8 +++----- Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 5 +++++ Marlin/src/inc/SanityCheck.h | 11 +---------- .../src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h | 2 ++ Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 6 +++--- 11 files changed, 21 insertions(+), 27 deletions(-) diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index c83376d2658a..702e42e561f8 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -113,7 +113,7 @@ bool PersistentStore::access_start() { // This must be the first time since power on that we have accessed the storage, or someone // loaded and called write_data and never called access_finish. // Lets go looking for the slot that holds our configuration. - if (eeprom_data_written) DEBUG_ECHOLN("Dangling EEPROM write_data"); + if (eeprom_data_written) DEBUG_ECHOLNPGM("Dangling EEPROM write_data"); uint32_t address = FLASH_ADDRESS_START; while (address <= FLASH_ADDRESS_END) { uint32_t address_value = (*(__IO uint32_t*)address); diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp index cf8e16e4b132..99101c6e81fe 100644 --- a/Marlin/src/HAL/STM32/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -32,7 +32,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired) { PinName pin_name = digitalPinToPinName(pin); TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance - + LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance) return; diff --git a/Marlin/src/HAL/STM32F1/watchdog.cpp b/Marlin/src/HAL/STM32F1/watchdog.cpp index d37fe7dfc7fc..b812a4fa6403 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.cpp +++ b/Marlin/src/HAL/STM32F1/watchdog.cpp @@ -34,9 +34,7 @@ #include "watchdog.h" /** - * The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and - * 625 reload value (counts down to 0) - * use 1250 for 8 seconds + * The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). */ #define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout @@ -56,7 +54,7 @@ void watchdogSetup() { * * @return No return * - * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0) + * @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). */ void watchdog_init() { #if DISABLED(DISABLE_WATCHDOG_INIT) diff --git a/Marlin/src/HAL/STM32F1/watchdog.h b/Marlin/src/HAL/STM32F1/watchdog.h index 72513d476c11..68920f8cb692 100644 --- a/Marlin/src/HAL/STM32F1/watchdog.h +++ b/Marlin/src/HAL/STM32F1/watchdog.h @@ -27,11 +27,9 @@ #include -// Arduino STM32F1 core now has watchdog support - -// Initialize watchdog with a 4 second countdown time +// Initialize watchdog with a 4 or 8 second countdown time void watchdog_init(); -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or STM32F1 will reset. +// Reset watchdog. MUST be called every 4 or 8 seconds after the +// first watchdog_init or the STM32F1 will reset. void HAL_watchdog_refresh(); diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 6f2409f69f23..4ca103da5bac 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -113,7 +113,7 @@ void GcodeSuite::M3_M4(const bool is_M4) { else cutter.set_power(cutter.upower_to_ocr(get_s_power())); #elif ENABLED(SPINDLE_SERVO) - cutter.set_power(get_s_power()); + cutter.set_power(get_s_power()); #else cutter.set_enabled(true); #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 6f632aa569b6..a2ac480f2a77 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -675,6 +675,10 @@ #define HAS_BED_PROBE 1 #endif +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + #undef PROBE_MANUALLY +#endif + #if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING) #define PROBE_SELECTED 1 #endif @@ -747,6 +751,7 @@ #define HAS_PROBING_PROCEDURE 1 #endif #if !HAS_LEVELING + #undef PROBE_MANUALLY #undef RESTORE_LEVELING_AFTER_G28 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index cadf84abd1b0..443669bb2542 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1382,9 +1382,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Unified Bed Leveling */ - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - #if IS_SCARA #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." #elif DISABLED(EEPROM_SETTINGS) @@ -1410,13 +1407,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif ENABLED(MESH_BED_LEVELING) - // Hide PROBE_MANUALLY from the rest of the code - #undef PROBE_MANUALLY - - /** - * Mesh Bed Leveling - */ - + // Mesh Bed Leveling #if ENABLED(DELTA) #error "MESH_BED_LEVELING is not compatible with DELTA printers." #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9 diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp index e2f2fd934695..467444c21459 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp @@ -26,7 +26,7 @@ #if ENABLED(DGUS_LCD_UI_FYSETC) -#include "../DGUSDisplayDef.h" +#include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h index f6a65fe8a061..910f5f7791f9 100644 --- a/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h @@ -21,6 +21,8 @@ */ #pragma once +#include "../DGUSDisplayDef.h" + enum DGUSLCD_Screens : uint8_t { DGUSLCD_SCREEN_BOOT = 0, DGUSLCD_SCREEN_MAIN = 1, 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 2fcf42d9bb6a..8df631b67788 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -256,7 +256,7 @@ * ----- ----- * LCD LCD */ - + #define LCD_PINS_RS P1_23 #define BTN_EN1 P1_20 diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index ee2afb1d26ee..a0a3b45043f2 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -13,10 +13,10 @@ # Useful for JTAG debugging # -# It will separe release and debug build folders. -# It useful when we need keep two live versions: one debug, for debugging, +# It will separe release and debug build folders. +# It useful when we need keep two live versions: one debug, for debugging, # other release, for flashing. # Without this, PIO will recompile everything twice for any small change. -# +# if env.GetBuildType() == "debug": env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' From 077b9201ef0de16fee6f95d79dac0fbd19633793 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 5 Nov 2020 16:10:18 -0800 Subject: [PATCH 087/443] Fix BTT002 PeripheralPins PWM assignments (#20036) --- .../variants/BIGTREE_BTT002/PeripheralPins.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c index cff269db0b90..bee09b15b156 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c @@ -114,14 +114,10 @@ const PinMap PinMap_I2C_SCL[] = { #ifdef HAL_TIM_MODULE_ENABLED const PinMap PinMap_PWM[] = { - {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 HEATER0 - {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 HEATER1 - {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 HEATER2 - {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 BED - {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 FAN0 - {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 FAN1 - {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 FAN2 - {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 EXTENSION1-4 + {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 BED + {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 HEATER0 + {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 FAN0 + {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 FAN1 /** * Unused by specifications on BTT002. (PLEASE CONFIRM) @@ -132,9 +128,9 @@ const PinMap PinMap_PWM[] = { */ //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 - //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 BLTOUCH is a "servo" + //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 - //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 BLTOUCH is a "servo" + //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 @@ -154,8 +150,10 @@ const PinMap PinMap_PWM[] = { //{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 //{PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 //{PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 //{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 @@ -163,9 +161,7 @@ const PinMap PinMap_PWM[] = { //{PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 //{PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 //{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - //{PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 //{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 //{PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 //{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N @@ -180,7 +176,11 @@ const PinMap PinMap_PWM[] = { //{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 //{PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 //{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + //{PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + //{PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 + //{PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + //{PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 //{PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 //{PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 //{PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N From 323b3a63d68d87de235dbdc04e798756bbd9510d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 6 Nov 2020 00:10:33 +0000 Subject: [PATCH 088/443] [cron] Bump distribution date (2020-11-06) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d4b3e4c27147..35c6ae618577 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-05" + #define STRING_DISTRIBUTION_DATE "2020-11-06" #endif /** From f924344cc57d2c4503edfdc9e681f3ddb5052b4e Mon Sep 17 00:00:00 2001 From: Sergey1560 <53866542+Sergey1560@users.noreply.github.com> Date: Fri, 6 Nov 2020 03:13:21 +0300 Subject: [PATCH 089/443] Don't close diveDir in fileExists (#20035) --- Marlin/src/sd/cardreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index a633440ff668..5a914050c4cb 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -637,7 +637,7 @@ bool CardReader::fileExists(const char * const path) { if (fname) { diveDir->rewind(); selectByName(*diveDir, fname); - diveDir->close(); + //diveDir->close(); } return !!fname; } From ce904475312fbe573efadf96e125fcf284a8bbd6 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 5 Nov 2020 16:15:29 -0800 Subject: [PATCH 090/443] Fix 0 extruders & bed compile (#20030) --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 3 +++ Marlin/src/lcd/menu/menu_temperature.cpp | 9 ++------- buildroot/tests/rambo-tests | 10 ++++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index d07474d810e3..85654b9189b4 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -104,6 +104,9 @@ #if DO_DRAW_HOTENDS #define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) +#endif + +#if EITHER(DO_DRAW_BED, DO_DRAW_HOTENDS) #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) #endif diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 28ea54efbab1..f91430132838 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -63,15 +63,14 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i #if HAS_TEMP_HOTEND inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); } - #if HAS_HEATED_BED - inline void _preheat_both(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, m); } - #endif + void do_preheat_end_m() { _preheat_end(editable.int8, 0); } #endif #if HAS_HEATED_BED inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(-1, -1, m); } #endif #if HAS_TEMP_HOTEND && HAS_HEATED_BED + inline void _preheat_both(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, m); } // Indexed "Preheat ABC" and "Heat Bed" items #define PREHEAT_ITEMS(M,E) do{ \ @@ -86,10 +85,6 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i #endif - void do_preheat_end_m() { - _preheat_end(editable.int8, 0); - } - #if HAS_MULTI_HOTEND || HAS_HEATED_BED // Set editable.int8 to the Material index before entering this menu diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index ec8af16c23b4..6fc720d1e14a 100644 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -60,6 +60,16 @@ opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS exec_test $1 $2 "Rambo CNC Configuration" +# +# Rambo heated bed only +# +restore_configs +opt_set MOTHERBOARD BOARD_RAMBO +opt_set EXTRUDERS 0 +opt_set TEMP_SENSOR_BED 1 +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +exec_test $1 $2 "Rambo heated bed only" + # # Build with the default configurations # From c574bcce880e769ae3851304da2a1b1ee19466ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Jovan=C3=AD=20Gonz=C3=A1lez?= Date: Fri, 6 Nov 2020 01:16:08 +0100 Subject: [PATCH 091/443] Add Spanish translations (#20020) --- Marlin/src/lcd/language/language_es.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index c77b12ee7749..ca7328c3e60f 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -43,9 +43,11 @@ namespace Language_es { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD/USB insertado"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD/USB retirado"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Esperando al SD/USB"); + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("Fallo al iniciar SD"); PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Error lectura SD/USB"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Disp. USB retirado"); PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Inicio USB fallido"); + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Desbordamiento de subllamada"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); @@ -60,6 +62,10 @@ namespace Language_es { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Origen Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Origen Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto alineado Z"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Recorrido asistido"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Iteración: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("¡Precisión disminuyendo!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precisión conseguida"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origen XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Pulsar para comenzar"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Siguiente punto"); From 78e10d346ab407ef2fdf4d8c9f43e6327c5c3136 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 7 Nov 2020 00:10:42 +0000 Subject: [PATCH 092/443] [cron] Bump distribution date (2020-11-07) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 35c6ae618577..217f076a82f1 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-06" + #define STRING_DISTRIBUTION_DATE "2020-11-07" #endif /** From af75e24c2e4bb380dc9496cba5fd397f056ad0ab Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Nov 2020 19:09:29 -0600 Subject: [PATCH 093/443] Clean up corrected urls --- Marlin/src/core/multi_language.h | 2 +- Marlin/src/lcd/extui/example.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h | 2 +- .../lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp | 2 +- .../lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h | 2 +- .../ftdi_eve_lib/extended/command_processor.cpp | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.h | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp | 2 +- .../lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h | 2 +- .../ftdi_eve_lib/extended/unicode/font_bitmaps.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/font_bitmaps.h | 2 +- .../ftdi_eve_lib/extended/unicode/font_size_t.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/font_size_t.h | 2 +- .../ftdi_eve_lib/extended/unicode/standard_char_set.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/standard_char_set.h | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h | 2 +- .../ftdi_eve_lib/extended/unicode/western_char_set.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/western_char_set.h | 2 +- .../ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp | 2 +- .../ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp | 2 +- .../screens/base_numeric_adjustment_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h | 2 +- .../lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h | 2 +- .../lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp | 2 +- .../screens/confirm_abort_print_dialog_box.cpp | 2 +- .../screens/confirm_auto_calibration_dialog_box.cpp | 2 +- .../screens/confirm_erase_flash_dialog_box.cpp | 2 +- .../screens/confirm_start_print_dialog_box.cpp | 2 +- .../screens/confirm_user_request_alert_box.cpp | 2 +- .../ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp | 2 +- .../ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp | 2 +- .../screens/stepper_bump_sensitivity_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp | 2 +- .../lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp | 2 +- .../src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h | 2 +- .../lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h | 2 +- .../lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h | 2 +- Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h | 2 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/extui/ui_api.h | 2 +- Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp | 2 +- Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h | 2 +- 143 files changed, 143 insertions(+), 143 deletions(-) diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h index 5852c439a845..6af4af2f8df4 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/example.cpp b/Marlin/src/lcd/extui/example.cpp index a5ef5652bc0f..592d67214d07 100644 --- a/Marlin/src/lcd/extui/example.cpp +++ b/Marlin/src/lcd/extui/example.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index 2c466ffd0449..a64c237fa13f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h index 3edc2a9de1c8..eef8cf8677ca 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ class SPIFlash { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp index 46683401dca7..8d2d74ea2607 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index fcaa610e8bdb..be393a952c30 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h index 11ad0798b56f..741b7076d146 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/compat.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h index 7476c9e67e4c..76b231536bea 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h index c09d10f1488c..6bb920885a5b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index bb95411e06fd..f64f2b5b5f0b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_basic.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h index a9fdb5c5c73c..74a7f298002a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h index 1e6642fedc19..507e25151846 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h index 75a2d54fca52..47cd698253c3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h index 4063bf2d5dc7..26053709d3ca 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h index 448717b47834..e57d11c3a736 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /**************************************************************************** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h index 8d455907e91a..d90fc1e8f044 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp index d91d08fbfa05..a9b46e013bad 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_basic.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h index 30ec786c60ae..e3a23d768f19 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index 436c67edf2eb..cd41a5fe06df 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h index b763c890c20b..73260703c2a0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp index 7224b681bba5..a7777a97fe07 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index 94ccbb7a605b..b27ed7f59e7d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index baed9f8502fe..9f2b6dd35fbc 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h index da927aeae23a..44934f909a26 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp index 3dd2b88b19f7..0808f2f4f253 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h index d9bede92dfbc..c5f08297bed5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h index 6e4d0668fe3e..006978babb1e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h index e3c3ebb39d5a..490cbd4e548f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h index 7da621321141..202c3cd7fb79 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h index 2b18244e22fb..62762ee964b2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp index 57a9e3e89b0a..81a081faae7a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h index d1f84c8a6e86..ef923614986f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h index fbdfe2fe998a..20df15a91edb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index 6a5b6e3cf879..481589854bfa 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h index e2650b10aeff..fcfe70bd76d1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index 3616f15ab620..18e5d4bc5b00 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h index 261995147cd4..9d8cd440615e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index b2f62f060ccc..a69280f5fc2e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.h index 7852b7ec3e38..a2d8aa944391 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp index 58ec96ac15fb..84233c5ce39c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h index 700da7bcf2f9..f64d033d524b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp index c5126721abb2..e288d270307c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h index f1e22e17ddf5..185b53e6ff87 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp index 733cf8f6603a..0e251f7bb1c7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h index f5bf644ef9e7..a2cb8b25c97a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp index b50c12fc6df1..b795e01d42d3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h index 7decdfd38f66..e320bd7344f2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index bee3f74cab4f..d21b7f0e7f32 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index 16f7e197b589..566f21218763 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp index 4aa2580c633a..af0f5cb8435e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../ftdi_extended.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h index 2adad2327afa..652bd6b2ebed 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h index 3426e1377dbf..3f85cf02aa61 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h index 5357de3ef36c..669513404636 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py index da08014e893e..c6eba3946c63 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py @@ -56,7 +56,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h index 5c1a74f66e9d..c5ddbb4a6114 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp index 912c95731d12..e4ecdc8b4900 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h index 873e84455ad0..cbc05c5aa3b0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index ce60ab5090dd..807c816307df 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp index fe68faefee44..ed7e653af1a6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h index 5ad84c60b0ff..ae95a647091c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp index 9cd17637bd52..952f0cac0235 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index cfb268f0b44f..1b7d04331459 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp index bd09d2a5cd20..89d9f053303f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp index 8d65518455dd..58f4544ffc5b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp index 1c4ef594bb4e..10cbd3bc62a0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp index c84dd45f004f..16b26e68214d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index a11609dd97d2..eb8f74231338 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp index 76ebdca587e4..b2611be2509e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp index da772971ce01..85885fb38837 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp index 48ce320482b2..102631f18ed3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp index e2bb8a241402..5ddc2d02aea1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h index 9279fd7df0d6..4faddc64b1d9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h index f03e3413f833..50fc5ab9f846 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp index c5e26da98a32..fc6dc5ee57bd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index e881995f2e69..2515732d43de 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp index 0d8d71b45ce1..9723abba0998 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp index 4ce8f608f123..e79f25fcb52d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp index 776a9fe5f716..5b2b7d4116a8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 60394d06dfb5..3f85fc9320fd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp index eb3e2a3e01e7..528d93d5d17f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp index 7e1a82025ddc..f7c85672aff9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp index 574de2108829..baf5959c1b0e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp index 4e5b174d53f0..0dbee2414db1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp index 6b6affadd569..93dfcba47d2e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp index 8496955f732c..203b2b037e30 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp index 8e56c4197bbd..3a5abf944936 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp index 782ae7bbc7f8..2ae3d7b049fd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp index 8845dfb5c0aa..1a4d9fd70548 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 7f3f507fd64f..41f72e8e5375 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp index 2698708e51ba..28f0e6a73158 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp index 82ee118e4c68..dfdba33b08d0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp index f1808bf20e69..c281ccb05081 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index f4c224dbe8cf..90e304007959 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp index c806ef499b65..3f0e25f73447 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp index 25a44c1adbb5..8fb813e79f8e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp index b96c2be7c80c..9c751bc34521 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp index d365b12eb143..329fa6c97f42 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp index d98324623c28..273da348c1d9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp index 5b4c1c917536..6c5dfcfa9fb5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp index a91d48c0376c..a202a611ec70 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp index 8a5c675facc4..2feaa032955e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp index 7854ce5e395c..35bbd7ad906c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 53e3ab00c736..17e15afc5ccd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp index 29ac2f1b4038..fdbb9623b5e5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp index 2316f93ee236..ac1374b99aef 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp index d7e476e04ef5..8912663f27ba 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp index 5dd3174821e2..06faf303e2f2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp index 07d6900c16f4..85c7206b049f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp index ed3c8d999b4b..aac0f9a277e0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp index a8891162ea0d..03f9e2c46593 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp index 69eecaf54b36..c3110b77dc65 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp index 94b8ac0fb50f..9be2239797d6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp index f4a99accd63d..350e2de7eb64 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h index dc38890a0efc..dab411a25691 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screen_data.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index 16aa68216842..64927d58d936 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 71fc7d9ee30d..7b062045f97d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp index de7eb92a8897..a4464c1e4937 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp index cb263248088e..0e224da9670c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index fc7453fca70f..8aef5dd41375 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp index 693d125fbf48..84d76dcefa85 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp index 136582f09aa7..d6e36c1efa5d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp index 92035d1b1c04..e9bc50ae453f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp index 44ee453f15e6..2ffbdb9b8ec7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp index b7ce76ecd2b3..c3114a39227d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h index e37a82d28a5f..545c701700a7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/string_format.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp index c254d2997f62..e320bf5a015a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp index 436445024a2f..185512b57b45 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp index 8c3bc856b3c7..cd5cedf46304 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 258ee4b04fb0..894b238ae01e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp index d7c456204123..6a9acbf8f1dc 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp index f5cd03697c08..dd211e343962 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../config.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h index 2cb039c84df9..8c0366ebebad 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bitmaps.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h index 4e2fde6ab333..cdcf00a21b25 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h @@ -18,7 +18,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h index 63115b418730..bdb9d492aba8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h index eb9cadeba1e4..e023599a27c1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h index dd5088e0ce2b..e3a30a6dfeff 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h @@ -11,7 +11,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp index f4a80bcc09fd..afbed0cab123 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.cpp @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../compat.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h index b2b889038650..66c1cb810ca8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/sounds.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h index df7782ce87dd..e0f0f31da509 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/theme.h @@ -17,7 +17,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 80033e911ba3..ac8e6ebf88ba 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -38,7 +38,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 48d0e9722060..c429a0aadee9 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -39,7 +39,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 6d2182cb8bbd..358b49d5b422 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /* What follows is a modified version of the MAX3421e originally defined in diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h index 07ca811a4def..5c3b852d5506 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ #pragma once From 0a64f197d9796b8e786f511c17079cfabfacd436 Mon Sep 17 00:00:00 2001 From: Mauro Date: Sat, 7 Nov 2020 02:28:41 +0100 Subject: [PATCH 094/443] Fix E4d@box pins, stepper i2s (#20055) --- Marlin/src/pins/esp32/pins_E4D.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index ebb8e1af7dc8..2a1f070ddaaf 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -31,7 +31,7 @@ #error "Oops! Select an ESP32 board in 'Tools > Board.'" #elif EXTRUDERS > 1 || E_STEPPERS > 1 #error "E4d@box only supports one E Stepper. Comment out this line to continue." -#elif HOTENDS > 2 +#elif HOTENDS > 1 #error "E4d@box currently supports only one hotend. Comment out this line to continue." #endif @@ -39,6 +39,21 @@ #define BOARD_WEBSITE_URL "github.com/Exilaus/E4d@box" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +// +// Disable I2S stepper stream +// +#undef I2S_STEPPER_STREAM + +// +// Redefine I2S for ESP32 +// +#undef I2S_WS +#define I2S_WS 23 +#undef I2S_BCK +#define I2S_BCK 22 +#undef I2S_DATA +#define I2S_DATA 21 + // // Limit Switches // @@ -82,9 +97,11 @@ #define FAN_PIN 0 #define HEATER_BED_PIN 15 -// SPI +// +// MicroSD card on SPI +// +#define MOSI_PIN 23 +#define MISO_PIN 19 +#define SCK_PIN 18 #define SDSS 5 -#define I2S_STEPPER_STREAM -#define I2S_WS 23 -#define I2S_BCK 22 -#define I2S_DATA 21 +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers From 97d7af7a23040ca681657c2e29be48c221d0b671 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Nov 2020 20:16:30 -0600 Subject: [PATCH 095/443] Use nullptr --- .../extended/unicode/western_char_set.cpp | 2 +- .../ftdi_eve_lib/extras/poly_ui.h | 4 ++-- Marlin/src/lcd/tft/tft_string.h | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp index af0f5cb8435e..171637f03ab6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -435,7 +435,7 @@ base_char = base_special ? NO_DOT_I : std_char; } - // If cmd != NULL, draw the glyph to the screen + // If cmd != nullptr, draw the glyph to the screen if (cmd) { ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char); if (accent_char) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h index a501de20ba87..ba41650f2f84 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h @@ -90,7 +90,7 @@ class PolyReader { if (start_x != eol) close_loop(); else - p = NULL; + p = nullptr; } else { x = pgm_read_word_far(p++); @@ -106,7 +106,7 @@ class PolyReader { } } - bool has_more() { return p != NULL; } + bool has_more() { return p != nullptr; } bool end_of_loop() { return start_x == eol; } }; diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 924d6de43027..e800b1ded95e 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -80,22 +80,22 @@ 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] == NULL ? glyphs[0x3F] : glyphs[character]; } /* Use '?' for unknown glyphs */ + 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 void set(); static void add(uint8_t character) { add_character(character); eol(); } static void add(uint8_t *string); - static void add(uint8_t *string, int8_t index, uint8_t *itemString = NULL); + 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 = NULL) { set(); add(string, index, (uint8_t *)itemString); }; + 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 = NULL) { set((uint8_t *)string, index, itemString); } + 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 trim(uint8_t character = 0x20); - static void rtrim(uint8_t character = 0x20); - static void ltrim(uint8_t character = 0x20); + static void trim(uint8_t character=0x20); + static void rtrim(uint8_t character=0x20); + static void ltrim(uint8_t character=0x20); 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; } From 85d094bbb4cb6200057403be3d208a29920ecf12 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 7 Nov 2020 00:07:15 -0300 Subject: [PATCH 096/443] Standardize Marlin SPI (part 1) (#19989) --- .github/workflows/test-builds.yml | 1 + Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 39 ++--- Marlin/src/HAL/LPC1768/MarlinSPI.h | 45 +++++ Marlin/src/HAL/LPC1768/include/SPI.h | 5 + Marlin/src/HAL/STM32/MarlinSPI.cpp | 161 ++++++++++++++++++ Marlin/src/HAL/STM32/MarlinSPI.h | 107 ++++++++++++ Marlin/src/HAL/STM32/timers.h | 2 +- Marlin/src/HAL/STM32F1/MarlinSPI.h | 45 +++++ Marlin/src/HAL/STM32F1/SPI.cpp | 12 ++ Marlin/src/HAL/STM32F1/SPI.h | 5 + Marlin/src/lcd/lcdprint.cpp | 7 +- Marlin/src/lcd/tft/tft_string.cpp | 38 +++-- Marlin/src/libs/W25Qxx.cpp | 30 ++-- Marlin/src/libs/W25Qxx.h | 4 + Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 3 + buildroot/tests/mks_robin_nano35-tests | 2 +- buildroot/tests/mks_robin_nano35_stm32-tests | 69 ++++++++ 17 files changed, 522 insertions(+), 53 deletions(-) create mode 100644 Marlin/src/HAL/LPC1768/MarlinSPI.h create mode 100644 Marlin/src/HAL/STM32/MarlinSPI.cpp create mode 100644 Marlin/src/HAL/STM32/MarlinSPI.h create mode 100644 Marlin/src/HAL/STM32F1/MarlinSPI.h create mode 100644 buildroot/tests/mks_robin_nano35_stm32-tests diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 962473383892..41b3047485f2 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -83,6 +83,7 @@ jobs: - STM32F103RET6_creality - LERDGEX - mks_robin_nano35 + - mks_robin_nano35_stm32 - NUCLEO_F767ZI # Put lengthy tests last diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index b800721c5abc..16ac789fc0f3 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -127,11 +127,9 @@ for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]); } - void spiSend(uint32_t chan, byte b) { - } + void spiSend(uint32_t chan, byte b) {} - void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) { - } + void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {} // Read single byte from SPI uint8_t spiRec() { return doio(0xFF); } @@ -143,9 +141,7 @@ for (uint16_t i = 0; i < nbyte; i++) buf[i] = doio(0xFF); } - uint8_t spiTransfer(uint8_t b) { - return doio(b); - } + uint8_t spiTransfer(uint8_t b) { return doio(b); } // Write from buffer to SPI void spiSendBlock(uint8_t token, const uint8_t* buf) { @@ -201,6 +197,15 @@ SPIClass::SPIClass(uint8_t device) { GPDMA_Init(); } +SPIClass::SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel) { + #if BOARD_NR_SPI >= 1 + if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1); + #endif + #if BOARD_NR_SPI >= 2 + if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2); + #endif +} + void SPIClass::begin() { // Init the SPI pins in the first begin call if ((_currentSetting->spi_d == LPC_SSP0 && spiInitialised[0] == false) || @@ -331,25 +336,15 @@ void SPIClass::read(uint8_t *buf, uint32_t len) { for (uint16_t i = 0; i < len; i++) buf[i] = transfer(0xFF); } -void SPIClass::setClock(uint32_t clock) { - _currentSetting->clock = clock; -} +void SPIClass::setClock(uint32_t clock) { _currentSetting->clock = clock; } -void SPIClass::setModule(uint8_t device) { - _currentSetting = &_settings[device - 1];// SPI channels are called 1 2 and 3 but the array is zero indexed -} +void SPIClass::setModule(uint8_t device) { _currentSetting = &_settings[device - 1]; } // SPI channels are called 1, 2, and 3 but the array is zero-indexed -void SPIClass::setBitOrder(uint8_t bitOrder) { - _currentSetting->bitOrder = bitOrder; -} +void SPIClass::setBitOrder(uint8_t bitOrder) { _currentSetting->bitOrder = bitOrder; } -void SPIClass::setDataMode(uint8_t dataMode) { - _currentSetting->dataMode = dataMode; -} +void SPIClass::setDataMode(uint8_t dataMode) { _currentSetting->dataMode = dataMode; } -void SPIClass::setDataSize(uint32_t ds) { - _currentSetting->dataSize = ds; -} +void SPIClass::setDataSize(uint32_t dataSize) { _currentSetting->dataSize = dataSize; } /** * Set up/tear down diff --git a/Marlin/src/HAL/LPC1768/MarlinSPI.h b/Marlin/src/HAL/LPC1768/MarlinSPI.h new file mode 100644 index 000000000000..fab245f904e3 --- /dev/null +++ b/Marlin/src/HAL/LPC1768/MarlinSPI.h @@ -0,0 +1,45 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +/** + * Marlin currently requires 3 SPI classes: + * + * SPIClass: + * This class is normally provided by frameworks and has a semi-default interface. + * This is needed because some libraries reference it globally. + * + * SPISettings: + * Container for SPI configs for SPIClass. As above, libraries may reference it globally. + * + * These two classes are often provided by frameworks so we cannot extend them to add + * useful methods for Marlin. + * + * MarlinSPI: + * Provides the default SPIClass interface plus some Marlin goodies such as a simplified + * interface for SPI DMA transfer. + * + */ + +using MarlinSPI = SPIClass; diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index ffcd87fe9665..ecd91f6a3b73 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -126,6 +126,11 @@ class SPIClass { */ SPIClass(uint8_t spiPortNumber); + /** + * Init using pins + */ + SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)-1); + /** * Select and configure the current selected SPI device to use */ diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp new file mode 100644 index 000000000000..fd05b1aeb4e8 --- /dev/null +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -0,0 +1,161 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "MarlinSPI.h" + +static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) { + spi_init(obj, speed, mode, msb); + // spi_init set 8bit always + // TODO: copy the code from spi_init and handle data size, to avoid double init always!! + if (dataSize != SPI_DATASIZE_8BIT) { + obj->handle.Init.DataSize = dataSize; + HAL_SPI_Init(&obj->handle); + __HAL_SPI_ENABLE(&obj->handle); + } +} + +void MarlinSPI::setClockDivider(uint8_t _div) { + _speed = spi_getClkFreq(&_spi);// / _div; + _clockDivider = _div; +} + +void MarlinSPI::begin(void) { + //TODO: only call spi_init if any parameter changed!! + spi_init(&_spi, _speed, _dataMode, _bitOrder, _dataSize); +} + +void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc) { + _dmaHandle.Init.Direction = direction; + _dmaHandle.Init.PeriphInc = DMA_PINC_DISABLE; + _dmaHandle.Init.Mode = DMA_NORMAL; + _dmaHandle.Init.Priority = DMA_PRIORITY_LOW; + _dmaHandle.Init.MemInc = minc ? DMA_MINC_ENABLE : DMA_MINC_DISABLE; + + if (_dataSize == DATA_SIZE_8BIT) { + _dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + _dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + } + else { + _dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; + _dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; + } + #ifdef STM32F4xx + _dmaHandle.Init.Channel = DMA_CHANNEL_3; + _dmaHandle.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + #endif + + // start DMA hardware + // TODO: check if hardware is already enabled + #ifdef SPI1_BASE + if (_spiHandle.Instance == SPI1) { + #ifdef STM32F1xx + __HAL_RCC_DMA1_CLK_ENABLE(); + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel3 : DMA1_Channel2; + #elif defined(STM32F4xx) + __HAL_RCC_DMA2_CLK_ENABLE(); + _dmaHandle.Instance = DMA2_Stream3; + #endif + } + #endif + #ifdef SPI2_BASE + if (_spiHandle.Instance == SPI2) { + #ifdef STM32F1xx + __HAL_RCC_DMA1_CLK_ENABLE(); + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel5 : DMA1_Channel4; + #elif defined(STM32F4xx) + //TODO: f4 dma config + #endif + } + #endif + #ifdef SPI3_BASE + if (_spiHandle.Instance == SPI3) { + #ifdef STM32F1xx + __HAL_RCC_DMA2_CLK_ENABLE(); + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA2_Channel2 : DMA2_Channel1; + #elif defined(STM32F4xx) + //TODO: f4 dma config + #endif + } + #endif + + HAL_DMA_Init(&_dmaHandle); +} + +byte MarlinSPI::transfer(uint8_t _data) { + uint8_t rxData = 0xFF; + HAL_SPI_TransmitReceive(&_spi.handle, &_data, &rxData, 1, HAL_MAX_DELAY); + return rxData; +} + +uint8_t MarlinSPI::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length) { + const uint8_t ff = 0xFF; + + //if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) //only enable if disabled + __HAL_SPI_ENABLE(&_spi.handle); + + if (receiveBuf) { + setupDma(_spi.handle, _dmaRx, DMA_PERIPH_TO_MEMORY, true); + HAL_DMA_Start(&_dmaRx, (uint32_t)&(_spi.handle.Instance->DR), (uint32_t)receiveBuf, length); + SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_RXDMAEN); /* Enable Rx DMA Request */ + } + + // check for 2 lines transfer + bool mincTransmit = true; + if (transmitBuf == nullptr && _spi.handle.Init.Direction == SPI_DIRECTION_2LINES && _spi.handle.Init.Mode == SPI_MODE_MASTER) { + transmitBuf = &ff; + mincTransmit = false; + } + + if (transmitBuf) { + setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, mincTransmit); + HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length); + SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */ + } + + if (transmitBuf) { + HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + HAL_DMA_Abort(&_dmaTx); + HAL_DMA_DeInit(&_dmaTx); + } + + // while ((_spi.handle.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {} + + if (receiveBuf) { + HAL_DMA_PollForTransfer(&_dmaRx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + HAL_DMA_Abort(&_dmaRx); + HAL_DMA_DeInit(&_dmaRx); + } + + return 1; +} + +uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) { + setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, minc); + HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length); + __HAL_SPI_ENABLE(&_spi.handle); + SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */ + HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + HAL_DMA_Abort(&_dmaTx); + // DeInit objects + HAL_DMA_DeInit(&_dmaTx); + return 1; +} diff --git a/Marlin/src/HAL/STM32/MarlinSPI.h b/Marlin/src/HAL/STM32/MarlinSPI.h new file mode 100644 index 000000000000..fbd3585ff447 --- /dev/null +++ b/Marlin/src/HAL/STM32/MarlinSPI.h @@ -0,0 +1,107 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "HAL.h" +#include + +extern "C" { + #include +} + +/** + * Marlin currently requires 3 SPI classes: + * + * SPIClass: + * This class is normally provided by frameworks and has a semi-default interface. + * This is needed because some libraries reference it globally. + * + * SPISettings: + * Container for SPI configs for SPIClass. As above, libraries may reference it globally. + * + * These two classes are often provided by frameworks so we cannot extend them to add + * useful methods for Marlin. + * + * MarlinSPI: + * Provides the default SPIClass interface plus some Marlin goodies such as a simplified + * interface for SPI DMA transfer. + * + */ + +#define DATA_SIZE_8BIT SPI_DATASIZE_8BIT +#define DATA_SIZE_16BIT SPI_DATASIZE_16BIT + +class MarlinSPI { +public: + MarlinSPI() : MarlinSPI(NC, NC, NC, NC) {} + + MarlinSPI(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)NC) : _mosiPin(mosi), _misoPin(miso), _sckPin(sclk), _ssPin(ssel) { + _spi.pin_miso = digitalPinToPinName(_misoPin); + _spi.pin_mosi = digitalPinToPinName(_mosiPin); + _spi.pin_sclk = digitalPinToPinName(_sckPin); + _spi.pin_ssel = digitalPinToPinName(_ssPin); + _dataSize = DATA_SIZE_8BIT; + _bitOrder = MSBFIRST; + _dataMode = SPI_MODE_0; + _spi.handle.State = HAL_SPI_STATE_RESET; + setClockDivider(SPI_SPEED_CLOCK_DIV2_MHZ); + } + + void begin(void); + void end(void) {} + + byte transfer(uint8_t _data); + uint8_t dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length); + uint8_t dmaSend(const void * transmitBuf, uint16_t length, bool minc = true); + + /* These methods are deprecated and kept for compatibility. + * Use SPISettings with SPI.beginTransaction() to configure SPI parameters. + */ + void setBitOrder(BitOrder _order) { _bitOrder = _order; } + + void setDataMode(uint8_t _mode) { + switch (_mode) { + case SPI_MODE0: _dataMode = SPI_MODE_0; break; + case SPI_MODE1: _dataMode = SPI_MODE_1; break; + case SPI_MODE2: _dataMode = SPI_MODE_2; break; + case SPI_MODE3: _dataMode = SPI_MODE_3; break; + } + } + + void setClockDivider(uint8_t _div); + +private: + void setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc = false); + + spi_t _spi; + DMA_HandleTypeDef _dmaTx; + DMA_HandleTypeDef _dmaRx; + BitOrder _bitOrder; + spi_mode_e _dataMode; + uint8_t _clockDivider; + uint32_t _speed; + uint32_t _dataSize; + pin_t _mosiPin; + pin_t _misoPin; + pin_t _sckPin; + pin_t _ssPin; +}; diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index 2bf70fc0facf..464982430358 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -105,7 +105,7 @@ void SetTimerInterruptPriorities(); // FORCE_INLINE because these are used in performance-critical situations FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) { - return timer_instance[timer_num] != NULL; + return timer_instance[timer_num] != nullptr; } FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0; diff --git a/Marlin/src/HAL/STM32F1/MarlinSPI.h b/Marlin/src/HAL/STM32F1/MarlinSPI.h new file mode 100644 index 000000000000..fab245f904e3 --- /dev/null +++ b/Marlin/src/HAL/STM32F1/MarlinSPI.h @@ -0,0 +1,45 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +/** + * Marlin currently requires 3 SPI classes: + * + * SPIClass: + * This class is normally provided by frameworks and has a semi-default interface. + * This is needed because some libraries reference it globally. + * + * SPISettings: + * Container for SPI configs for SPIClass. As above, libraries may reference it globally. + * + * These two classes are often provided by frameworks so we cannot extend them to add + * useful methods for Marlin. + * + * MarlinSPI: + * Provides the default SPIClass interface plus some Marlin goodies such as a simplified + * interface for SPI DMA transfer. + * + */ + +using MarlinSPI = SPIClass; diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index ef00b407a883..89951092380c 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -147,6 +147,18 @@ SPIClass::SPIClass(uint32_t spi_num) { _currentSetting->state = SPI_STATE_IDLE; } +SPIClass::SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel) { + #if BOARD_NR_SPI >= 1 + if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1); + #endif + #if BOARD_NR_SPI >= 2 + if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2); + #endif + #if BOARD_NR_SPI >= 3 + if (mosi == BOARD_SPI3_MOSI_PIN) SPIClass(3); + #endif +} + /** * Set up/tear down */ diff --git a/Marlin/src/HAL/STM32F1/SPI.h b/Marlin/src/HAL/STM32F1/SPI.h index 0d20a46577e7..828644f1ddb5 100644 --- a/Marlin/src/HAL/STM32F1/SPI.h +++ b/Marlin/src/HAL/STM32F1/SPI.h @@ -163,6 +163,11 @@ class SPIClass { */ SPIClass(uint32_t spiPortNumber); + /** + * Init using pins + */ + SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel=-1); + /** * @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0). */ diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index e381c590f578..6781b81d7c38 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -32,7 +32,12 @@ /** * lcd_put_u8str_ind_P - * Print a string with an index substituted within it + * + * Print a string with an index substituted within it: + * + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) */ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { uint8_t *p = (uint8_t*)pstr; diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index b707596bb314..eb805ac423dc 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -44,21 +44,21 @@ void TFT_String::set_font(const uint8_t *font) { for (glyph = 0; glyph < 256; glyph++) glyphs[glyph] = nullptr; - DEBUG_ECHOLNPAIR("Format: ", font_header->Format); - DEBUG_ECHOLNPAIR("BBXWidth: ", font_header->BBXWidth); - DEBUG_ECHOLNPAIR("BBXHeight: ", font_header->BBXHeight); - DEBUG_ECHOLNPAIR("BBXOffsetX: ", font_header->BBXOffsetX); - DEBUG_ECHOLNPAIR("BBXOffsetY: ", font_header->BBXOffsetY); - DEBUG_ECHOLNPAIR("CapitalAHeight: ", font_header->CapitalAHeight); - DEBUG_ECHOLNPAIR("Encoding65Pos: ", font_header->Encoding65Pos); - DEBUG_ECHOLNPAIR("Encoding97Pos: ", font_header->Encoding97Pos); + DEBUG_ECHOLNPAIR("Format: ", font_header->Format); + DEBUG_ECHOLNPAIR("BBXWidth: ", font_header->BBXWidth); + DEBUG_ECHOLNPAIR("BBXHeight: ", font_header->BBXHeight); + DEBUG_ECHOLNPAIR("BBXOffsetX: ", font_header->BBXOffsetX); + DEBUG_ECHOLNPAIR("BBXOffsetY: ", font_header->BBXOffsetY); + DEBUG_ECHOLNPAIR("CapitalAHeight: ", font_header->CapitalAHeight); + DEBUG_ECHOLNPAIR("Encoding65Pos: ", font_header->Encoding65Pos); + DEBUG_ECHOLNPAIR("Encoding97Pos: ", font_header->Encoding97Pos); DEBUG_ECHOLNPAIR("FontStartEncoding: ", font_header->FontStartEncoding); - DEBUG_ECHOLNPAIR("FontEndEncoding: ", font_header->FontEndEncoding); - DEBUG_ECHOLNPAIR("LowerGDescent: ", font_header->LowerGDescent); - DEBUG_ECHOLNPAIR("FontAscent: ", font_header->FontAscent); - DEBUG_ECHOLNPAIR("FontDescent: ", font_header->FontDescent); - DEBUG_ECHOLNPAIR("FontXAscent: ", font_header->FontXAscent); - DEBUG_ECHOLNPAIR("FontXDescent: ", font_header->FontXDescent); + DEBUG_ECHOLNPAIR("FontEndEncoding: ", font_header->FontEndEncoding); + DEBUG_ECHOLNPAIR("LowerGDescent: ", font_header->LowerGDescent); + DEBUG_ECHOLNPAIR("FontAscent: ", font_header->FontAscent); + DEBUG_ECHOLNPAIR("FontDescent: ", font_header->FontDescent); + DEBUG_ECHOLNPAIR("FontXAscent: ", font_header->FontXAscent); + DEBUG_ECHOLNPAIR("FontXDescent: ", font_header->FontXDescent); add_glyphs(font); } @@ -72,9 +72,8 @@ void TFT_String::add_glyphs(const uint8_t *font) { glyphs[glyph] = (glyph_t *)pointer; pointer += sizeof(glyph_t) + ((glyph_t *)pointer)->DataSize; } - else { + else pointer++; - } } } @@ -86,6 +85,13 @@ void TFT_String::set() { uint8_t read_byte(uint8_t *byte) { return *byte; } +/** + * Add a string, applying substitutions for the following characters: + * + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + */ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString) { wchar_t wchar; diff --git a/Marlin/src/libs/W25Qxx.cpp b/Marlin/src/libs/W25Qxx.cpp index 03e002f66f82..ebf326f2e5f2 100644 --- a/Marlin/src/libs/W25Qxx.cpp +++ b/Marlin/src/libs/W25Qxx.cpp @@ -25,7 +25,6 @@ #if HAS_SPI_FLASH #include "W25Qxx.h" -#include W25QXXFlash W25QXX; @@ -41,6 +40,11 @@ W25QXXFlash W25QXX; #ifndef SPI_FLASH_CS_PIN #define SPI_FLASH_CS_PIN W25QXX_CS_PIN #endif +#ifndef NC + #define NC -1 +#endif + +MarlinSPI W25QXXFlash::mySPI(SPI_FLASH_MOSI_PIN, SPI_FLASH_MISO_PIN, SPI_FLASH_SCK_PIN, NC); #define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) #define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) @@ -69,11 +73,11 @@ void W25QXXFlash::init(uint8_t spiRate) { case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; default: clock = SPI_CLOCK_DIV2;// Default from the SPI library } - SPI.setModule(SPI_DEVICE); - SPI.begin(); - SPI.setClockDivider(clock); - SPI.setBitOrder(MSBFIRST); - SPI.setDataMode(SPI_MODE0); + + mySPI.setClockDivider(clock); + mySPI.setBitOrder(MSBFIRST); + mySPI.setDataMode(SPI_MODE0); + mySPI.begin(); } /** @@ -82,12 +86,12 @@ void W25QXXFlash::init(uint8_t spiRate) { * @return Byte received */ uint8_t W25QXXFlash::spi_flash_Rec() { - const uint8_t returnByte = SPI.transfer(0xFF); + const uint8_t returnByte = mySPI.transfer(0xFF); return returnByte; } uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) { - const uint8_t returnByte = SPI.transfer(data); + const uint8_t returnByte = mySPI.transfer(data); return returnByte; } @@ -100,7 +104,9 @@ uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) { * * @details Uses DMA */ -void W25QXXFlash::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { SPI.dmaTransfer(0, const_cast(buf), nbyte); } +void W25QXXFlash::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { + mySPI.dmaTransfer(0, const_cast(buf), nbyte); +} /** * @brief Send a single byte on SPI port @@ -109,7 +115,7 @@ void W25QXXFlash::spi_flash_Read(uint8_t* buf, uint16_t nbyte) { SPI.dmaTransfer * * @details */ -void W25QXXFlash::spi_flash_Send(uint8_t b) { SPI.send(b); } +void W25QXXFlash::spi_flash_Send(uint8_t b) { mySPI.transfer(b); } /** * @brief Write token and then write from 512 byte buffer to SPI (for SD card) @@ -120,8 +126,8 @@ void W25QXXFlash::spi_flash_Send(uint8_t b) { SPI.send(b); } * @details Use DMA */ void W25QXXFlash::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) { - SPI.send(token); - SPI.dmaSend(const_cast(buf), 512); + mySPI.transfer(token); + mySPI.dmaSend(const_cast(buf), 512); } uint16_t W25QXXFlash::W25QXX_ReadID(void) { diff --git a/Marlin/src/libs/W25Qxx.h b/Marlin/src/libs/W25Qxx.h index ac3e8a169b24..eddae6b1f27d 100644 --- a/Marlin/src/libs/W25Qxx.h +++ b/Marlin/src/libs/W25Qxx.h @@ -23,6 +23,8 @@ #include +#include HAL_PATH(../HAL, MarlinSPI.h) + #define W25X_WriteEnable 0x06 #define W25X_WriteDisable 0x04 #define W25X_ReadStatusReg 0x05 @@ -49,6 +51,8 @@ #define SPI_FLASH_PerWritePageSize 256 class W25QXXFlash { +private: + static MarlinSPI mySPI; public: void init(uint8_t spiRate); static uint8_t spi_flash_Rec(); diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 5c3dfc2ad8c1..e7e583a6f52b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -191,6 +191,9 @@ #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 + #define TFT_CS_PIN FSMC_CS_PIN + #define TFT_RS_PIN FSMC_RS_PIN + #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index d67fa516b8d5..426f29d47358 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -15,7 +15,7 @@ opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" # -# MKS Robin v2 nano LVGL SPI +# MKS Robin v2 nano Emulated DOGM SPI # (Robin v2 nano has no FSMC interface) # use_example_configs Mks/Robin diff --git a/buildroot/tests/mks_robin_nano35_stm32-tests b/buildroot/tests/mks_robin_nano35_stm32-tests new file mode 100644 index 000000000000..58912b85a34c --- /dev/null +++ b/buildroot/tests/mks_robin_nano35_stm32-tests @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +# +# Build tests for MKS Robin nano +# (STM32F1 genericSTM32F103VE) +# + +# exit on first failure +set -e + +# +# MKS Robin nano v1.2 Emulated DOGM FSMC +# +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO +exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" + +# +# MKS Robin v2 nano Emulated DOGM SPI +# (Robin v2 nano has no FSMC interface) +# +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +opt_disable TFT_INTERFACE_FSMC +opt_enable TFT_INTERFACE_SPI +exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" + +# +# MKS Robin nano v1.2 LVGL FSMC +# +# use_example_configs Mks/Robin +# opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO +# opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +# opt_enable TFT_LVGL_UI TFT_RES_480x320 +# exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" + +# +# MKS Robin v2 nano LVGL SPI +# (Robin v2 nano has no FSMC interface) +# +# use_example_configs Mks/Robin +# opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +# opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +# opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 +# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" + +# +# MKS Robin v2 nano New Color UI 480x320 SPI +# (Robin v2 nano has no FSMC interface) +# +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 +opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 +exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" + +# +# MKS Robin v2 nano LVGL SPI + TMC +# (Robin v2 nano has no FSMC interface) +# +# use_example_configs Mks/Robin +# opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +# opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +# opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 +# opt_set X_DRIVER_TYPE TMC2209 +# opt_set Y_DRIVER_TYPE TMC2209 +# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" + +# cleanup +restore_configs From 8c052e43f10340fb73f632e4a29255b2a04f7423 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Nov 2020 23:46:46 -0600 Subject: [PATCH 097/443] Update some file headers --- Marlin/src/HAL/LPC1768/tft/xpt2046.cpp | 5 ++++- Marlin/src/HAL/LPC1768/tft/xpt2046.h | 5 ++++- Marlin/src/HAL/STM32/tft/xpt2046.cpp | 5 ++++- Marlin/src/HAL/STM32/tft/xpt2046.h | 5 ++++- Marlin/src/HAL/STM32F1/tft/xpt2046.cpp | 5 ++++- Marlin/src/HAL/STM32F1/tft/xpt2046.h | 5 ++++- .../lib/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h | 2 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 2 +- Marlin/src/lcd/tft/fontdata/fontdata_10x20.cpp | 5 ++++- Marlin/src/lcd/tft/fontdata/fontdata_ISO10646_1.cpp | 5 ++++- Marlin/src/lcd/tft/fontdata/helvetica_12_bold.cpp | 5 ++++- Marlin/src/lcd/tft/fontdata/helvetica_14.cpp | 5 ++++- Marlin/src/lcd/tft/touch.cpp | 5 ++++- Marlin/src/lcd/tft/touch.h | 5 ++++- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 2 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h | 2 +- 16 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp index 5f96630043c1..e51256a708ab 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.h b/Marlin/src/HAL/LPC1768/tft/xpt2046.h index 019f75efce12..29db0b3fc454 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.h +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.h @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index 8c8d28f66a50..f95bb8ca4da4 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 7a6d8439c59c..3acf3898a3b5 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp index 616d05fead15..4f5c4df37534 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.h b/Marlin/src/HAL/STM32F1/tft/xpt2046.h index 019f75efce12..29db0b3fc454 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.h @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h index 6ea317dbc3cd..5d9735892deb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h @@ -10,7 +10,7 @@ * GNU General Public License for more details. * * * * To view a copy of the GNU General Public License, go to the following * - * location: . * + * location: . * ****************************************************************************/ /** diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 4623b8f49242..8a6cbaaf318c 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/tft/fontdata/fontdata_10x20.cpp b/Marlin/src/lcd/tft/fontdata/fontdata_10x20.cpp index cc328e885d41..f03366d6f72f 100644 --- a/Marlin/src/lcd/tft/fontdata/fontdata_10x20.cpp +++ b/Marlin/src/lcd/tft/fontdata/fontdata_10x20.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/tft/fontdata/fontdata_ISO10646_1.cpp b/Marlin/src/lcd/tft/fontdata/fontdata_ISO10646_1.cpp index ade8bf23b8e4..21531f5c142f 100644 --- a/Marlin/src/lcd/tft/fontdata/fontdata_ISO10646_1.cpp +++ b/Marlin/src/lcd/tft/fontdata/fontdata_ISO10646_1.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/tft/fontdata/helvetica_12_bold.cpp b/Marlin/src/lcd/tft/fontdata/helvetica_12_bold.cpp index 12efb3ba4947..e7411ea9ed28 100644 --- a/Marlin/src/lcd/tft/fontdata/helvetica_12_bold.cpp +++ b/Marlin/src/lcd/tft/fontdata/helvetica_12_bold.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp b/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp index a27ea4369793..87e7135e379e 100644 --- a/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp +++ b/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index d54506442dec..cde969802498 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 4ba3e22c8e22..7cb05891de70 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -1,6 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 4f555c373f0c..9bb2cd371a18 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h index 021ef1d5f6b8..b12c12c848c9 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm From 4785b04aa13470ee8f1b8f2db07058d473616b06 Mon Sep 17 00:00:00 2001 From: George Fu Date: Sat, 7 Nov 2020 13:48:52 +0800 Subject: [PATCH 098/443] FYSETC E4 board support (#20032) --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/esp32/pins_FYSETC_E4.h | 126 +++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + platformio.ini | 5 + 4 files changed, 134 insertions(+) create mode 100644 Marlin/src/pins/esp32/pins_FYSETC_E4.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index a1e39f9ae81d..12bf167f40c5 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -378,6 +378,7 @@ #define BOARD_MRR_ESPA 6001 // MRR ESPA board based on ESP32 (native pins only) #define BOARD_MRR_ESPE 6002 // MRR ESPE board based on ESP32 (with I2S stepper stream) #define BOARD_E4D_BOX 6003 // E4d@BOX +#define BOARD_FYSETC_E4 6004 // FYSETC E4 // // SAMD51 ARM Cortex M4 diff --git a/Marlin/src/pins/esp32/pins_FYSETC_E4.h b/Marlin/src/pins/esp32/pins_FYSETC_E4.h new file mode 100644 index 000000000000..af179256e136 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_FYSETC_E4.h @@ -0,0 +1,126 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * FYSETC E4 pin assignments + * FYSETC E4 is a 3D printer control board based on the ESP32 microcontroller. + * Supports 4 stepper drivers, heated bed, single hotend. + */ + +#ifndef ARDUINO_ARCH_ESP32 + #error "Oops! Select an ESP32 board in 'Tools > Board.'" +#elif EXTRUDERS > 1 || E_STEPPERS > 1 + #error "FYSETC E4 only supports one E Stepper. Comment out this line to continue." +#elif HOTENDS > 1 + #error "FYSETC E4 currently supports only one hotend. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "FYSETC_E4" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Disable I2S stepper stream +// +#undef I2S_STEPPER_STREAM +#define I2S_WS -1 +#define I2S_BCK -1 +#define I2S_DATA -1 + +// +// Limit Switches +// +#define X_STOP_PIN 34 +#define Y_STOP_PIN 35 +#define Z_STOP_PIN 15 + +// +// Steppers +// +#define X_STEP_PIN 27 +#define X_DIR_PIN 26 +#define X_ENABLE_PIN 25 + +#define Y_STEP_PIN 33 +#define Y_DIR_PIN 32 +#define Y_ENABLE_PIN X_ENABLE_PIN + +#define Z_STEP_PIN 14 +#define Z_DIR_PIN 12 +#define Z_ENABLE_PIN X_ENABLE_PIN + +#define E0_STEP_PIN 16 +#define E0_DIR_PIN 17 +#define E0_ENABLE_PIN X_ENABLE_PIN + +#if HAS_TMC_UART + // + // TMC2209 stepper drivers + // + + // + // Hardware serial 1 + // + #define X_HARDWARE_SERIAL Serial1 + #define Y_HARDWARE_SERIAL Serial1 + #define Z_HARDWARE_SERIAL Serial1 + #define E0_HARDWARE_SERIAL Serial1 + + #define TMC_BAUD_RATE 115200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN 36 // Analog Input +#define TEMP_BED_PIN 39 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 2 +#define FAN_PIN 13 +#define HEATER_BED_PIN 4 + +// +// MicroSD card +// +#define MOSI_PIN 23 +#define MISO_PIN 19 +#define SCK_PIN 18 +#define SDSS 5 +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers + +/** + * Hardware serial pins + * + * Override these pins in Configuration.h or Configuration_adv.h if needed. + * + * Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX + * but MRR ESPA does not have enough spare pins for such reassignment. + */ +#ifndef HARDWARE_SERIAL1_RX + #define HARDWARE_SERIAL1_RX 21 +#endif +#ifndef HARDWARE_SERIAL1_TX + #define HARDWARE_SERIAL1_TX 22 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 62749a3f6e28..2936676c4df5 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -665,6 +665,8 @@ #include "esp32/pins_MRR_ESPE.h" // ESP32 env:esp32 #elif MB(E4D_BOX) #include "esp32/pins_E4D.h" // ESP32 env:esp32 +#elif MB(FYSETC_E4) + #include "esp32/pins_FYSETC_E4.h" // ESP32 env:FYSETC_E4 // // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) diff --git a/platformio.ini b/platformio.ini index b052a26b5878..0bd4fbe7a13b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1363,6 +1363,11 @@ upload_speed = 115200 #upload_port = marlinesp.local #board_build.flash_mode = qio +[env:FYSETC_E4] +platform = espressif32@1.11.2 +extends = env:esp32 +board_build.partitions = default_16MB.csv + # # Teensy 3.1 / 3.2 (ARM Cortex-M4) # From bdfedf249a8562cf54dff54ad67433f1e11ebc9e Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 6 Nov 2020 21:49:53 -0800 Subject: [PATCH 099/443] Fix FYSETC S6 timer conflict (#20044) --- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 8638e9a4cfb1..656849487aaf 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -34,8 +34,8 @@ #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif -// Change the priority to 3. Priority 2 is for software serial. -//#define TEMP_TIMER_IRQ_PRIO 3 +// Avoid conflict with TIMER_TONE defined in variant +#define STEP_TIMER 10 // // EEPROM Emulation From bd872d5dcfd49d3182b535e06791fb17f7a96b0d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 6 Nov 2020 21:51:52 -0800 Subject: [PATCH 100/443] STM32F1 cleanup, incl. SoftwareSerial removal (#20046) --- Marlin/src/HAL/STM32F1/SoftwareSerial.cpp | 60 ----------------------- Marlin/src/HAL/STM32F1/SoftwareSerial.h | 44 ----------------- Marlin/src/HAL/STM32F1/build_flags.py | 2 +- Marlin/src/HAL/STM32F1/inc/SanityCheck.h | 5 -- platformio.ini | 14 ++---- 5 files changed, 6 insertions(+), 119 deletions(-) delete mode 100644 Marlin/src/HAL/STM32F1/SoftwareSerial.cpp delete mode 100644 Marlin/src/HAL/STM32F1/SoftwareSerial.h diff --git a/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp b/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp deleted file mode 100644 index 993403cf720d..000000000000 --- a/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 . - * - */ -#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL) - -/** - * Empty class for Software Serial implementation (Custom RX/TX pins) - * - * TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted - */ - -#include "SoftwareSerial.h" - -// Constructor - -SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {} - -// Public - -void SoftwareSerial::begin(const uint32_t baudrate) { -} - -bool SoftwareSerial::available() { - return false; -} - -uint8_t SoftwareSerial::read() { - return 0; -} - -uint16_t SoftwareSerial::write(uint8_t byte) { - return 0; -} - -void SoftwareSerial::flush() {} - -void SoftwareSerial::listen() { - listening = true; -} - -void SoftwareSerial::stopListening() { - listening = false; -} - -#endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/SoftwareSerial.h b/Marlin/src/HAL/STM32F1/SoftwareSerial.h deleted file mode 100644 index 1c8058665a47..000000000000 --- a/Marlin/src/HAL/STM32F1/SoftwareSerial.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#ifndef HAVE_SW_SERIAL - #define SW_SERIAL_PLACEHOLDER 1 -#endif - -class SoftwareSerial { -public: - SoftwareSerial(int8_t RX_pin, int8_t TX_pin); - - void begin(const uint32_t baudrate); - - bool available(); - - uint8_t read(); - uint16_t write(uint8_t byte); - void flush(); - - void listen(); - void stopListening(); - -protected: - bool listening; -}; diff --git a/Marlin/src/HAL/STM32F1/build_flags.py b/Marlin/src/HAL/STM32F1/build_flags.py index 98c871a1d8f9..c51fd4fa58fd 100755 --- a/Marlin/src/HAL/STM32F1/build_flags.py +++ b/Marlin/src/HAL/STM32F1/build_flags.py @@ -3,7 +3,7 @@ #dynamic build flags for generic compile options if __name__ == "__main__": - args = " ".join([ "-std=gnu11", + args = " ".join([ "-std=gnu++14", "-Os", "-mcpu=cortex-m3", "-mthumb", diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index 937bef8803ea..8d4c54ec0fd4 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -25,11 +25,6 @@ * Test STM32F1-specific configuration values for errors at compile-time. */ -#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL - #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER." - #error "Missing SoftwareSerial implementation." -#endif - #if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise #if USE_FALLBACK_EEPROM diff --git a/platformio.ini b/platformio.ini index 0bd4fbe7a13b..7ab0755cdcaf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -711,7 +711,7 @@ src_filter = ${common.default_src_filter} + + lib_ignore = SPI @@ -1121,18 +1121,14 @@ build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # Creality (STM32F103RET6) # [env:STM32F103RET6_creality] -platform = ${common_stm32f1.platform} -extends = common_stm32f1 -board = genericSTM32F103RE -build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py - ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY -DTEMP_TIMER_CHAN=4 -extra_scripts = ${common.extra_scripts} +platform = ${env:STM32F103RE.platform} +extends = env:STM32F103RE +build_flags = ${env:STM32F103RE.build_flags} -DTEMP_TIMER_CHAN=4 +extra_scripts = ${env:STM32F103RE.extra_scripts} pre:buildroot/share/PlatformIO/scripts/random-bin.py buildroot/share/PlatformIO/scripts/creality.py -lib_ignore = ${common_stm32f1.lib_ignore} debug_tool = jlink upload_protocol = jlink -monitor_speed = 115200 # # FLSUN QQ (STM32F103VET6) From a439892d7a50fba1de9c30ffe22e73600f54952f Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 6 Nov 2020 22:48:17 -0800 Subject: [PATCH 101/443] Sanity-check illegal native USB (#20047) Co-authored-by: Scott Lahteine --- Marlin/src/inc/SanityCheck.h | 14 ++++++++++++++ Marlin/src/pins/stm32f1/pins_CHITU3D.h | 6 ++++-- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 6 ++++-- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 6 ++++-- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 6 +++--- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 2 ++ Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 4 ++-- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 2 ++ Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 3 ++- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 2 ++ Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 2 ++ Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 2 ++ Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 2 ++ Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 3 +++ Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 2 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 2 ++ Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 4 ++-- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 3 +++ buildroot/tests/mks_robin_lite-tests | 2 +- buildroot/tests/mks_robin_pro-tests | 2 ++ 28 files changed, 76 insertions(+), 15 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 443669bb2542..498455e59e49 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2294,6 +2294,20 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3." #endif +/** + * Some boards forbid the use of -1 Native USB + */ +#if ENABLED(BOARD_NO_NATIVE_USB) + #undef BOARD_NO_NATIVE_USB + #if SERIAL_PORT == -1 + #error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board." + #elif SERIAL_PORT_2 == -1 + #error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board." + #elif LCD_SERIAL_PORT == -1 + #error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board." + #endif +#endif + /** * Serial displays require a dedicated serial port */ diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 1d8f4f684b06..aa83a0cb04c8 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D" #define DEFAULT_MACHINE_NAME "STM32F103RET6" +#define BOARD_NO_NATIVE_USB + // Enable I2C_EEPROM for testing //#define I2C_EEPROM diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 181872737276..b13fde026c93 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D V5" #define DEFAULT_MACHINE_NAME "STM32F103ZET6" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index 1d6e6b3983d8..a015fb27041f 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** @@ -32,6 +32,8 @@ #define BOARD_INFO_NAME "Chitu3D" #define DEFAULT_MACHINE_NAME "STM32F103ZET6" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index eb910dd8466e..c6f2dd8b8081 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -26,9 +26,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 1 || E_STEPPERS > 1 +#elif HOTENDS > 1 || E_STEPPERS > 1 #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue." #endif @@ -39,6 +37,8 @@ #define DEFAULT_MACHINE_NAME "Ender 3 V2" #endif +#define BOARD_NO_NATIVE_USB + // // EEPROM // diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index bf3389492a88..5f91072440f5 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -38,6 +38,8 @@ #define BOARD_INFO_NAME "FLSun HiSpeedV1" #define BOARD_WEBSITE_URL "github.com/Foxies-CSTL" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 9bb2cd371a18..073d6c73687b 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -21,12 +21,12 @@ */ #pragma once -#ifndef __STM32F1__ +#if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif #define BOARD_INFO_NAME "FLY_MINI" -#define BOARD_WEBSITE_URL "github.com/FLYmaker" +#define BOARD_WEBSITE_URL "github.com/FLYmaker" #define DISABLE_JTAG // diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index bab6182e4fde..aebb776b2961 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -28,6 +28,8 @@ #define BOARD_INFO_NAME "FYSETC AIO II" #define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG #define pins_v2_20190128 // new pins define diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index deca1a054641..b8a4ccf770c4 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -29,11 +29,12 @@ #define BOARD_INFO_NAME "FYSETC Cheetah" #define BOARD_WEBSITE_URL "fysetc.com" -// https://github.com/FYSETC/Cheetah // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 00c5721384df..52b857ac0ab9 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index b10748e57f3b..85d0be6d6b70 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 00c5721384df..52b857ac0ab9 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "STM32F103VET6" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index b913530f676b..292119ce024e 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "GTM32 Pro VB" #define DEFAULT_MACHINE_NAME "M201" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 0dd8fb69a580..f86acf1f2414 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -33,8 +33,11 @@ #elif HOTENDS > 1 || E_STEPPERS > 1 #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue." #endif + #define BOARD_INFO_NAME "JGAurora A5S A1 board" +#define BOARD_NO_NATIVE_USB + #ifndef STM32_XL_DENSITY #define STM32_XL_DENSITY #endif diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index c685570707cf..fd5c57387846 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -31,6 +31,8 @@ #define BOARD_INFO_NAME "Longer3D" #define ALFAWISE_UX0 // Common to all Longer3D STM32F1 boards (used for Open drain mosfets) +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG // We still want to debug with STLINK... #define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK // Release PB4 (STEP_X_PIN) from JTAG NRST role. diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index e6c8098f2a25..581dd5375ba4 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 2b7417c29ffb..9c0f2deeab96 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin e3p" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // 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 ffcdc3cfdf03..2dcd7780af0e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -29,6 +29,8 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif +#define BOARD_NO_NATIVE_USB + #define BOARD_WEBSITE_URL "github.com/makerbase-mks" //#define DISABLE_DEBUG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index ab5350e4de28..d7c4aebe37dc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -32,6 +32,8 @@ #endif #define BOARD_WEBSITE_URL "github.com/makerbase-mks" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG #define DISABLE_JTAG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 4c1299fe02ab..f8b8a891bed6 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -36,6 +36,8 @@ #endif #define BOARD_WEBSITE_URL "github.com/makerbase-mks" +#define BOARD_NO_NATIVE_USB + //#define DISABLE_DEBUG #define DISABLE_JTAG diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 8c63f7973207..2406c22d55ae 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin Mini" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index e7e583a6f52b..3c9b2f5b5968 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin Nano" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index e009d34d9414..9c1d073da6ba 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -35,6 +35,8 @@ #define BOARD_INFO_NAME "MKS Robin nano V2.0" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 639a8f05791d..8f1a405e8c61 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -33,6 +33,8 @@ #define BOARD_INFO_NAME "MKS Robin pro" +#define BOARD_NO_NATIVE_USB + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index 3ebc4bca571f..ef82b71f560b 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 8314858d1351..2fc34ce296ca 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -35,6 +35,9 @@ #endif #define BOARD_INFO_NAME "Trigorilla Pro" + +#define BOARD_NO_NATIVE_USB + #define DISABLE_JTAG // diff --git a/buildroot/tests/mks_robin_lite-tests b/buildroot/tests/mks_robin_lite-tests index 34809641eca9..d54627e06980 100644 --- a/buildroot/tests/mks_robin_lite-tests +++ b/buildroot/tests/mks_robin_lite-tests @@ -8,7 +8,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE -opt_set SERIAL_PORT -1 +opt_set SERIAL_PORT 1 opt_enable EEPROM_SETTINGS opt_enable SDSUPPORT exec_test $1 $2 "Default Configuration with Fallback SD EEPROM" diff --git a/buildroot/tests/mks_robin_pro-tests b/buildroot/tests/mks_robin_pro-tests index 50ec7b0dd127..3cafc6142f84 100644 --- a/buildroot/tests/mks_robin_pro-tests +++ b/buildroot/tests/mks_robin_pro-tests @@ -8,6 +8,8 @@ set -e use_example_configs Mks/Robin_Pro opt_enable EMERGENCY_PARSER +opt_set SERIAL_PORT 3 +opt_disable SERIAL_PORT_2 opt_set SDCARD_CONNECTION LCD opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 From bb7dbceb5c3ac338e856e7427bff69be6ce2230b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 02:38:39 -0600 Subject: [PATCH 102/443] Add 'mfconfig' script used to manage configs --- buildroot/share/git/mfconfig | 183 +++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100755 buildroot/share/git/mfconfig diff --git a/buildroot/share/git/mfconfig b/buildroot/share/git/mfconfig new file mode 100755 index 000000000000..3fd5e399cc56 --- /dev/null +++ b/buildroot/share/git/mfconfig @@ -0,0 +1,183 @@ +#!/usr/bin/env bash +# +# mfconfig init source dest +# mfconfig manual source dest +# +# The MarlinFirmware/Configurations layout could be broken up into branches, +# but this makes management more complicated and requires more commits to +# perform the same operation, so this uses a single branch with subfolders. +# +# init - Initialize the repo with a base commit and changes: +# - Source will be an 'import' branch containing all current configs. +# - Create an empty 'BASE' branch from 'init-repo'. +# - Add Marlin config files, but reset all to defaults. +# - Commit this so changes will be clear in following commits. +# - Add changed Marlin config files and commit. +# +# manual - Manually import changes from the Marlin repo +# - Replace 'default' configs with those from the Marlin repo. +# - Wait for manual propagation to the rest of the configs. +# - Run init with the given 'source' and 'dest' +# + +REPOHOME="`dirname ~/Projects/Maker/Firmware/.`" +MARLINREPO="$REPOHOME/MarlinFirmware" +CONFIGREPO="$REPOHOME/Configurations" + +CEXA=config/examples +CDEF=config/default +BC=Configuration.h +AC=Configuration_adv.h + +COMMIT_STEPS=0 + +#cd "$CONFIGREPO" 2>/dev/null || { echo "Can't find Configurations repo!" ; exit 1; } + +ACTION=${1:-init} +IMPORT=${2:-"import-2.0.x"} +EXPORT=${3:-"bugfix-2.0.x"} + +echo -n "Doing grhh ... " ; grhh ; echo + +if [[ $ACTION == "manual" ]]; then + + # + # Copy the latest default configs from MarlinFirmware/Marlin + # or one of the import branches here, then use them to construct + # a 'BASE' branch with only defaults as a starting point. + # + + echo "- Updating '$IMPORT' from Marlin..." + + git checkout $IMPORT || exit + + # Reset from the latest complete state + #git reset --hard master + + cp "$MARLINREPO/Marlin/"Configuration*.h "$CDEF/" + #git add . && git commit -m "Changes from Marlin ($(date '+%Y-%m-%d %H:%M'))." + + echo "- Fix up the import branch and come back." + + read -p "- Ready to init [y/N] ?" INIT_YES + echo + + [[ $INIT_YES == 'Y' || $INIT_YES == 'y' ]] || { echo "Done." ; exit ; } + + ACTION='init' +fi + +if [[ $ACTION == "init" ]]; then + # + # Copy all configs from a source such as MarlinFirmware/Marlin + # or one of the import branches here, then use them to construct + # a 'BASE' branch with only defaults as a starting point. + # + + echo "- Initializing BASE branch..." + + # Use the import branch as the source + git checkout $IMPORT || exit + + # Copy to a temporary location + TEMP=$( mktemp -d ) ; cp -R config $TEMP + + # Make sure we're not on the 'BASE' branch... + git checkout master >/dev/null 2>&1 || exit + + # Create 'BASE' as a copy of 'init-repo' (README, LICENSE, etc.) + git branch -D BASE 2>/dev/null + git checkout init-repo -b BASE || exit + + # Copy all config files into place + echo "- Copying configs from Marlin..." + cp -R "$TEMP/config" . + + # Delete anything that's not a Configuration file + find config -type f \! -name "Configuration*" -exec rm "{}" \; + + # DEBUG: Commit the original config files for comparison + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Commit for comparison" >/dev/null + + # Init Cartesian configurations to default + echo "- Initializing configs to default state..." + + find "$CEXA" -name $BC ! -path */delta/* -print0 \ + | while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done + find "$CEXA" -name $AC ! -path */delta/* -print0 \ + | while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done + + # DEBUG: Commit the reset for review + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Cartesian/SCARA configs..." >/dev/null + + # Create base Delta configurations + cp "$CDEF"/* "$CEXA/delta/generic" + + # DEBUG: Commit the reset for review + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Generic Delta..." >/dev/null + + cp -R "$TEMP/$CEXA/delta/generic"/Conf* "$CEXA/delta/generic" + + # DEBUG: Commit Generic Delta changes for review + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Apply Generic Delta..." >/dev/null + + find "$CEXA/delta" -name $BC ! -path */generic/* -print0 \ + | while read -d $'\0' F ; do cp "$CEXA/delta/generic/$BC" "$F" ; done + find "$CEXA/delta" -name $AC ! -path */generic/* -print0 \ + | while read -d $'\0' F ; do cp "$CEXA/delta/generic/$AC" "$F" ; done + + # DEBUG: Commit the reset for review + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Delta configs..." >/dev/null + + # SCARA configurations + find "$CEXA/SCARA" -name $BC \ + | while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done + find "$CEXA/SCARA" -name $AC \ + | while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done + + # DEBUG: Commit the reset for review or... + ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset SCARA..." >/dev/null + + # Update the %VERSION% in the README.md file + SED=$(which gsed || which sed) + VERS=$( echo $EXPORT | $SED 's/release-//' ) + eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md" + rm -f README.md~ + + # NOT DEBUGGING: Commit the 'BASE', ready for customizations + ((COMMIT_STEPS)) || git add . >/dev/null && git commit --amend --no-edit >/dev/null + + # Create a new branch from 'BASE' for the final result + echo "- Creating '$EXPORT' branch for the result..." + git branch -D $EXPORT 2>/dev/null + git checkout -b $EXPORT || exit + + # Delete temporary branch + git branch -D BASE 2>/dev/null + + echo "- Applying example config customizations..." + cp -R "$TEMP/config" . + find config -type f \! -name "Configuration*" -exec rm "{}" \; + + echo "- Adding path labels to all configs..." + config-labels.py >/dev/null 2>&1 + + git add . >/dev/null && git commit -m "Examples Customizations" >/dev/null + + echo "- Copying extras from Marlin..." + cp -R "$TEMP/config" . + + # Apply labels again! + config-labels.py >/dev/null 2>&1 + + git add . >/dev/null && git commit -m "Examples Extras" >/dev/null + + rm -rf $TEMP + + git push -f --set-upstream upstream "$EXPORT" + +else + + echo "Usage: mfconfig init|manual|rebase" + +fi From 10fd9ed896bc2eebc4f4d81e02d7f7502e207039 Mon Sep 17 00:00:00 2001 From: Darren Horrocks Date: Sat, 7 Nov 2020 08:42:14 +0000 Subject: [PATCH 103/443] Anet 1.0 alternative graphical LCD wiring (#20022) --- Marlin/Configuration.h | 3 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 5 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 5 +- Marlin/src/pins/sanguino/pins_ANET_10.h | 54 +++++++++++++++------ 6 files changed, 51 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0b6234bbccd0..1297c61aedfc 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2095,9 +2095,10 @@ // // Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 // A clone of the RepRapDiscount full graphics display but with -// different pins/wiring (see pins_ANET_10.h). +// different pins/wiring (see pins_ANET_10.h). Enable one of these. // //#define ANET_FULL_GRAPHICS_LCD +//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING // // AZSMZ 12864 LCD with SD diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index a2ac480f2a77..98aa4afb8c21 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -235,7 +235,7 @@ #define BOARD_ST7920_DELAY_2 DELAY_NS(125) #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER) +#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING, BQ_LCD_SMART_CONTROLLER) #define IS_RRD_FG_SC 1 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 498455e59e49..ef79241d7179 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2220,7 +2220,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \ + COUNT_ENABLED(VIKI2, miniVIKI) \ + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \ - + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \ + ENABLED(AZSMZ_12864) \ + ENABLED(BQ_LCD_SMART_CONTROLLER) \ + ENABLED(CARTESIO_UI) \ 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 51e48fc8e949..6f84a2a44d06 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -215,9 +215,10 @@ #define EXPA2_10_PIN P0_17 #if HAS_WIRED_LCD + #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) + #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." - #if ENABLED(ANET_FULL_GRAPHICS_LCD) - + #elif ENABLED(ANET_FULL_GRAPHICS_LCD) #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue." /** 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 8df631b67788..14bac7d723a7 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -233,7 +233,10 @@ * EXP2 EXP1 */ #if HAS_WIRED_LCD - #if ENABLED(ANET_FULL_GRAPHICS_LCD) + #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) + #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." + + #elif ENABLED(ANET_FULL_GRAPHICS_LCD) #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." /** diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index d48db36287ee..81c0fe562dee 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -145,13 +145,16 @@ * * Only the following displays are supported: * ZONESTAR_LCD - * ANET_FULL_GRAPHICS_LCD + * ANET_FULL_GRAPHICS_LCD(_ALT_WIRING)? * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER */ #if HAS_WIRED_LCD + #define LCD_SDSS 28 + #if HAS_ADC_BUTTONS + #define SERVO0_PIN 27 // free for BLTouch/3D-Touch #define LCD_PINS_RS 28 #define LCD_PINS_ENABLE 29 @@ -160,26 +163,49 @@ #define LCD_PINS_D6 16 #define LCD_PINS_D7 17 #define ADC_KEYPAD_PIN 1 + #elif IS_RRD_FG_SC + // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #define SERVO0_PIN 29 // free for BLTouch/3D-Touch - #define BEEPER_PIN 17 - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 28 - #define LCD_PINS_D4 30 - #define BTN_EN1 11 - #define BTN_EN2 10 - #define BTN_ENC 16 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #define BOARD_ST7920_DELAY_2 DELAY_NS(63) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + + #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) + #define SERVO0_PIN 30 + #define BEEPER_PIN 27 + #define LCD_PINS_RS 29 + #define LCD_PINS_ENABLE 16 + #define LCD_PINS_D4 11 + #define BTN_EN1 28 + #define BTN_EN2 10 + #define BTN_ENC 17 + #define BOARD_ST7920_DELAY_1 DELAY_NS(250) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS(250) + #else + #define SERVO0_PIN 29 // free for BLTouch/3D-Touch + #define BEEPER_PIN 17 + #define LCD_PINS_RS 27 + #define LCD_PINS_ENABLE 28 + #define LCD_PINS_D4 30 + #define BTN_EN1 11 + #define BTN_EN2 10 + #define BTN_ENC 16 + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(63) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif + #endif + #else + #define SERVO0_PIN 27 + +#endif + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN SERVO0_PIN #endif /** From 53cc8a0d6eca6ca306208eb44914241ec80a185b Mon Sep 17 00:00:00 2001 From: Darren Horrocks Date: Sat, 7 Nov 2020 08:43:51 +0000 Subject: [PATCH 104/443] Optimized (non-optiboot) Melzi env (#20021) Co-authored-by: Scott Lahteine --- Marlin/src/pins/pins.h | 40 +++++------ platformio.ini | 158 +++++++++++++++++++++++------------------ 2 files changed, 107 insertions(+), 91 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 2936676c4df5..22b0c6947f8f 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -298,27 +298,27 @@ // #elif MB(SANGUINOLOLU_11) - #include "sanguino/pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(SANGUINOLOLU_12) - #include "sanguino/pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(MELZI) - #include "sanguino/pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(MELZI_V2) - #include "sanguino/pins_MELZI_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(MELZI_MAKR3D) - #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(MELZI_CREALITY) - #include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi env:melzi_optimized env:melzi_optiboot + #include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi env:melzi_optimized env:melzi_optiboot env:melzi_optiboot_optimized #elif MB(MELZI_MALYAN) - #include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(MELZI_TRONXY) - #include "sanguino/pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(STB_11) - #include "sanguino/pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(AZTEEG_X1) - #include "sanguino/pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(ZMIB_V2) - #include "sanguino/pins_ZMIB_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_ZMIB_V2.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized // // Other ATmega644P, ATmega644, ATmega1284P @@ -327,27 +327,27 @@ #elif MB(GEN3_MONOLITHIC) #include "sanguino/pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino644p #elif MB(GEN3_PLUS) - #include "sanguino/pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN6) - #include "sanguino/pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN6_DELUXE) - #include "sanguino/pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN7_CUSTOM) - #include "sanguino/pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN7_12) - #include "sanguino/pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN7_13) - #include "sanguino/pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(GEN7_14) - #include "sanguino/pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized #elif MB(OMCA_A) #include "sanguino/pins_OMCA_A.h" // ATmega644 env:sanguino644p #elif MB(OMCA) #include "sanguino/pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino644p #elif MB(ANET_10) - #include "sanguino/pins_ANET_10.h" // ATmega1284P env:sanguino1284p + #include "sanguino/pins_ANET_10.h" // ATmega1284P env:sanguino1284p env:sanguino1284p_optimized #elif MB(SETHI) - #include "sanguino/pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p + #include "sanguino/pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino644p env:sanguino1284p env:sanguino1284p_optimized // // Teensyduino - AT90USB1286, AT90USB1286P diff --git a/platformio.ini b/platformio.ini index 7ab0755cdcaf..07edbf391867 100644 --- a/platformio.ini +++ b/platformio.ini @@ -434,9 +434,9 @@ src_filter = ${common.default_src_filter} + # ATmega2560 # [env:mega2560] -platform = atmelavr -extends = common_avr8 -board = megaatmega2560 +platform = atmelavr +extends = common_avr8 +board = megaatmega2560 # # ATmega2560 with extended pins 70-85 defined @@ -457,9 +457,9 @@ extra_scripts = ${common.extra_scripts} # ATmega1280 # [env:mega1280] -platform = atmelavr -extends = common_avr8 -board = megaatmega1280 +platform = atmelavr +extends = common_avr8 +board = megaatmega1280 # # MightyBoard ATmega2560 (MegaCore 100 pin boards variants) @@ -474,81 +474,97 @@ upload_speed = 57600 # MightyBoard ATmega2560 (MegaCore 100 pin boards variants) # [env:MightyBoard2560] -platform = atmelavr -extends = common_avr8 -board = ATmega2560 -upload_protocol = wiring -upload_speed = 57600 +platform = atmelavr +extends = common_avr8 +board = ATmega2560 +upload_protocol = wiring +upload_speed = 57600 board_upload.maximum_size = 253952 # # RAMBo # [env:rambo] -platform = atmelavr -extends = common_avr8 -board = reprap_rambo +platform = atmelavr +extends = common_avr8 +board = reprap_rambo # # FYSETC F6 V1.3 # [env:FYSETC_F6_13] -platform = atmelavr -extends = common_avr8 -board = fysetc_f6_13 +platform = atmelavr +extends = common_avr8 +board = fysetc_f6_13 # # FYSETC F6 V1.4 # [env:FYSETC_F6_14] -platform = atmelavr -extends = common_avr8 -board = fysetc_f6_14 +platform = atmelavr +extends = common_avr8 +board = fysetc_f6_14 # # Sanguinololu (ATmega644p) # [env:sanguino644p] -platform = atmelavr -extends = common_avr8 -board = sanguino_atmega644p +platform = atmelavr +extends = common_avr8 +board = sanguino_atmega644p # # Sanguinololu (ATmega1284p) # [env:sanguino1284p] -platform = atmelavr -extends = common_avr8 -board = sanguino_atmega1284p +platform = atmelavr +extends = common_avr8 +board = sanguino_atmega1284p board_upload.maximum_size = 126976 # # Melzi and clones (ATmega1284p) # [env:melzi] -platform = atmelavr -extends = common_avr8 -board = sanguino_atmega1284p -upload_speed = 57600 -board_upload.maximum_size = 126976 +platform = atmelavr +extends = env:sanguino1284p +upload_speed = 57600 + +# +# Sanguinololu (ATmega1284p stock bootloader with tuned flags) +# + +[tuned_1284p] +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 +build_flags = ${tuned_1284p.build_flags} + +# +# Melzi and clones (alias for sanguino1284p_optimized) +# +[env:melzi_optimized] +platform = atmelavr +extends = env:sanguino1284p_optimized # # Melzi and clones (Optiboot bootloader) # [env:melzi_optiboot] -platform = atmelavr -extends = common_avr8 -board = sanguino_atmega1284p -upload_speed = 115200 +platform = atmelavr +extends = common_avr8 +board = sanguino_atmega1284p +upload_speed = 115200 # # Melzi and clones (Zonestar Melzi2 with tuned flags) # -[env:melzi_optimized] -platform = atmelavr -extends = env:melzi_optiboot -build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues -build_unflags = -g -ggdb +[env:melzi_optiboot_optimized] +platform = atmelavr +extends = env:melzi_optiboot +build_flags = ${tuned_1284p.build_flags} # # AT90USB1286 boards using CDC bootloader @@ -558,10 +574,10 @@ build_unflags = -g -ggdb # - TEENSYLU # [env:at90usb1286_cdc] -platform = teensy -extends = common_avr8 -board = at90usb1286 -lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet +platform = teensy +extends = common_avr8 +board = at90usb1286 +lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet # # AT90USB1286 boards using DFU bootloader @@ -570,8 +586,8 @@ lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet # - ? 5DPRINT ? # [env:at90usb1286_dfu] -platform = teensy -extends = env:at90usb1286_cdc +platform = teensy +extends = env:at90usb1286_cdc ################################# # # @@ -586,20 +602,20 @@ extends = env:at90usb1286_cdc # - RADDS # [env:DUE] -platform = atmelsam -board = due -src_filter = ${common.default_src_filter} + + +platform = atmelsam +board = due +src_filter = ${common.default_src_filter} + + [env:DUE_USB] -platform = atmelsam -extends = env:DUE -board = dueUSB +platform = atmelsam +extends = env:DUE +board = dueUSB [env:DUE_debug] # Used when WATCHDOG_RESET_MANUAL is enabled -platform = atmelsam -extends = env:DUE -build_flags = ${common.build_flags} +platform = atmelsam +extends = env:DUE +build_flags = ${common.build_flags} -funwind-tables -mpoke-function-name @@ -607,24 +623,24 @@ build_flags = ${common.build_flags} # Archim SAM # [common_DUE_archim] -platform = atmelsam -extends = env:DUE -board = archim -build_flags = ${common.build_flags} +platform = atmelsam +extends = env:DUE +board = archim +build_flags = ${common.build_flags} -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON board_build.variants_dir = buildroot/share/PlatformIO/variants/ -extra_scripts = ${common.extra_scripts} +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 +platform = ${common_DUE_archim.platform} +extends = common_DUE_archim # Used when WATCHDOG_RESET_MANUAL is enabled [env:DUE_archim_debug] -platform = ${common_DUE_archim.platform} -extends = common_DUE_archim -build_flags = ${common_DUE_archim.build_flags} -funwind-tables -mpoke-function-name +platform = ${common_DUE_archim.platform} +extends = common_DUE_archim +build_flags = ${common_DUE_archim.build_flags} -funwind-tables -mpoke-function-name ################################# # # @@ -678,14 +694,14 @@ 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 +platform = ${common_LPC.platform} +extends = common_LPC +board = nxp_lpc1768 [env:LPC1769] -platform = ${common_LPC.platform} -extends = common_LPC -board = nxp_lpc1769 +platform = ${common_LPC.platform} +extends = common_LPC +board = nxp_lpc1769 ################################# # # From 2fdeceda58808015a93d1cb2a1137c0528668a3e Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 7 Nov 2020 06:00:29 -0300 Subject: [PATCH 105/443] Color UI single touch menu navigation (#20053) --- Marlin/Configuration.h | 4 ++++ Marlin/src/lcd/tft/touch.cpp | 5 ++++- Marlin/src/lcd/tft/ui_320x240.cpp | 5 ++++- Marlin/src/lcd/tft/ui_480x320.cpp | 5 ++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1297c61aedfc..719e11b899ca 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2343,6 +2343,10 @@ //#define XPT2046_Y_CALIBRATION -8981 //#define XPT2046_X_OFFSET -43 //#define XPT2046_Y_OFFSET 257 + + #if ENABLED(TFT_COLOR_UI) + //#define SINGLE_TOUCH_NAVIGATION + #endif #endif // diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index cde969802498..adbc2923a466 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -206,7 +206,10 @@ void Touch::touch(touch_control_t *control) { case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break; case BACK: ui.goto_previous_screen(); break; - case CLICK: ui.lcd_clicked = true; break; + case CLICK: + TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data); + ui.lcd_clicked = true; + break; #if HAS_RESUME_CONTINUE case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break; #endif diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 4e2cd8acc484..999cec29baa9 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -647,7 +647,10 @@ void menu_item(const uint8_t row, bool sel ) { #endif menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); - TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 2 + 34 * row, 320, 32, encoderTopLine + row)); + #if ENABLED(TOUCH_SCREEN) + const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; + touch.add_control(tct, 0, 2 + 34 * row, 320, 32, encoderTopLine + row); + #endif } void MarlinUI::move_axis_screen() { diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 0c44a3151b58..9ba5c1b157f6 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -652,7 +652,10 @@ void menu_item(const uint8_t row, bool sel ) { #endif menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); - TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row)); + #if ENABLED(TOUCH_SCREEN) + const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; + touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row); + #endif } #if ENABLED(BABYSTEP_ZPROBE_OFFSET) From 6954772ece00a5fa2fdd327a6af1a0d593d22723 Mon Sep 17 00:00:00 2001 From: Speaka <48431623+Speaka@users.noreply.github.com> Date: Sat, 7 Nov 2020 10:20:27 +0100 Subject: [PATCH 106/443] Tramming Wizard submenu option (#20000) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 4 +- Marlin/src/feature/tramming.h | 59 ++++++++++++ Marlin/src/gcode/bedlevel/G35.cpp | 26 +++--- Marlin/src/lcd/language/language_en.h | 6 +- Marlin/src/lcd/menu/menu_motion.cpp | 8 +- Marlin/src/lcd/menu/menu_tramming.cpp | 93 +++++++++++++++++++ .../PlatformIO/scripts/common-dependencies.h | 3 + buildroot/tests/DUE-tests | 2 +- platformio.ini | 2 + 9 files changed, 184 insertions(+), 19 deletions(-) create mode 100644 Marlin/src/feature/tramming.h create mode 100644 Marlin/src/lcd/menu/menu_tramming.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b39e9e17226c..cd8a055ffb20 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -808,7 +808,9 @@ #define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation //#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first - //#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item for Assisted Tramming + + //#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item to run G35 Assisted Tramming (MarlinUI) + //#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu /** * Screw thread: diff --git a/Marlin/src/feature/tramming.h b/Marlin/src/feature/tramming.h new file mode 100644 index 000000000000..79f7407716d3 --- /dev/null +++ b/Marlin/src/feature/tramming.h @@ -0,0 +1,59 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../inc/MarlinConfigPre.h" + +#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1 + #error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51." +#endif + +constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY; + +#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos) +static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions."); + +extern const char point_name_1[], point_name_2[], point_name_3[] + #ifdef TRAMMING_POINT_NAME_4 + , point_name_4[] + #ifdef TRAMMING_POINT_NAME_5 + , point_name_5[] + #endif + #endif +; + +#define _NR_TRAM_NAMES 2 +#ifdef TRAMMING_POINT_NAME_3 + #undef _NR_TRAM_NAMES + #define _NR_TRAM_NAMES 3 + #ifdef TRAMMING_POINT_NAME_4 + #undef _NR_TRAM_NAMES + #define _NR_TRAM_NAMES 4 + #ifdef TRAMMING_POINT_NAME_5 + #undef _NR_TRAM_NAMES + #define _NR_TRAM_NAMES 5 + #endif + #endif +#endif +static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries."); +#undef _NR_TRAM_NAMES + +extern PGM_P const tramming_point_name[]; diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index b39a7b9ed8c4..f0abc543cb8b 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -36,19 +36,23 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" -constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY; +// +// Define tramming point names. +// -static PGMSTR(point_name_1, TRAMMING_POINT_NAME_1); -static PGMSTR(point_name_2, TRAMMING_POINT_NAME_2); -static PGMSTR(point_name_3, TRAMMING_POINT_NAME_3); +#include "../../feature/tramming.h" // Validate + +PGMSTR(point_name_1, TRAMMING_POINT_NAME_1); +PGMSTR(point_name_2, TRAMMING_POINT_NAME_2); +PGMSTR(point_name_3, TRAMMING_POINT_NAME_3); #ifdef TRAMMING_POINT_NAME_4 - static PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); + PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); #ifdef TRAMMING_POINT_NAME_5 - static PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); + PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); #endif #endif -static PGM_P const tramming_point_name[] PROGMEM = { +PGM_P const tramming_point_name[] PROGMEM = { point_name_1, point_name_2, point_name_3 #ifdef TRAMMING_POINT_NAME_4 , point_name_4 @@ -58,14 +62,6 @@ static PGM_P const tramming_point_name[] PROGMEM = { #endif }; -#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos) - -#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1 - #error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51." -#endif - -static_assert(G35_PROBE_COUNT > 2, "TRAMMING_POINT_XY requires at least 3 XY positions."); - /** * G35: Read bed corners to help adjust bed screws * diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 42954d79e5b9..2f50902bffb3 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -73,7 +73,6 @@ namespace Language_en { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); - PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assisted Tramming"); PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Iteration: %i"); PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Accuracy Decreasing!"); PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Accuracy Achieved"); @@ -85,6 +84,10 @@ namespace Language_en { PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Set Home Offsets"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Set Origin"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assisted Tramming"); + PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); + PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Select Origin"); + PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Last value "); #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preheat ") PREHEAT_1_LABEL; PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preheat ") PREHEAT_1_LABEL " ~"; @@ -666,6 +669,7 @@ namespace Language_en { PROGMEM Language_Str MSG_REHEATING = _UxGT("Reheating..."); PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z Probe Wizard"); + PROGMEM Language_Str MSG_SOUND = _UxGT("Sound"); } diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 2972920f34a7..c681842e903d 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -305,6 +305,10 @@ void menu_move() { void menu_bed_leveling(); #endif +#if ENABLED(ASSISTED_TRAMMING_WIZARD) + void goto_tramming_wizard(); +#endif + void menu_motion() { START_MENU(); @@ -346,7 +350,9 @@ void menu_motion() { // // Assisted Bed Tramming // - #if ENABLED(ASSISTED_TRAMMING_MENU_ITEM) + #if ENABLED(ASSISTED_TRAMMING_WIZARD) + SUBMENU(MSG_TRAMMING_WIZARD, goto_tramming_wizard); + #elif ENABLED(ASSISTED_TRAMMING_MENU_ITEM) GCODES_ITEM(MSG_ASSISTED_TRAMMING, PSTR("G35")); #endif diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp new file mode 100644 index 000000000000..c01f983833ea --- /dev/null +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -0,0 +1,93 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +// +// Bed Tramming Wizard +// + +#include "../../inc/MarlinConfigPre.h" + +#if BOTH(HAS_LCD_MENU, ASSISTED_TRAMMING_WIZARD) + +#include "menu_item.h" + +#include "../../feature/tramming.h" + +#include "../../module/motion.h" +#include "../../module/probe.h" +#include "../../gcode/queue.h" + +//#define DEBUG_OUT 1 +#include "../../core/debug_out.h" + +float z_measured[G35_PROBE_COUNT] = { 0 }; +static uint8_t tram_index = 0; + +bool probe_single_point() { + const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true); + DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); + z_measured[tram_index] = z_probed_height; + return !isnan(z_probed_height); +} + +void _menu_single_probe(const uint8_t point) { + tram_index = point; + DEBUG_ECHOLNPAIR("Screen: single probe screen Arg:", point); + START_MENU(); + STATIC_ITEM(MSG_LEVEL_CORNERS, SS_LEFT); + STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, ftostr42_52(z_measured[0] - z_measured[point])); // Print diff + ACTION_ITEM(MSG_UBL_BC_INSERT2, []{ if (probe_single_point()) ui.refresh(); }); + ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen_no_defer(); }); // Back + END_MENU(); +} + +void tramming_wizard_menu() { + DEBUG_ECHOLNPAIR("Screen: tramming_wizard_menu"); + START_MENU(); + STATIC_ITEM(MSG_SELECT_ORIGIN); + + // Draw a menu item for each tramming point + LOOP_L_N(i, G35_PROBE_COUNT) + SUBMENU_N_P(i, (char*)pgm_read_ptr(&tramming_point_name[i]), []{ _menu_single_probe(MenuItemBase::itemIndex); }); + + ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen_no_defer(); }); + END_MENU(); +} + +// Init the wizard and enter the submenu +void goto_tramming_wizard() { + DEBUG_ECHOLNPAIR("Screen: goto_tramming_wizard", 1); + tram_index = 0; + ui.defer_status_screen(); + //probe_single_point(); // Probe first point to get differences + + // Inject G28, wait for homing to complete, + set_all_unhomed(); + queue.inject_P(G28_STR); + ui.goto_screen([]{ + _lcd_draw_homing(); + if (all_axes_homed()) + ui.goto_screen(tramming_wizard_menu); + }); +} + +#endif // HAS_LCD_MENU && ASSISTED_TRAMMING_WIZARD diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index f5b36c407ed4..ed2f46abaee1 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -111,6 +111,9 @@ #if ENABLED(TOUCH_SCREEN_CALIBRATION) #define HAS_MENU_TOUCH_SCREEN #endif + #if ENABLED(ASSISTED_TRAMMING_WIZARD) + #define HAS_MENU_TRAMMING + #endif #if ENABLED(AUTO_BED_LEVELING_UBL) #define HAS_MENU_UBL #endif diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index 0da0d798d04f..4a7c492d7b72 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -14,7 +14,7 @@ opt_set TEMP_SENSOR_BED 2 opt_set GRID_MAX_POINTS_X 16 opt_set FANMUX0_PIN 53 opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ - FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING ASSISTED_TRAMMING \ + FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD \ EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \ BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ diff --git a/platformio.ini b/platformio.ini index 07edbf391867..af7ce47a5044 100644 --- a/platformio.ini +++ b/platformio.ini @@ -48,6 +48,7 @@ default_src_filter = + - - + - - - + - - - - - @@ -259,6 +260,7 @@ HAS_MENU_CUTTER = src_filter=+ HAS_MENU_TEMPERATURE = src_filter=+ HAS_MENU_TMC = src_filter=+ HAS_MENU_TOUCH_SCREEN = src_filter=+ +HAS_MENU_TRAMMING = src_filter=+ HAS_MENU_UBL = src_filter=+ ANYCUBIC_LCD_CHIRON = src_filter=+ + ANYCUBIC_LCD_I3MEGA = src_filter=+ + From 2da25d67e155fa0bbf07a6e3767a2a15abb75726 Mon Sep 17 00:00:00 2001 From: LinFor Date: Sat, 7 Nov 2020 12:37:45 +0300 Subject: [PATCH 107/443] Fix Endstop Interrupts with SPI endstops, sanity checks (#20051) Co-authored-by: Scott Lahteine --- Marlin/src/inc/SanityCheck.h | 108 ++++++++++++++++++--------------- Marlin/src/module/endstops.cpp | 3 + 2 files changed, 63 insertions(+), 48 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ef79241d7179..b6ff725470e5 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1941,7 +1941,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif // Delta and Cartesian use 3 homing endstops -#if !IS_SCARA +#if NONE(IS_SCARA, SPI_ENDSTOPS) #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG) #error "Enable USE_XMIN_PLUG when homing X to MIN." #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG) @@ -2510,56 +2510,68 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209) #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209) - #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z) - #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z." - #elif X_SENSORLESS && X_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMIN) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN." - #elif X_SENSORLESS && X_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMAX) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX." - #elif Y_SENSORLESS && Y_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMIN) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN." - #elif Y_SENSORLESS && Y_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMAX) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX." - #elif Z_SENSORLESS && Z_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN." - #elif Z_SENSORLESS && Z_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMAX) - #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX." - #elif X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING - #if X_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN." - #else - #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN." - #endif - #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING - #if X_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX." - #else - #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX." - #endif - #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING - #if Y_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN." - #else - #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN." - #endif - #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING - #if Y_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX." - #else - #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX." + #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS) + #if X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN." + #elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX." + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN." + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX." + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN." + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX." #endif - #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING - #if Z_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN." - #else - #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN." + #endif + + #if ENABLED(SPI_ENDSTOPS) + #if ENABLED(QUICK_HOME) + #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results." #endif - #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING - #if Z_ENDSTOP_INVERTING - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX." - #else - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX." + #else + #if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN." + #else + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN." + #endif + #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX." + #else + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN." + #else + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX." + #else + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN." + #else + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX." + #else + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX." + #endif #endif + #endif + + #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z) + #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z." #elif ENDSTOP_NOISE_THRESHOLD #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD." #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 928c9ad8b9d0..825194cf45cc 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -899,6 +899,9 @@ void Endstops::update() { hit = true; } #endif + + if (TERN0(ENDSTOP_INTERRUPTS_FEATURE, hit)) update(); + return hit; } From b5ef6995233f4166a726bbda7d53aa9e2eecc472 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 16:20:19 -0600 Subject: [PATCH 108/443] TFT cleanup --- Marlin/src/HAL/STM32/tft/tft_fsmc.h | 20 +++++++++----------- Marlin/src/HAL/STM32F1/tft/tft_fsmc.h | 8 ++++---- Marlin/src/lcd/tft/ui_480x320.cpp | 14 +++++++------- Marlin/src/lcd/tft_io/ssd1963.h | 2 +- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index cbec7613ef4a..e2e0128c5efc 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.h @@ -21,30 +21,28 @@ */ #pragma once +#include "../../../inc/MarlinConfig.h" + #ifdef STM32F1xx #include "stm32f1xx_hal.h" + #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) #elif defined(STM32F4xx) #include "stm32f4xx_hal.h" + #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) #else - #error FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware. + #error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware." #endif #ifndef LCD_READ_ID - #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) + #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) #endif #ifndef LCD_READ_ID4 #define LCD_READ_ID4 0xD3 // Read display identification information (0xD3 on ILI9341) #endif -#define DATASIZE_8BIT SPI_DATASIZE_8BIT -#define DATASIZE_16BIT SPI_DATASIZE_16BIT -#define TFT_IO_DRIVER TFT_FSMC - -#ifdef STM32F1xx - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) -#elif defined(STM32F4xx) - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) -#endif +#define DATASIZE_8BIT SPI_DATASIZE_8BIT +#define DATASIZE_16BIT SPI_DATASIZE_16BIT +#define TFT_IO_DRIVER TFT_FSMC typedef struct { __IO uint16_t REG; diff --git a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h index 11eb1ffa8410..d9ee1f4c7767 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.h @@ -22,7 +22,7 @@ #pragma once #ifndef LCD_READ_ID - #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) + #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) #endif #ifndef LCD_READ_ID4 #define LCD_READ_ID4 0xD3 // Read display identification information (0xD3 on ILI9341) @@ -30,9 +30,9 @@ #include -#define DATASIZE_8BIT DMA_SIZE_8BITS -#define DATASIZE_16BIT DMA_SIZE_16BITS -#define TFT_IO_DRIVER TFT_FSMC +#define DATASIZE_8BIT DMA_SIZE_8BITS +#define DATASIZE_16BIT DMA_SIZE_16BITS +#define TFT_IO_DRIVER TFT_FSMC typedef struct { __IO uint16_t REG; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 9ba5c1b157f6..e2bbdcde7f8e 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -428,21 +428,21 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu extern screenFunc_t _manual_move_func_ptr; if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { - #define SLIDER_LENGHT 336 + #define SLIDER_LENGTH 336 #define SLIDER_Y_POSITION 186 - tft.canvas((TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION, SLIDER_LENGHT, 16); + tft.canvas((TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION, SLIDER_LENGTH, 16); tft.set_background(COLOR_BACKGROUND); - int16_t position = (SLIDER_LENGHT - 2) * ui.encoderPosition / maxEditValue; + int16_t position = (SLIDER_LENGTH - 2) * ui.encoderPosition / maxEditValue; tft.add_bar(0, 7, 1, 2, ui.encoderPosition == 0 ? COLOR_SLIDER_INACTIVE : COLOR_SLIDER); tft.add_bar(1, 6, position, 4, COLOR_SLIDER); - tft.add_bar(position + 1, 6, SLIDER_LENGHT - 2 - position, 4, COLOR_SLIDER_INACTIVE); - tft.add_bar(SLIDER_LENGHT - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE); + tft.add_bar(position + 1, 6, SLIDER_LENGTH - 2 - position, 4, COLOR_SLIDER_INACTIVE); + tft.add_bar(SLIDER_LENGTH - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE); #if ENABLED(TOUCH_SCREEN) - tft.add_image((SLIDER_LENGHT - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER); - touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGHT, 32, maxEditValue); + tft.add_image((SLIDER_LENGTH - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER); + touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGTH, 32, maxEditValue); #endif } diff --git a/Marlin/src/lcd/tft_io/ssd1963.h b/Marlin/src/lcd/tft_io/ssd1963.h index 4953a96233e8..af42e306c616 100644 --- a/Marlin/src/lcd/tft_io/ssd1963.h +++ b/Marlin/src/lcd/tft_io/ssd1963.h @@ -125,7 +125,7 @@ static const uint16_t ssd1963_init[] = { ESC_REG(SSD1963_NORON), ESC_REG(SSD1963_DISPON), - ESC_REG(SSD1963_SPWMCFG), 0x0006, 0x00f0, 0x0001, 0x00f0, 0x0000, 0x0000, + ESC_REG(SSD1963_SPWMCFG), 0x0006, 0x00F0, 0x0001, 0x00F0, 0x0000, 0x0000, ESC_REG(SSD1963_SDBCCFG), 0x000D, ESC_END }; From 883347bc11376608d16c715942113a89c1eb5bea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 16:53:37 -0600 Subject: [PATCH 109/443] Apply some pins formatting --- Marlin/src/pins/mega/pins_GT2560_V3_A20.h | 14 +++++++------- Marlin/src/pins/ramps/pins_3DRAG.h | 2 +- Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h | 10 +++++----- Marlin/src/pins/ramps/pins_DAGOMA_F5.h | 10 +++++----- Marlin/src/pins/ramps/pins_K8400.h | 10 +++++----- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 14 +++++++------- Marlin/src/pins/ramps/pins_RL200.h | 18 +++++++++--------- Marlin/src/pins/ramps/pins_TANGO.h | 14 +++++++------- Marlin/src/pins/ramps/pins_VORON.h | 10 +++++----- Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h | 14 +++++++------- Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h | 12 ++++++------ .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h | 18 +++++++++--------- .../src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h | 18 +++++++++--------- 13 files changed, 82 insertions(+), 82 deletions(-) diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h index 20cccf148f92..c445f5b24187 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h @@ -25,17 +25,17 @@ * Geeetech A20M pin assignment */ -#define LCD_PINS_RS 5 -#define LCD_PINS_ENABLE 36 -#define LCD_PINS_D4 21 -#define LCD_PINS_D7 6 +#define LCD_PINS_RS 5 +#define LCD_PINS_ENABLE 36 +#define LCD_PINS_D4 21 +#define LCD_PINS_D7 6 #define SPEAKER // The speaker can produce tones #if IS_NEWPANEL - #define BTN_EN1 16 - #define BTN_EN2 17 - #define BTN_ENC 19 + #define BTN_EN1 16 + #define BTN_EN2 17 + #define BTN_ENC 19 #endif #include "pins_GT2560_V3.h" diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index b7f0517aac02..5a0afdc550cf 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -157,7 +157,7 @@ #define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM #define SPINDLE_LASER_ENA_PIN 62 // Pullup! #define SPINDLE_DIR_PIN 48 - #elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // use expansion header if no LCD in use + #elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use #define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown! #define SPINDLE_DIR_PIN 17 #endif diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index af1adabbbcd2..97ef1b4fd869 100644 --- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -34,9 +34,9 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 66 // Pullup or pulldown! -#define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 66 // Pullup or pulldown! +#define SPINDLE_DIR_PIN 67 +#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #include "pins_RAMPS.h" @@ -45,5 +45,5 @@ // #undef TEMP_0_PIN #undef TEMP_1_PIN -#define TEMP_0_PIN 9 // Analog Input -#define TEMP_1_PIN 11 // Analog Input +#define TEMP_0_PIN 9 // Analog Input +#define TEMP_1_PIN 11 // Analog Input diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h index 667ae47f7098..07e46acfe71b 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h @@ -30,13 +30,13 @@ // // Endstops // -#define X_STOP_PIN 2 -#define Y_STOP_PIN 3 -#define Z_STOP_PIN 15 +#define X_STOP_PIN 2 +#define Y_STOP_PIN 3 +#define Z_STOP_PIN 15 -#define FIL_RUNOUT_PIN 39 +#define FIL_RUNOUT_PIN 39 #if EXTRUDERS > 1 - #define FIL_RUNOUT2_PIN 14 + #define FIL_RUNOUT2_PIN 14 #endif // diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index c36e291598eb..af687927f420 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -40,8 +40,8 @@ // // Limit Switches // -#define X_STOP_PIN 3 -#define Y_STOP_PIN 14 +#define X_STOP_PIN 3 +#define Y_STOP_PIN 14 #undef X_MIN_PIN #undef X_MAX_PIN @@ -52,13 +52,13 @@ // Steppers // #undef E1_STEP_PIN -#define E1_STEP_PIN 32 +#define E1_STEP_PIN 32 // // Heaters / Fans // #undef HEATER_1_PIN -#define HEATER_1_PIN 11 +#define HEATER_1_PIN 11 // // Misc. Functions @@ -69,5 +69,5 @@ #if Z_STEP_PIN == 26 #undef Z_STEP_PIN - #define Z_STEP_PIN 32 + #define Z_STEP_PIN 32 #endif diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 42796acf8b6a..a4dfca21b465 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -30,30 +30,30 @@ #endif #define BOARD_INFO_NAME "MKS BASE 1.6" -#define MKS_BASE_VERSION 16 +#define MKS_BASE_VERSION 16 // // Servos // -#define SERVO1_PIN 12 // Digital 12 / Pin 25 +#define SERVO1_PIN 12 // Digital 12 / Pin 25 // // Omitted RAMPS pins // #ifndef SERVO2_PIN - #define SERVO2_PIN -1 + #define SERVO2_PIN -1 #endif #ifndef SERVO3_PIN - #define SERVO3_PIN -1 + #define SERVO3_PIN -1 #endif #ifndef FILWIDTH_PIN - #define FILWIDTH_PIN -1 + #define FILWIDTH_PIN -1 #endif #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN -1 + #define FIL_RUNOUT_PIN -1 #endif #ifndef PS_ON_PIN - #define PS_ON_PIN -1 + #define PS_ON_PIN -1 #endif #include "pins_MKS_BASE_common.h" diff --git a/Marlin/src/pins/ramps/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h index 3fccb90276f4..047ad160bed1 100644 --- a/Marlin/src/pins/ramps/pins_RL200.h +++ b/Marlin/src/pins/ramps/pins_RL200.h @@ -37,16 +37,16 @@ #error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200." #endif -#define E0_STEP_PIN 26 // (RUMBA E1 pins) -#define E0_DIR_PIN 25 -#define E0_ENABLE_PIN 27 +#define E0_STEP_PIN 26 // (RUMBA E1 pins) +#define E0_DIR_PIN 25 +#define E0_ENABLE_PIN 27 -#define E1_STEP_PIN 29 // (RUMBA E2 pins) -#define E1_DIR_PIN 28 -#define E1_ENABLE_PIN 39 +#define E1_STEP_PIN 29 // (RUMBA E2 pins) +#define E1_DIR_PIN 28 +#define E1_ENABLE_PIN 39 -#define Z2_STEP_PIN 23 // (RUMBA E0 pins) -#define Z2_DIR_PIN 22 -#define Z2_ENABLE_PIN 24 +#define Z2_STEP_PIN 23 // (RUMBA E0 pins) +#define Z2_DIR_PIN 22 +#define Z2_ENABLE_PIN 24 #include "pins_RUMBA.h" diff --git a/Marlin/src/pins/ramps/pins_TANGO.h b/Marlin/src/pins/ramps/pins_TANGO.h index 715444cee216..451d2f874d7f 100644 --- a/Marlin/src/pins/ramps/pins_TANGO.h +++ b/Marlin/src/pins/ramps/pins_TANGO.h @@ -27,26 +27,26 @@ #define BOARD_INFO_NAME "Tango" -#define FAN_PIN 8 -#define FAN1_PIN -1 +#define FAN_PIN 8 +#define FAN1_PIN -1 #ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 7 + #define E0_AUTO_FAN_PIN 7 #endif #ifndef TEMP_0_PIN #if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 10 // Analog Input (connector *K1* on Tango thermocouple ADD ON is used) + #define TEMP_0_PIN 10 // Analog Input (connector *K1* on Tango thermocouple ADD ON is used) #else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) + #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) #endif #endif #ifndef TEMP_1_PIN #if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 9 // Analog Input (connector *K2* on Tango thermocouple ADD ON is used) + #define TEMP_1_PIN 9 // Analog Input (connector *K2* on Tango thermocouple ADD ON is used) #else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) + #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) #endif #endif diff --git a/Marlin/src/pins/ramps/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h index 40ec71b6f0fb..9ab657346814 100644 --- a/Marlin/src/pins/ramps/pins_VORON.h +++ b/Marlin/src/pins/ramps/pins_VORON.h @@ -28,7 +28,7 @@ #define BOARD_INFO_NAME "VORON Design v2" -#define RAMPS_D8_PIN 11 +#define RAMPS_D8_PIN 11 #include "pins_RAMPS.h" @@ -36,17 +36,17 @@ // Heaters / Fans // #undef FAN_PIN -#define FAN_PIN 5 // Using the pin for the controller fan since controller fan is always on. -#define CONTROLLER_FAN_PIN 8 +#define FAN_PIN 5 // Using the pin for the controller fan since controller fan is always on. +#define CONTROLLER_FAN_PIN 8 // // Auto fans // #ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan + #define E0_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan #endif #ifndef E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan) + #define E1_AUTO_FAN_PIN 6 // Servo pin 6 for E3D Fan (same pin for both extruders since it's the same fan) #endif // diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 9f406c1f7856..f110fe5794c4 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -62,17 +62,17 @@ #undef LCD_PINS_D6 #undef LCD_PINS_D7 -#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) -#define LCD_PINS_RS 28 // ST9720 CS -#define LCD_PINS_ENABLE 17 // ST9720 DAT -#define LCD_PINS_D4 30 // ST9720 CLK +#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) +#define LCD_PINS_RS 28 // ST9720 CS +#define LCD_PINS_ENABLE 17 // ST9720 DAT +#define LCD_PINS_D4 30 // ST9720 CLK #if ENABLED(BLTOUCH) - #define SERVO0_PIN 27 + #define SERVO0_PIN 27 #undef BEEPER_PIN #elif ENABLED(FILAMENT_RUNOUT_SENSOR) #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 27 + #define FIL_RUNOUT_PIN 27 #endif #if FIL_RUNOUT_PIN == BEEPER_PIN #undef BEEPER_PIN @@ -81,7 +81,7 @@ #if ENABLED(MINIPANEL) #undef DOGLCD_CS - #define DOGLCD_CS LCD_PINS_RS + #define DOGLCD_CS LCD_PINS_RS #endif /** diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 5014620c6b81..8b4faeeaf909 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -50,9 +50,9 @@ #undef BTN_EN2 #undef BTN_ENC -#define LCD_PINS_RS 17 // ST9720 CS -#define LCD_PINS_ENABLE 16 // ST9720 DAT -#define LCD_PINS_D4 11 // ST9720 CLK -#define BTN_EN1 30 -#define BTN_EN2 29 -#define BTN_ENC 28 +#define LCD_PINS_RS 17 // ST9720 CS +#define LCD_PINS_ENABLE 16 // ST9720 DAT +#define LCD_PINS_D4 11 // ST9720 CLK +#define BTN_EN1 30 +#define BTN_EN2 29 +#define BTN_ENC 28 diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h index 8d384c739681..165c41ffe7b3 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h @@ -25,7 +25,7 @@ #define BOARD_INFO_NAME "BTT SKR Mini E3 V1.2" -#define NEOPIXEL_PIN PC7 // LED driving pin +#define NEOPIXEL_PIN PC7 // LED driving pin /** * TMC2208/TMC2209 stepper drivers @@ -34,17 +34,17 @@ // // Software serial // - #define X_SERIAL_TX_PIN PB15 - #define X_SERIAL_RX_PIN PB15 + #define X_SERIAL_TX_PIN PB15 + #define X_SERIAL_RX_PIN PB15 - #define Y_SERIAL_TX_PIN PC6 - #define Y_SERIAL_RX_PIN PC6 + #define Y_SERIAL_TX_PIN PC6 + #define Y_SERIAL_RX_PIN PC6 - #define Z_SERIAL_TX_PIN PC10 - #define Z_SERIAL_RX_PIN PC10 + #define Z_SERIAL_TX_PIN PC10 + #define Z_SERIAL_RX_PIN PC10 - #define E0_SERIAL_TX_PIN PC11 - #define E0_SERIAL_RX_PIN PC11 + #define E0_SERIAL_TX_PIN PC11 + #define E0_SERIAL_RX_PIN PC11 // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h index 5e8bd11b4bd0..65b16755ca30 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH_V12.h @@ -36,7 +36,7 @@ #undef RGB_LED_G_PIN #undef RGB_LED_B_PIN -#define FAN1_PIN PB0 // Fan1 +#define FAN1_PIN PB0 // Fan1 #if HAS_TMC_UART @@ -47,17 +47,17 @@ // // Software serial // - #define X_SERIAL_TX_PIN PA11 - #define X_SERIAL_RX_PIN PA12 + #define X_SERIAL_TX_PIN PA11 + #define X_SERIAL_RX_PIN PA12 - #define Y_SERIAL_TX_PIN PB6 - #define Y_SERIAL_RX_PIN PB7 + #define Y_SERIAL_TX_PIN PB6 + #define Y_SERIAL_RX_PIN PB7 - #define Z_SERIAL_TX_PIN PB10 - #define Z_SERIAL_RX_PIN PB11 + #define Z_SERIAL_TX_PIN PB10 + #define Z_SERIAL_RX_PIN PB11 - #define E0_SERIAL_TX_PIN PA2 - #define E0_SERIAL_RX_PIN PA3 + #define E0_SERIAL_TX_PIN PA2 + #define E0_SERIAL_RX_PIN PA3 // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 From 7beebcd315da6587891a50fde1f7d53a8ec57c51 Mon Sep 17 00:00:00 2001 From: Albert van Osch Date: Sat, 7 Nov 2020 23:59:19 +0100 Subject: [PATCH 110/443] Zonestar Z8 XM2 support (#19991) --- Marlin/src/core/boards.h | 87 +++++----- Marlin/src/lcd/menu/menu_tramming.cpp | 2 +- Marlin/src/lcd/thermistornames.h | 2 + Marlin/src/module/thermistor/thermistor_503.h | 57 +++++++ Marlin/src/module/thermistor/thermistors.h | 3 + Marlin/src/pins/pins.h | 10 +- Marlin/src/pins/ramps/pins_ZRIB_V52.h | 159 ++++++++++++++++++ 7 files changed, 272 insertions(+), 48 deletions(-) create mode 100644 Marlin/src/module/thermistor/thermistor_503.h create mode 100644 Marlin/src/pins/ramps/pins_ZRIB_V52.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 12bf167f40c5..efccc3716de8 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -69,49 +69,50 @@ #define BOARD_MKS_GEN_L 1113 // MKS GEN L #define BOARD_KFB_2 1114 // BigTreeTech or BIQU KFB2.0 #define BOARD_ZRIB_V20 1115 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 1116 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 1117 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 1118 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 1119 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 1120 // Ultimaker -#define BOARD_ULTIMAKER_OLD 1121 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 1122 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 1123 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 1124 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 1125 // Rumba -#define BOARD_RUMBA_RAISE3D 1126 // Raise3D N series Rumba derivative -#define BOARD_RL200 1127 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) -#define BOARD_FORMBOT_TREX2PLUS 1128 // Formbot T-Rex 2 Plus -#define BOARD_FORMBOT_TREX3 1129 // Formbot T-Rex 3 -#define BOARD_FORMBOT_RAPTOR 1130 // Formbot Raptor -#define BOARD_FORMBOT_RAPTOR2 1131 // Formbot Raptor 2 -#define BOARD_BQ_ZUM_MEGA_3D 1132 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 1133 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 1134 // TriGorilla Anycubic version 1.3-based on RAMPS EFB -#define BOARD_TRIGORILLA_14 1135 // ... Ver 1.4 -#define BOARD_TRIGORILLA_14_11 1136 // ... Rev 1.1 (new servo pin order) -#define BOARD_RAMPS_ENDER_4 1137 // Creality: Ender-4, CR-8 -#define BOARD_RAMPS_CREALITY 1138 // Creality: CR10S, CR20, CR-X -#define BOARD_DAGOMA_F5 1139 // Dagoma F5 -#define BOARD_FYSETC_F6_13 1140 // FYSETC F6 1.3 -#define BOARD_FYSETC_F6_14 1141 // FYSETC F6 1.4 -#define BOARD_DUPLICATOR_I3_PLUS 1142 // Wanhao Duplicator i3 Plus -#define BOARD_VORON 1143 // VORON Design -#define BOARD_TRONXY_V3_1_0 1144 // Tronxy TRONXY-V3-1.0 -#define BOARD_Z_BOLT_X_SERIES 1145 // Z-Bolt X Series -#define BOARD_TT_OSCAR 1146 // TT OSCAR -#define BOARD_OVERLORD 1147 // Overlord/Overlord Pro -#define BOARD_HJC2560C_REV1 1148 // ADIMLab Gantry v1 -#define BOARD_HJC2560C_REV2 1149 // ADIMLab Gantry v2 -#define BOARD_TANGO 1150 // BIQU Tango V1 -#define BOARD_MKS_GEN_L_V2 1151 // MKS GEN L V2 -#define BOARD_MKS_GEN_L_V21 1152 // MKS GEN L V2.1 -#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D -#define BOARD_ORTUR_4 1154 // Ortur 4 -#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer -#define BOARD_RAMPS_S_12_EEFB 1156 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_RAMPS_S_12_EEEB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) -#define BOARD_RAMPS_S_12_EFFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) +#define BOARD_ZRIB_V52 1116 // zrib V5.2 control board (Chinese knock off RAMPS replica) +#define BOARD_FELIX2 1117 // Felix 2.0+ Electronics Board (RAMPS like) +#define BOARD_RIGIDBOARD 1118 // Invent-A-Part RigidBoard +#define BOARD_RIGIDBOARD_V2 1119 // Invent-A-Part RigidBoard V2 +#define BOARD_SAINSMART_2IN1 1120 // Sainsmart 2-in-1 board +#define BOARD_ULTIMAKER 1121 // Ultimaker +#define BOARD_ULTIMAKER_OLD 1122 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) +#define BOARD_AZTEEG_X3 1123 // Azteeg X3 +#define BOARD_AZTEEG_X3_PRO 1124 // Azteeg X3 Pro +#define BOARD_ULTIMAIN_2 1125 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) +#define BOARD_RUMBA 1126 // Rumba +#define BOARD_RUMBA_RAISE3D 1127 // Raise3D N series Rumba derivative +#define BOARD_RL200 1128 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) +#define BOARD_FORMBOT_TREX2PLUS 1129 // Formbot T-Rex 2 Plus +#define BOARD_FORMBOT_TREX3 1130 // Formbot T-Rex 3 +#define BOARD_FORMBOT_RAPTOR 1131 // Formbot Raptor +#define BOARD_FORMBOT_RAPTOR2 1132 // Formbot Raptor 2 +#define BOARD_BQ_ZUM_MEGA_3D 1133 // bq ZUM Mega 3D +#define BOARD_MAKEBOARD_MINI 1134 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake +#define BOARD_TRIGORILLA_13 1135 // TriGorilla Anycubic version 1.3-based on RAMPS EFB +#define BOARD_TRIGORILLA_14 1136 // ... Ver 1.4 +#define BOARD_TRIGORILLA_14_11 1137 // ... Rev 1.1 (new servo pin order) +#define BOARD_RAMPS_ENDER_4 1138 // Creality: Ender-4, CR-8 +#define BOARD_RAMPS_CREALITY 1139 // Creality: CR10S, CR20, CR-X +#define BOARD_DAGOMA_F5 1140 // Dagoma F5 +#define BOARD_FYSETC_F6_13 1141 // FYSETC F6 1.3 +#define BOARD_FYSETC_F6_14 1142 // FYSETC F6 1.4 +#define BOARD_DUPLICATOR_I3_PLUS 1143 // Wanhao Duplicator i3 Plus +#define BOARD_VORON 1144 // VORON Design +#define BOARD_TRONXY_V3_1_0 1145 // Tronxy TRONXY-V3-1.0 +#define BOARD_Z_BOLT_X_SERIES 1146 // Z-Bolt X Series +#define BOARD_TT_OSCAR 1147 // TT OSCAR +#define BOARD_OVERLORD 1148 // Overlord/Overlord Pro +#define BOARD_HJC2560C_REV1 1149 // ADIMLab Gantry v1 +#define BOARD_HJC2560C_REV2 1150 // ADIMLab Gantry v2 +#define BOARD_TANGO 1151 // BIQU Tango V1 +#define BOARD_MKS_GEN_L_V2 1152 // MKS GEN L V2 +#define BOARD_MKS_GEN_L_V21 1153 // MKS GEN L V2.1 +#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D +#define BOARD_ORTUR_4 1155 // Ortur 4 +#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer +#define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) +#define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) // // RAMBo and derivatives diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index c01f983833ea..a102fe7e57ee 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 37f285d483cd..f9f91ac49a5c 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -68,6 +68,8 @@ #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" #elif THERMISTOR_ID == 502 #define THERMISTOR_NAME "Zonestar (P802M Hot Bed)" +#elif THERMISTOR_ID == 503 + #define THERMISTOR_NAME "Zonestar (Z8XM2 Bed)" #elif THERMISTOR_ID == 512 #define THERMISTOR_NAME "RPW-Ultra" #elif THERMISTOR_ID == 6 diff --git a/Marlin/src/module/thermistor/thermistor_503.h b/Marlin/src/module/thermistor/thermistor_503.h new file mode 100644 index 000000000000..fc4bffffdb58 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_503.h @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// Zonestar (Z8XM2) Heated Bed thermistor. Added By AvanOsch +// These are taken from the Zonestar settings in original Repetier firmware: Z8XM2_ZRIB_LCD12864_V51.zip +const temp_entry_t temptable_503[] PROGMEM = { + { OV( 12), 300 }, + { OV( 27), 270 }, + { OV( 47), 250 }, + { OV( 68), 230 }, + { OV( 99), 210 }, + { OV( 120), 200 }, + { OV( 141), 190 }, + { OV( 171), 180 }, + { OV( 201), 170 }, + { OV( 261), 160 }, + { OV( 321), 150 }, + { OV( 401), 140 }, + { OV( 451), 130 }, + { OV( 551), 120 }, + { OV( 596), 110 }, + { OV( 626), 105 }, + { OV( 666), 100 }, + { OV( 697), 90 }, + { OV( 717), 85 }, + { OV( 798), 69 }, + { OV( 819), 65 }, + { OV( 870), 55 }, + { OV( 891), 51 }, + { OV( 922), 39 }, + { OV( 968), 28 }, + { OV( 980), 23 }, + { OV( 991), 17 }, + { OV( 1001), 9 }, + { OV(1021), -27 }, + { OV(1023), -200} +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index f90361d9a346..ab92102de39c 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -75,6 +75,9 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Průša P802M hot bed #include "thermistor_502.h" #endif +#if ANY_THERMISTOR_IS(503) // Zonestar (Z8XM2) Heated Bed thermistor + #include "thermistor_503.h" +#endif #if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" #include "thermistor_512.h" #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 22b0c6947f8f..5eb4717e7863 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -104,13 +104,13 @@ #elif MB(3DRAG) #include "ramps/pins_3DRAG.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(K8200) - #include "ramps/pins_K8200.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) + #include "ramps/pins_K8200.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(K8400) - #include "ramps/pins_K8400.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) + #include "ramps/pins_K8400.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(K8600) #include "ramps/pins_K8600.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(K8800) - #include "ramps/pins_K8800.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (3DRAG) + #include "ramps/pins_K8800.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(BAM_DICE) #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(BAM_DICE_DUE) @@ -132,7 +132,9 @@ #elif MB(KFB_2) #include "ramps/pins_BIQU_KFB_2.h" // ATmega2560 env:mega2560 #elif MB(ZRIB_V20) - #include "ramps/pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 (MKS_GEN_13) + #include "ramps/pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 +#elif MB(ZRIB_V52) + #include "ramps/pins_ZRIB_V52.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(FELIX2) #include "ramps/pins_FELIX2.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 #elif MB(RIGIDBOARD) diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h new file mode 100644 index 000000000000..983c840bbc13 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h @@ -0,0 +1,159 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * ZRIB V5.2 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "ZRIB V5.2 only supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "ZRIB V5.2" + +#define MKS_BASE_VERSION 14 +#define IS_RAMPS_EFB + +// +// Heaters / Fans +// +#define FAN_PIN 9 // PH6 ** Pin18 ** PWM9 +#define FAN1_PIN 6 + +// +// Extra Extruder / Stepper for V5.2 +// +#define E2_STEP_PIN 4 +#define E2_DIR_PIN 5 +#define E2_ENABLE_PIN 22 + +#include "pins_MKS_BASE_common.h" + +/* + Available connectors on MKS BASE v1.4 (Basically same as ZRIB V5.2) + + ======= + | GND | + |-----| E0 + | 10 | (10) PB4 ** Pin23 ** PWM10 + |-----| + | GND | + |-----| E1 + | 7 | ( 7) PH4 ** Pin16 ** PWM7 + |-----| + | GND | + |-----| FAN + | 9 | ( 9) PH6 ** Pin18 ** PWM9 + ======= + + ======= + | GND | + |-----| Heated Bed + | 8 | ( 8) PH5 ** Pin17 ** PWM8 + ======= + + ========== + | 12-24V | + |--------| Power + | GND | + ========== + + XS3 Connector + ================= + | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11 + |----|-----|----| + | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12 + ================= + + Servos Connector + ================= + | 11 | GND | 5V | (11) PB5 ** Pin24 ** PWM11 + |----|-----|----| + | 12 | GND | 5V | (12) PB6 ** Pin25 ** PWM12 + ================= + + ICSP + ================= + | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI + |----|----|-----| + | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO + ================= (52) PB1 ** Pin20 ** SPI_SCK + + XS6/AUX-1 Connector + ====================== + | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA + |----|-----|----|----| + | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO + ====================== (51) PB2 ** Pin21 ** SPI_MOSI + (52) PB1 ** Pin20 ** SPI_SCK + (21) PD0 ** Pin43 ** I2C_SCL + + Temperature + ================================== + | GND | 69 | GND | 68 | GND | 67 | + ================================== + (69) PK7 ** Pin82 ** A15 + (68) PK6 ** Pin83 ** A14 + (67) PK5 ** Pin84 ** A13 + + Limit Switches + ============ + | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2 + |----|-----| + | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3 + |----|-----| + | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX + |----|-----| + | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX + |----|-----| + | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX + |----|-----| + | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX + ============ + + EXP1 + ============ + | 37 | 35 | (37) PC0 ** Pin53 ** D37 + |-----|----| (35) PC2 ** Pin55 ** D35 + | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX + |-----|----| (16) PH1 ** Pin13 ** USART2_TX + | 23 | 25 | (23) PA1 ** Pin77 ** D23 + |-----|----| (25) PA3 ** Pin75 ** D25 + | 27 | 29 | (27) PA5 ** Pin73 ** D27 + |-----|----| (29) PA7 ** Pin71 ** D29 + | GND | 5V | + ============ + + EXP2 + ============ + | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO + |-----|----| (52) PB1 ** Pin20 ** SPI_SCK + | 31 | 53 | (31) PC6 ** Pin59 ** D31 + |-----|----| (53) PB0 ** Pin19 ** SPI_SS + | 33 | 51 | (33) PC4 ** Pin57 ** D33 + |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI + | 49 | 41 | (49) PL0 ** Pin35 ** D49 + |-----|----| (41) PG0 ** Pin51 ** D41 + | GND | NC | + ============ +*/ From 45116128e8b2e7a7c6320170da6e46912a381f8b Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 8 Nov 2020 00:11:23 +0000 Subject: [PATCH 111/443] [cron] Bump distribution date (2020-11-08) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 217f076a82f1..2cabf66badfc 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-07" + #define STRING_DISTRIBUTION_DATE "2020-11-08" #endif /** From 18fb4b1ce1cff0843bb2ac2cb810dd15081747b4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 17:43:47 -0600 Subject: [PATCH 112/443] MSG_AUTOSTART => MSG_RUN_AUTO_FILES --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp | 3 ++- Marlin/src/lcd/language/language_an.h | 2 +- Marlin/src/lcd/language/language_bg.h | 2 +- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 2 +- Marlin/src/lcd/language/language_de.h | 2 +- Marlin/src/lcd/language/language_el.h | 2 +- Marlin/src/lcd/language/language_el_gr.h | 2 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_es.h | 2 +- Marlin/src/lcd/language/language_eu.h | 2 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 2 +- Marlin/src/lcd/language/language_jp_kana.h | 2 +- Marlin/src/lcd/language/language_ko_KR.h | 2 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 2 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 2 +- Marlin/src/lcd/language/language_tr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_vi.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/language/language_zh_TW.h | 2 +- Marlin/src/lcd/menu/menu_main.cpp | 6 +++--- 32 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 5c6022d09e4e..fe2397fa6b42 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -2144,7 +2144,7 @@ void HMI_Printing() { #endif #endif - strcat_P(cmd, PSTR("M24")); + strcat_P(cmd, M24_STR); queue.inject(cmd); } else { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp index edd90848d544..4f700a16dc51 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -32,6 +32,7 @@ #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" #include "../../../../inc/MarlinConfig.h" +#include "../../../../MarlinCore.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" @@ -95,7 +96,7 @@ void printer_state_polling() { gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now_P(PSTR("G90")); } - gcode.process_subcommands_now_P(PSTR("M24")); + gcode.process_subcommands_now_P(M24_STR); uiCfg.print_state = WORKING; start_print_time(); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index a5030fcd5636..13400f84592d 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -42,7 +42,7 @@ namespace Language_an { PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarcheta sacada"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters PROGMEM Language_Str MSG_MAIN = _UxGT("Menu prencipal"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automatico"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Inicio automatico"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Amortar motors"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Levar a l'orichen"); PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Orichen X"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index dcb06e31e703..b774cc29a2ba 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -40,7 +40,7 @@ namespace Language_bg { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Картата е поставена"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Картата е извадена"); PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Автостарт"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Изкл. двигатели"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Паркиране"); PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Задай Начало"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 0657c4a75959..0ad725262df1 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -38,7 +38,7 @@ namespace Language_ca { PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Targeta extreta."); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inici automatic"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Inici automatic"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desactiva motors"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu de depuracio"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra progres"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 9cbd7042d613..073d46bad26c 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -57,7 +57,7 @@ namespace Language_cz { PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavní nabídka"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Další nastavení"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurace"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolnit motory"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Nabídka ladění"); #if LCD_WIDTH >= 20 diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index f8d891576e15..1ca23d604418 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -53,7 +53,7 @@ namespace Language_de { PROGMEM Language_Str MSG_MAIN = _UxGT("Hauptmenü"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Erw. Einstellungen"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren deaktivieren"); // M84 :: Max length 19 characters PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug-Menü"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Statusbalken-Test"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 125119d5ccfa..885f74570849 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -40,7 +40,7 @@ namespace Language_el { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Εισαγωγή κάρτας"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Αυτόματη εκκίνηση"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση Μοτέρ"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); //SHORTEN PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index 3db6fccdf07f..fe36b6d6633e 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -41,7 +41,7 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Αυτόματη εκκίνηση"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση βηματιστή"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 2f50902bffb3..ffaaf2e02ac6 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -64,7 +64,7 @@ namespace Language_en { PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Advanced Settings"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Run Auto Files"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disable Steppers"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Progress Bar Test"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index ca7328c3e60f..d4cf5fe54b89 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -53,7 +53,7 @@ namespace Language_es { PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ajustes avanzados"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuración"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automático"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Inicio automático"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menú depuración"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prob. barra progreso"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 7e35c6ee41ec..01ba4b5200c9 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -42,7 +42,7 @@ namespace Language_eu { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Txartela sartuta"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Txartela kenduta"); PROGMEM Language_Str MSG_MAIN = _UxGT("Menu nagusia"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto hasiera"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Auto hasiera"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Itzali motoreak"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Arazketa Menua"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prog. Barra Proba"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index e8621377d966..c8633ce0aaac 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -40,7 +40,7 @@ namespace Language_fi { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kortti asetettu"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kortti poistettu"); PROGMEM Language_Str MSG_MAIN = _UxGT("Palaa"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Automaatti"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Automaatti"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Vapauta moottorit"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Aja referenssiin"); PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Aseta origo"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 714feeee9976..661d6b5cc325 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -52,7 +52,7 @@ namespace Language_fr { PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. avancée"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Exéc. auto.gcode"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Exéc. auto.gcode"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Arrêter moteurs"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu debug"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barre progress."); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 2fd4bf69758a..d1d170417424 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -54,7 +54,7 @@ namespace Language_gl { PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Axustes avanzados"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuración"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoarranque"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autoarranque"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menú depuración"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra progreso"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 1b2ae41fcedb..dba0e6df6790 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -41,7 +41,7 @@ namespace Language_hr { PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD kartica uklonjena"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto pokretanje"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Auto pokretanje"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Ugasi steppere"); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Automatski homing"); PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home-aj X"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 6e1b30c18096..a5eae451a6b0 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -56,7 +56,7 @@ namespace Language_hu { PROGMEM Language_Str MSG_MAIN = _UxGT(""); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("További Beállítások"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguráció"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoinditás"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autoinditás"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motorok kikapcsolása"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hiba Menü"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Haladás sáv teszt"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 73639c27900b..5a3d8f4c52fb 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -62,7 +62,7 @@ namespace Language_it { PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principale"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Impostaz. avanzate"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configurazione"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu di debug"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 32b12f50cb8b..ef288bd3966a 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -47,7 +47,7 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("メディアノトリダシ"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("エンドストップ"); // "Endstops" // Max length 8 characters PROGMEM Language_Str MSG_MAIN = _UxGT("メイン"); // "Main" - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("ジドウカイシ"); // "Autostart" + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("ジドウカイシ"); // "Autostart" PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("モーターデンゲン オフ"); // "Disable steppers" PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("デバッグメニュー"); // "Debug Menu" PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("プログレスバー テスト"); // "Progress Bar Test" diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index 1ab03dcf57df..20700896c1c1 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -42,7 +42,7 @@ namespace Language_ko_KR { PROGMEM Language_Str MSG_MAIN = _UxGT("뒤로"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("고급 설정"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("설정"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("자동 시작"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("자동 시작"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("모터 정지"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("디버깅 메뉴"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("프로그레스바 테스트"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index c142c5c9bfd6..9cbebe1bb35d 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -43,7 +43,7 @@ namespace Language_nl { PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kaart verwijderd"); PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters PROGMEM Language_Str MSG_MAIN = _UxGT("Hoofdmenu"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren uit"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); // accepted English terms PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Vooruitgang Test"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 770c872a4099..9b764c86a71c 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -52,7 +52,7 @@ namespace Language_pl { PROGMEM Language_Str MSG_MAIN = _UxGT("Menu główne"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ustawienie zaawansowane"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguracja"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Wyłącz silniki"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debugowania"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testowy pasek postępu"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index cf2f7a0ccef1..b52ae51c1cc0 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -51,7 +51,7 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. Avançada"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuração"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Início automático"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Início automático"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desabilit. motores"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debug"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testar Barra Progres"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 7b54f24abf7d..c4d2bea07369 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -53,7 +53,7 @@ namespace Language_ro { PROGMEM Language_Str MSG_MAIN = _UxGT("Principal"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Setari Avansate"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configurare"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Dezactivare Motoare"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Meniu Debug"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test Bara Progres"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 2a2f56857303..37341853578f 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -56,7 +56,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_MAIN = _UxGT("Основное меню"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Другие настройки"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Конфигурация"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Автостарт"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Выключить двигатели"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Меню отладки"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест индикатора"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index d0fdf5749cf2..e3de108191d0 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -57,7 +57,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavná ponuka"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Pokročilé nastav."); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurácia"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto-štart"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Auto-štart"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolniť motory"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Ponuka ladenia"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. priebehu"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index f81f153789ae..cca3a7eda739 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -57,7 +57,7 @@ namespace Language_tr { PROGMEM Language_Str MSG_MAIN = _UxGT("Ana"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Gelişmiş Ayarlar"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Yapılandırma"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Oto. Başlat"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Oto. Başlat"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motorları Durdur"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hata Ayıklama"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Durum Çubuğu Testi"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 9cc1002964f8..ac79b0b820fc 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -58,7 +58,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_MAIN = _UxGT("Основне меню"); PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Інші налаштування"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Конфігурація"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Автостарт"); PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Вимкнути двигуни"); PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Меню Debug"); PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест Progress Bar"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index f7cf60657535..8a1cfad92ac2 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -47,7 +47,7 @@ namespace Language_vi { PROGMEM Language_Str MSG_MAIN = _UxGT("Chính"); // Main PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Thiết lập cấp cao"); // Advanced Settings PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Cấu hình"); // Configuration - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Khởi chạy tự động"); // Autostart + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Khởi chạy tự động"); // Autostart PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Tắt động cơ bước"); // Disable steppers PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu gỡ lỗi"); // Debug Menu PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Kiểm tra tiến độ"); // Progress bar test diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 3bebe12fda8d..56fd8a22f62a 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -51,7 +51,7 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_MAIN = _UxGT("主菜单"); //"Main" PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("高级设置"); PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("配置"); - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自动开始"); //"Autostart" + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("自动开始"); //"Autostart" PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("关闭步进电机"); //"Disable steppers" PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("调试菜单"); // "Debug Menu" PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("进度条测试"); // "Progress Bar Test" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 7abf895d5457..ac061e9b818d 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -50,7 +50,7 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_MAIN = _UxGT("主選單"); //"Main" PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("進階設置"); //"Advanced Settings" PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("設置"); //Configuration - PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自動開始"); //"Autostart" + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("自動開始"); //"Autostart" PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("關閉步進馬達"); //"Disable steppers" PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("除錯選單"); // "Debug Menu" PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("進度條測試"); // "Progress Bar Test" diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 5b983825599e..992303b7913e 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -133,10 +133,10 @@ void menu_main() { // *** IF THIS SECTION IS CHANGED, REPRODUCE BELOW *** // - // Autostart + // Run Auto Files // #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart); #endif if (card_detected) { @@ -238,7 +238,7 @@ void menu_main() { // Autostart // #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart); #endif if (card_detected) { From dcb0f5dc3b70f22fb3d9391525d260dbd2bef9d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 17:55:31 -0600 Subject: [PATCH 113/443] Temperature 'autostart' => 'auto_job' --- Marlin/src/gcode/temp/M104_M109.cpp | 4 ++-- Marlin/src/gcode/temp/M140_M190.cpp | 4 ++-- Marlin/src/gcode/temp/M141_M191.cpp | 4 ++-- Marlin/src/module/temperature.cpp | 6 +++--- Marlin/src/module/temperature.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index d2b466e2fba5..90e1b601e477 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -105,7 +105,7 @@ void GcodeSuite::M104() { * mode, for instance in a dual extruder setup, without affecting the running * print timer. */ - thermalManager.check_timer_autostart(false, true); + thermalManager.auto_job_check_timer(false, true); #endif } @@ -182,7 +182,7 @@ void GcodeSuite::M109() { * standby mode, (e.g., in a dual extruder setup) without affecting * the running print timer. */ - thermalManager.check_timer_autostart(true, true); + thermalManager.auto_job_check_timer(true, true); #endif #if HAS_DISPLAY diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index ac8228085e0e..d684127fe151 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -81,7 +81,7 @@ void GcodeSuite::M140() { * temperatures need to be set below mintemp. Order of M140, M104, and M141 * at the end of the print does not matter. */ - thermalManager.check_timer_autostart(false, true); + thermalManager.auto_job_check_timer(false, true); #endif } } @@ -128,7 +128,7 @@ void GcodeSuite::M190() { thermalManager.setTargetBed(temp); - TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false)); + TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false)); ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING)); diff --git a/Marlin/src/gcode/temp/M141_M191.cpp b/Marlin/src/gcode/temp/M141_M191.cpp index fc80c5f4cba4..17eb71eadaec 100644 --- a/Marlin/src/gcode/temp/M141_M191.cpp +++ b/Marlin/src/gcode/temp/M141_M191.cpp @@ -60,7 +60,7 @@ void GcodeSuite::M141() { * temperatures need to be set below mintemp. Order of M140, M104, and M141 * at the end of the print does not matter. */ - thermalManager.check_timer_autostart(false, true); + thermalManager.auto_job_check_timer(false, true); #endif } } @@ -75,7 +75,7 @@ void GcodeSuite::M191() { const bool no_wait_for_cooling = parser.seenval('S'); if (no_wait_for_cooling || parser.seenval('R')) { thermalManager.setTargetChamber(parser.value_celsius()); - TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false)); + TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false)); } else return; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d119a72a646e..40f8624efb3f 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2154,7 +2154,7 @@ void Temperature::disable_all_heaters() { #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - bool Temperature::over_autostart_threshold() { + bool Temperature::auto_job_over_threshold() { #if HAS_HOTEND HOTEND_LOOP() if (degTargetHotend(e) > (EXTRUDE_MINTEMP) / 2) return true; #endif @@ -2162,8 +2162,8 @@ void Temperature::disable_all_heaters() { || TERN0(HAS_HEATED_CHAMBER, degTargetChamber() > CHAMBER_MINTEMP); } - void Temperature::check_timer_autostart(const bool can_start, const bool can_stop) { - if (over_autostart_threshold()) { + void Temperature::auto_job_check_timer(const bool can_start, const bool can_stop) { + if (auto_job_over_threshold()) { if (can_start) startOrResumeJob(); } else if (can_stop) { diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 57b0fecbcc99..4b27fff19d5a 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -731,8 +731,8 @@ class Temperature { /** * Methods to check if heaters are enabled, indicating an active job */ - static bool over_autostart_threshold(); - static void check_timer_autostart(const bool can_start, const bool can_stop); + static bool auto_job_over_threshold(); + static void auto_job_check_timer(const bool can_start, const bool can_stop); #endif /** From 06bf3ccfb7a19c972e5f40816d49e3860711f976 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Nov 2020 18:28:29 -0600 Subject: [PATCH 114/443] Add alternative TERN macros --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/core/macros.h | 3 +++ Marlin/src/feature/backlash.h | 4 ++-- Marlin/src/feature/leds/neopixel.h | 2 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 2 +- .../lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h | 3 +++ Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 4 ++-- Marlin/src/lcd/menu/menu_filament.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- Marlin/src/module/settings.cpp | 6 +++--- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/module/temperature.h | 2 +- Marlin/src/module/tool_change.cpp | 8 ++++---- 15 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e395bdccb8c4..be3dcdd109e6 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -248,7 +248,7 @@ bool wait_for_heatup = true; bool wait_for_user; // = false; void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) { - TERN(ADVANCED_PAUSE_FEATURE,,UNUSED(no_sleep)); + UNUSED(no_sleep); KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; if (ms) ms += millis(); // expire time diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 7948e8ce873c..7985706173fe 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -196,6 +196,9 @@ #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. +#define IF_ENABLED TERN_ +#define IF_DISABLED(O,A) TERN(O,,A) + #define ANY(V...) !DISABLED(V) #define NONE(V...) DISABLED(V) #define ALL(V...) ENABLED(V) diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 8d00570f991e..49857f1f99d0 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -54,17 +54,17 @@ class Backlash { #endif static inline float get_measurement(const AxisEnum a) { + UNUSED(a); // Return the measurement averaged over all readings return TERN(MEASURE_BACKLASH_WHEN_PROBING , measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : 0 , 0 ); - TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a)); } static inline bool has_measurement(const AxisEnum a) { + UNUSED(a); return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0); - TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a)); } static inline bool has_any_measurement() { diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 42046fa5638f..d7354207fc53 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -110,7 +110,7 @@ class Marlin_NeoPixel { #if CONJOINED_NEOPIXEL adaneo2.show(); #else - TERN(NEOPIXEL2_SEPARATE,,adaneo1.setPin(NEOPIXEL2_PIN)); + IF_DISABLED(NEOPIXEL2_SEPARATE, adaneo1.setPin(NEOPIXEL2_PIN)); adaneo1.show(); adaneo1.setPin(NEOPIXEL_PIN); #endif diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 0aba49d56452..480721e56af9 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -123,7 +123,7 @@ bool MarlinUI::detected() { return true; } custom_start_bmp #endif ; - TERN(CUSTOM_BOOTSCREEN_ANIMATED,,UNUSED(frame)); + UNUSED(frame); u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index cd41a5fe06df..0f4bbbdb9aec 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -253,6 +253,9 @@ #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. + #define IF_ENABLED TERN_ + #define IF_DISABLED(O,A) _TERN(_ENA_1(O),,A) + #define ANY(V...) !DISABLED(V) #define NONE(V...) DISABLED(V) #define ALL(V...) ENABLED(V) diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index cd949270497a..35c736c56074 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -81,7 +81,7 @@ void MarlinUI::save_previous_screen() { } void MarlinUI::_goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back/*=false*/)) { - TERN(TURBO_BACK_MENU_ITEM,,constexpr bool is_back = false); + IF_DISABLED(TURBO_BACK_MENU_ITEM, constexpr bool is_back = false); TERN_(HAS_TOUCH_XPT2046, on_edit_screen = false); if (screen_history_depth > 0) { menuPosition &sh = screen_history[--screen_history_depth]; diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 0e207ffc55aa..fdddf1781a9b 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -202,12 +202,12 @@ void menu_backlash(); // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver void copy_and_scalePID_i(int16_t e) { - TERN(PID_PARAMS_PER_HOTEND,,UNUSED(e)); + UNUSED(e); PID_PARAM(Ki, e) = scalePID_i(raw_Ki); thermalManager.updatePID(); } void copy_and_scalePID_d(int16_t e) { - TERN(PID_PARAMS_PER_HOTEND,,UNUSED(e)); + UNUSED(e); PID_PARAM(Kd, e) = scalePID_d(raw_Kd); thermalManager.updatePID(); } diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index d116a6a398c0..5f0afa47688a 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -219,7 +219,7 @@ static PGM_P pause_header() { #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (ui.should_draw()) { \ - TERN(HAS_GRAPHICAL_TFT,, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ + IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index f0f5c21beca2..5dce47eec294 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -64,7 +64,7 @@ static void _lcd_mesh_fine_tune(PGM_P const msg) { ubl.encoder_diff > 0 ? 0.005f : -0.005f ); ubl.encoder_diff = 0; - TERN(IS_TFTGLCD_PANEL,,ui.refresh(LCDVIEW_CALL_REDRAW_NEXT)); + IF_DISABLED(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT)); } TERN_(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT)); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index fc432b7e9b57..b1b9bb6e0af5 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1497,7 +1497,7 @@ void MarlinSettings::postprocess() { } DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); - TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_version()); + IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version()); eeprom_error = true; } else { @@ -2325,13 +2325,13 @@ void MarlinSettings::postprocess() { if (eeprom_error) { DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize()); - TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_index()); + IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_index()); } else if (working_crc != stored_crc) { eeprom_error = true; DEBUG_ERROR_START(); DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); - TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_crc()); + IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc()); } else if (!validating) { DEBUG_ECHO_START(); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 0a83a90ba2be..627ecf9ebbcc 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -180,7 +180,7 @@ bool Stepper::abort_current_block; uint32_t Stepper::acceleration_time, Stepper::deceleration_time; uint8_t Stepper::steps_per_isr; -TERN(ADAPTIVE_STEP_SMOOTHING,,constexpr) uint8_t Stepper::oversampling_factor; +IF_DISABLED(ADAPTIVE_STEP_SMOOTHING, constexpr) uint8_t Stepper::oversampling_factor; xyze_long_t Stepper::delta_error{0}; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 40f8624efb3f..4eb721651136 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -268,7 +268,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP; #endif TERN_(WATCH_BED, bed_watch_t Temperature::watch_bed); // = { 0 } - TERN(PIDTEMPBED,, millis_t Temperature::next_bed_check_ms); + IF_DISABLED(PIDTEMPBED, millis_t Temperature::next_bed_check_ms); #endif // HAS_HEATED_BED #if HAS_TEMP_CHAMBER diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 4b27fff19d5a..c3c3ce2d8b98 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -392,7 +392,7 @@ class Temperature { #if HAS_HEATED_BED TERN_(WATCH_BED, static bed_watch_t watch_bed); - TERN(PIDTEMPBED,,static millis_t next_bed_check_ms); + IF_DISABLED(PIDTEMPBED, static millis_t next_bed_check_ms); #ifdef BED_MINTEMP static int16_t mintemp_raw_BED; #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 1cdafe019da2..0d0ef46059cd 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -799,8 +799,8 @@ void tool_change_prime() { // Park #if ENABLED(TOOLCHANGE_PARK) if (ok) { - TERN(TOOLCHANGE_PARK_Y_ONLY,,current_position.x = toolchange_settings.change_point.x); - TERN(TOOLCHANGE_PARK_X_ONLY,,current_position.y = toolchange_settings.change_point.y); + IF_DISABLED(TOOLCHANGE_PARK_Y_ONLY, current_position.x = toolchange_settings.change_point.x); + IF_DISABLED(TOOLCHANGE_PARK_X_ONLY, current_position.y = toolchange_settings.change_point.y); planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), active_extruder); planner.synchronize(); } @@ -998,8 +998,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Toolchange park #if ENABLED(TOOLCHANGE_PARK) && DISABLED(SWITCHING_NOZZLE) if (can_move_away && toolchange_settings.enable_park) { - TERN(TOOLCHANGE_PARK_Y_ONLY,,current_position.x = toolchange_settings.change_point.x); - TERN(TOOLCHANGE_PARK_X_ONLY,,current_position.y = toolchange_settings.change_point.y); + IF_DISABLED(TOOLCHANGE_PARK_Y_ONLY, current_position.x = toolchange_settings.change_point.x); + IF_DISABLED(TOOLCHANGE_PARK_X_ONLY, current_position.y = toolchange_settings.change_point.y); planner.buffer_line(current_position, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE), old_tool); planner.synchronize(); } From 5013fdaf796f695c1e1db55e6fd0c59e15aae25c Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 8 Nov 2020 00:15:30 -0800 Subject: [PATCH 115/443] Fix tool-change servo index for E2 and up (#20060) --- Marlin/src/module/tool_change.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0d0ef46059cd..d77901f029d4 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -123,7 +123,7 @@ if (e < EXTRUDERS - 1) #endif { - MOVE_SERVO(_SERVO_NR(e), servo_angles[_SERVO_NR(e)][e]); + MOVE_SERVO(_SERVO_NR(e), servo_angles[_SERVO_NR(e)][e & 1]); safe_delay(500); } } From 3c318d0dc79fb935169a17463e8cc683778e52e5 Mon Sep 17 00:00:00 2001 From: "Alexander D. Kanevskiy" Date: Sun, 8 Nov 2020 10:20:07 +0200 Subject: [PATCH 116/443] POWER_LOSS_PIN for BTT SKR mini MZ / E3 2.0 (#20069) --- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 50257f4f4608..b65411be8a3b 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 @@ -62,6 +62,13 @@ #define FIL_RUNOUT_PIN PC15 // "E0-STOP" #endif +// +// Power-loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PC12 // Power Loss Detection: PWR-DET +#endif + // // Steppers // From d5fdc75c828b4f54bcb0eb376bd7ded50610b2fc Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 9 Nov 2020 00:11:21 +0000 Subject: [PATCH 117/443] [cron] Bump distribution date (2020-11-09) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2cabf66badfc..bed40f9463e7 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-08" + #define STRING_DISTRIBUTION_DATE "2020-11-09" #endif /** From c753d2b7f4161e2fff30cc9061dba5e6d68a7762 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Mon, 9 Nov 2020 01:31:14 +0100 Subject: [PATCH 118/443] Use extra G35 BLTouch HS Mode clearance in Tramming Wizard (#20057) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/bedlevel/G35.cpp | 3 +-- Marlin/src/lcd/menu/menu_tramming.cpp | 4 ++++ Marlin/src/module/probe.cpp | 13 ++----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index f0abc543cb8b..789d8bcf193a 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -120,8 +120,7 @@ void GcodeSuite::G35() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G35 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE)); - + do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7)); const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true); if (isnan(z_probed_height)) { diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index a102fe7e57ee..317335d51bc2 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -43,6 +43,10 @@ float z_measured[G35_PROBE_COUNT] = { 0 }; static uint8_t tram_index = 0; bool probe_single_point() { + // In BLTOUCH HS mode, the probe travels in a deployed state. + // Users of Tramming Wizard might have a badly misaligned bed, so raise Z by the + // length of the deployed pin (BLTOUCH stroke < 7mm) + do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7)); const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true); DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); z_measured[tram_index] = z_probed_height; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index d00872038939..ff80063d658d 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -667,8 +667,8 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise if (bltouch.triggered()) bltouch._reset(); #endif - // TODO: Adapt for SCARA, where the offset rotates - xyz_pos_t npos = { rx, ry }; + // On delta keep Z below clip height or do_blocking_move_to will abort + xyz_pos_t npos = { rx, ry, _MIN(TERN(DELTA, delta_clip_start_height, current_position.z), current_position.z) }; if (probe_relative) { // The given position is in terms of the probe if (!can_reach(npos)) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable"); @@ -678,15 +678,6 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise } else if (!position_is_reachable(npos)) return NAN; // The given position is in terms of the nozzle - npos.z = - #if ENABLED(DELTA) - // Move below clip height or xy move will be aborted by do_blocking_move_to - _MIN(current_position.z, delta_clip_start_height) - #else - current_position.z - #endif - ; - const float old_feedrate_mm_s = feedrate_mm_s; feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; From 4ace02f4c2b6eda750412feaa661c856fe7a8674 Mon Sep 17 00:00:00 2001 From: Hebezo Date: Mon, 9 Nov 2020 01:37:41 +0100 Subject: [PATCH 119/443] Add POWER_OFF_DELAY option (#19987) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 7 ++++--- Marlin/src/MarlinCore.h | 10 ++++++---- Marlin/src/feature/power.cpp | 8 ++++++++ Marlin/src/feature/power.h | 1 + Marlin/src/gcode/control/M80_M81.cpp | 2 +- Marlin/src/inc/Conditionals_post.h | 9 +++++++-- Marlin/src/inc/SanityCheck.h | 4 ++-- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 719e11b899ca..ea77b4e429ab 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -344,9 +344,10 @@ #define AUTO_POWER_E_FANS #define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CHAMBER_FAN - //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature - //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature - #define POWER_TIMEOUT 30 + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature + #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration + //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif #endif diff --git a/Marlin/src/MarlinCore.h b/Marlin/src/MarlinCore.h index 69afc7f30e88..908636e9677c 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -92,11 +92,13 @@ extern bool wait_for_heatup; #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); powersupply_on = true; }while(0) #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); powersupply_on = false; }while(0) #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() + #define PSU_ON() powerManager.power_on() + #define PSU_OFF() powerManager.power_off() + #define PSU_OFF_SOON() powerManager.power_off_soon() #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() + #define PSU_ON() PSU_PIN_ON() + #define PSU_OFF() PSU_PIN_OFF() + #define PSU_OFF_SOON PSU_OFF #endif #endif diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 9427f684e7ad..8d05d146986f 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -126,4 +126,12 @@ void Power::power_off() { } } +void Power::power_off_soon() { + #if POWER_OFF_DELAY + lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY); + #else + power_off(); + #endif +} + #endif // AUTO_POWER_CONTROL diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 8b988907e6c6..2462b9231b92 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -32,6 +32,7 @@ class Power { static void check(); static void power_on(); static void power_off(); + static void power_off_soon(); private: static millis_t lastPowerOn; static bool is_power_needed(); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index a8f7f7c10b64..ea0f9c2b1393 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -105,7 +105,7 @@ void GcodeSuite::M81() { #if HAS_SUICIDE suicide(); #elif ENABLED(PSU_CONTROL) - PSU_OFF(); + PSU_OFF_SOON(); #endif LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF ".")); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index bbbcf6fb2fea..a8e619fb3b6b 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -416,8 +416,13 @@ #endif #endif -#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) - #define PSU_POWERUP_DELAY 250 +#if ENABLED(PSU_CONTROL) + #ifndef PSU_POWERUP_DELAY + #define PSU_POWERUP_DELAY 250 + #endif + #ifndef POWER_OFF_DELAY + #define POWER_OFF_DELAY 0 + #endif #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b6ff725470e5..1082947191cc 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3016,9 +3016,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'." #elif !PIN_EXISTS(PS_ON) #error "PSU_CONTROL requires PS_ON_PIN." + #elif POWER_OFF_DELAY < 0 + #error "POWER_OFF_DELAY must be a positive value." #endif -#elif ENABLED(AUTO_POWER_CONTROL) - #error "AUTO_POWER_CONTROL requires PSU_CONTROL." #endif #if HAS_CUTTER From 59eca253e1518f17e1ffe962ffc6e7bfa0db49a3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 Nov 2020 01:17:37 -0600 Subject: [PATCH 120/443] Simplified temp sensor conditionals --- Marlin/src/inc/Conditionals_post.h | 100 ++++++++------- Marlin/src/inc/SanityCheck.h | 42 +++---- Marlin/src/module/temperature.cpp | 137 +++++++++++---------- Marlin/src/module/temperature.h | 25 ++-- Marlin/src/module/thermistor/thermistors.h | 44 +++---- 5 files changed, 170 insertions(+), 178 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a8e619fb3b6b..9eeb39f9a8b7 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -436,7 +436,7 @@ #endif #if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 + #define HEATER_0_USES_MAX6675 1 #if TEMP_SENSOR_0 == -3 #define HEATER_0_MAX6675_TMIN -270 #define HEATER_0_MAX6675_TMAX 1800 @@ -445,19 +445,19 @@ #define HEATER_0_MAX6675_TMAX 1024 #endif #if TEMP_SENSOR_0 == -5 - #define MAX6675_IS_MAX31865 + #define MAX6675_IS_MAX31865 1 #elif TEMP_SENSOR_0 == -3 - #define MAX6675_IS_MAX31855 + #define MAX6675_IS_MAX31855 1 #endif #elif TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 + #define HEATER_0_USES_AD8495 1 #elif TEMP_SENSOR_0 == -1 - #define HEATER_0_USES_AD595 + #define HEATER_0_USES_AD595 1 #elif TEMP_SENSOR_0 > 0 #define THERMISTOR_HEATER_0 TEMP_SENSOR_0 - #define HEATER_0_USES_THERMISTOR + #define HEATER_0_USES_THERMISTOR 1 #if TEMP_SENSOR_0 == 1000 - #define HEATER_0_USER_THERMISTOR + #define HEATER_0_USER_THERMISTOR 1 #endif #else #undef HEATER_0_MINTEMP @@ -465,7 +465,7 @@ #endif #if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2 - #define HEATER_1_USES_MAX6675 + #define HEATER_1_USES_MAX6675 1 #if TEMP_SENSOR_1 == -3 #define HEATER_1_MAX6675_TMIN -270 #define HEATER_1_MAX6675_TMAX 1800 @@ -483,14 +483,14 @@ #endif #endif #elif TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 + #define HEATER_1_USES_AD8495 1 #elif TEMP_SENSOR_1 == -1 - #define HEATER_1_USES_AD595 + #define HEATER_1_USES_AD595 1 #elif TEMP_SENSOR_1 > 0 #define THERMISTOR_HEATER_1 TEMP_SENSOR_1 - #define HEATER_1_USES_THERMISTOR + #define HEATER_1_USES_THERMISTOR 1 #if TEMP_SENSOR_1 == 1000 - #define HEATER_1_USER_THERMISTOR + #define HEATER_1_USER_THERMISTOR 1 #endif #else #undef HEATER_1_MINTEMP @@ -498,18 +498,18 @@ #endif #if TEMP_SENSOR_2 == -4 - #define HEATER_2_USES_AD8495 + #define HEATER_2_USES_AD8495 1 #elif TEMP_SENSOR_2 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." #elif TEMP_SENSOR_2 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2." #elif TEMP_SENSOR_2 == -1 - #define HEATER_2_USES_AD595 + #define HEATER_2_USES_AD595 1 #elif TEMP_SENSOR_2 > 0 #define THERMISTOR_HEATER_2 TEMP_SENSOR_2 - #define HEATER_2_USES_THERMISTOR + #define HEATER_2_USES_THERMISTOR 1 #if TEMP_SENSOR_2 == 1000 - #define HEATER_2_USER_THERMISTOR + #define HEATER_2_USER_THERMISTOR 1 #endif #else #undef HEATER_2_MINTEMP @@ -517,18 +517,18 @@ #endif #if TEMP_SENSOR_3 == -4 - #define HEATER_3_USES_AD8495 + #define HEATER_3_USES_AD8495 1 #elif TEMP_SENSOR_3 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." #elif TEMP_SENSOR_3 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." #elif TEMP_SENSOR_3 == -1 - #define HEATER_3_USES_AD595 + #define HEATER_3_USES_AD595 1 #elif TEMP_SENSOR_3 > 0 #define THERMISTOR_HEATER_3 TEMP_SENSOR_3 - #define HEATER_3_USES_THERMISTOR + #define HEATER_3_USES_THERMISTOR 1 #if TEMP_SENSOR_3 == 1000 - #define HEATER_3_USER_THERMISTOR + #define HEATER_3_USER_THERMISTOR 1 #endif #else #undef HEATER_3_MINTEMP @@ -536,18 +536,18 @@ #endif #if TEMP_SENSOR_4 == -4 - #define HEATER_4_USES_AD8495 + #define HEATER_4_USES_AD8495 1 #elif TEMP_SENSOR_4 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." #elif TEMP_SENSOR_4 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." #elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 + #define HEATER_4_USES_AD595 1 #elif TEMP_SENSOR_4 > 0 #define THERMISTOR_HEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR + #define HEATER_4_USES_THERMISTOR 1 #if TEMP_SENSOR_4 == 1000 - #define HEATER_4_USER_THERMISTOR + #define HEATER_4_USER_THERMISTOR 1 #endif #else #undef HEATER_4_MINTEMP @@ -555,18 +555,18 @@ #endif #if TEMP_SENSOR_5 == -4 - #define HEATER_5_USES_AD8495 + #define HEATER_5_USES_AD8495 1 #elif TEMP_SENSOR_5 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5." #elif TEMP_SENSOR_5 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5." #elif TEMP_SENSOR_5 == -1 - #define HEATER_5_USES_AD595 + #define HEATER_5_USES_AD595 1 #elif TEMP_SENSOR_5 > 0 #define THERMISTOR_HEATER_5 TEMP_SENSOR_5 - #define HEATER_5_USES_THERMISTOR + #define HEATER_5_USES_THERMISTOR 1 #if TEMP_SENSOR_5 == 1000 - #define HEATER_5_USER_THERMISTOR + #define HEATER_5_USER_THERMISTOR 1 #endif #else #undef HEATER_5_MINTEMP @@ -574,18 +574,18 @@ #endif #if TEMP_SENSOR_6 == -4 - #define HEATER_6_USES_AD8495 + #define HEATER_6_USES_AD8495 1 #elif TEMP_SENSOR_6 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6." #elif TEMP_SENSOR_6 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6." #elif TEMP_SENSOR_6 == -1 - #define HEATER_6_USES_AD595 + #define HEATER_6_USES_AD595 1 #elif TEMP_SENSOR_6 > 0 #define THERMISTOR_HEATER_6 TEMP_SENSOR_6 - #define HEATER_6_USES_THERMISTOR + #define HEATER_6_USES_THERMISTOR 1 #if TEMP_SENSOR_6 == 1000 - #define HEATER_6_USER_THERMISTOR + #define HEATER_6_USER_THERMISTOR 1 #endif #else #undef HEATER_6_MINTEMP @@ -593,18 +593,18 @@ #endif #if TEMP_SENSOR_7 == -4 - #define HEATER_7_USES_AD8495 + #define HEATER_7_USES_AD8495 1 #elif TEMP_SENSOR_7 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7." #elif TEMP_SENSOR_7 == -2 #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7." #elif TEMP_SENSOR_7 == -1 - #define HEATER_7_USES_AD595 + #define HEATER_7_USES_AD595 1 #elif TEMP_SENSOR_7 > 0 #define THERMISTOR_HEATER_7 TEMP_SENSOR_7 - #define HEATER_7_USES_THERMISTOR + #define HEATER_7_USES_THERMISTOR 1 #if TEMP_SENSOR_7 == 1000 - #define HEATER_7_USER_THERMISTOR + #define HEATER_7_USER_THERMISTOR 1 #endif #else #undef HEATER_7_MINTEMP @@ -612,18 +612,18 @@ #endif #if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 + #define HEATER_BED_USES_AD8495 1 #elif TEMP_SENSOR_BED == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." #elif TEMP_SENSOR_BED == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." #elif TEMP_SENSOR_BED == -1 - #define HEATER_BED_USES_AD595 + #define HEATER_BED_USES_AD595 1 #elif TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED - #define HEATER_BED_USES_THERMISTOR + #define HEATER_BED_USES_THERMISTOR 1 #if TEMP_SENSOR_BED == 1000 - #define HEATER_BED_USER_THERMISTOR + #define HEATER_BED_USER_THERMISTOR 1 #endif #else #undef BED_MINTEMP @@ -631,18 +631,18 @@ #endif #if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 + #define HEATER_CHAMBER_USES_AD8495 1 #elif TEMP_SENSOR_CHAMBER == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." #elif TEMP_SENSOR_CHAMBER == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." #elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 + #define HEATER_CHAMBER_USES_AD595 1 #elif TEMP_SENSOR_CHAMBER > 0 #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR + #define HEATER_CHAMBER_USES_THERMISTOR 1 #if TEMP_SENSOR_CHAMBER == 1000 - #define HEATER_CHAMBER_USER_THERMISTOR + #define HEATER_CHAMBER_USER_THERMISTOR 1 #endif #else #undef CHAMBER_MINTEMP @@ -650,25 +650,21 @@ #endif #if TEMP_SENSOR_PROBE == -4 - #define HEATER_PROBE_USES_AD8495 + #define HEATER_PROBE_USES_AD8495 1 #elif TEMP_SENSOR_PROBE == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE." #elif TEMP_SENSOR_PROBE == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE." #elif TEMP_SENSOR_PROBE == -1 - #define HEATER_PROBE_USES_AD595 + #define HEATER_PROBE_USES_AD595 1 #elif TEMP_SENSOR_PROBE > 0 #define THERMISTORPROBE TEMP_SENSOR_PROBE - #define PROBE_USES_THERMISTOR + #define HEATER_PROBE_USES_THERMISTOR 1 #if TEMP_SENSOR_PROBE == 1000 - #define PROBE_USER_THERMISTOR + #define HEATER_PROBE_USER_THERMISTOR 1 #endif #endif -#define HOTEND_USES_THERMISTOR ANY( \ - HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \ - HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR ) - /** * X_DUAL_ENDSTOPS endstop reassignment */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1082947191cc..3762d40c53e2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1618,34 +1618,41 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * Required custom thermistor settings */ -#if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA)) +#if HEATER_0_USER_THERMISTOR && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA)) #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA)) +#elif HEATER_1_USER_THERMISTOR && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA)) #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA)) +#elif HEATER_2_USER_THERMISTOR && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA)) #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA)) +#elif HEATER_3_USER_THERMISTOR && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA)) #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA)) +#elif HEATER_4_USER_THERMISTOR && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA)) #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) +#elif HEATER_5_USER_THERMISTOR && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_6_USER_THERMISTOR) && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA)) +#elif HEATER_6_USER_THERMISTOR && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA)) #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_7_USER_THERMISTOR) && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA)) +#elif HEATER_7_USER_THERMISTOR && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA)) #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) +#elif HEATER_BED_USER_THERMISTOR && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) +#elif HEATER_CHAMBER_USER_THERMISTOR && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h." #endif /** - * A Sensor ID has to be set for each heater + * Pins and Sensor IDs must be set for each heater */ +#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS) + #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." +#elif HAS_HOTEND && !HAS_TEMP_HOTEND + #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." +#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 + #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." +#endif #if HAS_MULTI_HOTEND - #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2) + #if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2) #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." #elif TEMP_SENSOR_1 == 0 #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." @@ -1808,7 +1815,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif -#if ENABLED(MAX6675_IS_MAX31865) && (!defined(MAX31865_SENSOR_OHMS) || !defined(MAX31865_CALIBRATION_OHMS)) +#if MAX6675_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS) && defined(MAX31865_CALIBRATION_OHMS)) #error "MAX31865_SENSOR_OHMS and MAX31865_CALIBRATION_OHMS must be set in Configuration.h when using a MAX31865 temperature sensor." #endif @@ -1827,15 +1834,6 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_0 is required if there are any extruders." #endif -// Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS) - #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif HAS_HOTEND && !HAS_TEMP_HOTEND - #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 - #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." -#endif - /** * Temperature status LEDs */ diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 4eb721651136..b476b3559308 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -44,7 +44,7 @@ #include "../lcd/extui/ui_api.h" #endif -#if ENABLED(MAX6675_IS_MAX31865) +#if MAX6675_IS_MAX31865 #include #ifndef MAX31865_CS_PIN #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example @@ -114,7 +114,13 @@ #if HAS_SERVOS #include "./servo.h" #endif -#if HOTEND_USES_THERMISTOR + +#if ANY(HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \ + HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR ) + #define HAS_HOTEND_THERMISTOR 1 +#endif + +#if HAS_HOTEND_THERMISTOR #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static const temp_entry_t* heater_ttbl_map[2] = { HEATER_0_TEMPTABLE, HEATER_1_TEMPTABLE }; static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; @@ -1046,11 +1052,11 @@ void Temperature::manage_heater() { updateTemperaturesFromRawValues(); // also resets the watchdog #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS) - #if ENABLED(HEATER_0_USES_MAX6675) + #if HEATER_0_USES_MAX6675 if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); #endif - #if ENABLED(HEATER_1_USES_MAX6675) + #if HEATER_1_USES_MAX6675 if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); #endif @@ -1336,34 +1342,34 @@ void Temperature::manage_heater() { void Temperature::reset_user_thermistors() { user_thermistor_t user_thermistor[USER_THERMISTORS] = { - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 }, #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 }, #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 }, #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 }, #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, #endif - #if ENABLED(HEATER_6_USER_THERMISTOR) + #if HEATER_6_USER_THERMISTOR { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 }, #endif - #if ENABLED(HEATER_7_USER_THERMISTOR) + #if HEATER_7_USER_THERMISTOR { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 }, #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 } #endif }; @@ -1462,91 +1468,91 @@ void Temperature::manage_heater() { switch (e) { case 0: - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); - #elif ENABLED(HEATER_0_USES_MAX6675) + #elif HEATER_0_USES_MAX6675 return ( - #if ENABLED(MAX6675_IS_MAX31865) + #if MAX6675_IS_MAX31865 max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS) #else raw * 0.25 #endif ); - #elif ENABLED(HEATER_0_USES_AD595) + #elif HEATER_0_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_0_USES_AD8495) + #elif HEATER_0_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 1: - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); - #elif ENABLED(HEATER_1_USES_MAX6675) + #elif HEATER_1_USES_MAX6675 return raw * 0.25; - #elif ENABLED(HEATER_1_USES_AD595) + #elif HEATER_1_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_1_USES_AD8495) + #elif HEATER_1_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 2: - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); - #elif ENABLED(HEATER_2_USES_AD595) + #elif HEATER_2_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_2_USES_AD8495) + #elif HEATER_2_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 3: - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); - #elif ENABLED(HEATER_3_USES_AD595) + #elif HEATER_3_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_3_USES_AD8495) + #elif HEATER_3_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 4: - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); - #elif ENABLED(HEATER_4_USES_AD595) + #elif HEATER_4_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_USES_AD8495) + #elif HEATER_4_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 5: - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); - #elif ENABLED(HEATER_5_USES_AD595) + #elif HEATER_5_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_5_USES_AD8495) + #elif HEATER_5_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 6: - #if ENABLED(HEATER_6_USER_THERMISTOR) + #if HEATER_6_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_6, raw); - #elif ENABLED(HEATER_6_USES_AD595) + #elif HEATER_6_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_6_USES_AD8495) + #elif HEATER_6_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 7: - #if ENABLED(HEATER_7_USER_THERMISTOR) + #if HEATER_7_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_7, raw); - #elif ENABLED(HEATER_7_USES_AD595) + #elif HEATER_7_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_7_USES_AD8495) + #elif HEATER_7_USES_AD8495 return TEMP_AD8495(raw); #else break; @@ -1554,7 +1560,7 @@ void Temperature::manage_heater() { default: break; } - #if HOTEND_USES_THERMISTOR + #if HAS_HOTEND_THERMISTOR // Thermistor with conversion table? const temp_entry_t(*tt)[] = (temp_entry_t(*)[])(heater_ttbl_map[e]); SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); @@ -1568,13 +1574,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. float Temperature::analog_to_celsius_bed(const int raw) { - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_BED, raw); - #elif ENABLED(HEATER_BED_USES_THERMISTOR) + #elif HEATER_BED_USES_THERMISTOR SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) + #elif HEATER_BED_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) + #elif HEATER_BED_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1587,13 +1593,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For chamber temperature measurement. float Temperature::analog_to_celsius_chamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_CHAMBER, raw); - #elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR) + #elif HEATER_CHAMBER_USES_THERMISTOR SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) + #elif HEATER_CHAMBER_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) + #elif HEATER_CHAMBER_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1606,13 +1612,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For probe temperature measurement. float Temperature::analog_to_celsius_probe(const int raw) { - #if ENABLED(PROBE_USER_THERMISTOR) + #if HEATER_PROBE_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_PROBE, raw); - #elif ENABLED(PROBE_USES_THERMISTOR) + #elif HEATER_PROBE_USES_THERMISTOR SCAN_THERMISTOR_TABLE(PROBE_TEMPTABLE, PROBE_TEMPTABLE_LEN); - #elif ENABLED(PROBE_USES_AD595) + #elif HEATER_PROBE_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(PROBE_USES_AD8495) + #elif HEATER_PROBE_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1628,16 +1634,11 @@ void Temperature::manage_heater() { * as it would block the stepper routine. */ void Temperature::updateTemperaturesFromRawValues() { - #if ENABLED(HEATER_0_USES_MAX6675) - temp_hotend[0].raw = READ_MAX6675(0); - #endif - #if ENABLED(HEATER_1_USES_MAX6675) - temp_hotend[1].raw = READ_MAX6675(1); - #endif + TERN_(HEATER_0_USES_MAX6675, temp_hotend[0].raw = READ_MAX6675(0)); + TERN_(HEATER_1_USES_MAX6675, temp_hotend[1].raw = READ_MAX6675(1)); #if HAS_HOTEND HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); #endif - TERN_(HAS_HEATED_BED, temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw)); TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw)); TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw)); @@ -1700,7 +1701,7 @@ void Temperature::init() { #if MB(RUMBA) // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector - #define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495) + #define _AD(N) (HEATER_##N##_USES_AD595 || HEATER_##N##_USES_AD8495) #if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER) MCUCR = _BV(JTD); MCUCR = _BV(JTD); @@ -1802,7 +1803,7 @@ void Temperature::init() { #endif - #if ENABLED(HEATER_1_USES_MAX6675) + #if HEATER_1_USES_MAX6675 OUT_WRITE(MAX6675_SS2_PIN, HIGH); #endif @@ -2215,7 +2216,7 @@ void Temperature::disable_all_heaters() { #define MAX6675_HEAT_INTERVAL 250UL - #if ENABLED(MAX6675_IS_MAX31855) + #if MAX6675_IS_MAX31855 static uint32_t max6675_temp = 2000; #define MAX6675_ERROR_MASK 7 #define MAX6675_DISCARD_BITS 18 @@ -2241,7 +2242,7 @@ void Temperature::disable_all_heaters() { next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; - #if ENABLED(MAX6675_IS_MAX31865) + #if MAX6675_IS_MAX31865 max6675_temp = int(max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS)); #endif @@ -2256,7 +2257,7 @@ void Temperature::disable_all_heaters() { #if COUNT_6675 > 1 #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) #define SET_OUTPUT_MAX6675() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) - #elif ENABLED(HEATER_1_USES_MAX6675) + #elif HEATER_1_USES_MAX6675 #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V) #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS2_PIN) #else @@ -2336,14 +2337,14 @@ void Temperature::disable_all_heaters() { */ void Temperature::update_raw_temperatures() { - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) + #if HAS_TEMP_ADC_0 && !HEATER_0_USES_MAX6675 temp_hotend[0].update(); #endif #if HAS_TEMP_ADC_1 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = temp_hotend[1].acc; - #elif DISABLED(HEATER_1_USES_MAX6675) + #elif !HEATER_1_USES_MAX6675 temp_hotend[1].update(); #endif #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index c3c3ce2d8b98..4090b845d33a 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -253,31 +253,31 @@ typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t; #if HAS_USER_THERMISTORS enum CustomThermistorIndex : uint8_t { - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR CTI_HOTEND_0, #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR CTI_HOTEND_1, #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR CTI_HOTEND_2, #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR CTI_HOTEND_3, #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR CTI_HOTEND_4, #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR CTI_HOTEND_5, #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR CTI_BED, #endif - #if ENABLED(HEATER_PROBE_USER_THERMISTOR) + #if HEATER_PROBE_USER_THERMISTOR CTI_PROBE, #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR CTI_CHAMBER, #endif USER_THERMISTORS @@ -811,15 +811,12 @@ class Temperature { #if HAS_MAX6675 #define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) #if COUNT_6675 > 1 + #define HAS_MULTI_6675 #define READ_MAX6675(N) read_max6675(N) #else #define READ_MAX6675(N) read_max6675() #endif - static int read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex=0 - #endif - ); + static int read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex=0)); #endif static void checkExtruderAutoFans(); diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index ab92102de39c..340712e22d99 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -206,7 +206,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_0 #define HEATER_0_TEMPTABLE TT_NAME(THERMISTOR_HEATER_0) #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) -#elif defined(HEATER_0_USES_THERMISTOR) +#elif HEATER_0_USES_THERMISTOR #error "No heater 0 thermistor table specified" #else #define HEATER_0_TEMPTABLE nullptr @@ -216,7 +216,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_1 #define HEATER_1_TEMPTABLE TT_NAME(THERMISTOR_HEATER_1) #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) -#elif defined(HEATER_1_USES_THERMISTOR) +#elif HEATER_1_USES_THERMISTOR #error "No heater 1 thermistor table specified" #else #define HEATER_1_TEMPTABLE nullptr @@ -226,7 +226,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_2 #define HEATER_2_TEMPTABLE TT_NAME(THERMISTOR_HEATER_2) #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) -#elif defined(HEATER_2_USES_THERMISTOR) +#elif HEATER_2_USES_THERMISTOR #error "No heater 2 thermistor table specified" #else #define HEATER_2_TEMPTABLE nullptr @@ -236,7 +236,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_3 #define HEATER_3_TEMPTABLE TT_NAME(THERMISTOR_HEATER_3) #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) -#elif defined(HEATER_3_USES_THERMISTOR) +#elif HEATER_3_USES_THERMISTOR #error "No heater 3 thermistor table specified" #else #define HEATER_3_TEMPTABLE nullptr @@ -246,7 +246,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_4 #define HEATER_4_TEMPTABLE TT_NAME(THERMISTOR_HEATER_4) #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) -#elif defined(HEATER_4_USES_THERMISTOR) +#elif HEATER_4_USES_THERMISTOR #error "No heater 4 thermistor table specified" #else #define HEATER_4_TEMPTABLE nullptr @@ -256,7 +256,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_5 #define HEATER_5_TEMPTABLE TT_NAME(THERMISTOR_HEATER_5) #define HEATER_5_TEMPTABLE_LEN COUNT(HEATER_5_TEMPTABLE) -#elif defined(HEATER_5_USES_THERMISTOR) +#elif HEATER_5_USES_THERMISTOR #error "No heater 5 thermistor table specified" #else #define HEATER_5_TEMPTABLE nullptr @@ -266,7 +266,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_6 #define HEATER_6_TEMPTABLE TT_NAME(THERMISTOR_HEATER_6) #define HEATER_6_TEMPTABLE_LEN COUNT(HEATER_6_TEMPTABLE) -#elif defined(HEATER_6_USES_THERMISTOR) +#elif HEATER_6_USES_THERMISTOR #error "No heater 6 thermistor table specified" #else #define HEATER_6_TEMPTABLE nullptr @@ -276,7 +276,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_7 #define HEATER_7_TEMPTABLE TT_NAME(THERMISTOR_HEATER_7) #define HEATER_7_TEMPTABLE_LEN COUNT(HEATER_7_TEMPTABLE) -#elif defined(HEATER_7_USES_THERMISTOR) +#elif HEATER_7_USES_THERMISTOR #error "No heater 7 thermistor table specified" #else #define HEATER_7_TEMPTABLE nullptr @@ -286,7 +286,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORBED #define BED_TEMPTABLE TT_NAME(THERMISTORBED) #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) +#elif HEATER_BED_USES_THERMISTOR #error "No bed thermistor table specified" #else #define BED_TEMPTABLE_LEN 0 @@ -295,7 +295,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORCHAMBER #define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER) #define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) +#elif HEATER_CHAMBER_USES_THERMISTOR #error "No chamber thermistor table specified" #else #define CHAMBER_TEMPTABLE_LEN 0 @@ -304,7 +304,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORPROBE #define PROBE_TEMPTABLE TT_NAME(THERMISTORPROBE) #define PROBE_TEMPTABLE_LEN COUNT(PROBE_TEMPTABLE) -#elif defined(HEATER_PROBE_USES_THERMISTOR) +#elif HEATER_PROBE_USES_THERMISTOR #error "No probe thermistor table specified" #else #define PROBE_TEMPTABLE_LEN 0 @@ -402,7 +402,7 @@ static_assert( #endif #ifndef HEATER_0_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_0) || !defined(HEATER_0_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_0) || !HEATER_0_USES_THERMISTOR #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_0_RAW_LO_TEMP 0 #else @@ -411,7 +411,7 @@ static_assert( #endif #endif #ifndef HEATER_1_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_1) || !defined(HEATER_1_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_1) || !HEATER_1_USES_THERMISTOR #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_1_RAW_LO_TEMP 0 #else @@ -420,7 +420,7 @@ static_assert( #endif #endif #ifndef HEATER_2_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_2) || !defined(HEATER_2_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_2) || !HEATER_2_USES_THERMISTOR #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_2_RAW_LO_TEMP 0 #else @@ -429,7 +429,7 @@ static_assert( #endif #endif #ifndef HEATER_3_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_3) || !defined(HEATER_3_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_3) || !HEATER_3_USES_THERMISTOR #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_3_RAW_LO_TEMP 0 #else @@ -438,7 +438,7 @@ static_assert( #endif #endif #ifndef HEATER_4_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_4) || !defined(HEATER_4_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_4) || !HEATER_4_USES_THERMISTOR #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_4_RAW_LO_TEMP 0 #else @@ -447,7 +447,7 @@ static_assert( #endif #endif #ifndef HEATER_5_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_5) || !defined(HEATER_5_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_5) || !HEATER_5_USES_THERMISTOR #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_5_RAW_LO_TEMP 0 #else @@ -456,7 +456,7 @@ static_assert( #endif #endif #ifndef HEATER_6_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_6) || !defined(HEATER_6_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_6) || !HEATER_6_USES_THERMISTOR #define HEATER_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_6_RAW_LO_TEMP 0 #else @@ -465,7 +465,7 @@ static_assert( #endif #endif #ifndef HEATER_7_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_7) || !defined(HEATER_7_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_7) || !HEATER_7_USES_THERMISTOR #define HEATER_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_7_RAW_LO_TEMP 0 #else @@ -474,7 +474,7 @@ static_assert( #endif #endif #ifndef HEATER_BED_RAW_HI_TEMP - #if TT_REV(THERMISTORBED) || !defined(HEATER_BED_USES_THERMISTOR) + #if TT_REV(THERMISTORBED) || !HEATER_BED_USES_THERMISTOR #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_BED_RAW_LO_TEMP 0 #else @@ -483,7 +483,7 @@ static_assert( #endif #endif #ifndef HEATER_CHAMBER_RAW_HI_TEMP - #if TT_REV(THERMISTORCHAMBER) || !defined(HEATER_CHAMBER_USES_THERMISTOR) + #if TT_REV(THERMISTORCHAMBER) || !HEATER_CHAMBER_USES_THERMISTOR #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_CHAMBER_RAW_LO_TEMP 0 #else @@ -492,7 +492,7 @@ static_assert( #endif #endif #ifndef HEATER_PROBE_RAW_HI_TEMP - #if TT_REV(THERMISTORPROBE) || !defined(HEATER_PROBE_USES_THERMISTOR) + #if TT_REV(THERMISTORPROBE) || !HEATER_PROBE_USES_THERMISTOR #define HEATER_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_PROBE_RAW_LO_TEMP 0 #else From 12ba2ad77ea2dcad514b41eaeb57498f71be0c9d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 10 Nov 2020 00:11:19 +0000 Subject: [PATCH 121/443] [cron] Bump distribution date (2020-11-10) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index bed40f9463e7..77f7c2cf2026 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-09" + #define STRING_DISTRIBUTION_DATE "2020-11-10" #endif /** From f17394d67740e1f5591b3e0e23cc7313b218776d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 Nov 2020 18:53:19 -0600 Subject: [PATCH 122/443] Ability to disable M32 --- Marlin/src/gcode/gcode.cpp | 5 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/sd/M32.cpp | 4 +- Marlin/src/inc/Conditionals_adv.h | 4 ++ Marlin/src/sd/cardreader.cpp | 82 +++++++++++++++++-------------- Marlin/src/sd/cardreader.h | 9 ++-- buildroot/tests/LPC1769-tests | 1 + platformio.ini | 2 + 8 files changed, 64 insertions(+), 45 deletions(-) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index e2c70ad3ae88..1d6bd9423175 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -431,7 +431,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 28: M28(); break; // M28: Start SD write case 29: M29(); break; // M29: Stop SD write case 30: M30(); break; // M30 Delete File - case 32: M32(); break; // M32: Select file and start SD print + + #if HAS_MEDIA_SUBCALLS + case 32: M32(); break; // M32: Select file and start SD print + #endif #if ENABLED(LONG_FILENAME_HOST_SUPPORT) case 33: M33(); break; // M33: Get the long full path to a file or folder diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 34df51e517e1..5db8b08e08d4 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -541,7 +541,7 @@ class GcodeSuite { static void M31(); #if ENABLED(SDSUPPORT) - static void M32(); + TERN_(HAS_MEDIA_SUBCALLS, static void M32()); TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33()); #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) static void M34(); diff --git a/Marlin/src/gcode/sd/M32.cpp b/Marlin/src/gcode/sd/M32.cpp index 55ec6ea49741..ea893c9232cb 100644 --- a/Marlin/src/gcode/sd/M32.cpp +++ b/Marlin/src/gcode/sd/M32.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA_SUBCALLS #include "../gcode.h" #include "../../sd/cardreader.h" @@ -56,4 +56,4 @@ void GcodeSuite::M32() { } } -#endif // SDSUPPORT +#endif // HAS_MEDIA_SUBCALLS diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 2a898d608439..02513e3eaaa8 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -146,6 +146,10 @@ #define HAS_PRINT_PROGRESS 1 #endif +#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH + #define HAS_MEDIA_SUBCALLS 1 +#endif + #if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME) #define HAS_PRINT_PROGRESS_PERMYRIAD 1 #endif diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 5a914050c4cb..d2713539b728 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -118,9 +118,11 @@ Sd2Card CardReader::sd2card; SdVolume CardReader::volume; SdFile CardReader::file; -uint8_t CardReader::file_subcall_ctr; -uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; -char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; +#if HAS_MEDIA_SUBCALLS + uint8_t CardReader::file_subcall_ctr; + uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; + char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; +#endif uint32_t CardReader::filesize, CardReader::sdpos; @@ -135,7 +137,8 @@ CardReader::CardReader() { #endif flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; filesize = sdpos = 0; - file_subcall_ctr = 0; + + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); workDirDepth = 0; ZERO(workDirParents); @@ -540,34 +543,39 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* switch (subcall_type) { case 0: // Starting a new print. "Now fresh file: ..." announceOpen(2, path); - file_subcall_ctr = 0; + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); break; - case 1: // Starting a sub-procedure + #if HAS_MEDIA_SUBCALLS - // With no file is open it's a simple macro. "Now doing file: ..." - if (!isFileOpen()) { announceOpen(1, path); break; } + case 1: // Starting a sub-procedure - // Too deep? The firmware has to bail. - if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:" STRINGIFY(SD_PROCEDURE_DEPTH)); - kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW)); - return; - } + // With no file is open it's a simple macro. "Now doing file: ..." + if (!isFileOpen()) { announceOpen(1, path); break; } - // Store current filename (based on workDirParents) and position - getAbsFilename(proc_filenames[file_subcall_ctr]); - filespos[file_subcall_ctr] = sdpos; + // Too deep? The firmware has to bail. + if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { + SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:", int(SD_PROCEDURE_DEPTH)); + kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW)); + return; + } - // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); - file_subcall_ctr++; - break; + // Store current filename (based on workDirParents) and position + getAbsFilename(proc_filenames[file_subcall_ctr]); - case 2: // Resuming previous file after sub-procedure - SERIAL_ECHO_MSG("END SUBROUTINE"); - break; + TERN_(HAS_MEDIA_SUBCALLS, filespos[file_subcall_ctr] = sdpos); + + // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); + file_subcall_ctr++; + break; + + case 2: // Resuming previous file after sub-procedure + SERIAL_ECHO_MSG("END SUBROUTINE"); + break; + + #endif } endFilePrint(); @@ -603,7 +611,7 @@ void CardReader::openFileWrite(char * const path) { if (!isMounted()) return; announceOpen(2, path); - file_subcall_ctr = 0; + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); endFilePrint(); @@ -1158,17 +1166,19 @@ uint16_t CardReader::get_num_Files() { void CardReader::fileHasFinished() { planner.synchronize(); file.close(); - if (file_subcall_ctr > 0) { // Resume calling file after closing procedure - file_subcall_ctr--; - openFileRead(proc_filenames[file_subcall_ctr], 2); // 2 = Returning from sub-procedure - setIndex(filespos[file_subcall_ctr]); - startFileprint(); - } - else { - endFilePrint(TERN_(SD_RESORT, true)); - marlin_state = MF_SD_COMPLETE; - } + #if HAS_MEDIA_SUBCALLS + if (file_subcall_ctr > 0) { // Resume calling file after closing procedure + file_subcall_ctr--; + openFileRead(proc_filenames[file_subcall_ctr], 2); // 2 = Returning from sub-procedure + setIndex(filespos[file_subcall_ctr]); + startFileprint(); + return; + } + #endif + + endFilePrint(TERN_(SD_RESORT, true)); + marlin_state = MF_SD_COMPLETE; } #if ENABLED(AUTO_REPORT_SD_STATUS) diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 33645b6531eb..c6fe37400c2d 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -249,12 +249,11 @@ class CardReader { // // Procedure calls to other files // - #ifndef SD_PROCEDURE_DEPTH - #define SD_PROCEDURE_DEPTH 1 + #if HAS_MEDIA_SUBCALLS + static uint8_t file_subcall_ctr; + static uint32_t filespos[SD_PROCEDURE_DEPTH]; + static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; #endif - static uint8_t file_subcall_ctr; - static uint32_t filespos[SD_PROCEDURE_DEPTH]; - static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; // // SD Auto Reporting diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index 4314b0d5ff8d..df66f0ab75bd 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -23,6 +23,7 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER +opt_disable SD_PROCEDURE_DEPTH opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Smoothieboard with many features" diff --git a/platformio.ini b/platformio.ini index af7ce47a5044..15b8d4c23a64 100644 --- a/platformio.ini +++ b/platformio.ini @@ -180,6 +180,7 @@ default_src_filter = + - - + - - - + - - - - @@ -370,6 +371,7 @@ Z_PROBE_SLED = src_filter=+ G38_PROBE_TARGET = src_filter=+ MAGNETIC_PARKING_EXTRUDER = src_filter=+ SDSUPPORT = src_filter=+ +HAS_MEDIA_SUBCALLS = src_filter=+ HAS_EXTRUDERS = src_filter=+ + AUTO_REPORT_TEMPERATURES = src_filter=+ INCH_MODE_SUPPORT = src_filter=+ From a70fdfaeba716eb38245cf629fbf20984d48ec91 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 10 Nov 2020 10:21:05 +0100 Subject: [PATCH 123/443] Fix 320x240 touch buttons Y (#20079) --- Marlin/src/lcd/touch/touch_buttons.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/touch/touch_buttons.h b/Marlin/src/lcd/touch/touch_buttons.h index bf05d2bae591..a79bb15be427 100644 --- a/Marlin/src/lcd/touch/touch_buttons.h +++ b/Marlin/src/lcd/touch/touch_buttons.h @@ -47,7 +47,7 @@ #define BUTTONC_X_LO BUTTONB_X_HI + BUTTON_SPACING #define BUTTONC_X_HI BUTTONC_X_LO + BUTTON_WIDTH - 1 -#define BUTTON_Y_HI (TFT_HEIGHT) - (BUTTON_SPACING / 2) +#define BUTTON_Y_HI (TFT_HEIGHT) - BUTTON_SPACING #define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT class TouchButtons { From 6ce1eeb4ae65d1c5523cd81d806bd0450ddbe66a Mon Sep 17 00:00:00 2001 From: Gustavo Alvarez <462213+sl1pkn07@users.noreply.github.com> Date: Tue, 10 Nov 2020 10:22:08 +0100 Subject: [PATCH 124/443] Fix SKR E3 DIP pin CLCD_SPI_CS (#20078) --- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c151b44bb705..c748dbbed3cf 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -264,7 +264,7 @@ #define BEEPER_PIN PB6 #define CLCD_MOD_RESET PA9 - #define CLCD_SPI_CS PA8 + #define CLCD_SPI_CS PB8 #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 From 60aadd2a02db40d69aadcb9ecf629493b8cc8b36 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Tue, 10 Nov 2020 10:26:45 +0100 Subject: [PATCH 125/443] Update issues/support link (#20077) Co-authored-by: Scott Lahteine --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3c2afa87477..f70b7c409acb 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0. - This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle. - Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. -- Please submit your questions and concerns to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues). +- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). Support resources are also listed there. ### [RepRap.org Wiki Page](https://reprap.org/wiki/Marlin) From 2abb674c878538557d7f38faaf3c6d3d182b1fe7 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Tue, 10 Nov 2020 10:27:34 +0100 Subject: [PATCH 126/443] What if 8 was 9? (#20076) --- Marlin/src/MarlinCore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index be3dcdd109e6..44abf722f21a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -509,7 +509,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { kill(); } - // M18 / M94 : Handle steppers inactive time timeout + // M18 / M84 : Handle steppers inactive time timeout if (gcode.stepper_inactive_time) { static bool already_shutdown_steppers; // = false From 53e79224fc404361f6233c19466816270dd5cf1b Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 10 Nov 2020 01:32:08 -0800 Subject: [PATCH 127/443] Fix Arduino DUE compilation (#20058) --- Marlin/src/HAL/STM32/MarlinSPI.cpp | 4 ++++ Marlin/src/feature/controllerfan.cpp | 2 ++ Marlin/src/feature/controllerfan.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index fd05b1aeb4e8..da11b88a60b1 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -20,6 +20,8 @@ * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #include "MarlinSPI.h" static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) { @@ -159,3 +161,5 @@ uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) HAL_DMA_DeInit(&_dmaTx); return 1; } + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index fa5a86b0194e..020646775253 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -34,6 +34,8 @@ uint8_t ControllerFan::speed; #if ENABLED(CONTROLLER_FAN_EDITABLE) controllerFan_settings_t ControllerFan::settings; // {0} + #else + const controllerFan_settings_t &ControllerFan::settings = controllerFan_defaults; #endif void ControllerFan::setup() { diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index d1d39f21f3f2..55f2d5cfc7aa 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -58,7 +58,7 @@ class ControllerFan { #if ENABLED(CONTROLLER_FAN_EDITABLE) static controllerFan_settings_t settings; #else - static const controllerFan_settings_t constexpr &settings = controllerFan_defaults; + static const controllerFan_settings_t &settings; #endif static inline bool state() { return speed > 0; } static inline void init() { reset(); } From f15fef90a9cb678826377e82564b79910acafc40 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 11 Nov 2020 00:09:42 +0000 Subject: [PATCH 128/443] [cron] Bump distribution date (2020-11-11) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 77f7c2cf2026..bc74acfd7c37 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-10" + #define STRING_DISTRIBUTION_DATE "2020-11-11" #endif /** From f8ee6f8b3176b6df7bc3d23119a4bee36c6ff0d8 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 10 Nov 2020 22:39:34 -0300 Subject: [PATCH 129/443] Fix UI compile issues (#20092) --- .../lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 10 +- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 6 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 4 +- Marlin/src/lcd/lcdprint.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 112 +++++++++--------- Marlin/src/lcd/marlinui.h | 10 +- 9 files changed, 76 insertions(+), 74 deletions(-) diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index c745f971dc1f..aa5f990898f6 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -55,7 +55,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_MARLINUI_U8GLIB +#if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI) #include "HAL_LCD_com_defines.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 8f7279f5ddf8..befed7a64661 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -181,7 +181,7 @@ static void disp_language(uint8_t language, uint8_t state) { strcat_P(public_buf_l, PSTR(".bin")); - lv_obj_set_event_cb_mks(obj, event_handler, id, nullptr, 0); + lv_obj_set_event_cb_mks(obj, event_handler, id, "", 0); lv_imgbtn_set_src_both(obj, public_buf_l); if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index f513ea4d0b09..9014e88d75c4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -279,7 +279,7 @@ void disp_gcode_icon(uint8_t file_num) { cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); if (list_file.IsFolder[i]) { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); @@ -298,7 +298,7 @@ void disp_gcode_icon(uint8_t file_num) { strcat(test_public_buf_l, list_file.file_name[i]); char *temp = strstr(test_public_buf_l, ".GCO"); if (temp) strcpy(temp, ".bin"); - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l); if (i < 3) { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); @@ -308,7 +308,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -320,7 +320,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -328,7 +328,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); } else { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index c7f5f418f5b8..58b593a128f9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1680,7 +1680,7 @@ lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/, lv_style_t *style/*=&style_para_value*/) { lv_obj_t *btn = lv_btn_create(par, nullptr); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + lv_obj_set_event_cb_mks(btn, cb, id, "", 0); else lv_obj_set_event_cb(btn, cb); lv_btn_set_style_both(btn, style); @@ -1748,7 +1748,7 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, con lv_obj_t *btn = lv_imgbtn_create(par, nullptr); if (img) lv_imgbtn_set_src_both(btn, img); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + lv_obj_set_event_cb_mks(btn, cb, id, "", 0); else lv_obj_set_event_cb(btn, cb); lv_imgbtn_use_label_style(btn); @@ -1785,7 +1785,7 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_ lv_obj_t *btn = lv_btn_create(par, nullptr); /*Add a button the current screen*/ lv_obj_set_pos(btn, x, y); /*Set its position*/ lv_obj_set_size(btn, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, "", 0); lv_btn_use_label_style(btn); lv_btn_set_layout(btn, LV_LAYOUT_OFF); lv_obj_t *label = lv_label_create_empty(btn); /*Add a label to the button*/ diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 313abd45453a..6f14c20d29aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -73,7 +73,7 @@ void lv_draw_wifi(void) { buttonReconnect = lv_imgbtn_create(scr, nullptr); - lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, nullptr, 0); + lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, "", 0); lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin"); lv_imgbtn_use_label_style(buttonReconnect); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 097263a655f7..d67cb8cc29ba 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -21,7 +21,7 @@ */ #include "../../../../inc/MarlinConfigPre.h" -#if HAS_TFT_LVGL_UI +#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION) #include "draw_ui.h" #include "wifi_module.h" @@ -822,4 +822,4 @@ int32_t wifi_upload(int type) { return esp_upload.uploadResult == success ? 0 : -1; } -#endif // HAS_TFT_LVGL_UI +#endif // HAS_TFT_LVGL_UI && USE_WIFI_FUNCTION diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 6781b81d7c38..2c78b14834b4 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -26,7 +26,7 @@ #include "../inc/MarlinConfigPre.h" -#if HAS_WIRED_LCD +#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT #include "lcdprint.h" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 1994e4094bc3..17c3c3edfede 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -262,67 +262,71 @@ millis_t MarlinUI::next_button_update_ms; // = 0 #endif - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { - SETCURSOR(col, row); - if (!string) return; - - auto _newline = [&col, &row]{ - col = 0; row++; // Move col to string len (plus space) - SETCURSOR(0, row); // Simulate carriage return - }; - - uint8_t *p = (uint8_t*)string; - wchar_t ch; - if (wordwrap) { - uint8_t *wrd = nullptr, c = 0; - // find the end of the part - for (;;) { - if (!wrd) wrd = p; // Get word start /before/ advancing - p = get_utf8_value_cb(p, cb_read_byte, &ch); - const bool eol = !ch; // zero ends the string - // End or a break between phrases? - if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { - if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces - // Past the right and the word is not too long? - if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? - c += !eol; // +1 so the space will be printed - col += c; // advance col to new position - while (c) { // character countdown - --c; // count down to zero - wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again - lcd_put_wchar(ch); // character to the LCD + #if !HAS_GRAPHICAL_TFT + + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { + SETCURSOR(col, row); + if (!string) return; + + auto _newline = [&col, &row]{ + col = 0; row++; // Move col to string len (plus space) + SETCURSOR(0, row); // Simulate carriage return + }; + + uint8_t *p = (uint8_t*)string; + wchar_t ch; + if (wordwrap) { + uint8_t *wrd = nullptr, c = 0; + // find the end of the part + for (;;) { + if (!wrd) wrd = p; // Get word start /before/ advancing + p = get_utf8_value_cb(p, cb_read_byte, &ch); + const bool eol = !ch; // zero ends the string + // End or a break between phrases? + if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { + if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces + // Past the right and the word is not too long? + if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? + c += !eol; // +1 so the space will be printed + col += c; // advance col to new position + while (c) { // character countdown + --c; // count down to zero + wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again + lcd_put_wchar(ch); // character to the LCD + } + if (eol) break; // all done! + wrd = nullptr; // set up for next word } - if (eol) break; // all done! - wrd = nullptr; // set up for next word + else c++; // count word characters } - else c++; // count word characters } - } - else { - for (;;) { - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - lcd_put_wchar(ch); - col++; - if (col >= LCD_WIDTH) _newline(); + else { + for (;;) { + p = get_utf8_value_cb(p, cb_read_byte, &ch); + if (!ch) break; + lcd_put_wchar(ch); + col++; + if (col >= LCD_WIDTH) _newline(); + } } } - } - void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; - uint8_t col = 0, row = 0; - if (!string && plen + slen <= LCD_WIDTH) { - col = (LCD_WIDTH - plen - slen) / 2; - row = LCD_HEIGHT > 3 ? 1 : 0; - } - wrap_string_P(col, row, pref, true); - if (string) { - if (col) { col = 0; row++; } // Move to the start of the next line - wrap_string(col, row, string); + void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; + uint8_t col = 0, row = 0; + if (!string && plen + slen <= LCD_WIDTH) { + col = (LCD_WIDTH - plen - slen) / 2; + row = LCD_HEIGHT > 3 ? 1 : 0; + } + wrap_string_P(col, row, pref, true); + if (string) { + if (col) { col = 0; row++; } // Move to the start of the next line + wrap_string(col, row, string); + } + if (suff) wrap_string_P(col, row, suff); } - if (suff) wrap_string_P(col, row, suff); - } + + #endif // !HAS_GRAPHICAL_TFT #endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index d0b66aee457c..ed02f4000ba2 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -80,12 +80,10 @@ #include "lcdprint.h" - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); - inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } - inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } - - #if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" + #if !HAS_GRAPHICAL_TFT + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); + inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } + inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } #endif typedef void (*screenFunc_t)(); From 87ce545e154dffc6c1e46d8d8f6f3c05cae18184 Mon Sep 17 00:00:00 2001 From: Speaka <48431623+Speaka@users.noreply.github.com> Date: Wed, 11 Nov 2020 02:41:21 +0100 Subject: [PATCH 130/443] Tramming Wizard wait position (#20063) --- Marlin/Configuration_adv.h | 1 + Marlin/src/lcd/menu/menu_tramming.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index cd8a055ffb20..ba56862d5dbf 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -811,6 +811,7 @@ //#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item to run G35 Assisted Tramming (MarlinUI) //#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu + //#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment /** * Screw thread: diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index 317335d51bc2..c9043a118bd8 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -50,6 +50,14 @@ bool probe_single_point() { const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true); DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); z_measured[tram_index] = z_probed_height; + + #ifdef ASSISTED_TRAMMING_WAIT_POSITION + // Move XY to safe position + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Moving away"); + const xyz_pos_t wait_pos = ASSISTED_TRAMMING_WAIT_POSITION; + do_blocking_move_to(wait_pos, XY_PROBE_FEEDRATE_MM_S); + #endif + return !isnan(z_probed_height); } From d4ba94479b114df6a6d5220c87dd7bf100942863 Mon Sep 17 00:00:00 2001 From: ellensp Date: Wed, 11 Nov 2020 15:06:42 +1300 Subject: [PATCH 131/443] BTT driver expansion for SKR 1.3/1.4 (#20088) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 172 ++++++++++-------- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 51 ++++++ Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 2 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 6 +- Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h | 2 +- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 +- 7 files changed, 157 insertions(+), 80 deletions(-) diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 999cec29baa9..559bc5b22233 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -649,7 +649,7 @@ void menu_item(const uint8_t row, bool sel ) { menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); #if ENABLED(TOUCH_SCREEN) const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; - touch.add_control(tct, 0, 2 + 34 * row, 320, 32, encoderTopLine + row); + touch.add_control(tct, 0, 2 + 34 * row, TFT_WIDTH, 32, encoderTopLine + row); #endif } diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 14bac7d723a7..bb2cacd5ba0e 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -208,31 +208,57 @@ #define E1_SERIAL_TX_PIN P1_01 #define E1_SERIAL_RX_PIN P1_01 - #define Z2_SERIAL_TX_PIN P1_01 - #define Z2_SERIAL_RX_PIN P1_01 - // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 #endif +/* _____ _____ + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | 1.31 1.23 | 3 4 | 1.22 + * 0.18 | 5 6 3.25 1.21 | 5 6 1.20 + * 0.16 | 7 8 | 3.26 1.19 | 7 8 | 1.18 + * 0.15 | 9 10| 0.17 0.28 | 9 10| 1.30 + * ----- ----- + * EXP2 EXP1 + */ + +#define EXPA1_03_PIN P1_23 +#define EXPA1_04_PIN P1_22 +#define EXPA1_05_PIN P1_21 +#define EXPA1_06_PIN P1_20 +#define EXPA1_07_PIN P1_19 +#define EXPA1_08_PIN P1_18 +#define EXPA1_09_PIN P0_28 +#define EXPA1_10_PIN P1_30 + +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN P1_31 +#define EXPA2_05_PIN P0_18 +#define EXPA2_06_PIN P3_25 +#define EXPA2_07_PIN P0_16 +#define EXPA2_08_PIN P3_26 +#define EXPA2_09_PIN P0_15 +#define EXPA2_10_PIN P0_17 + // // SD Connection // #if SD_CONNECTION_IS(LCD) - #define SS_PIN P0_16 + #define SS_PIN EXPA2_07_PIN #endif /** * _____ _____ * NC | · · | GND 5V | · · | GND * RESET | · · | 1.31 (SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) - * (MOSI) 0.18 | · · | 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) + * (MOSI) 0.18 | · · 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · 1.20 (LCD_D4) * (SD_SS) 0.16 | · · | 3.26 (BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) * (SCK) 0.15 | · · | 0.17 (MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) * ----- ----- * EXP2 EXP1 */ -#if HAS_WIRED_LCD + +#if HAS_WIRED_LCD && !HAS_BTT_EXP_MOT #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." @@ -249,35 +275,35 @@ * * The ANET_FULL_GRAPHICS_LCD connector plug: * - * 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 - * ----- ----- - * LCD LCD + * 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 */ - #define LCD_PINS_RS P1_23 + #define LCD_PINS_RS EXPA1_03_PIN - #define BTN_EN1 P1_20 - #define BTN_EN2 P1_22 - #define BTN_ENC P1_18 + #define BTN_EN1 EXPA1_06_PIN + #define BTN_EN2 EXPA1_04_PIN + #define BTN_ENC EXPA1_08_PIN - #define LCD_PINS_ENABLE P1_21 - #define LCD_PINS_D4 P1_19 + #define LCD_PINS_ENABLE EXPA1_05_PIN + #define LCD_PINS_D4 EXPA1_07_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC P0_28 // (58) open-drain - #define LCD_PINS_RS P1_22 + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_04_PIN - #define BTN_EN1 P1_18 - #define BTN_EN2 P1_20 + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN - #define LCD_PINS_ENABLE P1_23 - #define LCD_PINS_D4 P1_21 + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) @@ -285,43 +311,43 @@ * _____ * 5V | 1 2 | GND * (MOSI) 1.23 | 3 4 | 1.22 (LCD_RS) - * (LCD_A0) 1.21 | 5 6 | 1.20 (BTN_EN2) + * (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) * ----- * EXP1 */ - #define BTN_EN1 P1_18 - #define BTN_EN2 P1_20 - #define BTN_ENC P0_28 + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN - #define DOGLCD_CS P1_22 - #define DOGLCD_A0 P1_21 - #define DOGLCD_SCK P1_30 - #define DOGLCD_MOSI P1_23 + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN P1_22 - #define TFT_A0_PIN P1_23 - #define TFT_DC_PIN P1_23 - #define TFT_MISO_PIN P0_17 - #define TFT_BACKLIGHT_PIN P1_18 - #define TFT_RESET_PIN P1_19 + #define TFT_CS_PIN EXPA1_04_PIN + #define TFT_A0_PIN EXPA1_03_PIN + #define TFT_DC_PIN EXPA1_03_PIN + #define TFT_MISO_PIN EXPA2_10_PIN + #define TFT_BACKLIGHT_PIN EXPA1_08_PIN + #define TFT_RESET_PIN EXPA1_07_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN P1_21 - #define TOUCH_CS_PIN P1_20 + #define TOUCH_INT_PIN EXPA1_05_PIN + #define TOUCH_CS_PIN EXPA1_06_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 // SPI 1 - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 + #define SCK_PIN EXPA2_09_PIN + #define MISO_PIN EXPA2_10_PIN + #define MOSI_PIN EXPA2_05_PIN // Disable any LCD related PINs config #define LCD_PINS_ENABLE -1 @@ -361,72 +387,72 @@ #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS P3_26 + #define TFTGLCD_CS EXPA2_08_PIN #endif - #define SD_DETECT_PIN P1_31 + #define SD_DETECT_PIN EXPA2_04_PIN #else - #define BTN_ENC P0_28 // (58) open-drain - #define LCD_PINS_RS P1_19 + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_07_PIN - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 + #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4 - #define LCD_PINS_ENABLE P1_18 - #define LCD_PINS_D4 P1_20 + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 + #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4 #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant) + #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant) #endif #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P1_18 - #define DOGLCD_A0 P1_19 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN P1_20 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P1_21 + #define RGB_LED_R_PIN EXPA1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_22 + #define RGB_LED_G_PIN EXPA1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_23 + #define RGB_LED_B_PIN EXPA1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_21 + #define NEOPIXEL_PIN EXPA1_05_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P1_21 - #define DOGLCD_A0 P1_22 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 + #define DOGLCD_CS EXPA1_05_PIN + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define FORCE_SOFT_SPI #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 P1_21 - #define LCD_PINS_D6 P1_22 - #define LCD_PINS_D7 P1_23 + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN #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 EXPA1_03_PIN // Detect the presence of the encoder #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 820c35a01cb9..e6cfc0afaf76 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -29,6 +29,14 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif +// If you have the Big tree tech driver expantion module, enable HAS_BTT_EXP_MOT +// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT +//#define HAS_BTT_EXP_MOT 1 + +#if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT) + #ERROR "Having a LCD on EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possable." +#endif + // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -115,3 +123,46 @@ #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif + +#if HAS_BTT_EXP_MOT +/* _____ _____ + * NC | · · | GND NC | · · | GND + * NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN) + * (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG) + * (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG) + * (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG) + * ----- ----- + * EXP2 EXP1 + */ + + // M1 on Driver Expansion Module + #define E2_STEP_PIN EXPA2_05_PIN + #define E2_DIR_PIN EXPA2_06_PIN + #define E2_ENABLE_PIN EXPA2_04_PIN + #define E2_DIAG_PIN EXPA1_06_PIN + #define E2_CS_PIN EXPA1_05_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXPA1_05_PIN + #define E2_SERIAL_RX_PIN EXPA1_05_PIN + #endif + // M2 on Driver Expansion Module + #define E3_STEP_PIN EXPA2_08_PIN + #define E3_DIR_PIN EXPA2_07_PIN + #define E3_ENABLE_PIN EXPA1_03_PIN + #define E3_DIAG_PIN EXPA1_08_PIN + #define E3_CS_PIN EXPA1_07_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXPA1_07_PIN + #define E3_SERIAL_RX_PIN EXPA1_07_PIN + #endif + // M3 on Driver Expansion Module + #define E4_STEP_PIN EXPA2_10_PIN + #define E4_DIR_PIN EXPA2_09_PIN + #define E4_ENABLE_PIN EXPA1_04_PIN + #define E4_DIAG_PIN EXPA1_10_PIN + #define E4_CS_PIN EXPA1_09_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXPA1_09_PIN + #define E4_SERIAL_RX_PIN EXPA1_09_PIN + #endif +#endif // HAS_BTT_EXP_MOT diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index f948c32f923a..b0d1ec1f03b7 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -229,7 +229,7 @@ * _____ _____ * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) + * (LCD_D4) 0.15 | · · 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- 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 0719752399d8..dcf0741a7699 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -249,9 +249,9 @@ /** * _____ _____ - * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) - * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) + * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) + * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) + * (LCD_D4) 0.15 | · · 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index a0174f260298..c11cd9e9da94 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -155,7 +155,7 @@ * _____ * 5V | · · | GND * (LCD_EN) P0_18 | · · | P0_16 (LCD_RS) - * (LCD_D4) P0_15 | · · | P3_25 (BTN_EN2) + * (LCD_D4) P0_15 | · · P3_25 (BTN_EN2) * (RESET) P2_11 | · · | P3_26 (BTN_EN1) * (BTN_ENC) P1_30 | · · | P1_31 (BEEPER) * ----- diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 80eb3f15346b..66714240e79b 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -201,7 +201,7 @@ * ----- ----- * 5V/D41 | · · | GND 5V | · · | GND * RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6) - * (MOSI) D51 | · · | D33 (BTN_EN2) (LCD_D5) D25 | · · | D23 (LCD_D4) + * (MOSI) D51 | · · D33 (BTN_EN2) (LCD_D5) D25 | · · D23 (LCD_D4) * (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN) * (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER) * ----- ----- From 3b68e44d9ad6dad4d1b905aa67f19bf3b08725c0 Mon Sep 17 00:00:00 2001 From: Costas Basdekis Date: Wed, 11 Nov 2020 02:13:29 +0000 Subject: [PATCH 132/443] Fix Linux GPIO logging (#20093) Co-authored-by: Scott Lahteine --- .gitignore | 3 +++ Marlin/src/HAL/LINUX/main.cpp | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 1ac1abbe15ac..4e4412f5e769 100755 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,6 @@ cmake-build-* #Python __pycache__ + +#IOLogger logs +*_log.csv diff --git a/Marlin/src/HAL/LINUX/main.cpp b/Marlin/src/HAL/LINUX/main.cpp index 481f059030b7..eadc409324c9 100644 --- a/Marlin/src/HAL/LINUX/main.cpp +++ b/Marlin/src/HAL/LINUX/main.cpp @@ -19,22 +19,23 @@ */ #ifdef __PLAT_LINUX__ -extern void setup(); -extern void loop(); - -#include - -#include -#include +//#define GPIO_LOGGING // Full GPIO and Positional Logging #include "../../inc/MarlinConfig.h" -#include -#include #include "../shared/Delay.h" #include "hardware/IOLoggerCSV.h" #include "hardware/Heater.h" #include "hardware/LinearAxis.h" +#include +#include +#include +#include +#include + +extern void setup(); +extern void loop(); + // simple stdout / stdin implementation for fake serial port void write_serial_thread() { for (;;) { @@ -64,8 +65,6 @@ void simulation_loop() { LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN); LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC); - //#define GPIO_LOGGING // Full GPIO and Positional Logging - #ifdef GPIO_LOGGING IOLoggerCSV logger("all_gpio_log.csv"); Gpio::attachLogger(&logger); @@ -88,7 +87,7 @@ void simulation_loop() { #ifdef GPIO_LOGGING if (x_axis.position != x || y_axis.position != y || z_axis.position != z) { - uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update); + uint64_t update = _MAX(x_axis.last_update, y_axis.last_update, z_axis.last_update); position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl; position_log.flush(); x = x_axis.position; From 0465e0ae3aaec257618d095f7e2b28ef677dbe4a Mon Sep 17 00:00:00 2001 From: Costas Basdekis Date: Wed, 11 Nov 2020 06:39:23 +0000 Subject: [PATCH 133/443] Distinct runout states (#19965) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 22 +++++- Marlin/src/HAL/DUE/fastio.h | 3 + Marlin/src/HAL/ESP32/fastio.h | 3 + Marlin/src/feature/mmu2/mmu2.cpp | 2 +- Marlin/src/feature/runout.h | 67 ++++++++++++++----- Marlin/src/gcode/feature/pause/M600.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 67 +++++++++++++++++++ Marlin/src/inc/SanityCheck.h | 30 ++++----- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 4 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 6 +- .../screens/endstop_state_screen.cpp | 4 +- Marlin/src/module/endstops.cpp | 7 +- buildroot/tests/BIGTREE_GTR_V1_0-tests | 15 ++++- buildroot/tests/mega2560-tests | 15 +++++ 14 files changed, 202 insertions(+), 45 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ea77b4e429ab..0036f40c4a34 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1186,9 +1186,27 @@ #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. - //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins. + + // Override individually if the runout sensors vary + //#define FIL_RUNOUT1_STATE LOW + //#define FIL_RUNOUT1_PULL + //#define FIL_RUNOUT2_STATE LOW + //#define FIL_RUNOUT2_PULL + //#define FIL_RUNOUT3_STATE LOW + //#define FIL_RUNOUT3_PULL + //#define FIL_RUNOUT4_STATE LOW + //#define FIL_RUNOUT4_PULL + //#define FIL_RUNOUT5_STATE LOW + //#define FIL_RUNOUT5_PULL + //#define FIL_RUNOUT6_STATE LOW + //#define FIL_RUNOUT6_PULL + //#define FIL_RUNOUT7_STATE LOW + //#define FIL_RUNOUT7_PULL + //#define FIL_RUNOUT8_STATE LOW + //#define FIL_RUNOUT8_PULL // Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) diff --git a/Marlin/src/HAL/DUE/fastio.h b/Marlin/src/HAL/DUE/fastio.h index 119d0005af9b..5fb8b4d01533 100644 --- a/Marlin/src/HAL/DUE/fastio.h +++ b/Marlin/src/HAL/DUE/fastio.h @@ -163,6 +163,9 @@ #define SET_INPUT(IO) _SET_INPUT(IO) // Set pin as input with pullup (wrapper) #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) +// Set pin as input with pulldown (substitution) +#define SET_INPUT_PULLDOWN SET_INPUT + // Set pin as output (wrapper) - reads the pin and sets the output to that value #define SET_OUTPUT(IO) _SET_OUTPUT(IO) // Set pin as PWM diff --git a/Marlin/src/HAL/ESP32/fastio.h b/Marlin/src/HAL/ESP32/fastio.h index 2ded3a5f62e8..8db89dca12a1 100644 --- a/Marlin/src/HAL/ESP32/fastio.h +++ b/Marlin/src/HAL/ESP32/fastio.h @@ -52,6 +52,9 @@ // Set pin as input with pullup wrapper #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) +// Set pin as input with pulldown (substitution) +#define SET_INPUT_PULLDOWN SET_INPUT + // Set pin as output wrapper #define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0) diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu2/mmu2.cpp index c5cf48585093..d76476e719f3 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu2/mmu2.cpp @@ -163,7 +163,7 @@ uint8_t MMU2::get_current_tool() { } #if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) - #define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) + #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif void MMU2::mmu_loop() { diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index a5abf057d1ff..aa1ccc9cc52a 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -149,18 +149,34 @@ class FilamentSensorBase { public: static inline void setup() { - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #elif ENABLED(FIL_RUNOUT_PULLDOWN) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) + #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0) + #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL) + #if NUM_RUNOUT_SENSORS >= 1 + INIT_RUNOUT_PIN(1); #endif - - #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN); - REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT) - #undef _INIT_RUNOUT - #undef INIT_RUNOUT_PIN + #if NUM_RUNOUT_SENSORS >= 2 + INIT_RUNOUT_PIN(2); + #endif + #if NUM_RUNOUT_SENSORS >= 3 + INIT_RUNOUT_PIN(3); + #endif + #if NUM_RUNOUT_SENSORS >= 4 + INIT_RUNOUT_PIN(4); + #endif + #if NUM_RUNOUT_SENSORS >= 5 + INIT_RUNOUT_PIN(5); + #endif + #if NUM_RUNOUT_SENSORS >= 6 + INIT_RUNOUT_PIN(6); + #endif + #if NUM_RUNOUT_SENSORS >= 7 + INIT_RUNOUT_PIN(7); + #endif + #if NUM_RUNOUT_SENSORS >= 8 + INIT_RUNOUT_PIN(8); + #endif + #undef _INIT_RUNOUT_PIN + #undef INIT_RUNOUT_PIN } // Return a bitmask of runout pin states @@ -172,11 +188,32 @@ class FilamentSensorBase { // Return a bitmask of runout flag states (1 bits always indicates runout) static inline uint8_t poll_runout_states() { - return poll_runout_pins() - #if FIL_RUNOUT_STATE == LOW - ^ uint8_t(_BV(NUM_RUNOUT_SENSORS) - 1) + return poll_runout_pins() ^ uint8_t(0 + #if NUM_RUNOUT_SENSORS >= 1 + | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 2 + | (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 3 + | (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 4 + | (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 5 + | (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 6 + | (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 7 + | (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 8 + | (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1)) #endif - ; + ); } }; diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 0af68333caa2..e676ed38a4a0 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -88,7 +88,7 @@ void GcodeSuite::M600() { // In this case, for duplicating modes set DXC_ext to the extruder that ran out. #if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1 if (idex_is_duplicating()) - DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_STATE) ? 1 : 0; + DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0; #else DXC_ext = active_extruder; #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 98aa4afb8c21..865365c0ee52 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -675,6 +675,73 @@ #define HAS_BED_PROBE 1 #endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if NUM_RUNOUT_SENSORS >= 1 + #ifndef FIL_RUNOUT1_STATE + #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT1_PULL + #define FIL_RUNOUT1_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 2 + #ifndef FIL_RUNOUT2_STATE + #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT2_PULL + #define FIL_RUNOUT2_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 3 + #ifndef FIL_RUNOUT3_STATE + #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT3_PULL + #define FIL_RUNOUT3_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 4 + #ifndef FIL_RUNOUT4_STATE + #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT4_PULL + #define FIL_RUNOUT4_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 5 + #ifndef FIL_RUNOUT5_STATE + #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT5_PULL + #define FIL_RUNOUT5_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 6 + #ifndef FIL_RUNOUT6_STATE + #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT6_PULL + #define FIL_RUNOUT6_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 7 + #ifndef FIL_RUNOUT7_STATE + #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT7_PULL + #define FIL_RUNOUT7_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 8 + #ifndef FIL_RUNOUT8_STATE + #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT8_PULL + #define FIL_RUNOUT8_PULL FIL_RUNOUT_PULL + #endif + #endif +#endif // FILAMENT_RUNOUT_SENSOR + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #undef PROBE_MANUALLY #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3762d40c53e2..e2a79cd5eab4 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -111,7 +111,7 @@ #elif defined(FILAMENT_SENSOR) #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." #elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." + #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL. Please update your configuration." #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #elif defined(LANGUAGE_INCLUDE) @@ -660,8 +660,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." -#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) - #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN." #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX) #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX." #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX) @@ -814,18 +812,20 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif NUM_RUNOUT_SENSORS > E_STEPPERS #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." - #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN." - #elif NONE(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." + #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2) + #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2." + #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3) + #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3." + #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4) + #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4." + #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5) + #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5." + #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6) + #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6." + #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7) + #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7." + #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8) + #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8." #elif FILAMENT_RUNOUT_DISTANCE_MM < 0 #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero." #elif DISABLED(ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index a1d1217d6ec0..4725afb8bc7e 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -76,8 +76,8 @@ namespace Anycubic { #endif // Filament runout is handled by Marlin settings in Configuration.h - // set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. - // enable FIL_RUNOUT_PULLUP + // opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. + // opt_enable FIL_RUNOUT_PULL TFTSer.begin(115200); diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 2aaa0d0e336f..6d15d937b99b 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -87,7 +87,7 @@ void AnycubicTFTClass::OnSetup() { SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - SET_INPUT_PULLUP(FIL_RUNOUT_PIN); + SET_INPUT_PULLUP(FIL_RUNOUT1_PIN); #endif mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; @@ -935,7 +935,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() { #if ENABLED(FILAMENT_RUNOUT_SENSOR) // NOTE: ExtUI::getFilamentRunoutState() only returns the runout state if the job is printing // we want to actually check the status of the pin here, regardless of printstate - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { if (mediaPrintingState == AMPRINTSTATE_PRINTING || mediaPrintingState == AMPRINTSTATE_PAUSED || mediaPrintingState == AMPRINTSTATE_PAUSE_REQUESTED) { // play tone to indicate filament is out ExtUI::injectCommands_P(PSTR("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567")); @@ -983,7 +983,7 @@ void AnycubicTFTClass::PausePrint() { void AnycubicTFTClass::ResumePrint() { #if ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { #if ENABLED(ANYCUBIC_LCD_DEBUG) SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 41f72e8e5375..09561edc0219 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -92,12 +92,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) - PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_STATE) + PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE) #else PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) #endif #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) - PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE) + PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE) #else PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) #endif diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 825194cf45cc..697ced783379 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -459,18 +459,19 @@ void _O2 Endstops::report_states() { #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); + print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); #else - #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break; + #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break; LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) { pin_t pin; + uint8_t state; switch (i) { default: continue; REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _CASE_RUNOUT) } SERIAL_ECHOPGM(STR_FILAMENT_RUNOUT_SENSOR); if (i > 1) SERIAL_CHAR(' ', '0' + i); - print_es_state(extDigitalRead(pin) != FIL_RUNOUT_STATE); + print_es_state(extDigitalRead(pin) != state); } #undef _CASE_RUNOUT #endif diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests index e8d47562aa61..1db0bcffd2e7 100644 --- a/buildroot/tests/BIGTREE_GTR_V1_0-tests +++ b/buildroot/tests/BIGTREE_GTR_V1_0-tests @@ -24,7 +24,20 @@ opt_set E2_AUTO_FAN_PIN PC12 opt_set X_DRIVER_TYPE TMC2208 opt_set Y_DRIVER_TYPE TMC2130 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan and Mixed TMC Drivers" +opt_enable FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE +opt_set FIL_RUNOUT_PIN 3 +opt_set FIL_RUNOUT2_PIN 4 +opt_set FIL_RUNOUT3_PIN 5 +opt_set FIL_RUNOUT4_PIN 6 +opt_set FIL_RUNOUT5_PIN 7 +opt_set FIL_RUNOUT6_PIN 8 +opt_set FIL_RUNOUT7_PIN 9 +opt_set FIL_RUNOUT8_PIN 10 +opt_set FIL_RUNOUT4_STATE HIGH +opt_enable FIL_RUNOUT4_PULL +opt_set FIL_RUNOUT8_STATE HIGH +opt_enable FIL_RUNOUT8_PULL +exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index a6902b9d144b..9ae43dcdb5d1 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -75,6 +75,21 @@ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." +# +# 5 runout sensors with distinct states +# +restore_configs +opt_set EXTRUDERS 5 +opt_set NUM_SERVOS 1 +opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ + AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ + NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ + PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ + FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL +opt_set MIXING_STEPPERS 5 +opt_set FIL_RUNOUT3_STATE HIGH +exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" + # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features # From 5b9aeb2e5f4abbe152fa4ba5dbb5dd8151d3f6f4 Mon Sep 17 00:00:00 2001 From: LinFor Date: Wed, 11 Nov 2020 23:14:39 +0300 Subject: [PATCH 134/443] Handle UTF in long filenames (#20087) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 4 ++ Marlin/src/lcd/fontutils.cpp | 107 +++++++++++++------------------ Marlin/src/sd/SdBaseFile.cpp | 58 +++++++++++++++-- Marlin/src/sd/SdFatConfig.h | 7 +- buildroot/share/fonts/genpages.c | 48 +++++--------- 5 files changed, 124 insertions(+), 100 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ba56862d5dbf..b308b05e19b3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1256,6 +1256,10 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // Allow international symbols in long filenames. To display correctly, the + // LCD's font must contain the characters. Check your selected LCD language. + #define UTF_FILENAME_SUPPORT + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 22b54c72de72..4aaf62184423 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -9,6 +9,8 @@ #include "../inc/MarlinConfig.h" +#define MAX_UTF8_CHAR_SIZE 4 + #if HAS_WIRED_LCD #include "marlinui.h" #include "../MarlinCore.h" @@ -79,6 +81,8 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t uint32_t val = 0; uint8_t *p = pstart; + #define NEXT_6_BITS() do{ val <<= 6; p++; valcur = cb_read_byte(p); val |= (valcur & 0x3F); }while(0) + uint8_t valcur = cb_read_byte(p); if (0 == (0x80 & valcur)) { val = valcur; @@ -86,74 +90,51 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t } else if (0xC0 == (0xE0 & valcur)) { val = valcur & 0x1F; - val <<= 6; - p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xE0 == (0xF0 & valcur)) { - val = valcur & 0x0F; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF0 == (0xF8 & valcur)) { - val = valcur & 0x07; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF8 == (0xFC & valcur)) { - val = valcur & 0x03; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xFC == (0xFE & valcur)) { - val = valcur & 0x01; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); + NEXT_6_BITS(); p++; } + #if MAX_UTF8_CHAR_SIZE >= 3 + else if (0xE0 == (0xF0 & valcur)) { + val = valcur & 0x0F; + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 4 + else if (0xF0 == (0xF8 & valcur)) { + val = valcur & 0x07; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 5 + else if (0xF8 == (0xFC & valcur)) { + val = valcur & 0x03; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 6 + else if (0xFC == (0xFE & valcur)) { + val = valcur & 0x01; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif else if (0x80 == (0xC0 & valcur)) for (; 0x80 == (0xC0 & valcur); ) { p++; valcur = cb_read_byte(p); } else - for (; ((0xFE & valcur) > 0xFC); ) { p++; valcur = cb_read_byte(p); } + for (; 0xFC < (0xFE & valcur); ) { p++; valcur = cb_read_byte(p); } if (pval) *pval = val; diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 46ed9372ab69..acc5ba17f27c 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1103,19 +1103,67 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table. n = (seq - 1) * (FILENAME_LENGTH); - LOOP_L_N(i, FILENAME_LENGTH) - longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; + LOOP_L_N(i, FILENAME_LENGTH) { + uint16_t utf16_ch = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; + #if ENABLED(UTF_FILENAME_SUPPORT) + // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks + // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. + uint16_t idx = (n + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + longFilename[idx] = utf16_ch & 0xFF; + longFilename[idx+1] = (utf16_ch >> 8) & 0xFF; + #else + // Replace all multibyte characters to '_' + longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); + #endif + } // If this VFAT entry is the last one, add a NUL terminator at the end of the string - if (VFAT->sequenceNumber & 0x40) longFilename[n + FILENAME_LENGTH] = '\0'; + if (VFAT->sequenceNumber & 0x40) longFilename[(n + FILENAME_LENGTH) * LONG_FILENAME_CHARSIZE] = '\0'; } } } + // Return if normal file or subdirectory - if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; + if (DIR_IS_FILE_OR_SUBDIR(dir)) { + #if ENABLED(UTF_FILENAME_SUPPORT) + // Convert filename from utf-16 to utf-8 as Marlin expects + #if LONG_FILENAME_CHARSIZE > 2 + // Add warning for developers for currently not supported 3-byte cases (Conversion series of 2-byte + // codepoints to 3-byte in-place will break the rest of filename) + #error "Currently filename re-encoding is done in-place. It may break the remaining chars to use 3-byte codepoints." + #endif + uint16_t currentPos = 0; + LOOP_L_N(i, (LONG_FILENAME_LENGTH / 2)) { + uint16_t idx = i * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + + uint16_t utf16_ch = longFilename[idx] | (longFilename[idx + 1] << 8); + if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_' + longFilename[currentPos++] = '_'; + else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte utf-8 char + longFilename[currentPos++] = utf16_ch & 0x007F; + else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte utf-8 char + longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x1F); + longFilename[currentPos++] = 0x80 | (utf16_ch & 0x3F); + } + else { + #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte utf-8 char + longFilename[currentPos++] = 0xE0 | ((utf16_ch >> 12) & 0x0F); + longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x3F); + longFilename[currentPos++] = 0xC0 | (utf16_ch & 0x3F); + #else // Encode as '_' + longFilename[currentPos++] = '_'; + #endif + } + + if (0 == utf16_ch) break; // End of filename + } + return currentPos; + #else + return n; + #endif + } } } - // Read next directory entry into the cache // Assumes file is correctly positioned dir_t* SdBaseFile::readDirCache() { diff --git a/Marlin/src/sd/SdFatConfig.h b/Marlin/src/sd/SdFatConfig.h index 8f0596c5ddb5..13ac3a748785 100644 --- a/Marlin/src/sd/SdFatConfig.h +++ b/Marlin/src/sd/SdFatConfig.h @@ -103,5 +103,10 @@ #define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry +// UTF-8 may use up to 3 bytes to represent single UTF-16 code point. +// We discard 3-byte characters allowing only 2-bytes +// or 1-byte if UTF_FILENAME_SUPPORT disabled. +#define LONG_FILENAME_CHARSIZE TERN(UTF_FILENAME_SUPPORT, 2, 1) + // Total bytes needed to store a single long filename -#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1) +#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * LONG_FILENAME_CHARSIZE * MAX_VFAT_ENTRIES + 1) diff --git a/buildroot/share/fonts/genpages.c b/buildroot/share/fonts/genpages.c index 2a87b19d47f7..c855ceac509c 100644 --- a/buildroot/share/fonts/genpages.c +++ b/buildroot/share/fonts/genpages.c @@ -71,63 +71,49 @@ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) { assert(NULL != pstart); + #define NEXT_6_BITS() do{ val <<= 6; p++; val |= (*p & 0x3F); }while(0) + if (0 == (0x80 & *p)) { val = (size_t)*p; p++; } else if (0xC0 == (0xE0 & *p)) { val = *p & 0x1F; - val <<= 6; - p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xE0 == (0xF0 & *p)) { val = *p & 0x0F; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xF0 == (0xF8 & *p)) { val = *p & 0x07; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xF8 == (0xFC & *p)) { val = *p & 0x03; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xFC == (0xFE & *p)) { val = *p & 0x01; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } From bd6e60f56dc805625b56eff8728d28027d0b5b1e Mon Sep 17 00:00:00 2001 From: Davidsg33k Date: Wed, 11 Nov 2020 13:30:36 -0700 Subject: [PATCH 135/443] 400 Z steps-per-mm (#20104) --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0036f40c4a34..785be167b897 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -748,7 +748,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } /** * Default Max Feed Rate (mm/s) From 7216b8f8045d8295a8072b617d37e8a3822a6898 Mon Sep 17 00:00:00 2001 From: ellensp Date: Thu, 12 Nov 2020 09:35:13 +1300 Subject: [PATCH 136/443] Fix compile with PLR, no fan (#20096) --- Marlin/src/feature/powerloss.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 874bcff46da9..bef2309449d3 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -433,13 +433,15 @@ void PrintJobRecovery::resume() { #endif // Restore print cooling fan speeds - FANS_LOOP(i) { - uint8_t f = info.fan_speed[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - gcode.process_subcommands_now(cmd); + #if HAS_FAN + FANS_LOOP(i) { + const int f = info.fan_speed[i]; + if (f) { + sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); + gcode.process_subcommands_now(cmd); + } } - } + #endif // Restore retract and hop state #if ENABLED(FWRETRACT) From ddc23c62241d4decf376eb5c983b5ebd791108a4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Nov 2020 14:39:12 -0600 Subject: [PATCH 137/443] M32 followup --- Marlin/src/sd/cardreader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index d2713539b728..aea2e693c41e 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -562,8 +562,7 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* // Store current filename (based on workDirParents) and position getAbsFilename(proc_filenames[file_subcall_ctr]); - - TERN_(HAS_MEDIA_SUBCALLS, filespos[file_subcall_ctr] = sdpos); + filespos[file_subcall_ctr] = sdpos; // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' SERIAL_ECHO_START(); From 6ccb4b93b153c8872498ca20ec6143daae137333 Mon Sep 17 00:00:00 2001 From: Hebezo Date: Wed, 11 Nov 2020 22:16:19 +0100 Subject: [PATCH 138/443] Option to ignore SD at startup (#20099) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 1 + Marlin/src/inc/SanityCheck.h | 19 +++++++++++++------ Marlin/src/sd/cardreader.cpp | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b308b05e19b3..d05388075a9f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1172,6 +1172,7 @@ // Enable this option and set to HIGH if your SD cards are incorrectly detected. //#define SD_DETECT_STATE HIGH + //#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up //#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash) #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e2a79cd5eab4..995daa7b8e36 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -582,6 +582,11 @@ /** * Serial */ +#ifndef SERIAL_PORT + #error "SERIAL_PORT must be defined in Configuration.h" +#elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT + #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT. Please update your configuration." +#endif #if !(defined(__AVR__) && defined(USBCON)) #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." @@ -594,12 +599,6 @@ #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." #endif -#ifndef SERIAL_PORT - #error "SERIAL_PORT must be defined in Configuration.h" -#elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT. Please update your configuration." -#endif - /** * Multiple Stepper Drivers Per Axis */ @@ -2194,6 +2193,14 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif #endif +#if ENABLED(SD_IGNORE_AT_STARTUP) + #if ENABLED(POWER_LOSS_RECOVERY) + #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY." + #elif ENABLED(SDCARD_EEPROM_EMULATION) + #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION." + #endif +#endif + /** * Make sure only one display is enabled */ diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index aea2e693c41e..1be5f4f2f6bd 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -425,7 +425,8 @@ void CardReader::manage_media() { if (stat) { // Media Inserted safe_delay(500); // Some boards need a delay to get settled - mount(); // Try to mount the media + if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) + mount(); // Try to mount the media #if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II) reset_stepper_drivers(); // Workaround for Cheetah bug #endif From 40d442fde294faedf839e3a80c82cd72c1824ba8 Mon Sep 17 00:00:00 2001 From: JoAnn Manges Date: Wed, 11 Nov 2020 16:52:35 -0500 Subject: [PATCH 139/443] Fix MAX31865 on SPI (PT100/1000) support (#20074) --- Marlin/Configuration.h | 10 +- Marlin/src/inc/Conditionals_post.h | 9 +- Marlin/src/inc/SanityCheck.h | 10 +- Marlin/src/module/temperature.cpp | 187 ++++++++++-------- Marlin/src/module/temperature.h | 2 +- .../PlatformIO/variants/archim/variant.h | 8 +- platformio.ini | 2 +- 7 files changed, 128 insertions(+), 100 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 785be167b897..374a420539ff 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -436,11 +436,11 @@ #define DUMMY_THERMISTOR_998_VALUE 25 #define DUMMY_THERMISTOR_999_VALUE 100 -// Resistor values when using a MAX31865 (sensor -5) -// Sensor value is typically 100 (PT100) or 1000 (PT1000) -// Calibration value is typically 430 ohm for AdaFruit PT100 modules and 4300 ohm for AdaFruit PT1000 modules. -//#define MAX31865_SENSOR_OHMS 100 -//#define MAX31865_CALIBRATION_OHMS 430 +// Resistor values when using MAX31865 sensors (-5) on TEMP_SENSOR_0 / 1 +//#define MAX31865_SENSOR_OHMS_0 100 // (Ω) Typically 100 or 1000 (PT100 or PT1000) +//#define MAX31865_CALIBRATION_OHMS_0 430 // (Ω) Typically 430 for AdaFruit PT100; 4300 for AdaFruit PT1000 +//#define MAX31865_SENSOR_OHMS_1 100 +//#define MAX31865_CALIBRATION_OHMS_1 430 // Use temp sensor 1 as a redundant sensor with sensor 0. If the readings // from the two sensors differ too much the print will be aborted. diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 9eeb39f9a8b7..9fb3e53c4ea2 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -445,9 +445,9 @@ #define HEATER_0_MAX6675_TMAX 1024 #endif #if TEMP_SENSOR_0 == -5 - #define MAX6675_IS_MAX31865 1 + #define MAX6675_0_IS_MAX31865 1 #elif TEMP_SENSOR_0 == -3 - #define MAX6675_IS_MAX31855 1 + #define MAX6675_0_IS_MAX31855 1 #endif #elif TEMP_SENSOR_0 == -4 #define HEATER_0_USES_AD8495 1 @@ -473,6 +473,11 @@ #define HEATER_1_MAX6675_TMIN 0 #define HEATER_1_MAX6675_TMAX 1024 #endif + #if TEMP_SENSOR_1 == -5 + #define MAX6675_1_IS_MAX31865 1 + #elif TEMP_SENSOR_1 == -3 + #define MAX6675_1_IS_MAX31855 1 + #endif #if TEMP_SENSOR_1 != TEMP_SENSOR_0 #if TEMP_SENSOR_1 == -5 #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 995daa7b8e36..10f4676aa930 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -405,6 +405,10 @@ #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." #elif defined(MAX6675_SS2) #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." +#elif defined(MAX31865_SENSOR_OHMS) + #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0. Please update your configuration." +#elif defined(MAX31865_CALIBRATION_OHMS) + #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0. Please update your configuration." #elif defined(SPINDLE_LASER_ENABLE) #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h." #elif defined(SPINDLE_LASER_ENABLE_PIN) @@ -1814,8 +1818,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif -#if MAX6675_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS) && defined(MAX31865_CALIBRATION_OHMS)) - #error "MAX31865_SENSOR_OHMS and MAX31865_CALIBRATION_OHMS must be set in Configuration.h when using a MAX31865 temperature sensor." +#if MAX6675_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0)) + #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set in Configuration.h if TEMP_SENSOR_0 is MAX31865." +#elif MAX6675_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1)) + #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set in Configuration.h if TEMP_SENSOR_1 is MAX31865." #endif /** diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b476b3559308..22c92fe4484c 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -44,30 +44,44 @@ #include "../lcd/extui/ui_api.h" #endif -#if MAX6675_IS_MAX31865 +#if MAX6675_0_IS_MAX31865 || MAX6675_1_IS_MAX31865 #include - #ifndef MAX31865_CS_PIN - #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example + #if MAX6675_0_IS_MAX31865 && !defined(MAX31865_CS_PIN) && PIN_EXISTS(MAX6675_SS) + #define MAX31865_CS_PIN MAX6675_SS_PIN + #endif + #if MAX6675_1_IS_MAX31865 && !defined(MAX31865_CS2_PIN) && PIN_EXISTS(MAX6675_SS2) + #define MAX31865_CS2_PIN MAX6675_SS2_PIN #endif #ifndef MAX31865_MOSI_PIN - #define MAX31865_MOSI_PIN MOSI_PIN // 63 + #define MAX31865_MOSI_PIN MOSI_PIN #endif #ifndef MAX31865_MISO_PIN - #define MAX31865_MISO_PIN MAX6675_DO_PIN // 42 + #define MAX31865_MISO_PIN MAX6675_DO_PIN #endif #ifndef MAX31865_SCK_PIN - #define MAX31865_SCK_PIN MAX6675_SCK_PIN // 40 + #define MAX31865_SCK_PIN MAX6675_SCK_PIN + #endif + #if MAX6675_0_IS_MAX31865 && PIN_EXISTS(MAX31865_CS) + #define HAS_MAX31865 1 + Adafruit_MAX31865 max31865_0 = Adafruit_MAX31865(MAX31865_CS_PIN + #if MAX31865_CS_PIN != MAX6675_SS_PIN + , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK + #endif + ); + #endif + #if MAX6675_1_IS_MAX31865 && PIN_EXISTS(MAX31865_CS2) + #define HAS_MAX31865 1 + Adafruit_MAX31865 max31865_1 = Adafruit_MAX31865(MAX31865_CS2_PIN + #if MAX31865_CS2_PIN != MAX6675_SS2_PIN + , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK + #endif + ); #endif - Adafruit_MAX31865 max31865 = Adafruit_MAX31865(MAX31865_CS_PIN - #if MAX31865_CS_PIN != MAX6675_SS_PIN - , MAX31865_MOSI_PIN // For software SPI also set MOSI/MISO/SCK - , MAX31865_MISO_PIN - , MAX31865_SCK_PIN - #endif - ); #endif -#define MAX6675_SEPARATE_SPI (EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PINS_EXIST(MAX6675_SCK, MAX6675_DO)) +#if EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PINS_EXIST(MAX6675_SCK, MAX6675_DO) + #define MAX6675_SEPARATE_SPI 1 +#endif #if MAX6675_SEPARATE_SPI #include "../libs/private_spi.h" @@ -1471,13 +1485,7 @@ void Temperature::manage_heater() { #if HEATER_0_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); #elif HEATER_0_USES_MAX6675 - return ( - #if MAX6675_IS_MAX31865 - max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS) - #else - raw * 0.25 - #endif - ); + return TERN(MAX6675_0_IS_MAX31865, max31865_0.temperature(MAX31865_SENSOR_OHMS_0, MAX31865_CALIBRATION_OHMS_0), raw * 0.25); #elif HEATER_0_USES_AD595 return TEMP_AD595(raw); #elif HEATER_0_USES_AD8495 @@ -1489,7 +1497,7 @@ void Temperature::manage_heater() { #if HEATER_1_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); #elif HEATER_1_USES_MAX6675 - return raw * 0.25; + return TERN(MAX6675_1_IS_MAX31865, max31865_1.temperature(MAX31865_SENSOR_OHMS_1, MAX31865_CALIBRATION_OHMS_1), raw * 0.25); #elif HEATER_1_USES_AD595 return TEMP_AD595(raw); #elif HEATER_1_USES_AD8495 @@ -1691,7 +1699,8 @@ void Temperature::updateTemperaturesFromRawValues() { */ void Temperature::init() { - TERN_(MAX6675_IS_MAX31865, max31865.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE + TERN_(MAX6675_0_IS_MAX31865, max31865_0.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE + TERN_(MAX6675_1_IS_MAX31865, max31865_1.begin(MAX31865_2WIRE)); #if EARLY_WATCHDOG // Flag that the thermalManager should be running @@ -2200,50 +2209,64 @@ void Temperature::disable_all_heaters() { #define THERMOCOUPLE_MAX_ERRORS 15 #endif - int Temperature::read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex - #endif - ) { - #if COUNT_6675 == 1 - constexpr uint8_t hindex = 0; - #else - // Needed to return the correct temp when this is called too soon - static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; - #endif - - static uint8_t max6675_errors[COUNT_6675] = { 0 }; - + int Temperature::read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex/*=0*/)) { #define MAX6675_HEAT_INTERVAL 250UL - #if MAX6675_IS_MAX31855 + #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855 static uint32_t max6675_temp = 2000; #define MAX6675_ERROR_MASK 7 #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 + #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 + #elif HAS_MAX31865 + static uint16_t max6675_temp = 2000; // From datasheet 16 bits D15-D0 + #define MAX6675_ERROR_MASK 1 // D0 Bit not used + #define MAX6675_DISCARD_BITS 1 // Data is in D15-D1 + #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 #else static uint16_t max6675_temp = 2000; #define MAX6675_ERROR_MASK 4 #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 + #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 #endif + #if HAS_MULTI_6675 + // Needed to return the correct temp when this is called between readings + static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; + #define MAX6675_TEMP(I) max6675_temp_previous[I] + #define MAX6675_SEL(A,B) (hindex ? (B) : (A)) + #define MAX6675_WRITE(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) + #define MAX6675_SET_OUTPUT() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) + #else + constexpr uint8_t hindex = 0; + #define MAX6675_TEMP(I) max6675_temp + #if MAX6675_1_IS_MAX31865 + #define MAX6675_SEL(A,B) B + #else + #define MAX6675_SEL(A,B) A + #endif + #if HEATER_0_USES_MAX6675 + #define MAX6675_WRITE(V) WRITE(MAX6675_SS_PIN, V) + #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS_PIN) + #else + #define MAX6675_WRITE(V) WRITE(MAX6675_SS2_PIN, V) + #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS2_PIN) + #endif + #endif + + static uint8_t max6675_errors[COUNT_6675] = { 0 }; + // Return last-read value between readings static millis_t next_max6675_ms[COUNT_6675] = { 0 }; millis_t ms = millis(); - if (PENDING(ms, next_max6675_ms[hindex])) - return int( - #if COUNT_6675 == 1 - max6675_temp - #else - max6675_temp_previous[hindex] // Need to return the correct previous value - #endif - ); - + if (PENDING(ms, next_max6675_ms[hindex])) return int(MAX6675_TEMP(hindex)); next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; - #if MAX6675_IS_MAX31865 - max6675_temp = int(max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS)); + #if HAS_MAX31865 + Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1); + max6675_temp = int(maxref.temperature( + MAX6675_SEL(MAX31865_SENSOR_OHMS_0, MAX31865_SENSOR_OHMS_1), + MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1) + )); #endif // @@ -2254,39 +2277,24 @@ void Temperature::disable_all_heaters() { spiInit(MAX6675_SPEED_BITS); #endif - #if COUNT_6675 > 1 - #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) - #define SET_OUTPUT_MAX6675() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) - #elif HEATER_1_USES_MAX6675 - #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS2_PIN) - #else - #define WRITE_MAX6675(V) WRITE(MAX6675_SS_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS_PIN) - #endif - - SET_OUTPUT_MAX6675(); - WRITE_MAX6675(LOW); // enable TT_MAX6675 + MAX6675_SET_OUTPUT(); + MAX6675_WRITE(LOW); // enable TT_MAX6675 DELAY_NS(100); // Ensure 100ns delay // Read a big-endian temperature value max6675_temp = 0; for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= ( - #if MAX6675_SEPARATE_SPI - max6675_spi.receive() - #else - spiRec() - #endif - ); + max6675_temp |= TERN(MAX6675_SEPARATE_SPI, max6675_spi.receive(), spiRec()); if (i > 0) max6675_temp <<= 8; // shift left if not the last byte } - WRITE_MAX6675(HIGH); // disable TT_MAX6675 + MAX6675_WRITE(HIGH); // disable TT_MAX6675 + + const uint8_t fault_31865 = TERN1(HAS_MAX31865, maxref.readFault()); - if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK)) { - max6675_errors[hindex] += 1; + if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK) && fault_31865) { + max6675_errors[hindex]++; if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) { SERIAL_ERROR_START(); SERIAL_ECHOPGM("Temp measurement error! "); @@ -2298,18 +2306,29 @@ void Temperature::disable_all_heaters() { SERIAL_ECHOLNPGM("Short to GND"); else if (max6675_temp & 4) SERIAL_ECHOLNPGM("Short to VCC"); + #elif HAS_MAX31865 + if (fault_31865) { + maxref.clearFault(); + SERIAL_ECHOPAIR("MAX31865 Fault :(", fault_31865, ") >>"); + if (fault_31865 & MAX31865_FAULT_HIGHTHRESH) + SERIAL_ECHOLNPGM("RTD High Threshold"); + else if (fault_31865 & MAX31865_FAULT_LOWTHRESH) + SERIAL_ECHOLNPGM("RTD Low Threshold"); + else if (fault_31865 & MAX31865_FAULT_REFINLOW) + SERIAL_ECHOLNPGM("REFIN- > 0.85 x Bias"); + else if (fault_31865 & MAX31865_FAULT_REFINHIGH) + SERIAL_ECHOLNPGM("REFIN- < 0.85 x Bias - FORCE- open"); + else if (fault_31865 & MAX31865_FAULT_RTDINLOW) + SERIAL_ECHOLNPGM("REFIN- < 0.85 x Bias - FORCE- open"); + else if (fault_31865 & MAX31865_FAULT_OVUV) + SERIAL_ECHOLNPGM("Under/Over voltage"); + } #else SERIAL_ECHOLNPGM("MAX6675"); #endif // Thermocouple open - max6675_temp = 4 * ( - #if COUNT_6675 > 1 - hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX - #else - TERN(HEATER_1_USES_MAX6675, HEATER_1_MAX6675_TMAX, HEATER_0_MAX6675_TMAX) - #endif - ); + max6675_temp = 4 * MAX6675_SEL(HEATER_0_MAX6675_TMAX, HEATER_1_MAX6675_TMAX); } else max6675_temp >>= MAX6675_DISCARD_BITS; @@ -2319,13 +2338,11 @@ void Temperature::disable_all_heaters() { max6675_errors[hindex] = 0; } - #if ENABLED(MAX6675_IS_MAX31855) + #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855 if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature #endif - #if COUNT_6675 > 1 - max6675_temp_previous[hindex] = max6675_temp; - #endif + MAX6675_TEMP(hindex) = max6675_temp; return int(max6675_temp); } diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 4090b845d33a..edaa1c53843a 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -811,7 +811,7 @@ class Temperature { #if HAS_MAX6675 #define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) #if COUNT_6675 > 1 - #define HAS_MULTI_6675 + #define HAS_MULTI_6675 1 #define READ_MAX6675(N) read_max6675(N) #else #define READ_MAX6675(N) read_max6675() diff --git a/buildroot/share/PlatformIO/variants/archim/variant.h b/buildroot/share/PlatformIO/variants/archim/variant.h index 179a13735376..11f8f63bfb59 100644 --- a/buildroot/share/PlatformIO/variants/archim/variant.h +++ b/buildroot/share/PlatformIO/variants/archim/variant.h @@ -55,10 +55,10 @@ extern "C"{ *----------------------------------------------------------------------------*/ // Number of pins defined in PinDescription array -#define PINS_COUNT (79U) -#define NUM_DIGITAL_PINS (66U) -#define NUM_ANALOG_INPUTS (12U) -#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) +#define PINS_COUNT 79 +#define NUM_DIGITAL_PINS 66 +#define NUM_ANALOG_INPUTS 12 +#define analogInputToDigitalPin(p) ((p < 12) ? (p) + 54 : -1) #define digitalPinToPort(P) ( g_APinDescription[P].pPort ) #define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin ) diff --git a/platformio.ini b/platformio.ini index 15b8d4c23a64..360a02f4209a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -222,7 +222,7 @@ HAS_L64XX = Arduino-L6470@0.8.0 src_filter=+ + + NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 src_filter=+ -MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 +MAX6675_._IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 USES_LIQUIDCRYSTAL = LiquidCrystal@1.5.0 USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 From f4e9f3654e9be66b5a2234642ccf736a8467dee3 Mon Sep 17 00:00:00 2001 From: LinFor Date: Thu, 12 Nov 2020 01:27:45 +0300 Subject: [PATCH 140/443] Fix MAX6675 SPI init, conflicts (#20086) --- Marlin/src/MarlinCore.cpp | 8 ++++++++ Marlin/src/module/temperature.cpp | 19 +------------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 44abf722f21a..f38ba35dd514 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -991,6 +991,14 @@ void setup() { SETUP_RUN(HAL_init()); + // Init and disable SPI thermocouples + #if HEATER_0_USES_MAX6675 + OUT_WRITE(MAX6675_SS_PIN, HIGH); // Disable + #endif + #if HEATER_1_USES_MAX6675 + OUT_WRITE(MAX6675_SS2_PIN, HIGH); // Disable + #endif + #if HAS_L64XX SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 22c92fe4484c..167b35cc2bac 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1799,22 +1799,7 @@ void Temperature::init() { INIT_FAN_PIN(CONTROLLER_FAN_PIN); #endif - #if MAX6675_SEPARATE_SPI - - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - - max6675_spi.init(); - - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS_PIN, HIGH); - - #endif - - #if HEATER_1_USES_MAX6675 - OUT_WRITE(MAX6675_SS2_PIN, HIGH); - #endif + TERN_(MAX6675_SEPARATE_SPI, max6675_spi.init()); HAL_adc_init(); @@ -2277,9 +2262,7 @@ void Temperature::disable_all_heaters() { spiInit(MAX6675_SPEED_BITS); #endif - MAX6675_SET_OUTPUT(); MAX6675_WRITE(LOW); // enable TT_MAX6675 - DELAY_NS(100); // Ensure 100ns delay // Read a big-endian temperature value From 2282801172abdbce0b26b993d8d3be9ab4ae3649 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Nov 2020 16:58:34 -0600 Subject: [PATCH 141/443] Add HOME_Z_FIRST option (#20113) --- Marlin/Configuration_adv.h | 1 + Marlin/src/gcode/calibrate/G28.cpp | 13 ++++--------- Marlin/src/inc/Conditionals_LCD.h | 4 ++++ Marlin/src/inc/SanityCheck.h | 6 +++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d05388075a9f..0acf2e5f770c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -660,6 +660,7 @@ //#define QUICK_HOME // If G28 contains XY do a diagonal move first //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X +//#define HOME_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first // @section bltouch diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index a91dd82a2a61..ef39290d2d38 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -313,7 +313,7 @@ void GcodeSuite::G28() { home_all = homeX == homeY && homeX == homeZ, // All or None doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ; - #if Z_HOME_DIR > 0 // If homing away from BED do Z first + #if ENABLED(HOME_Z_FIRST) if (doZ) homeaxis(Z_AXIS); @@ -373,18 +373,13 @@ void GcodeSuite::G28() { TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); // Home Z last if homing towards the bed - #if Z_HOME_DIR < 0 - + #if DISABLED(HOME_Z_FIRST) if (doZ) { TERN_(BLTOUCH, bltouch.init()); - TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS)); - probe.move_z_after_homing(); - - } // doZ - - #endif // Z_HOME_DIR < 0 + } + #endif sync_plan_position(); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 865365c0ee52..0bb98e9e061a 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -778,6 +778,10 @@ #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #endif +#if Z_HOME_DIR > 0 + #define HOME_Z_FIRST // If homing away from BED do Z first +#endif + /** * Set granular options based on the specific type of leveling */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 10f4676aa930..0f98a8badf75 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1548,7 +1548,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. */ #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY." + #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY." #endif /** @@ -1965,6 +1965,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "Enable USE_ZMAX_PLUG when homing Z to MAX." #endif +#if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING) + #error "HOME_Z_FIRST can't be used when homing Z with a probe." +#endif + // Dual/multiple endstops requirements #if ENABLED(X_DUAL_ENDSTOPS) #if !X2_USE_ENDSTOP From 0cccc60409c4b237d747fdf49b648f1cbed7ddde Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Nov 2020 16:58:09 -0600 Subject: [PATCH 142/443] Terse sanity messages --- Marlin/src/inc/SanityCheck.h | 470 +++++++++++++++++------------------ 1 file changed, 230 insertions(+), 240 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0f98a8badf75..2ef4cbb78528 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -79,9 +79,9 @@ * Warnings for old configurations */ #ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." + #error "MOTHERBOARD is required." #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) - #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." + #error "X_BED_SIZE and Y_BED_SIZE are now required!" #elif WATCH_TEMP_PERIOD > 500 #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) @@ -93,41 +93,41 @@ #elif defined(X_HOME_RETRACT_MM) #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." #elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH). Please update your configuration." + #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)." #elif defined(SD_DETECT_INVERTED) - #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH). Please update your configuration." + #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)." #elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." + #error "BTENABLED is now BLUETOOTH." #elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." + #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME." #elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." + #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE." #elif defined(USE_AUTOMATIC_VERSIONING) - #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." + #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE." #elif defined(SDSLOW) #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." #elif defined(SDEXTRASLOW) #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." #elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." + #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR." #elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL. Please update your configuration." + #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL." #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." + #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE." #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." #elif defined(PID_PARAMS_PER_EXTRUDER) #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) - #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." + #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed." #elif defined(SERVO_ENDSTOP_ANGLES) #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #elif defined(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." + #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR." #elif defined(DEFAULT_XYJERK) #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." #elif defined(XY_TRAVEL_SPEED) @@ -135,57 +135,57 @@ #elif defined(PROBE_SERVO_DEACTIVATION_DELAY) #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." #elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." + #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY." #elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." + #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE." #elif ENABLED(FILAMENT_CHANGE_FEATURE) - #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." + #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE." #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS) - #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT." #elif defined(FILAMENT_CHANGE_Z_ADD) - #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT." #elif defined(FILAMENT_CHANGE_XY_FEEDRATE) - #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE." #elif defined(FILAMENT_CHANGE_Z_FEEDRATE) - #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE." #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS) - #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT." #elif defined(PAUSE_PARK_Z_ADD) - #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT." #elif defined(PAUSE_PARK_XY_FEEDRATE) - #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." + #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE." #elif defined(PAUSE_PARK_Z_FEEDRATE) - #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." + #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE." #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE) - #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE." #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) - #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH." #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE." #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." + #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE." #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH." #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." + #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH." #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) - #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." + #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT." #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." + #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS." #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) - #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." + #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT." #elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." + #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND." #elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." + #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED." #elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." + #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED." #elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." + #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND." #elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." + #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED." #elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." + #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED." #elif defined(ENDSTOPS_ONLY_FOR_HOMING) #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #elif defined(HOMING_FEEDRATE) @@ -193,111 +193,111 @@ #elif defined(MANUAL_HOME_POSITIONS) #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." #elif defined(PID_ADD_EXTRUSION_RATE) - #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." + #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default." #elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." + #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT." #elif defined(MIN_Z_HEIGHT_FOR_HOMING) - #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." + #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT." #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) - #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." + #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES." #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) - #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." + #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES." #elif defined(MANUAL_BED_LEVELING) - #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration." + #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING." #elif defined(MESH_HOME_SEARCH_Z) - #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration." + #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE." #elif defined(MANUAL_PROBE_Z_RANGE) - #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." + #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE." #elif !defined(MIN_STEPS_PER_SEGMENT) - #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. + #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)." #elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." + #error "MIN_STEPS_PER_SEGMENT must be at least 1." #elif defined(PREVENT_DANGEROUS_EXTRUDE) - #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." + #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION." #elif defined(SCARA) - #error "SCARA is now MORGAN_SCARA. Please update your configuration." + #error "SCARA is now MORGAN_SCARA." #elif defined(ENABLE_AUTO_BED_LEVELING) #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #elif defined(AUTO_BED_LEVELING_FEATURE) #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." + #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y." #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]." #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) - #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]." #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) - #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]." #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) - #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]." #elif defined(UBL_G26_MESH_VALIDATION) - #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION." #elif defined(UBL_MESH_EDIT_ENABLED) - #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION." #elif defined(UBL_MESH_EDITING) - #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION." #elif defined(BLTOUCH_HEATERS_OFF) - #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration." + #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF." #elif defined(BLTOUCH_V3) - #error "BLTOUCH_V3 is obsolete. Please update your configuration." + #error "BLTOUCH_V3 is obsolete." #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE) - #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete. Please update your configuration." + #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete." #elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." + #error "BEEPER is now BEEPER_PIN." #elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." + #error "SDCARDDETECT is now SD_DETECT_PIN." #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE) - #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions." + #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN." #elif defined(LCD_PIN_BL) - #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions." + #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN." #elif defined(LCD_PIN_RESET) - #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." + #error "LCD_PIN_RESET is now LCD_RESET_PIN." #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) - #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." + #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN." #elif defined(PID_FAN_SCALING) && !HAS_FAN #error "PID_FAN_SCALING needs at least one fan enabled." #elif defined(min_software_endstops) || defined(max_software_endstops) - #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." + #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS." #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." #elif defined(CONTROLLERFAN_PIN) - #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN." #elif defined(CONTROLLERFAN_SPEED) - #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE." #elif defined(CONTROLLERFAN_SECS) - #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME." #elif defined(MIN_RETRACT) - #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." + #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT." #elif defined(ADVANCE) - #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." + #error "ADVANCE is now LIN_ADVANCE." #elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." + #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO." #elif defined(NEOPIXEL_RGBW_LED) - #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." + #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED." #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead." #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS) #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead." #elif defined(UBL_MESH_INSET) - #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." + #error "UBL_MESH_INSET is now just MESH_INSET." #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y) - #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration." + #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]." #elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y) - #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." + #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it." #elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y) - #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." + #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it." #elif defined(MIN_PROBE_EDGE) - #error "MIN_PROBE_EDGE is now called PROBING_MARGIN. Please update your configuration." + #error "MIN_PROBE_EDGE is now called PROBING_MARGIN." #elif defined(MIN_PROBE_EDGE_LEFT) - #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT. Please update your configuration." + #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT." #elif defined(MIN_PROBE_EDGE_RIGHT) - #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT. Please update your configuration." + #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT." #elif defined(MIN_PROBE_EDGE_FRONT) - #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT. Please update your configuration." + #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT." #elif defined(MIN_PROBE_EDGE_BACK) - #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK. Please update your configuration." + #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK." #elif defined(LEFT_PROBE_BED_POSITION) #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead." #elif defined(RIGHT_PROBE_BED_POSITION) @@ -307,243 +307,229 @@ #elif defined(BACK_PROBE_BED_POSITION) #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead." #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY) - #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration." + #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY." #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE) - #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." + #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE." #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) - #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." + #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES." #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) - #error "K1 is now PID_K1. Please update your configuration." + #error "K1 is now PID_K1." #elif defined(PROBE_DOUBLE_TOUCH) - #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." + #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING." #elif defined(ANET_KEYPAD_LCD) - #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." + #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD." #elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." + #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)." #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) - #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." + #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN." #elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(STEALTHCHOP) - #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h." + #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)." #elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." + #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." #elif defined(HAVE_TMC2208) - #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." + #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." #elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." + #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470." #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \ || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \ || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \ || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." + #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." #elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) || defined(Z3_IS_TMC2208) \ || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." + #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." #elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) || defined(Z3_IS_L6470) \ || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) || defined(E6_IS_L6470) || defined(E7_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." + #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470." #elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." + #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS." #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH." #elif defined(LEVEL_CORNERS_INSET) - #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB . Please update your Configuration.h." + #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB." #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB) - #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h." + #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values." #elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." + #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION." #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." + #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM." #elif defined(JUNCTION_ACCELERATION_FACTOR) #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." #elif defined(JUNCTION_ACCELERATION) #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." #elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD." #elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL." #elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE." #elif defined(ENDSTOP_NOISE_FILTER) - #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration." + #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]." #elif defined(RETRACT_ZLIFT) - #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h." + #error "RETRACT_ZLIFT is now RETRACT_ZRAISE." #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT) - #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE." #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE) - #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE." #elif defined(SINGLENOZZLE_SWAP_LENGTH) - #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration." + #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH." #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED) - #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration." + #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED." #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED) - #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration." + #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED." #elif defined(SINGLENOZZLE_SWAP_PARK) - #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration." + #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK." #elif defined(SINGLENOZZLE_TOOLCHANGE_XY) - #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration." + #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY." #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE) - #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration." + #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE." #elif defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE." #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE) - #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE." #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0 - #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration." + #error "G0_FEEDRATE is now used to set the G0 feedrate." #elif defined(MBL_Z_STEP) - #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration." + #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP." #elif defined(CHDK) - #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h." -#elif defined(MAX6675_SS) - #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." -#elif defined(MAX6675_SS2) - #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." + #error "CHDK is now CHDK_PIN." +#elif defined(MAX6675_SS) || defined(MAX6675_SS2) + #error "MAX6675_SS / MAX6675_SS2 is now MAX6675_SS_PIN / MAX6675_SS2_PIN." #elif defined(MAX31865_SENSOR_OHMS) - #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0. Please update your configuration." + #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0." #elif defined(MAX31865_CALIBRATION_OHMS) - #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0. Please update your configuration." + #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0." #elif defined(SPINDLE_LASER_ENABLE) - #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE." #elif defined(SPINDLE_LASER_ENABLE_PIN) - #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins." + #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN." #elif defined(SPINDLE_DIR_CHANGE) - #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h." + #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR." #elif defined(SPINDLE_STOP_ON_DIR_CHANGE) - #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h." + #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP." #elif defined(SPINDLE_LASER_ACTIVE_HIGH) - #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE." #elif defined(SPINDLE_LASER_ENABLE_INVERT) - #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE." #elif defined(CUTTER_POWER_DISPLAY) - #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT. Please update your Configuration_adv.h." + #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT." #elif defined(CHAMBER_HEATER_PIN) - #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins." + #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN." #elif defined(TMC_Z_CALIBRATION) - #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION. Please update your configuration." + #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION." #elif defined(Z_MIN_PROBE_ENDSTOP) - #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h." + #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it." #elif defined(DUAL_NOZZLE_DUPLICATION_MODE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration." + #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION." #elif defined(MENU_ITEM_CASE_LIGHT) - #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU. Please update your configuration." + #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU." #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT. Please update your Configuration_adv.h." + #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT." #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE) - #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION. Please update your Configuration_adv.h." + #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION." #elif defined(USB_SD_DISABLED) - #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE. Please update your Configuration_adv.h." + #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE." #elif defined(USB_SD_ONBOARD) #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead." #elif defined(PSU_ACTIVE_HIGH) - #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE. Please update your configuration." + #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE." #elif POWER_SUPPLY == 1 #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'." #elif POWER_SUPPLY == 2 #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'." #elif defined(POWER_SUPPLY) - #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h." + #error "POWER_SUPPLY is now obsolete. Please remove it." #elif defined(MKS_ROBIN_TFT) - #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration." + #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT." #elif defined(SDPOWER) - #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." + #error "SDPOWER is now SDPOWER_PIN." #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) - #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h." + #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them." #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X) - #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting. Please update your configuration." + #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting." #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER) - #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET. Please update your configuration." + #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET." #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y) - #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them from Configuration.h." + #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them." #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X) - #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY. Please update your Configuration_adv.h." + #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY." #elif defined(JUNCTION_DEVIATION) - #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it from Configuration.h." + #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it." #elif defined(BABYSTEP_MULTIPLICATOR) - #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]. Please update Configuration_adv.h." + #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]." #elif defined(LULZBOT_TOUCH_UI) - #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE. Please update your configuration." + #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE." #elif defined(PS_DEFAULT_OFF) - #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF. Please update your configuration." + #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF." #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH) - #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT. Please update Configuration_adv.h." + #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT." #elif defined(FILAMENT_UNLOAD_DELAY) - #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY. Please update Configuration_adv.h." + #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY." #elif defined(HOME_USING_SPREADCYCLE) - #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it from Configuration_adv.h." + #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it." #elif defined(DGUS_LCD) - #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY). Please update your configuration." + #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)." #elif defined(DGUS_SERIAL_PORT) - #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT." #elif defined(DGUS_BAUDRATE) - #error "DGUS_BAUDRATE is now LCD_BAUDRATE. Please update your configuration." + #error "DGUS_BAUDRATE is now LCD_BAUDRATE." #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS) - #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS. Please update your configuration." -#elif defined(DGUS_SERIAL_PORT) - #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS." #elif defined(ANYCUBIC_LCD_SERIAL_PORT) - #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT." #elif defined(INTERNAL_SERIAL_PORT) - #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT. Please update your configuration." -#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) - #error "X_DUAL_ENDSTOPS_ADJUSTMENT is now X2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." -#elif defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) - #error "Y_DUAL_ENDSTOPS_ADJUSTMENT is now Y2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." -#elif defined(Z_DUAL_ENDSTOPS_ADJUSTMENT) - #error "Z_DUAL_ENDSTOPS_ADJUSTMENT is now Z2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT." +#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT) + #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT." #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3) - #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT." #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4) - #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT." #elif defined(Z_DUAL_STEPPER_DRIVERS) - #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2. Please update Configuration_adv.h." + #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2." #elif defined(Z_TRIPLE_STEPPER_DRIVERS) - #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3. Please update Configuration_adv.h." + #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3." #elif defined(Z_QUAD_STEPPER_DRIVERS) - #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4. Please update Configuration_adv.h." -#elif defined(Z_DUAL_ENDSTOPS) - #error "Z_DUAL_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." -#elif defined(Z_TRIPLE_ENDSTOPS) - #error "Z_TRIPLE_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." -#elif defined(Z_QUAD_ENDSTOPS) - #error "Z_QUAD_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." + #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4." +#elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS) + #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS." #elif defined(DUGS_UI_MOVE_DIS_OPTION) - #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION. Please update Configuration_adv.h." + #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION." #elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN) - #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN. Make sure your pins are up to date." + #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN." #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN) - #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN. Make sure your pins are up to date." + #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN." #elif defined(HOMING_BACKOFF_MM) - #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM. Please update Configuration_adv.h." + #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM." #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM) - #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM. Please update Configuration_adv.h." + #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM." #elif defined(DIGIPOT_I2C) - #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018). Please update Configuration_adv.h." + #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)." #elif defined(TOUCH_BUTTONS) - #error "TOUCH_BUTTONS is now TOUCH_SCREEN. Please update your Configuration.h." -#elif defined(LCD_FULL_PIXEL_HEIGHT) - #error "LCD_FULL_PIXEL_HEIGHT is deprecated and should be removed. Please update your Configuration.h." -#elif defined(LCD_FULL_PIXEL_WIDTH) - #error "LCD_FULL_PIXEL_WIDTH is deprecated and should be removed. Please update your Configuration.h." + #error "TOUCH_BUTTONS is now TOUCH_SCREEN." +#elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH) + #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed." #elif defined(FSMC_UPSCALE) - #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE. Please update your Configuration.h." + #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE." #elif defined(ANYCUBIC_TFT_MODEL) - #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA. Please update your Configuration.h." + #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA." #elif defined(EVENT_GCODE_SD_STOP) - #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT. Please update your Configuration.h." + #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT." #elif defined(GRAPHICAL_TFT_ROTATE_180) - #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180. Please update your Configuration.h." + #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180." #elif defined(FIL_RUNOUT_INVERTING) #if FIL_RUNOUT_INVERTING - #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH. Please update your Configuration.h." + #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH." #else - #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW. Please update your Configuration.h." + #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW." #endif #endif @@ -552,11 +538,11 @@ */ #if ENABLED(PROBE_TEMP_COMPENSATION) #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) - #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array). Please update Configuration_adv.h." + #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)." #elif !defined(PTC_PARK_POS) #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS." #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y) - #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array). Please update Configuration_adv.h." + #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)." #elif !defined(PTC_PROBE_POS) #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS." #endif @@ -587,9 +573,13 @@ * Serial */ #ifndef SERIAL_PORT - #error "SERIAL_PORT must be defined in Configuration.h" + #error "SERIAL_PORT must be defined." #elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT. Please update your configuration." + #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT." +#elif defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == SERIAL_PORT + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT." +#elif defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == SERIAL_PORT_2 + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2." #endif #if !(defined(__AVR__) && defined(USBCON)) #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024 @@ -845,7 +835,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif DISABLED(NOZZLE_PARK_FEATURE) #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE) - #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE. Please add it to Configuration_adv.h." + #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE." #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER) @@ -892,24 +882,24 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #ifndef TOOLCHANGE_FS_LENGTH - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH." #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED." #elif !defined(TOOLCHANGE_FS_PRIME_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED." #endif #endif #if ENABLED(TOOLCHANGE_PARK) #ifndef TOOLCHANGE_PARK_XY - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration." + #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY." #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE) - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration." + #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE." #endif #endif #ifndef TOOLCHANGE_ZRAISE - #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration_adv.h." + #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1." #endif #elif ENABLED(MK2_MULTIPLEXER) @@ -922,7 +912,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Sanity checking for the Průša MK2 Multiplexer */ #ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." + #error "SNMM is now MK2_MULTIPLEXER." #endif /** @@ -1221,7 +1211,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(EXT_SOLENOID) #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." #elif !HAS_SOLENOID_1 - #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." + #error "SOLENOID_PROBE requires SOL1_PIN." #endif #endif @@ -1388,7 +1378,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if IS_SCARA #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." #elif DISABLED(EEPROM_SETTINGS) - #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." + #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." #elif !defined(RESTORE_LEVELING_AFTER_G28) @@ -1777,22 +1767,22 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER) - #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN. Please add it to your configuration." + #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN." #endif #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2)) - #error "CHAMBER_FAN_MODE must be between 0 and 2. Please update your Configuration_adv.h." + #error "CHAMBER_FAN_MODE must be between 0 and 2." #endif #if ENABLED(CHAMBER_VENT) #ifndef CHAMBER_VENT_SERVO_NR - #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO. Update your Configuration_adv.h." + #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO." #elif !NUM_SERVOS #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)." #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS." #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR - #error "CHAMBER SERVO is already used by BLTOUCH. Please change." + #error "CHAMBER SERVO is already used by BLTOUCH." #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) #error "SERVO0_PIN must be defined for your Heated Chamber vent servo." #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) @@ -1806,7 +1796,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #if TEMP_SENSOR_PROBE #if !PIN_EXISTS(TEMP_PROBE) - #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN. Please add it to your configuration." + #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." #elif !HAS_TEMP_ADC_PROBE #error "TEMP_PROBE_PIN must be an ADC pin." #elif !ENABLED(FIX_MOUNTED_PROBE) @@ -1819,9 +1809,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif #if MAX6675_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0)) - #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set in Configuration.h if TEMP_SENSOR_0 is MAX31865." + #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865." #elif MAX6675_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1)) - #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set in Configuration.h if TEMP_SENSOR_1 is MAX31865." + #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865." #endif /** @@ -2328,17 +2318,17 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal */ #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == SERIAL_PORT - #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT. Please update your configuration." + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT." #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2 - #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2. Please update your configuration." + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2." #endif #else #if HAS_DGUS_LCD - #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined." #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON) - #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined." #elif ENABLED(MALYAN_LCD) - #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined." #endif #endif @@ -2827,7 +2817,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) - #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration." + #error "PRINTCOUNTER requires EEPROM_SETTINGS." #endif #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) @@ -2972,11 +2962,11 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1 #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION." #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION) - #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h." + #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION." #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY) - #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h." + #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS." #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS) - #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h." + #error "PHOTO_SWITCH_MS is required with CHDK_PIN." #elif defined(PHOTO_RETRACT_MM) static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0."); #endif @@ -3038,16 +3028,16 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if HAS_CUTTER #ifndef CUTTER_POWER_UNIT - #error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h." + #error "CUTTER_POWER_UNIT is required with a spindle or laser." #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO) - #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO. Please update your Configuration_adv.h." + #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO." #endif #if ENABLED(LASER_POWER_INLINE) #if ENABLED(SPINDLE_CHANGE_DIR) #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible." #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER) - #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER. Please update your Configuration_adv.h." + #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER." #endif #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) #if DISABLED(SPINDLE_LASER_PWM) From 37b56e09a3a801a55eface753e041582fa38570d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 12 Nov 2020 00:10:01 +0000 Subject: [PATCH 143/443] [cron] Bump distribution date (2020-11-12) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index bc74acfd7c37..ca6885610622 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-11" + #define STRING_DISTRIBUTION_DATE "2020-11-12" #endif /** From eb3d6a5333c98a9d6e1a434df34feaea1f1570ef Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 13 Nov 2020 00:10:25 +0000 Subject: [PATCH 144/443] [cron] Bump distribution date (2020-11-13) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ca6885610622..3bf908a15d79 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-12" + #define STRING_DISTRIBUTION_DATE "2020-11-13" #endif /** From 288eb06708b4d92d55bdea107eb06e1255d70c9d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 12 Nov 2020 20:26:49 -0800 Subject: [PATCH 145/443] UTF longname followup (#20115) --- Marlin/src/sd/SdBaseFile.cpp | 63 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index acc5ba17f27c..db2a9e2de9c5 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1109,8 +1109,8 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. uint16_t idx = (n + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding - longFilename[idx] = utf16_ch & 0xFF; - longFilename[idx+1] = (utf16_ch >> 8) & 0xFF; + longFilename[idx] = utf16_ch & 0xFF; + longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; #else // Replace all multibyte characters to '_' longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); @@ -1122,45 +1122,44 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { } } - // Return if normal file or subdirectory + // Post-process normal file or subdirectory longname, if any if (DIR_IS_FILE_OR_SUBDIR(dir)) { #if ENABLED(UTF_FILENAME_SUPPORT) - // Convert filename from utf-16 to utf-8 as Marlin expects #if LONG_FILENAME_CHARSIZE > 2 // Add warning for developers for currently not supported 3-byte cases (Conversion series of 2-byte // codepoints to 3-byte in-place will break the rest of filename) #error "Currently filename re-encoding is done in-place. It may break the remaining chars to use 3-byte codepoints." #endif - uint16_t currentPos = 0; - LOOP_L_N(i, (LONG_FILENAME_LENGTH / 2)) { - uint16_t idx = i * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding - - uint16_t utf16_ch = longFilename[idx] | (longFilename[idx + 1] << 8); - if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_' - longFilename[currentPos++] = '_'; - else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte utf-8 char - longFilename[currentPos++] = utf16_ch & 0x007F; - else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte utf-8 char - longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x1F); - longFilename[currentPos++] = 0x80 | (utf16_ch & 0x3F); - } - else { - #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte utf-8 char - longFilename[currentPos++] = 0xE0 | ((utf16_ch >> 12) & 0x0F); - longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x3F); - longFilename[currentPos++] = 0xC0 | (utf16_ch & 0x3F); - #else // Encode as '_' - longFilename[currentPos++] = '_'; - #endif - } - if (0 == utf16_ch) break; // End of filename - } - return currentPos; - #else - return n; + // Is there a long filename to decode? + if (longFilename) { + // Reset n to the start of the long name + n = 0; + for (uint16_t idx = 0; idx < (LONG_FILENAME_LENGTH) / 2; idx += 2) { // idx is fixed since FAT LFN always contains UTF-16LE encoding + uint16_t utf16_ch = longFilename[idx] | (longFilename[idx + 1] << 8); + if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_' + longFilename[n++] = '_'; + else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte UTF-8 char + longFilename[n++] = utf16_ch & 0x007F; + else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte UTF-8 char + longFilename[n++] = 0xC0 | ((utf16_ch >> 6) & 0x1F); + longFilename[n++] = 0x80 | ( utf16_ch & 0x3F); + } + else { + #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte UTF-8 char + longFilename[n++] = 0xE0 | ((utf16_ch >> 12) & 0x0F); + longFilename[n++] = 0xC0 | ((utf16_ch >> 6) & 0x3F); + longFilename[n++] = 0xC0 | ( utf16_ch & 0x3F); + #else // Encode as '_' + longFilename[n++] = '_'; + #endif + } + if (0 == utf16_ch) break; // End of filename + } // idx + } // longFilename #endif - } + return n; + } // DIR_IS_FILE_OR_SUBDIR } } From 99c377b4e4d982c4e8afe388351020efd042a543 Mon Sep 17 00:00:00 2001 From: LinFor Date: Fri, 13 Nov 2020 07:49:19 +0300 Subject: [PATCH 146/443] Fix UTF filename scroll (#20121) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 2 +- Marlin/src/lcd/fontutils.cpp | 42 ++++++++++++++++++++++----- Marlin/src/lcd/fontutils.h | 4 +++ Marlin/src/lcd/marlinui.cpp | 14 ++++----- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 480721e56af9..4e265a8ee4df 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -461,8 +461,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { + const uint8_t maxlen = LCD_WIDTH - isDir; if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); - constexpr uint8_t maxlen = LCD_WIDTH - 1; const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 4aaf62184423..65c8c06409a1 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -75,6 +75,11 @@ int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, return -1; } +/* Returns true if passed byte is first byte of UTF-8 char sequence */ +static inline bool utf8_is_start_byte_of_char(const uint8_t b) { + return 0x80 != (b & 0xC0); +} + /* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences and returns the pointer to the next character */ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { @@ -131,8 +136,8 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t p++; } #endif - else if (0x80 == (0xC0 & valcur)) - for (; 0x80 == (0xC0 & valcur); ) { p++; valcur = cb_read_byte(p); } + else if (!utf8_is_start_byte_of_char(valcur)) + for (; !utf8_is_start_byte_of_char(valcur); ) { p++; valcur = cb_read_byte(p); } else for (; 0xFC < (0xFE & valcur); ) { p++; valcur = cb_read_byte(p); } @@ -143,12 +148,12 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t static inline uint8_t utf8_strlen_cb(const char *pstart, read_byte_cb_t cb_read_byte) { uint8_t cnt = 0; - uint8_t *pnext = (uint8_t *)pstart; + uint8_t *p = (uint8_t *)pstart; for (;;) { - wchar_t ch; - pnext = get_utf8_value_cb(pnext, cb_read_byte, &ch); - if (!ch) break; - cnt++; + const uint8_t b = cb_read_byte(p); + if (!b) break; + if (utf8_is_start_byte_of_char(b)) cnt++; + p++; } return cnt; } @@ -160,3 +165,26 @@ uint8_t utf8_strlen(const char *pstart) { uint8_t utf8_strlen_P(PGM_P pstart) { return utf8_strlen_cb(pstart, read_byte_rom); } + +static inline uint8_t utf8_byte_pos_by_char_num_cb(const char *pstart, read_byte_cb_t cb_read_byte, const uint8_t charnum) { + uint8_t *p = (uint8_t *)pstart; + uint8_t char_idx = 0; + uint8_t byte_idx = 0; + for (;;) { + const uint8_t b = cb_read_byte(p + byte_idx); + if (!b) return byte_idx; // Termination byte of string + if (utf8_is_start_byte_of_char(b)) { + char_idx++; + if (char_idx == charnum + 1) return byte_idx; + } + byte_idx++; + } +} + +uint8_t utf8_byte_pos_by_char_num(const char *pstart, const uint8_t charnum) { + return utf8_byte_pos_by_char_num_cb(pstart, read_byte_ram, charnum); +} + +uint8_t utf8_byte_pos_by_char_num_P(PGM_P pstart, const uint8_t charnum) { + return utf8_byte_pos_by_char_num_cb(pstart, read_byte_rom, charnum); +} diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 74c4a87fb9d3..04ff81148f96 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -41,3 +41,7 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t /* Returns length of string in CHARACTERS, NOT BYTES */ uint8_t utf8_strlen(const char *pstart); uint8_t utf8_strlen_P(PGM_P pstart); + +/* Returns start byte position of desired char number */ +uint8_t utf8_byte_pos_by_char_num(const char *pstart, const uint8_t charnum); +uint8_t utf8_byte_pos_by_char_num_P(PGM_P pstart, const uint8_t charnum); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 17c3c3edfede..457d3cefd76f 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -208,10 +208,13 @@ millis_t MarlinUI::next_button_update_ms; // = 0 filename_scroll_pos = 0; // Reset scroll to the start lcd_status_update_delay = 8; // Don't scroll right away } - outstr += filename_scroll_pos; + // Advance byte position corresponding to filename_scroll_pos char position + outstr += TERN(UTF_FILENAME_SUPPORT, utf8_byte_pos_by_char_num(outstr, filename_scroll_pos), filename_scroll_pos); } #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge + theCard.longFilename[ + TERN(UTF_FILENAME_SUPPORT, utf8_byte_pos_by_char_num(theCard.longFilename, maxlen), maxlen) + ] = '\0'; // cutoff at screen edge #endif } return outstr; @@ -1006,11 +1009,8 @@ void MarlinUI::update() { // If scrolling of long file names is enabled and we are in the sd card menu, // cause a refresh to occur until all the text has scrolled into view. if (currentScreen == menu_media && !lcd_status_update_delay--) { - lcd_status_update_delay = 4; - if (++filename_scroll_pos > filename_scroll_max) { - filename_scroll_pos = 0; - lcd_status_update_delay = 12; - } + lcd_status_update_delay = ++filename_scroll_pos >= filename_scroll_max ? 12 : 4; // Long delay at end and start + if (filename_scroll_pos > filename_scroll_max) filename_scroll_pos = 0; refresh(LCDVIEW_REDRAW_NOW); RESET_STATUS_TIMEOUT(); } From 1b0a5abd73d162b68b2881486630f60a1e9e7825 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Thu, 12 Nov 2020 23:54:18 -0500 Subject: [PATCH 147/443] G34 Z stepper locking (#20091) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/calibrate/G28.cpp | 5 + Marlin/src/gcode/calibrate/G34_M422.cpp | 622 +++++++++++++----------- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/inc/SanityCheck.h | 7 +- platformio.ini | 1 + 6 files changed, 341 insertions(+), 298 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index ef39290d2d38..c0bc179869e2 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -375,6 +375,11 @@ void GcodeSuite::G28() { // Home Z last if homing towards the bed #if DISABLED(HOME_Z_FIRST) if (doZ) { + #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) + stepper.set_all_z_lock(false); + stepper.set_separate_multi_axis(false); + #endif + TERN_(BLTOUCH, bltouch.init()); TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS)); probe.move_z_after_homing(); diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 5e1ec5b961ab..8d3dd0d06b23 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(Z_STEPPER_AUTO_ALIGN) +#if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) #include "../../feature/z_stepper_align.h" @@ -51,364 +51,398 @@ /** * G34: Z-Stepper automatic alignment * - * I - * T - * A - * R points based on current probe offsets + * Manual stepper lock controls (reset by G28): + * L Unlock all steppers + * Z<1-4> Z stepper to lock / unlock + * S 0=UNLOCKED 1=LOCKED. If omitted, assume LOCKED. + * + * Examples: + * G34 Z1 ; Lock Z1 + * G34 L Z2 ; Unlock all, then lock Z2 + * G34 Z2 S0 ; Unlock Z2 + * + * With Z_STEPPER_AUTO_ALIGN: + * I Number of tests. If omitted, Z_STEPPER_ALIGN_ITERATIONS. + * T Target Accuracy factor. If omitted, Z_STEPPER_ALIGN_ACC. + * A Provide an Amplification value. If omitted, Z_STEPPER_ALIGN_AMP. + * R Flag to recalculate points based on current probe offsets */ void GcodeSuite::G34() { DEBUG_SECTION(log_G34, "G34", DEBUGGING(LEVELING)); if (DEBUGGING(LEVELING)) log_machine_info(); - do { // break out on error - - #if NUM_Z_STEPPER_DRIVERS == 4 - SERIAL_ECHOLNPGM("Alignment for 4 steppers is Experimental!"); - #elif NUM_Z_STEPPER_DRIVERS > 4 - SERIAL_ECHOLNPGM("Alignment not supported for over 4 steppers"); - break; - #endif - - const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); - if (!WITHIN(z_auto_align_iterations, 1, 30)) { - SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); - break; + planner.synchronize(); // Prevent damage + + const bool seenL = parser.seen('L'); + if (seenL) stepper.set_all_z_lock(false); + + const bool seenZ = parser.seenval('Z'); + if (seenZ) { + const bool state = parser.boolval('S', true); + switch (parser.intval('Z')) { + case 1: stepper.set_z1_lock(state); break; + case 2: stepper.set_z2_lock(state); break; + #if NUM_Z_STEPPER_DRIVERS >= 3 + case 3: stepper.set_z3_lock(state); break; + #if NUM_Z_STEPPER_DRIVERS >= 4 + case 4: stepper.set_z4_lock(state); break; + #endif + #endif } + } - const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); - if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { - SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); - break; - } + if (seenL || seenZ) { + stepper.set_separate_multi_axis(seenZ); + return; + } - const float z_auto_align_amplification = - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - Z_STEPPER_ALIGN_AMP; - #else - parser.floatval('A', Z_STEPPER_ALIGN_AMP); - if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { - SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); - break; - } + #if ENABLED(Z_STEPPER_AUTO_ALIGN) + do { // break out on error + + #if NUM_Z_STEPPER_DRIVERS == 4 + SERIAL_ECHOLNPGM("Alignment for 4 steppers is Experimental!"); + #elif NUM_Z_STEPPER_DRIVERS > 4 + SERIAL_ECHOLNPGM("Alignment not supported for over 4 steppers"); + break; #endif - if (parser.seen('R')) z_stepper_align.reset_to_default(); + const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); + if (!WITHIN(z_auto_align_iterations, 1, 30)) { + SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); + break; + } - const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; + const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); + if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { + SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); + break; + } - // Wait for planner moves to finish! - planner.synchronize(); + const float z_auto_align_amplification = TERN(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); + if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { + SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); + break; + } - // Disable the leveling matrix before auto-aligning - #if HAS_LEVELING - TERN_(RESTORE_LEVELING_AFTER_G34, const bool leveling_was_active = planner.leveling_active); - set_bed_leveling_enabled(false); - #endif + if (parser.seen('R')) z_stepper_align.reset_to_default(); - TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); + const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - // Always home with tool 0 active - #if HAS_MULTI_HOTEND - const uint8_t old_tool_index = active_extruder; - tool_change(0, true); - #endif + // Disable the leveling matrix before auto-aligning + #if HAS_LEVELING + TERN_(RESTORE_LEVELING_AFTER_G34, const bool leveling_was_active = planner.leveling_active); + set_bed_leveling_enabled(false); + #endif - TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false)); - - // In BLTOUCH HS mode, the probe travels in a deployed state. - // Users of G34 might have a badly misaligned bed, so raise Z by the - // length of the deployed pin (BLTOUCH stroke < 7mm) - #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE)) - - // Compute a worst-case clearance height to probe from. After the first - // iteration this will be re-calculated based on the actual bed position - auto magnitude2 = [&](const uint8_t i, const uint8_t j) { - const xy_pos_t diff = z_stepper_align.xy[i] - z_stepper_align.xy[j]; - return HYPOT2(diff.x, diff.y); - }; - float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * SQRT( - #if NUM_Z_STEPPER_DRIVERS == 3 - _MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 0)) - #elif NUM_Z_STEPPER_DRIVERS == 4 - _MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 3), - magnitude2(3, 0), magnitude2(0, 2), magnitude2(1, 3)) - #else - magnitude2(0, 1) + TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); + + // Always home with tool 0 active + #if HAS_MULTI_HOTEND + const uint8_t old_tool_index = active_extruder; + tool_change(0, true); #endif - ); - // Home before the alignment procedure - if (!all_axes_known()) home_all_axes(); + TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false)); - // Move the Z coordinate realm towards the positive - dirty trick - current_position.z += z_probe * 0.5f; - sync_plan_position(); - // Now, the Z origin lies below the build plate. That allows to probe deeper, before run_z_probe throws an error. - // This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration. + // In BLTOUCH HS mode, the probe travels in a deployed state. + // Users of G34 might have a badly misaligned bed, so raise Z by the + // length of the deployed pin (BLTOUCH stroke < 7mm) + #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE)) - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N(NUM_Z_STEPPER_DRIVERS, 10000.0f, 10000.0f, 10000.0f, 10000.0f); - #else - float last_z_align_level_indicator = 10000.0f; - #endif - float z_measured[NUM_Z_STEPPER_DRIVERS] = { 0 }, - z_maxdiff = 0.0f, - amplification = z_auto_align_amplification; + // Compute a worst-case clearance height to probe from. After the first + // iteration this will be re-calculated based on the actual bed position + auto magnitude2 = [&](const uint8_t i, const uint8_t j) { + const xy_pos_t diff = z_stepper_align.xy[i] - z_stepper_align.xy[j]; + return HYPOT2(diff.x, diff.y); + }; + float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * SQRT( + #if NUM_Z_STEPPER_DRIVERS == 3 + _MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 0)) + #elif NUM_Z_STEPPER_DRIVERS == 4 + _MAX(magnitude2(0, 1), magnitude2(1, 2), magnitude2(2, 3), + magnitude2(3, 0), magnitude2(0, 2), magnitude2(1, 3)) + #else + magnitude2(0, 1) + #endif + ); - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - bool adjustment_reverse = false; - #endif + // Home before the alignment procedure + if (!all_axes_known()) home_all_axes(); - #if HAS_DISPLAY - PGM_P const msg_iteration = GET_TEXT(MSG_ITERATION); - const uint8_t iter_str_len = strlen_P(msg_iteration); - #endif + // Move the Z coordinate realm towards the positive - dirty trick + current_position.z += z_probe * 0.5f; + sync_plan_position(); + // Now, the Z origin lies below the build plate. That allows to probe deeper, before run_z_probe throws an error. + // This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration. + + #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N(NUM_Z_STEPPER_DRIVERS, 10000.0f, 10000.0f, 10000.0f, 10000.0f); + #else + float last_z_align_level_indicator = 10000.0f; + #endif + float z_measured[NUM_Z_STEPPER_DRIVERS] = { 0 }, + z_maxdiff = 0.0f, + amplification = z_auto_align_amplification; - // Final z and iteration values will be used after breaking the loop - float z_measured_min; - uint8_t iteration = 0; - bool err_break = false; // To break out of nested loops - while (iteration < z_auto_align_iterations) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> probing all positions."); + #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + bool adjustment_reverse = false; + #endif - const int iter = iteration + 1; - SERIAL_ECHOLNPAIR("\nG34 Iteration: ", iter); #if HAS_DISPLAY - char str[iter_str_len + 2 + 1]; - sprintf_P(str, msg_iteration, iter); - ui.set_status(str); + PGM_P const msg_iteration = GET_TEXT(MSG_ITERATION); + const uint8_t iter_str_len = strlen_P(msg_iteration); #endif - // Initialize minimum value - z_measured_min = 100000.0f; - float z_measured_max = -100000.0f; - - // Probe all positions (one per Z-Stepper) - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { - // iteration odd/even --> downward / upward stepper sequence - const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPER_DRIVERS - 1 - i : i; - - // Safe clearance even on an incline - if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe); - - if (DEBUGGING(LEVELING)) - DEBUG_ECHOLNPAIR_P(PSTR("Probing X"), z_stepper_align.xy[iprobe].x, SP_Y_STR, z_stepper_align.xy[iprobe].y); - - // Probe a Z height for each stepper. - // Probing sanity check is disabled, as it would trigger even in normal cases because - // current_position.z has been manually altered in the "dirty trick" above. - const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false); - if (isnan(z_probed_height)) { - SERIAL_ECHOLNPGM("Probing failed"); - LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); - err_break = true; - break; - } + // Final z and iteration values will be used after breaking the loop + float z_measured_min; + uint8_t iteration = 0; + bool err_break = false; // To break out of nested loops + while (iteration < z_auto_align_iterations) { + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> probing all positions."); + + const int iter = iteration + 1; + SERIAL_ECHOLNPAIR("\nG34 Iteration: ", iter); + #if HAS_DISPLAY + char str[iter_str_len + 2 + 1]; + sprintf_P(str, msg_iteration, iter); + ui.set_status(str); + #endif - // Add height to each value, to provide a more useful target height for - // the next iteration of probing. This allows adjustments to be made away from the bed. - z_measured[iprobe] = z_probed_height + Z_CLEARANCE_BETWEEN_PROBES; + // Initialize minimum value + z_measured_min = 100000.0f; + float z_measured_max = -100000.0f; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(iprobe + 1), " measured position is ", z_measured[iprobe]); + // Probe all positions (one per Z-Stepper) + LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + // iteration odd/even --> downward / upward stepper sequence + const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPER_DRIVERS - 1 - i : i; + + // Safe clearance even on an incline + if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe); + + if (DEBUGGING(LEVELING)) + DEBUG_ECHOLNPAIR_P(PSTR("Probing X"), z_stepper_align.xy[iprobe].x, SP_Y_STR, z_stepper_align.xy[iprobe].y); + + // Probe a Z height for each stepper. + // Probing sanity check is disabled, as it would trigger even in normal cases because + // current_position.z has been manually altered in the "dirty trick" above. + const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false); + if (isnan(z_probed_height)) { + SERIAL_ECHOLNPGM("Probing failed"); + LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); + err_break = true; + break; + } - // Remember the minimum measurement to calculate the correction later on - z_measured_min = _MIN(z_measured_min, z_measured[iprobe]); - z_measured_max = _MAX(z_measured_max, z_measured[iprobe]); - } // for (i) + // Add height to each value, to provide a more useful target height for + // the next iteration of probing. This allows adjustments to be made away from the bed. + z_measured[iprobe] = z_probed_height + Z_CLEARANCE_BETWEEN_PROBES; - if (err_break) break; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(iprobe + 1), " measured position is ", z_measured[iprobe]); - // Adapt the next probe clearance height based on the new measurements. - // Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment. - z_maxdiff = z_measured_max - z_measured_min; - z_probe = Z_BASIC_CLEARANCE + z_measured_max + z_maxdiff; + // Remember the minimum measurement to calculate the correction later on + z_measured_min = _MIN(z_measured_min, z_measured[iprobe]); + z_measured_max = _MAX(z_measured_max, z_measured[iprobe]); + } // for (i) - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Replace the initial values in z_measured with calculated heights at - // each stepper position. This allows the adjustment algorithm to be - // shared between both possible probing mechanisms. - - // This must be done after the next z_probe height is calculated, so that - // the height is calculated from actual print area positions, and not - // extrapolated motor movements. - - // Compute the least-squares fit for all probed points. - // Calculate the Z position of each stepper and store it in z_measured. - // This allows the actual adjustment logic to be shared by both algorithms. - linear_fit_data lfd; - incremental_LSF_reset(&lfd); - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { - SERIAL_ECHOLNPAIR("PROBEPT_", int(i), ": ", z_measured[i]); - incremental_LSF(&lfd, z_stepper_align.xy[i], z_measured[i]); - } - finish_incremental_LSF(&lfd); + if (err_break) break; - z_measured_min = 100000.0f; - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { - z_measured[i] = -(lfd.A * z_stepper_align.stepper_xy[i].x + lfd.B * z_stepper_align.stepper_xy[i].y + lfd.D); - z_measured_min = _MIN(z_measured_min, z_measured[i]); - } + // Adapt the next probe clearance height based on the new measurements. + // Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment. + z_maxdiff = z_measured_max - z_measured_min; + z_probe = Z_BASIC_CLEARANCE + z_measured_max + z_maxdiff; + + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Replace the initial values in z_measured with calculated heights at + // each stepper position. This allows the adjustment algorithm to be + // shared between both possible probing mechanisms. + + // This must be done after the next z_probe height is calculated, so that + // the height is calculated from actual print area positions, and not + // extrapolated motor movements. + + // Compute the least-squares fit for all probed points. + // Calculate the Z position of each stepper and store it in z_measured. + // This allows the actual adjustment logic to be shared by both algorithms. + linear_fit_data lfd; + incremental_LSF_reset(&lfd); + LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + SERIAL_ECHOLNPAIR("PROBEPT_", int(i), ": ", z_measured[i]); + incremental_LSF(&lfd, z_stepper_align.xy[i], z_measured[i]); + } + finish_incremental_LSF(&lfd); - SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]); - #endif + z_measured_min = 100000.0f; + LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + z_measured[i] = -(lfd.A * z_stepper_align.stepper_xy[i].x + lfd.B * z_stepper_align.stepper_xy[i].y + lfd.D); + z_measured_min = _MIN(z_measured_min, z_measured[i]); + } - SERIAL_ECHOLNPAIR("\n" - "DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1]) - #if NUM_Z_STEPPER_DRIVERS == 3 - , " Z2-Z3=", ABS(z_measured[1] - z_measured[2]) - , " Z3-Z1=", ABS(z_measured[2] - z_measured[0]) - #endif - ); - #if HAS_DISPLAY - char fstr1[10]; - #if NUM_Z_STEPPER_DRIVERS == 2 - char msg[6 + (6 + 5) * 1 + 1]; - #else - char msg[6 + (6 + 5) * 3 + 1], fstr2[10], fstr3[10]; + SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]); #endif - sprintf_P(msg, - PSTR("Diffs Z1-Z2=%s" - #if NUM_Z_STEPPER_DRIVERS == 3 - " Z2-Z3=%s" - " Z3-Z1=%s" - #endif - ), dtostrf(ABS(z_measured[0] - z_measured[1]), 1, 3, fstr1) + + SERIAL_ECHOLNPAIR("\n" + "DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1]) #if NUM_Z_STEPPER_DRIVERS == 3 - , dtostrf(ABS(z_measured[1] - z_measured[2]), 1, 3, fstr2) - , dtostrf(ABS(z_measured[2] - z_measured[0]), 1, 3, fstr3) + , " Z2-Z3=", ABS(z_measured[1] - z_measured[2]) + , " Z3-Z1=", ABS(z_measured[2] - z_measured[0]) #endif ); - ui.set_status(msg); - #endif + #if HAS_DISPLAY + char fstr1[10]; + #if NUM_Z_STEPPER_DRIVERS == 2 + char msg[6 + (6 + 5) * 1 + 1]; + #else + char msg[6 + (6 + 5) * 3 + 1], fstr2[10], fstr3[10]; + #endif + sprintf_P(msg, + PSTR("Diffs Z1-Z2=%s" + #if NUM_Z_STEPPER_DRIVERS == 3 + " Z2-Z3=%s" + " Z3-Z1=%s" + #endif + ), dtostrf(ABS(z_measured[0] - z_measured[1]), 1, 3, fstr1) + #if NUM_Z_STEPPER_DRIVERS == 3 + , dtostrf(ABS(z_measured[1] - z_measured[2]), 1, 3, fstr2) + , dtostrf(ABS(z_measured[2] - z_measured[0]), 1, 3, fstr3) + #endif + ); + ui.set_status(msg); + #endif - auto decreasing_accuracy = [](const float &v1, const float &v2){ - if (v1 < v2 * 0.7f) { - SERIAL_ECHOLNPGM("Decreasing Accuracy Detected."); - LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY); - return true; - } - return false; - }; + auto decreasing_accuracy = [](const float &v1, const float &v2){ + if (v1 < v2 * 0.7f) { + SERIAL_ECHOLNPGM("Decreasing Accuracy Detected."); + LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY); + return true; + } + return false; + }; - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Check if the applied corrections go in the correct direction. - // Calculate the sum of the absolute deviations from the mean of the probe measurements. - // Compare to the last iteration to ensure it's getting better. + // Check if the applied corrections go in the correct direction. + // Calculate the sum of the absolute deviations from the mean of the probe measurements. + // Compare to the last iteration to ensure it's getting better. - // Calculate mean value as a reference - float z_measured_mean = 0.0f; - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) z_measured_mean += z_measured[zstepper]; - z_measured_mean /= NUM_Z_STEPPER_DRIVERS; + // Calculate mean value as a reference + float z_measured_mean = 0.0f; + LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) z_measured_mean += z_measured[zstepper]; + z_measured_mean /= NUM_Z_STEPPER_DRIVERS; - // Calculate the sum of the absolute deviations from the mean value - float z_align_level_indicator = 0.0f; - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) - z_align_level_indicator += ABS(z_measured[zstepper] - z_measured_mean); + // Calculate the sum of the absolute deviations from the mean value + float z_align_level_indicator = 0.0f; + LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) + z_align_level_indicator += ABS(z_measured[zstepper] - z_measured_mean); - // If it's getting worse, stop and throw an error - err_break = decreasing_accuracy(last_z_align_level_indicator, z_align_level_indicator); - if (err_break) break; + // If it's getting worse, stop and throw an error + err_break = decreasing_accuracy(last_z_align_level_indicator, z_align_level_indicator); + if (err_break) break; - last_z_align_level_indicator = z_align_level_indicator; - #endif + last_z_align_level_indicator = z_align_level_indicator; + #endif - // The following correction actions are to be enabled for select Z-steppers only - stepper.set_separate_multi_axis(true); - - bool success_break = true; - // Correct the individual stepper offsets - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) { - // Calculate current stepper move - float z_align_move = z_measured[zstepper] - z_measured_min; - const float z_align_abs = ABS(z_align_move); - - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Optimize one iteration's correction based on the first measurements - if (z_align_abs) amplification = (iteration == 1) ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; - - // Check for less accuracy compared to last move - if (decreasing_accuracy(last_z_align_move[zstepper], z_align_abs)) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " last_z_align_move = ", last_z_align_move[zstepper]); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " z_align_abs = ", z_align_abs); - adjustment_reverse = !adjustment_reverse; - } + // The following correction actions are to be enabled for select Z-steppers only + stepper.set_separate_multi_axis(true); + + bool success_break = true; + // Correct the individual stepper offsets + LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) { + // Calculate current stepper move + float z_align_move = z_measured[zstepper] - z_measured_min; + const float z_align_abs = ABS(z_align_move); + + #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Optimize one iteration's correction based on the first measurements + if (z_align_abs) amplification = (iteration == 1) ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; + + // Check for less accuracy compared to last move + if (decreasing_accuracy(last_z_align_move[zstepper], z_align_abs)) { + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " last_z_align_move = ", last_z_align_move[zstepper]); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " z_align_abs = ", z_align_abs); + adjustment_reverse = !adjustment_reverse; + } + + // Remember the alignment for the next iteration, but only if steppers move, + // otherwise it would be just zero (in case this stepper was at z_measured_min already) + if (z_align_abs > 0) last_z_align_move[zstepper] = z_align_abs; + #endif - // Remember the alignment for the next iteration, but only if steppers move, - // otherwise it would be just zero (in case this stepper was at z_measured_min already) - if (z_align_abs > 0) last_z_align_move[zstepper] = z_align_abs; - #endif + // Stop early if all measured points achieve accuracy target + if (z_align_abs > z_auto_align_accuracy) success_break = false; - // Stop early if all measured points achieve accuracy target - if (z_align_abs > z_auto_align_accuracy) success_break = false; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", z_align_move); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " corrected by ", z_align_move); + // Lock all steppers except one + stepper.set_all_z_lock(true, zstepper); - // Lock all steppers except one - stepper.set_all_z_lock(true, zstepper); + #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Decreasing accuracy was detected so move was inverted. + // Will match reversed Z steppers on dual steppers. Triple will need more work to map. + if (adjustment_reverse) { + z_align_move = -z_align_move; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " correction reversed to ", z_align_move); + } + #endif - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Decreasing accuracy was detected so move was inverted. - // Will match reversed Z steppers on dual steppers. Triple will need more work to map. - if (adjustment_reverse) { - z_align_move = -z_align_move; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " correction reversed to ", z_align_move); - } - #endif + // Do a move to correct part of the misalignment for the current stepper + do_blocking_move_to_z(amplification * z_align_move + current_position.z); + } // for (zstepper) - // Do a move to correct part of the misalignment for the current stepper - do_blocking_move_to_z(amplification * z_align_move + current_position.z); - } // for (zstepper) + // Back to normal stepper operations + stepper.set_all_z_lock(false); + stepper.set_separate_multi_axis(false); - // Back to normal stepper operations - stepper.set_all_z_lock(false); - stepper.set_separate_multi_axis(false); + if (err_break) break; - if (err_break) break; + if (success_break) { + SERIAL_ECHOLNPGM("Target accuracy achieved."); + LCD_MESSAGEPGM(MSG_ACCURACY_ACHIEVED); + break; + } - if (success_break) { - SERIAL_ECHOLNPGM("Target accuracy achieved."); - LCD_MESSAGEPGM(MSG_ACCURACY_ACHIEVED); - break; - } + iteration++; + } // while (iteration < z_auto_align_iterations) - iteration++; - } // while (iteration < z_auto_align_iterations) + if (err_break) + SERIAL_ECHOLNPGM("G34 aborted."); + else { + SERIAL_ECHOLNPAIR("Did ", int(iteration + (iteration != z_auto_align_iterations)), " of ", int(z_auto_align_iterations)); + SERIAL_ECHOLNPAIR_F("Accuracy: ", z_maxdiff); + } - if (err_break) - SERIAL_ECHOLNPGM("G34 aborted."); - else { - SERIAL_ECHOLNPAIR("Did ", int(iteration + (iteration != z_auto_align_iterations)), " of ", int(z_auto_align_iterations)); - SERIAL_ECHOLNPAIR_F("Accuracy: ", z_maxdiff); - } + // Stow the probe, as the last call to probe.probe_at_point(...) left + // the probe deployed if it was successful. + probe.stow(); - // Stow the probe, as the last call to probe.probe_at_point(...) left - // the probe deployed if it was successful. - probe.stow(); - - #if ENABLED(HOME_AFTER_G34) - // After this operation the z position needs correction - set_axis_never_homed(Z_AXIS); - // Home Z after the alignment procedure - process_subcommands_now_P(PSTR("G28Z")); - #else - // Use the probed height from the last iteration to determine the Z height. - // z_measured_min is used, because all steppers are aligned to z_measured_min. - // Ideally, this would be equal to the 'z_probe * 0.5f' which was added earlier. - current_position.z -= z_measured_min - (float)Z_CLEARANCE_BETWEEN_PROBES; - sync_plan_position(); - #endif + #if ENABLED(HOME_AFTER_G34) + // After this operation the z position needs correction + set_axis_never_homed(Z_AXIS); + // Home Z after the alignment procedure + process_subcommands_now_P(PSTR("G28Z")); + #else + // Use the probed height from the last iteration to determine the Z height. + // z_measured_min is used, because all steppers are aligned to z_measured_min. + // Ideally, this would be equal to the 'z_probe * 0.5f' which was added earlier. + current_position.z -= z_measured_min - (float)Z_CLEARANCE_BETWEEN_PROBES; + sync_plan_position(); + #endif - // Restore the active tool after homing - TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER))); // Fetch previous tool for parking extruder + // Restore the active tool after homing + TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER))); // Fetch previous tool for parking extruder - #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G34) - set_bed_leveling_enabled(leveling_was_active); - #endif + #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G34) + set_bed_leveling_enabled(leveling_was_active); + #endif - }while(0); + }while(0); + #endif } +#endif // Z_MULTI_ENDSTOPS || Z_STEPPER_AUTO_ALIGN + +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + /** * M422: Set a Z-Stepper automatic alignment XY point. * Use repeatedly to set multiple points. diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1d6bd9423175..ee8aa0bba420 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -327,7 +327,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 33: G33(); break; // G33: Delta Auto-Calibration #endif - #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) + #if ANY(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) case 34: G34(); break; // G34: Z Stepper automatic alignment using probe #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 5db8b08e08d4..ddd48a389d30 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -468,7 +468,7 @@ class GcodeSuite { TERN_(DELTA_AUTO_CALIBRATION, static void G33()); - #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) + #if ANY(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) static void G34(); #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2ef4cbb78528..55778634cd81 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2792,8 +2792,11 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1." #elif !HAS_BED_PROBE #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe." - #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) && NUM_Z_STEPPER_DRIVERS < 3 - #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4." + #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0."); + #if NUM_Z_STEPPER_DRIVERS < 3 + #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4." + #endif #endif #endif diff --git a/platformio.ini b/platformio.ini index 360a02f4209a..932d19075dff 100644 --- a/platformio.ini +++ b/platformio.ini @@ -316,6 +316,7 @@ EXT_SOLENOID|MANUAL_SOLENOID_CONTROL = src_filter=+ +< HAS_CUTTER = src_filter=+ + EXPERIMENTAL_I2CBUS = src_filter=+ + MECHANICAL_GANTRY_CAL.+ = src_filter=+ +Z_MULTI_ENDSTOPS = src_filter=+ Z_STEPPER_AUTO_ALIGN = src_filter=+ + G26_MESH_VALIDATION = src_filter=+ ASSISTED_TRAMMING = src_filter=+ From fbc2d2d72636fb9347ddfa94a263adcb515e942d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Pereira?= Date: Fri, 13 Nov 2020 07:23:05 +0000 Subject: [PATCH 148/443] Typo in MMU2 serial protocol description (#19949) --- Marlin/src/feature/mmu2/serial-protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/mmu2/serial-protocol.md b/Marlin/src/feature/mmu2/serial-protocol.md index 936830e1dc08..7ff0901742af 100644 --- a/Marlin/src/feature/mmu2/serial-protocol.md +++ b/Marlin/src/feature/mmu2/serial-protocol.md @@ -26,7 +26,7 @@ Now we are sure MMU is available and ready. If there was a timeout or other comm - *Firmware version* is an integer value, but we don't care about it - *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled -- *FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise +- *FINDA status* is 1 if the filament is loaded to the extruder, 0 otherwise *Build number* is checked against the required value, if it does not match, printer is halted. From 6aea00289cc96fae1b03d0dd26b3954f3953db65 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 14 Nov 2020 00:10:15 +0000 Subject: [PATCH 149/443] [cron] Bump distribution date (2020-11-14) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3bf908a15d79..ead4db465b21 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-13" + #define STRING_DISTRIBUTION_DATE "2020-11-14" #endif /** From 988fc202e260a41bb246d978a2620685a7f06f8f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Nov 2020 00:45:26 -0600 Subject: [PATCH 150/443] LCD_FIRST_TOOL status bitmaps --- Marlin/src/lcd/dogm/status/combined.h | 171 ++++++++---- Marlin/src/lcd/dogm/status/hotend.h | 360 ++++++++++++++++++-------- 2 files changed, 377 insertions(+), 154 deletions(-) diff --git a/Marlin/src/lcd/dogm/status/combined.h b/Marlin/src/lcd/dogm/status/combined.h index 69aad5b00e53..ca18f21af6d5 100644 --- a/Marlin/src/lcd/dogm/status/combined.h +++ b/Marlin/src/lcd/dogm/status/combined.h @@ -29,6 +29,9 @@ #undef STATUS_BED_ANIM #define STATUS_HEATERS_XSPACE 24 +// +// Status Screen Combined Heater bitmaps +// #if HAS_HEATED_BED && HOTENDS <= 4 #if HOTENDS == 0 @@ -75,13 +78,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, @@ -94,13 +107,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00001000,B00100000,B10000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00010000,B01000001,B00000000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00010000,B01000001,B00000000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00001000,B00100000,B10000000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, @@ -113,13 +136,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, @@ -161,13 +194,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000, - B00111110,B11110000,B00000000,B00111011,B11110000, - B00111110,B11110000,B00000000,B00111000,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000, + B00111011,B01110000,B00000000,B00111100,B11110000, + B00111011,B01110000,B00000000,B00111010,B11110000, + B00011011,B01100000,B00000000,B00011110,B11100000, + B00011011,B01100000,B00000000,B00011110,B11100000, + B00111011,B01110000,B00000000,B00111110,B11110000, + B00111100,B11110000,B00000000,B00111110,B11110000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000, + B00111110,B11110000,B00000000,B00111011,B11110000, + B00111110,B11110000,B00000000,B00111000,B01110000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000, B00001111,B11000000,B00000000,B00001111,B11000000, B00000111,B10000000,B00000000,B00000111,B10000000, @@ -180,13 +223,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111100,B11110000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00111111,B01110000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011110,B11100000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011101,B11100000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00111011,B11110000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111000,B01110000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, @@ -199,13 +252,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, @@ -218,13 +281,23 @@ const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, - B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, - B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, - B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, - B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, - B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, - B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, - B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, + B00111011,B01110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111011,B01110000,B00000000,B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, + B00011011,B01100000,B00000000,B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, + B00111011,B01110000,B00000000,B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, + B00111100,B11110000,B00000000,B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, + #else + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, + #endif B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, diff --git a/Marlin/src/lcd/dogm/status/hotend.h b/Marlin/src/lcd/dogm/status/hotend.h index 559fa50018e3..4dddc42bee88 100644 --- a/Marlin/src/lcd/dogm/status/hotend.h +++ b/Marlin/src/lcd/dogm/status/hotend.h @@ -77,13 +77,23 @@ const unsigned char status_hotend1_a_bmp[] PROGMEM = { B00011111,B11100000, B00111111,B11110000, - B00111110,B11110000, - B00111100,B11110000, - B00011010,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111110,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111011,B01110000, + B00111100,B11110000, + #else + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + #endif B00001111,B11000000, B00000111,B10000000, B00000011,B00000000 @@ -92,13 +102,23 @@ const unsigned char status_hotend1_b_bmp[] PROGMEM = { B00011111,B11100000, B00100000,B00010000, - B00100001,B00010000, - B00100011,B00010000, - B00010101,B00100000, - B00010001,B00100000, - B00100001,B00010000, - B00100001,B00010000, - B00110001,B00110000, + #if LCD_FIRST_TOOL == 0 + B00100011,B00010000, + B00100100,B10010000, + B00010100,B10100000, + B00010100,B10100000, + B00100100,B10010000, + B00100100,B10010000, + B00110011,B00110000, + #else + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + #endif B00001000,B01000000, B00000100,B10000000, B00000011,B00000000 @@ -107,13 +127,23 @@ const unsigned char status_hotend2_a_bmp[] PROGMEM = { B00011111,B11100000, B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011110,B11100000, - B00111101,B11110000, - B00111011,B11110000, - B00111000,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + #else + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + #endif B00001111,B11000000, B00000111,B10000000, B00000011,B00000000 @@ -122,13 +152,23 @@ const unsigned char status_hotend2_b_bmp[] PROGMEM = { B00011111,B11100000, B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010001,B00100000, - B00100010,B00010000, - B00100100,B00010000, - B00110111,B10110000, + #if LCD_FIRST_TOOL == 0 + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + #else + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + #endif B00001000,B01000000, B00000100,B10000000, B00000011,B00000000 @@ -138,13 +178,23 @@ const unsigned char status_hotend1_a_bmp[] PROGMEM = { B00011111,B11100000, - B00111110,B11110000, - B00111100,B11110000, - B00111010,B11110000, - B00011110,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111011,B01110000, + B00111100,B11110000, + #else + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + #endif B00111111,B11110000, B00001111,B11000000, B00000111,B10000000, @@ -153,13 +203,23 @@ const unsigned char status_hotend2_a_bmp[] PROGMEM = { B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011110,B11100000, - B00011101,B11100000, - B00111011,B11110000, - B00111000,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + #else + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + #endif B00111111,B11110000, B00001111,B11000000, B00000111,B10000000, @@ -175,13 +235,23 @@ const unsigned char status_hotend3_a_bmp[] PROGMEM = { B00011111,B11100000, B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011100,B11100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + #else + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011100,B11100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + #endif B00001111,B11000000, B00000111,B10000000, B00000011,B00000000 @@ -190,13 +260,23 @@ const unsigned char status_hotend3_b_bmp[] PROGMEM = { B00011111,B11100000, B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010011,B00100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, + #if LCD_FIRST_TOOL == 0 + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + #else + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010011,B00100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + #endif B00001000,B01000000, B00000100,B10000000, B00000011,B00000000 @@ -206,13 +286,23 @@ const unsigned char status_hotend3_a_bmp[] PROGMEM = { B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011100,B11100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + #else + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011100,B11100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + #endif B00111111,B11110000, B00001111,B11000000, B00000111,B10000000, @@ -230,13 +320,23 @@ const unsigned char status_hotend4_a_bmp[] PROGMEM = { B00011111,B11100000, B00111111,B11110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011011,B01100000, - B00111000,B00110000, - B00111111,B01110000, - B00111111,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011100,B11100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + #else + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111000,B00110000, + B00111111,B01110000, + B00111111,B01110000, + #endif B00001111,B11000000, B00000111,B10000000, B00000011,B00000000 @@ -245,13 +345,23 @@ const unsigned char status_hotend4_b_bmp[] PROGMEM = { B00011111,B11100000, B00100000,B00010000, - B00100100,B10010000, - B00100100,B10010000, - B00010100,B10100000, - B00010100,B10100000, - B00100111,B11010000, - B00100000,B10010000, - B00110000,B10110000, + #if LCD_FIRST_TOOL == 0 + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010011,B00100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + #else + B00100100,B10010000, + B00100100,B10010000, + B00010100,B10100000, + B00010100,B10100000, + B00100111,B11010000, + B00100000,B10010000, + B00110000,B10110000, + #endif B00001000,B01000000, B00000100,B10000000, B00000011,B00000000 @@ -261,13 +371,23 @@ const unsigned char status_hotend4_a_bmp[] PROGMEM = { B00011111,B11100000, - B00111011,B01110000, - B00111011,B01110000, - B00111011,B01110000, - B00011011,B01100000, - B00011000,B00100000, - B00111111,B01110000, - B00111111,B01110000, + #if LCD_FIRST_TOOL == 0 + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011100,B11100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + #else + B00111011,B01110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011000,B00100000, + B00111111,B01110000, + B00111111,B01110000, + #endif B00111111,B11110000, B00001111,B11000000, B00000111,B10000000, @@ -285,13 +405,23 @@ const unsigned char status_hotend5_a_bmp[] PROGMEM = { B00011111,B11100000, B00111111,B11110000, - B00111000,B01110000, - B00111011,B11110000, - B00011000,B11100000, - B00011111,B01100000, - B00111111,B01110000, - B00111011,B01110000, - B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111000,B00110000, + B00111111,B01110000, + B00111111,B01110000, + #else + B00111000,B01110000, + B00111011,B11110000, + B00011000,B11100000, + B00011111,B01100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + #endif B00001111,B11000000, B00000111,B10000000, B00000011,B00000000 @@ -300,13 +430,23 @@ const unsigned char status_hotend5_b_bmp[] PROGMEM = { B00011111,B11100000, B00100000,B00010000, - B00100111,B10010000, - B00100100,B00010000, - B00010111,B00100000, - B00010000,B10100000, - B00100000,B10010000, - B00100100,B10010000, - B00110011,B00110000, + #if LCD_FIRST_TOOL == 0 + B00100100,B10010000, + B00100100,B10010000, + B00010100,B10100000, + B00010100,B10100000, + B00100111,B11010000, + B00100000,B10010000, + B00110000,B10110000, + #else + B00100111,B10010000, + B00100100,B00010000, + B00010111,B00100000, + B00010000,B10100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + #endif B00001000,B01000000, B00000100,B10000000, B00000011,B00000000 @@ -316,13 +456,23 @@ const unsigned char status_hotend5_a_bmp[] PROGMEM = { B00011111,B11100000, - B00111000,B01110000, - B00111011,B11110000, - B00111000,B11110000, - B00011111,B01100000, - B00011111,B01100000, - B00111011,B01110000, - B00111100,B11110000, + #if LCD_FIRST_TOOL == 0 + B00111011,B01110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011000,B00100000, + B00111111,B01110000, + B00111111,B01110000, + #else + B00111000,B01110000, + B00111011,B11110000, + B00111000,B11110000, + B00011111,B01100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + #endif B00111111,B11110000, B00001111,B11000000, B00000111,B10000000, From ddc997c81f79b0ec13d4d1c956f085245fe98802 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Nov 2020 18:28:06 -0600 Subject: [PATCH 151/443] .gitignore for native / simulation --- .gitignore | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4e4412f5e769..62f73a7c0d00 100755 --- a/.gitignore +++ b/.gitignore @@ -148,7 +148,7 @@ Marlin/*/*/*/*/readme.txt # Secure Credentials Configuration_Secure.h -#Visual Studio +# Visual Studio *.sln *.vcxproj *.vcxproj.user @@ -159,30 +159,34 @@ __vm/ .vs/ vc-fileutils.settings -#Visual Studio Code +# Visual Studio Code .vscode .vscode/.browse.c_cpp.db* .vscode/c_cpp_properties.json .vscode/launch.json .vscode/*.db -#cmake +# cmake CMakeLists.txt src/CMakeLists.txt CMakeListsPrivate.txt -#CLion +# CLion cmake-build-* -#Eclipse +# Eclipse .project .cproject .pydevproject .settings .classpath -#Python +# Python __pycache__ -#IOLogger logs +# IOLogger logs *_log.csv + +# Simulation / Native +eeprom.dat +imgui.ini From 1d43e81be01391ebdc451cf9b7cdd3e425dba4cc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Nov 2020 18:27:31 -0600 Subject: [PATCH 152/443] Fix compile warnings, serial alias --- Marlin/src/core/serial.h | 6 +++--- Marlin/src/gcode/stats/M31.cpp | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 6 ++++++ Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp | 4 ++-- Marlin/src/libs/duration_t.h | 7 ++++++- Marlin/src/module/printcounter.cpp | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index c3baaf9ada90..4824866aebe4 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -303,14 +303,14 @@ extern uint8_t marlin_debug_flags; void serial_echopair_PGM(PGM_P const s_P, const char *v); void serial_echopair_PGM(PGM_P const s_P, char v); void serial_echopair_PGM(PGM_P const s_P, int v); +void serial_echopair_PGM(PGM_P const s_P, unsigned int v); void serial_echopair_PGM(PGM_P const s_P, long v); +void serial_echopair_PGM(PGM_P const s_P, unsigned long v); void serial_echopair_PGM(PGM_P const s_P, float v); void serial_echopair_PGM(PGM_P const s_P, double v); -void serial_echopair_PGM(PGM_P const s_P, unsigned int v); -void serial_echopair_PGM(PGM_P const s_P, unsigned long v); inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } inline void serial_echopair_PGM(PGM_P const s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } +inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (uintptr_t)v); } void serialprintPGM(PGM_P str); void serial_echo_start(); diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index c0e7d2a7ae23..207f9e144e71 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -30,7 +30,7 @@ * M31: Get the time since the start of SD Print (or last M109) */ void GcodeSuite::M31() { - char buffer[21]; + char buffer[22]; duration_t(print_job_timer.duration()).toString(buffer); ui.set_status(buffer); diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 85654b9189b4..9fef6258268c 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -774,9 +774,15 @@ void MarlinUI::draw_status_screen() { mixer.update_mix_from_vtool(); mix_label = PSTR("Mx"); } + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-overflow" + sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages); + #pragma GCC diagnostic pop + #else if (show_e_total) { diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp index 7988985c2e4b..77feacf4a942 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp @@ -217,7 +217,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { // It is using a hex display for that: It expects BSD coded data in the format xxyyzz void DGUSScreenHandler::DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var) { printStatistics state = print_job_timer.getStats(); - char buf[21]; + char buf[22]; duration_t elapsed = state.printTime; elapsed.toString(buf); dgusdisplay.WriteVariable(VP_PrintAccTime, buf, var.size, true); @@ -225,7 +225,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var) { printStatistics state = print_job_timer.getStats(); - char buf[21]; + char buf[10]; sprintf_P(buf, PSTR("%u"), state.totalPrints); dgusdisplay.WriteVariable(VP_PrintsTotal, buf, var.size, true); } diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index 31d8bab38581..9c1d72dfaff3 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -106,6 +106,9 @@ struct duration_t { return this->value; } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-overflow" + /** * @brief Formats the duration as a string * @details String will be formated using a "full" representation of duration @@ -127,7 +130,7 @@ struct duration_t { m = this->minute() % 60, s = this->second() % 60; - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); + if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); @@ -163,4 +166,6 @@ struct duration_t { return 6; } } + + #pragma GCC diagnostic pop }; diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 86aedf2161a9..ab87717f0111 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -177,7 +177,7 @@ void PrintCounter::saveStats() { #endif void PrintCounter::showStats() { - char buffer[21]; + char buffer[22]; SERIAL_ECHOPGM(STR_STATS); SERIAL_ECHOLNPAIR( From c710b6e06cfcf20f95e1b55dd3d0fd1d32bde63a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Nov 2020 18:47:34 -0600 Subject: [PATCH 153/443] Optimize M360 --- Marlin/src/gcode/host/M360.cpp | 73 ++++++++++++++++------------------ 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index 9970dc4df95c..f49a32cc618c 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -28,16 +28,24 @@ #include "../../module/motion.h" #include "../../module/planner.h" -static void config_prefix(PGM_P const name, PGM_P const pref=nullptr) { +#if EXTRUDERS + #include "../../module/temperature.h" +#endif + +static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) { SERIAL_ECHOPGM("Config:"); if (pref) serialprintPGM(pref); + if (ind >= 0) { SERIAL_ECHO(int(ind)); SERIAL_CHAR(':'); } serialprintPGM(name); SERIAL_CHAR(':'); } -static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr) { - config_prefix(name, pref); +static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) { + config_prefix(name, pref, ind); SERIAL_ECHOLN(val); } +static void config_line_e(const int8_t e, PGM_P const name, const float val) { + config_line(name, val, PSTR("Extr."), e + 1); +} /** * M360: Report Firmware configuration @@ -52,19 +60,19 @@ void GcodeSuite::M360() { // // Basics and Enabled items // - config_line(PSTR("Baudrate"), BAUDRATE); - config_line(PSTR("InputBuffer"), MAX_CMD_SIZE); - config_line(PSTR("PrintlineCache"), BUFSIZE); - config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER)); - config_line(PSTR("SDCard"), ENABLED(SDSUPPORT)); - config_line(PSTR("Fan"), ENABLED(HAS_FAN)); - config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY)); + config_line(PSTR("Baudrate"), BAUDRATE); + config_line(PSTR("InputBuffer"), MAX_CMD_SIZE); + config_line(PSTR("PrintlineCache"), BUFSIZE); + config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER)); + config_line(PSTR("SDCard"), ENABLED(SDSUPPORT)); + config_line(PSTR("Fan"), ENABLED(HAS_FAN)); + config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY)); config_line(PSTR("SoftwarePowerSwitch"), 1); config_line(PSTR("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE)); - config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE)); - config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE)); - config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING)); - config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS)); + config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE)); + config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE)); + config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING)); + config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS)); // // Homing Directions @@ -96,15 +104,15 @@ void GcodeSuite::M360() { PGMSTR(UNRET_STR, "RetractionUndo"); PGMSTR(SPEED_STR, "Speed"); // M10 Retract with swap (long) moves - config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR); - config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR); - config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR); + config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR); + config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR); + config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR); config_line(PSTR("LongLength"), fwretract.settings.swap_retract_length, RET_STR); // M11 Recover (undo) with swap (long) moves - config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR); - config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR); + config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR); + config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR); config_line(PSTR("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, UNRET_STR); - config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR); + config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR); #endif // @@ -165,24 +173,13 @@ void GcodeSuite::M360() { // config_line(PSTR("NumExtruder"), EXTRUDERS); #if EXTRUDERS - #define DIAM_VALUE(N) TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[N]) - #if HAS_LINEAR_E_JERK - #define E_JERK_VAL(N) planner.max_e_jerk[E_INDEX_N(N)] - #elif HAS_CLASSIC_JERK - #define E_JERK_VAL(N) planner.max_jerk.e - #else - #define E_JERK_VAL(N) DEFAULT_EJERK - #endif - #define _EXTR_ITEM(N) do{ \ - PGMSTR(EXTR_STR, "Extr." STRINGIFY(INCREMENT(N)) ":"); \ - config_line(JERK_STR, E_JERK_VAL(N), EXTR_STR); \ - config_line(PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], EXTR_STR); \ - config_line(PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], EXTR_STR); \ - config_line(PSTR("Diameter"), DIAM_VALUE(N), EXTR_STR); \ - config_line(PSTR("MaxTemp"), (HEATER_##N##_MAXTEMP) - (HOTEND_OVERSHOOT), EXTR_STR); \ - }while(0) - - REPEAT(EXTRUDERS, _EXTR_ITEM); + LOOP_L_N(e, EXTRUDERS) { + config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(HAS_CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK))); + config_line_e(e, PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]); + config_line_e(e, PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]); + config_line_e(e, PSTR("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e])); + config_line_e(e, PSTR("MaxTemp"), thermalManager.heater_maxtemp[e]); + } #endif } From a6ff61d52e354862a35bee2b404e6718a339c99e Mon Sep 17 00:00:00 2001 From: Luu Lac <45380455+shitcreek@users.noreply.github.com> Date: Fri, 13 Nov 2020 18:48:59 -0600 Subject: [PATCH 154/443] Fix "autotune" LCD message (#20127) --- Marlin/src/gcode/temp/M303.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index c1bf9efd7f38..52e34fc47357 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -77,7 +77,7 @@ void GcodeSuite::M303() { KEEPALIVE_STATE(NOT_BUSY); #endif - ui.set_status(GET_TEXT(MSG_PID_AUTOTUNE)); + ui.set_status_P(GET_TEXT(MSG_PID_AUTOTUNE)); thermalManager.PID_autotune(temp, e, c, u); ui.reset_status(); } From a97a1ae218d141a32ea7c3fadc64672d845b8bcd Mon Sep 17 00:00:00 2001 From: phcay <58492957+phcay@users.noreply.github.com> Date: Sat, 14 Nov 2020 02:24:08 +0100 Subject: [PATCH 155/443] Fix extraneous Linear Advance DIR change (#20131) --- Marlin/src/module/stepper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 627ecf9ebbcc..8b4bc23cb98e 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2255,7 +2255,6 @@ uint32_t Stepper::block_phase_isr() { interval = LA_isr_rate; } else if (step_events_completed < decelerate_after && LA_current_adv_steps < LA_max_adv_steps) { - //step_events_completed <= (uint32_t)accelerate_until) { LA_steps++; LA_current_adv_steps++; interval = LA_isr_rate; @@ -2266,6 +2265,8 @@ uint32_t Stepper::block_phase_isr() { else interval = LA_ADV_NEVER; + if (!LA_steps) return interval; // Leave pins alone if there are no steps! + DIR_WAIT_BEFORE(); #if ENABLED(MIXING_EXTRUDER) From f9e54331bad2d529726929fd3eba1c588a9a8f77 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 13 Nov 2020 18:10:50 -0800 Subject: [PATCH 156/443] UTF Filenames followup (#20135) --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0acf2e5f770c..ecc6f9dd891f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1260,7 +1260,7 @@ // Allow international symbols in long filenames. To display correctly, the // LCD's font must contain the characters. Check your selected LCD language. - #define UTF_FILENAME_SUPPORT + //#define UTF_FILENAME_SUPPORT // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT From 189306d24ea6bd9e5e1a3e49f5e04722af7cc082 Mon Sep 17 00:00:00 2001 From: Minims Date: Sat, 14 Nov 2020 03:13:36 +0100 Subject: [PATCH 157/443] BTT Motor Expansion for SKR Pro (#20123) --- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 150 +++++++++++++----- 1 file changed, 111 insertions(+), 39 deletions(-) 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 995fcb95854a..e1d28f34de95 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -25,6 +25,13 @@ #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #endif +// BigTreeTech driver expansion module https://bit.ly/3ptRRoj +//#define BTT_MOTOR_EXPANSION + +#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION) + #error "It's not possible to have both LCD and motor expansion module on EXP1/EXP2." +#endif + // Use one of these or SDCard-based Emulation will be used #if NO_EEPROM_SELECTED //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation @@ -247,14 +254,43 @@ #define SDCARD_CONNECTION LCD #endif +/** + * ----- ----- + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | PF12(SD_DETECT) (LCD_D7) PG7 | 3 4 | PG6 (LCD_D6) + * (MOSI)PB15 | 5 6 PF11(BTN_EN2) (LCD_D5) PG3 | 5 6 PG2 (LCD_D4) + * (SD_SS)PB12 | 7 8 | PG10(BTN_EN1) (LCD_RS) PD10 | 7 8 | PD11 (LCD_EN) + * (SCK)PB13 | 9 10| PB14(MISO) (BTN_ENC) PA8 | 9 10| PG4 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +#define EXPA1_03_PIN PG7 +#define EXPA1_04_PIN PG6 +#define EXPA1_05_PIN PG3 +#define EXPA1_06_PIN PG2 +#define EXPA1_07_PIN PD10 +#define EXPA1_08_PIN PD11 +#define EXPA1_09_PIN PA8 +#define EXPA1_10_PIN PG4 + +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN PF12 +#define EXPA2_05_PIN PB15 +#define EXPA2_06_PIN PF11 +#define EXPA2_07_PIN PB12 +#define EXPA2_08_PIN PG10 +#define EXPA2_09_PIN PB13 +#define EXPA2_10_PIN PB14 + // // Onboard SD card // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 // #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN PF12 - #define SDSS PB12 + #define SD_DETECT_PIN EXPA2_04_PIN + #define SDSS EXPA2_07_PIN #elif SD_CONNECTION_IS(ONBOARD) @@ -273,16 +309,52 @@ #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board" #endif -/** - * ----- ----- - * NC | · · | GND 5V | · · | GND - * RESET | · · | PF12(SD_DETECT) (LCD_D7) PG7 | · · | PG6 (LCD_D6) - * (MOSI)PB15 | · · | PF11(BTN_EN2) (LCD_D5) PG3 | · · | PG2 (LCD_D4) - * (SD_SS)PB12 | · · | PG10(BTN_EN1) (LCD_RS) PD10 | · · | PD11 (LCD_EN) - * (SCK)PB13 | · · | PB14(MISO) (BTN_ENC) PA8 | · · | PG4 (BEEPER) - * ----- ----- - * EXP2 EXP1 - */ +#if ENABLED(BTT_MOTOR_EXPANSION) + /** + * _____ _____ + * NC | · · | GND NC | · · | GND + * NC | · · | PF12 (M1EN) (M2EN) PG7 | · · | PG6 (M3EN) + * (M1STP) PB15 | · · PF11 (M1DIR) (M1RX) PG3 | · · PG2 (M1DIAG) + * (M2DIR) PB12 | · · | PG10 (M2STP) (M2RX) PD10 | · · | PD11 (M2DIAG) + * (M3DIR) PB13 | · · | PB14 (M3STP) (M3RX) PA8 | · · | PG4 (M3DIAG) + * ----- ----- + * EXP2 EXP1 + */ + + // M1 on Driver Expansion Module + #define E3_STEP_PIN EXPA2_05_PIN + #define E3_DIR_PIN EXPA2_06_PIN + #define E3_ENABLE_PIN EXPA2_04_PIN + #define E3_DIAG_PIN EXPA1_06_PIN + #define E3_CS_PIN EXPA1_05_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXPA1_05_PIN + #define E3_SERIAL_RX_PIN EXPA1_05_PIN + #endif + + // M2 on Driver Expansion Module + #define E4_STEP_PIN EXPA2_08_PIN + #define E4_DIR_PIN EXPA2_07_PIN + #define E4_ENABLE_PIN EXPA1_03_PIN + #define E4_DIAG_PIN EXPA1_08_PIN + #define E4_CS_PIN EXPA1_07_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXPA1_07_PIN + #define E4_SERIAL_RX_PIN EXPA1_07_PIN + #endif + + // M3 on Driver Expansion Module + #define E5_STEP_PIN EXPA2_10_PIN + #define E5_DIR_PIN EXPA2_09_PIN + #define E5_ENABLE_PIN EXPA1_04_PIN + #define E5_DIAG_PIN EXPA1_10_PIN + #define E5_CS_PIN EXPA1_09_PIN + #if HAS_TMC_UART + #define E5_SERIAL_TX_PIN EXPA1_09_PIN + #define E5_SERIAL_RX_PIN EXPA1_09_PIN + #endif + +#endif // BTT_MOTOR_EXPANSION // // LCDs and Controllers @@ -290,23 +362,23 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS PG10 + #define TFTGLCD_CS EXPA2_08_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN PG4 - #define BTN_ENC PA8 + #define BEEPER_PIN EXPA1_10_PIN + #define BTN_ENC EXPA1_09_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PG6 + #define LCD_PINS_RS EXPA1_04_PIN - #define BTN_EN1 PD11 - #define BTN_EN2 PG2 + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN - #define LCD_PINS_ENABLE PG7 - #define LCD_PINS_D4 PG3 + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN // CR10_STOCKDISPLAY default timing is too fast #undef BOARD_ST7920_DELAY_1 @@ -315,45 +387,45 @@ #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 PG6 - #define DOGLCD_CS PG3 - #define BTN_EN1 PG10 - #define BTN_EN2 PF11 + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_CS EXPA1_05_PIN + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN #else - #define LCD_PINS_RS PD10 + #define LCD_PINS_RS EXPA1_07_PIN - #define BTN_EN1 PG10 - #define BTN_EN2 PF11 + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN - #define LCD_PINS_ENABLE PD11 - #define LCD_PINS_D4 PG2 + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS PD11 - #define DOGLCD_A0 PD10 + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PG2 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PG3 + #define RGB_LED_R_PIN EXPA1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PG6 + #define RGB_LED_G_PIN EXPA1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PG7 + #define RGB_LED_B_PIN EXPA1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PG3 + #define NEOPIXEL_PIN EXPA1_05_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 PG3 - #define LCD_PINS_D6 PG6 - #define LCD_PINS_D7 PG7 + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN #endif #endif From c5e411f49218535cd71c92b26bc226f9a9146e7d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 Nov 2020 18:09:17 -0600 Subject: [PATCH 158/443] Add parser.is_command(letter, code) --- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/parser.cpp | 4 ++-- Marlin/src/gcode/parser.h | 5 ++++- Marlin/src/gcode/queue.cpp | 13 ++++++++----- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index ee8aa0bba420..544d7b777dd7 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -250,7 +250,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { * Will still block Gcodes if M511 is disabled, in which case the printer should be unlocked via LCD Menu */ #if ENABLED(PASSWORD_FEATURE) - if (password.is_locked && !(parser.command_letter == 'M' && parser.codenum == 511)) { + if (password.is_locked && !parser.is_command('M', 511)) { SERIAL_ECHO_MSG(STR_PRINTER_LOCKED); return; } diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index bba64dbbc405..4bff045e304d 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -45,7 +45,7 @@ char *GCodeParser::command_ptr, *GCodeParser::string_arg, *GCodeParser::value_ptr; char GCodeParser::command_letter; -int GCodeParser::codenum; +uint16_t GCodeParser::codenum; #if ENABLED(USE_GCODE_SUBCODES) uint8_t GCodeParser::subcode; @@ -270,7 +270,7 @@ void GCodeParser::parse(char *p) { // Special handling for M32 [P] !/path/to/file.g# // The path must be the last parameter - if (param == '!' && letter == 'M' && codenum == 32) { + if (param == '!' && is_command('M', 32)) { string_arg = p; // Name starts after '!' char * const lb = strchr(p, '#'); // Already seen '#' as SD char (to pause buffering) if (lb) *lb = '\0'; // Safe to mark the end of the filename diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 17fb08438890..69bbdaf02d39 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -84,7 +84,7 @@ class GCodeParser { static char *command_ptr, // The command, so it can be echoed *string_arg, // string of command line command_letter; // G, M, or T - static int codenum; // 123 + static uint16_t codenum; // 123 #if ENABLED(USE_GCODE_SUBCODES) static uint8_t subcode; // .1 #endif @@ -244,6 +244,9 @@ class GCodeParser { static bool chain(); #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; } + // The code value pointer was set FORCE_INLINE static bool has_value() { return !!value_ptr; } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index f481052cbf4f..12dfce5111ff 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -416,11 +416,14 @@ inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD * keep sensor readings going and watchdog alive. */ inline bool process_line_done(uint8_t &sis, char (&buff)[MAX_CMD_SIZE], int &ind) { - sis = PS_NORMAL; - buff[ind] = 0; - if (ind) { ind = 0; return false; } - thermalManager.manage_heater(); - return true; + sis = PS_NORMAL; // "Normal" Serial Input State + buff[ind] = '\0'; // Of course, I'm a Terminator. + const bool is_empty = (ind == 0); // An empty line? + if (is_empty) + thermalManager.manage_heater(); // Keep sensors satisfied + else + ind = 0; // Start a new line + return is_empty; // Inform the caller } /** From 8d20a83e094428ad59607bef264acc3f888e544f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 15 Nov 2020 00:12:28 +0000 Subject: [PATCH 159/443] [cron] Bump distribution date (2020-11-15) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ead4db465b21..a0ed5f49349c 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-14" + #define STRING_DISTRIBUTION_DATE "2020-11-15" #endif /** From cab83ba840192ec09ba527372055cfa8810ecaf4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 Nov 2020 18:27:16 -0600 Subject: [PATCH 160/443] Fix some LCD/serial strings --- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 14 +++++++------- .../lcd/extui/lib/anycubic_chiron/chiron_tft.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 571d576bbc1f..9c36cca253f1 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -675,8 +675,8 @@ void MarlinUI::draw_status_screen() { // lcd.setCursor(0, 0); - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); lcd.write(' '); - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); lcd.write(' '); + _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); lcd.write(' '); + _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); lcd.write(' '); _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); #if HAS_LEVELING && !HAS_HEATED_BED @@ -700,7 +700,7 @@ void MarlinUI::draw_status_screen() { uint8_t len = elapsed.toDigital(buffer); lcd.setCursor((LCD_WIDTH - 1) - len, 1); - lcd.write(0x07); lcd.print(buffer); // LCD_CLOCK_CHAR + lcd.write(LCD_STR_CLOCK[0]); lcd.print(buffer); // // Line 3 - progressbar @@ -807,13 +807,13 @@ void MarlinUI::draw_status_screen() { void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { if (!PanelDetected) return; lcd.setCursor((LCD_WIDTH - 14) / 2, row + 1); - lcd.write(0x02); lcd_put_u8str_P(" E"); lcd.write('1' + extruder); lcd.write(' '); - lcd.print(i16tostr3rj(thermalManager.degHotend(extruder))); lcd.write(0x01); lcd.write('/'); - lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(0x01); + lcd.write(LCD_STR_THERMOMETER[0]); lcd_put_u8str_P(PSTR(" E")); lcd.write('1' + extruder); lcd.write(' '); + lcd.print(i16tostr3rj(thermalManager.degHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/'); + lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.print_line(); } - #endif // ADVANCED_PAUSE_FEATURE + #endif // Draw a static item with no left-right margin required. Centered by default. void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index 4725afb8bc7e..b6086b82ed4f 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -364,7 +364,7 @@ namespace Anycubic { faultDuration++; if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) { SendtoTFTLN(AC_msg_nozzle_temp_abnormal); - SERIAL_ECHOLNPAIR_P("Bed temp abnormal! : ", temp); + SERIAL_ECHOLNPAIR("Bed temp abnormal! : ", temp); break; } delay_ms(500); From ea371618da71dc43e6aee95a8e479c8797867e04 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 15 Nov 2020 19:39:58 -0300 Subject: [PATCH 161/443] Add Touch Calibration screen (#20049) --- Marlin/Configuration.h | 8 +- Marlin/src/HAL/LPC1768/tft/xpt2046.cpp | 2 +- Marlin/src/HAL/STM32F1/SPI.cpp | 8 +- Marlin/src/HAL/STM32F1/tft/xpt2046.cpp | 2 +- Marlin/src/MarlinCore.cpp | 8 +- Marlin/src/gcode/bedlevel/G26.cpp | 2 +- Marlin/src/gcode/lcd/M995.cpp | 13 +- Marlin/src/inc/Conditionals_LCD.h | 20 +- Marlin/src/inc/Conditionals_adv.h | 2 +- Marlin/src/inc/SanityCheck.h | 16 +- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 109 +++- .../lib/mks_ui/draw_touch_calibration.cpp | 120 ++++ .../extui/lib/mks_ui/draw_touch_calibration.h | 35 ++ Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 578 +++++------------- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 3 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 35 +- Marlin/src/lcd/language/language_en.h | 9 + Marlin/src/lcd/language/language_fr.h | 9 + Marlin/src/lcd/language/language_pt.h | 9 + Marlin/src/lcd/language/language_pt_br.h | 9 + Marlin/src/lcd/marlinui.cpp | 14 +- Marlin/src/lcd/marlinui.h | 22 +- Marlin/src/lcd/menu/menu.cpp | 8 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 4 +- Marlin/src/lcd/menu/menu_touch_screen.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 70 +-- Marlin/src/lcd/tft/touch.h | 79 +-- Marlin/src/lcd/tft/ui_320x240.cpp | 26 +- Marlin/src/lcd/tft/ui_480x320.cpp | 26 +- Marlin/src/lcd/tft_io/touch_calibration.cpp | 81 +++ Marlin/src/lcd/tft_io/touch_calibration.h | 93 +++ Marlin/src/lcd/touch/touch_buttons.cpp | 28 +- Marlin/src/module/settings.cpp | 12 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 31 +- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 31 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 31 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 16 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 16 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 60 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 29 - Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 16 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 29 - .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 16 - Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 16 +- platformio.ini | 2 +- 45 files changed, 848 insertions(+), 907 deletions(-) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h create mode 100644 Marlin/src/lcd/tft_io/touch_calibration.cpp create mode 100644 Marlin/src/lcd/tft_io/touch_calibration.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 374a420539ff..be512e371cba 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2358,10 +2358,10 @@ #define TOUCH_SCREEN_CALIBRATION - //#define XPT2046_X_CALIBRATION 12316 - //#define XPT2046_Y_CALIBRATION -8981 - //#define XPT2046_X_OFFSET -43 - //#define XPT2046_Y_OFFSET 257 + //#define TOUCH_CALIBRATION_X 12316 + //#define TOUCH_CALIBRATION_Y -8981 + //#define TOUCH_OFFSET_X -43 + //#define TOUCH_OFFSET_Y 257 #if ENABLED(TFT_COLOR_UI) //#define SINGLE_TOUCH_NAVIGATION diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp index e51256a708ab..cf14405484ff 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_TFT_XPT2046 || HAS_TOUCH_XPT2046 +#if HAS_TFT_XPT2046 || HAS_TOUCH_BUTTONS #include "xpt2046.h" #include diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index 89951092380c..c0a35b88d1a2 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -147,15 +147,15 @@ SPIClass::SPIClass(uint32_t spi_num) { _currentSetting->state = SPI_STATE_IDLE; } -SPIClass::SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel) { +SPIClass::SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel) : SPIClass(1) { #if BOARD_NR_SPI >= 1 - if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1); + if (mosi == BOARD_SPI1_MOSI_PIN) setModule(1); #endif #if BOARD_NR_SPI >= 2 - if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2); + if (mosi == BOARD_SPI2_MOSI_PIN) setModule(2); #endif #if BOARD_NR_SPI >= 3 - if (mosi == BOARD_SPI3_MOSI_PIN) SPIClass(3); + if (mosi == BOARD_SPI3_MOSI_PIN) setModule(3); #endif } diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp index 4f5c4df37534..98371c5ffb85 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_TFT_XPT2046 || HAS_TOUCH_XPT2046 +#if HAS_TFT_XPT2046 || HAS_TOUCH_BUTTONS #include "xpt2046.h" #include diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index f38ba35dd514..acd1321af45e 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -60,7 +60,7 @@ #include "sd/cardreader.h" #include "lcd/marlinui.h" -#if HAS_TOUCH_XPT2046 +#if HAS_TOUCH_BUTTONS #include "lcd/touch/touch_buttons.h" #endif @@ -1109,7 +1109,7 @@ void setup() { SETUP_RUN(ethernet.init()); #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS SETUP_RUN(touch.init()); #endif @@ -1307,6 +1307,10 @@ void setup() { SETUP_RUN(password.lock_machine()); // Will not proceed until correct password provided #endif + #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) && EITHER(TFT_CLASSIC_UI, TFT_COLOR_UI) + ui.check_touch_calibration(); + #endif + marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 1c0d8cba8eb2..650b039b5503 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -405,7 +405,7 @@ inline bool turn_on_heaters() { inline bool prime_nozzle() { const feedRate_t fr_slow_e = planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0f; - #if HAS_LCD_MENU && !HAS_TOUCH_XPT2046 // ui.button_pressed issue with touchscreen + #if HAS_LCD_MENU && !HAS_TOUCH_BUTTONS // ui.button_pressed issue with touchscreen #if ENABLED(PREVENT_LENGTHY_EXTRUDE) float Total_Prime = 0.0; #endif diff --git a/Marlin/src/gcode/lcd/M995.cpp b/Marlin/src/gcode/lcd/M995.cpp index 72d0d29f7683..bc8dc35d4e05 100644 --- a/Marlin/src/gcode/lcd/M995.cpp +++ b/Marlin/src/gcode/lcd/M995.cpp @@ -25,14 +25,23 @@ #if ENABLED(TOUCH_SCREEN_CALIBRATION) #include "../gcode.h" -#include "../../lcd/menu/menu.h" + +#if ENABLED(TFT_LVGL_UI) + #include "../../lcd/extui/lib/mks_ui/draw_touch_calibration.h" +#else + #include "../../lcd/menu/menu.h" +#endif /** * M995: Touch screen calibration for TFT display */ void GcodeSuite::M995() { - ui.goto_screen(touch_screen_calibration); + #if ENABLED(TFT_LVGL_UI) + lv_draw_touch_calibration_screen(); + #else + ui.goto_screen(touch_screen_calibration); + #endif } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 0bb98e9e061a..b784e12b9992 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1073,8 +1073,24 @@ // This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' #if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT #undef TOUCH_SCREEN - #undef TOUCH_SCREEN_CALIBRATION #if !HAS_TFT_LVGL_UI - #define HAS_TOUCH_XPT2046 1 + #define HAS_TOUCH_BUTTONS 1 + #endif +#endif + +// XPT2046_** Compatibility +#if !(defined(TOUCH_CALIBRATION_X) || defined(TOUCH_CALIBRATION_Y) || defined(TOUCH_OFFSET_X) || defined(TOUCH_OFFSET_Y) || defined(TOUCH_ORIENTATION)) + #if defined(XPT2046_X_CALIBRATION) && defined(XPT2046_Y_CALIBRATION) && defined(XPT2046_X_OFFSET) && defined(XPT2046_Y_OFFSET) + #define TOUCH_CALIBRATION_X XPT2046_X_CALIBRATION + #define TOUCH_CALIBRATION_Y XPT2046_Y_CALIBRATION + #define TOUCH_OFFSET_X XPT2046_X_OFFSET + #define TOUCH_OFFSET_Y XPT2046_Y_OFFSET + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #else + #define TOUCH_CALIBRATION_X 0 + #define TOUCH_CALIBRATION_Y 0 + #define TOUCH_OFFSET_X 0 + #define TOUCH_OFFSET_Y 0 + #define TOUCH_ORIENTATION TOUCH_ORIENTATION_NONE #endif #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 02513e3eaaa8..1bd9dc47a417 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -364,7 +364,7 @@ // Touch Screen or "Touch Buttons" need XPT2046 pins // but they use different components -#if EITHER(HAS_TFT_XPT2046, HAS_TOUCH_XPT2046) +#if EITHER(HAS_TFT_XPT2046, HAS_TOUCH_BUTTONS) #define NEED_TOUCH_PINS 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 55778634cd81..22930a76218c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3172,17 +3172,17 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) * Touch Buttons */ #if ENABLED(TOUCH_SCREEN) - #ifndef XPT2046_X_CALIBRATION - #error "XPT2046_X_CALIBRATION must be defined with TOUCH_SCREEN." + #ifndef TOUCH_CALIBRATION_X + #error "TOUCH_CALIBRATION_X must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_Y_CALIBRATION - #error "XPT2046_Y_CALIBRATION must be defined with TOUCH_SCREEN." + #ifndef TOUCH_CALIBRATION_Y + #error "TOUCH_CALIBRATION_Y must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_X_OFFSET - #error "XPT2046_X_OFFSET must be defined with TOUCH_SCREEN." + #ifndef TOUCH_OFFSET_X + #error "TOUCH_OFFSET_X must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_Y_OFFSET - #error "XPT2046_Y_OFFSET must be defined with TOUCH_SCREEN." + #ifndef TOUCH_OFFSET_Y + #error "TOUCH_OFFSET_Y must be defined with TOUCH_SCREEN." #endif #endif diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 8698dbb017db..d7d09fda5b75 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -75,6 +75,11 @@ TFT_IO tftio; #include "../touch/touch_buttons.h" +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../tft_io/touch_calibration.h" + #include "../marlinui.h" +#endif + #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1) #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1) @@ -129,7 +134,7 @@ static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, tftio.set_window(Xmin, Ymin, Xmax, Ymax); } -#if HAS_TOUCH_XPT2046 +#if HAS_TOUCH_BUTTONS static const uint8_t buttonD[] = { B01111111,B11111111,B11111111,B11111110, @@ -302,7 +307,7 @@ static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, } } -#endif // HAS_TOUCH_XPT2046 +#endif // HAS_TOUCH_BUTTONS // Used to fill RGB565 (16bits) background inline void memset2(const void *ptr, uint16_t fill, size_t cnt) { @@ -313,6 +318,27 @@ inline void memset2(const void *ptr, uint16_t fill, size_t cnt) { static bool preinit = true; static uint8_t page; +#if HAS_TOUCH_BUTTONS + static bool redrawTouchButtons = true; + static void drawTouchButtons(u8g_t *u8g, u8g_dev_t *dev) { + if (!redrawTouchButtons) return; + redrawTouchButtons = false; + + // Bottom buttons + setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI); + drawImage(buttonD, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTCANCEL_COLOR); + + setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI); + drawImage(buttonA, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); + + setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI); + drawImage(buttonB, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); + + setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI); + drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR); + } +#endif // HAS_TOUCH_BUTTONS + uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); @@ -328,6 +354,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, nullptr); tftio.Init(); tftio.InitTFT(); + TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); if (preinit) { preinit = false; @@ -343,28 +370,13 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u for (uint16_t i = 0; i < (TFT_HEIGHT) * sq(GRAPHICAL_TFT_UPSCALE); i++) u8g_WriteSequence(u8g, dev, (TFT_WIDTH) / 2, (uint8_t *)buffer); #endif - - // Bottom buttons - #if HAS_TOUCH_XPT2046 - setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI); - drawImage(buttonD, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTCANCEL_COLOR); - - setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI); - drawImage(buttonA, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); - - setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI); - drawImage(buttonB, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR); - - setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI); - drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR); - #endif // HAS_TOUCH_XPT2046 - return 0; case U8G_DEV_MSG_STOP: preinit = true; break; case U8G_DEV_MSG_PAGE_FIRST: page = 0; + TERN_(HAS_TOUCH_BUTTONS, drawTouchButtons(u8g, dev)); setWindow(u8g, dev, TFT_PIXEL_OFFSET_X, TFT_PIXEL_OFFSET_Y, X_HI, Y_HI); break; @@ -456,4 +468,65 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_tft_320x240_upscale_from_128x64_fn, U8G_COM_HAL_TFT_FN); +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + + static void drawCross(uint16_t x, uint16_t y, uint16_t color) { + tftio.set_window(x - 15, y, x + 15, y); + tftio.WriteMultiple(color, 31); + tftio.set_window(x, y - 15, x, y + 15); + tftio.WriteMultiple(color, 31); + } + + void MarlinUI::touch_calibration_screen() { + uint16_t x, y; + calibrationState calibration_stage = touch_calibration.get_calibration_state(); + + if (calibration_stage == CALIBRATION_NONE) { + // start and clear screen + defer_status_screen(true); + calibration_stage = touch_calibration.calibration_start(); + tftio.set_window(0, 0, (TFT_WIDTH) - 1, (TFT_HEIGHT) - 1); + tftio.WriteMultiple(TFT_MARLINBG_COLOR, uint32_t(TFT_WIDTH) * (TFT_HEIGHT)); + } + else { + // clear last cross + x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x; + y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y; + drawCross(x, y, TFT_MARLINBG_COLOR); + } + + const char *str = nullptr; + if (calibration_stage < CALIBRATION_SUCCESS) { + // handle current state + switch (calibration_stage) { + case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break; + case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break; + case CALIBRATION_TOP_RIGHT: str = GET_TEXT(MSG_TOP_RIGHT); break; + case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT(MSG_BOTTOM_RIGHT); break; + default: break; + } + + x = touch_calibration.calibration_points[calibration_stage].x; + y = touch_calibration.calibration_points[calibration_stage].y; + drawCross(x, y, TFT_MARLINUI_COLOR); + } + else { + // end calibration + str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED); + defer_status_screen(false); + touch_calibration.calibration_end(); + TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true); + } + + // draw current message + tftio.set_window(TFT_PIXEL_OFFSET_X, TFT_PIXEL_OFFSET_Y, X_HI, Y_HI); + do { + set_font(FONT_MENU); + lcd_put_u8str(0, LCD_PIXEL_HEIGHT / 2, str); + } while (u8g.nextPage()); + drawing_screen = false; + } + +#endif // TOUCH_SCREEN_CALIBRATION + #endif // HAS_MARLINUI_U8GLIB && (FSMC_CS_PIN || HAS_SPI_GRAPHICAL_TFT) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp new file mode 100644 index 000000000000..69307a702b87 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp @@ -0,0 +1,120 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../../../inc/MarlinConfigPre.h" + +#if BOTH(HAS_TFT_LVGL_UI, TOUCH_SCREEN_CALIBRATION) + +#include "draw_ui.h" +#include "draw_touch_calibration.h" +#include + +#include "../../../../inc/MarlinConfig.h" +#include "../../../tft_io/touch_calibration.h" +#include "SPI_TFT.h" + +static lv_obj_t *scr; +static lv_obj_t *status_label; + +static void event_handler(lv_obj_t *obj, lv_event_t event); + +enum { + ID_TC_RETURN = 1 +}; + +static void drawCross(uint16_t x, uint16_t y, uint16_t color) { + SPI_TFT.tftio.set_window(x - 15, y, x + 15, y); + SPI_TFT.tftio.WriteMultiple(color, 31); + SPI_TFT.tftio.set_window(x, y - 15, x, y + 15); + SPI_TFT.tftio.WriteMultiple(color, 31); +} + +void lv_update_touch_calibration_screen() { + uint16_t x, y; + + calibrationState calibration_stage = touch_calibration.get_calibration_state(); + if (calibration_stage == CALIBRATION_NONE) { + // start and clear screen + calibration_stage = touch_calibration.calibration_start(); + } + else { + // clear last cross + x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x; + y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y; + drawCross(x, y, LV_COLOR_BACKGROUND.full); + } + + const char *str = nullptr; + if (calibration_stage < CALIBRATION_SUCCESS) { + // handle current state + switch (calibration_stage) { + case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break; + case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break; + case CALIBRATION_TOP_RIGHT: str = GET_TEXT(MSG_TOP_RIGHT); break; + case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT(MSG_BOTTOM_RIGHT); break; + default: break; + } + + x = touch_calibration.calibration_points[calibration_stage].x; + y = touch_calibration.calibration_points[calibration_stage].y; + drawCross(x, y, LV_COLOR_WHITE.full); + } + else { + // end calibration + str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED); + touch_calibration.calibration_end(); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_TC_RETURN); + } + + // draw current message + lv_label_set_text(status_label, str); + lv_obj_align(status_label, nullptr, LV_ALIGN_CENTER, 0, 0); +} + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + if (event != LV_EVENT_RELEASED) return; + switch (obj->mks_obj_id) { + case ID_TC_RETURN: + TERN_(MKS_TEST, curent_disp_ui = 1); + lv_clear_touch_calibration_screen(); + lv_draw_ready_print(); + break; + } +} + +void lv_draw_touch_calibration_screen() { + disp_state_stack._disp_index = 0; + ZERO(disp_state_stack._disp_state); + scr = lv_screen_create(TOUCH_CALIBRATION_UI, ""); + + status_label = lv_label_create(scr, ""); + lv_obj_align(status_label, nullptr, LV_ALIGN_CENTER, 0, 0); + + lv_refr_now(lv_refr_get_disp_refreshing()); + + lv_update_touch_calibration_screen(); +} + +void lv_clear_touch_calibration_screen() { + lv_obj_del(scr); +} + +#endif // HAS_TFT_LVGL_UI && TOUCH_SCREEN_CALIBRATION diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h new file mode 100644 index 000000000000..b14700dcf336 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifdef __cplusplus + extern "C" { /* C-declarations for C++ */ +#endif + +extern void lv_draw_touch_calibration_screen(); +extern void lv_clear_touch_calibration_screen(); +extern void lv_update_touch_calibration_screen(); + +//extern void disp_temp_ready_print(); +#ifdef __cplusplus + } /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 58b593a128f9..a6c96d679903 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -48,6 +48,10 @@ #include "../../../../feature/pause.h" #endif +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "draw_touch_calibration.h" +#endif + CFG_ITMES gCfgItems; UI_CFG uiCfg; DISP_STATE_STACK disp_state_stack; @@ -1138,227 +1142,94 @@ void clear_cur_ui() { last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { - case PRINT_READY_UI: - //Get_Temperature_Flg = 0; - lv_clear_ready_print(); - break; - case PRINT_FILE_UI: - lv_clear_print_file(); - break; - case PRINTING_UI: - lv_clear_printing(); - break; - case MOVE_MOTOR_UI: - lv_clear_move_motor(); - break; - case OPERATE_UI: - lv_clear_operation(); - break; - case PAUSE_UI: - //Clear_pause(); - break; - case EXTRUSION_UI: - lv_clear_extrusion(); - break; - case PRE_HEAT_UI: - lv_clear_preHeat(); - break; - case CHANGE_SPEED_UI: - lv_clear_change_speed(); - break; - case FAN_UI: - lv_clear_fan(); - break; - case SET_UI: - lv_clear_set(); - break; - case ZERO_UI: - lv_clear_home(); - break; - case SPRAYER_UI: - //Clear_Sprayer(); - break; - case MACHINE_UI: - //Clear_Machine(); - break; - case LANGUAGE_UI: - lv_clear_language(); - break; - case ABOUT_UI: - lv_clear_about(); - break; - case LOG_UI: - //Clear_Connect(); - break; - case DISK_UI: - //Clear_Disk(); - break; + case PRINT_READY_UI: //Get_Temperature_Flg = 0; + lv_clear_ready_print(); break; + case PRINT_FILE_UI: lv_clear_print_file(); break; + case PRINTING_UI: lv_clear_printing(); break; + case MOVE_MOTOR_UI: lv_clear_move_motor(); break; + case OPERATE_UI: lv_clear_operation(); break; + case PAUSE_UI: /* Clear_pause(); */ break; + case EXTRUSION_UI: lv_clear_extrusion(); break; + case PRE_HEAT_UI: lv_clear_preHeat(); break; + case CHANGE_SPEED_UI: lv_clear_change_speed(); break; + case FAN_UI: lv_clear_fan(); break; + case SET_UI: lv_clear_set(); break; + case ZERO_UI: lv_clear_home(); break; + case SPRAYER_UI: /* Clear_Sprayer(); */ break; + case MACHINE_UI: /* Clear_Machine(); */ break; + case LANGUAGE_UI: lv_clear_language(); break; + case ABOUT_UI: lv_clear_about(); break; + case LOG_UI: /* Clear_Connect(); */ break; + case DISK_UI: /* Clear_Disk(); */ break; #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_UI: - lv_clear_wifi(); - break; + case WIFI_UI: lv_clear_wifi(); break; #endif - case MORE_UI: - //Clear_more(); - break; - case FILETRANSFER_UI: - //Clear_fileTransfer(); - break; - case DIALOG_UI: - lv_clear_dialog(); - break; - case FILETRANSFERSTATE_UI: - //Clear_WifiFileTransferdialog(); - break; - case PRINT_MORE_UI: - //Clear_Printmore(); - break; - case FILAMENTCHANGE_UI: - lv_clear_filament_change(); - break; - case LEVELING_UI: - lv_clear_manualLevel(); - break; - case BIND_UI: - //Clear_Bind(); - break; + case MORE_UI: /* Clear_more(); */ break; + case FILETRANSFER_UI: /* Clear_fileTransfer(); */ break; + case DIALOG_UI: lv_clear_dialog(); break; + case FILETRANSFERSTATE_UI: /* Clear_WifiFileTransferdialog(); */ break; + case PRINT_MORE_UI: /* Clear_Printmore(); */ break; + case FILAMENTCHANGE_UI: lv_clear_filament_change(); break; + case LEVELING_UI: lv_clear_manualLevel(); break; + case BIND_UI: /* Clear_Bind(); */ break; #if HAS_BED_PROBE - case NOZZLE_PROBE_OFFSET_UI: - lv_clear_auto_level_offset_settings(); - break; + case NOZZLE_PROBE_OFFSET_UI: lv_clear_auto_level_offset_settings(); break; #endif - case TOOL_UI: - lv_clear_tool(); - break; - case MESHLEVELING_UI: - //Clear_MeshLeveling(); - break; - case HARDWARE_TEST_UI: - //Clear_Hardwaretest(); - break; + case TOOL_UI: lv_clear_tool(); break; + case MESHLEVELING_UI: /* Clear_MeshLeveling(); */ break; + case HARDWARE_TEST_UI: /* Clear_Hardwaretest(); */ break; #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_LIST_UI: - lv_clear_wifi_list(); - break; + case WIFI_LIST_UI: lv_clear_wifi_list(); break; #endif - case KEY_BOARD_UI: - lv_clear_keyboard(); - break; + case KEY_BOARD_UI: lv_clear_keyboard(); break; #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_TIPS_UI: - lv_clear_wifi_tips(); - break; + case WIFI_TIPS_UI: lv_clear_wifi_tips(); break; #endif - case MACHINE_PARA_UI: - lv_clear_machine_para(); - break; - case MACHINE_SETTINGS_UI: - lv_clear_machine_settings(); - break; - case TEMPERATURE_SETTINGS_UI: - //Clear_TemperatureSettings(); - break; - case MOTOR_SETTINGS_UI: - lv_clear_motor_settings(); - break; - case MACHINETYPE_UI: - //Clear_MachineType(); - break; - case STROKE_UI: - //Clear_Stroke(); - break; - case HOME_DIR_UI: - //Clear_HomeDir(); - break; - case ENDSTOP_TYPE_UI: - //Clear_EndstopType(); - break; - case FILAMENT_SETTINGS_UI: - lv_clear_filament_settings(); - break; - case LEVELING_SETTIGNS_UI: - //Clear_LevelingSettings(); - break; - case LEVELING_PARA_UI: - lv_clear_level_settings(); - break; - case DELTA_LEVELING_PARA_UI: - //Clear_DeltaLevelPara(); - break; - case MANUAL_LEVELING_POSIGION_UI: - lv_clear_manual_level_pos_settings(); - break; - case MAXFEEDRATE_UI: - lv_clear_max_feedrate_settings(); - break; - case STEPS_UI: - lv_clear_step_settings(); - break; - case ACCELERATION_UI: - lv_clear_acceleration_settings(); - break; - case JERK_UI: - #if HAS_CLASSIC_JERK - lv_clear_jerk_settings(); - #endif - break; - case MOTORDIR_UI: - //Clear_MotorDir(); - break; - case HOMESPEED_UI: - //Clear_HomeSpeed(); - break; - case NOZZLE_CONFIG_UI: - //Clear_NozzleConfig(); - break; - case HOTBED_CONFIG_UI: - //Clear_HotbedConfig(); - break; - case ADVANCED_UI: - lv_clear_advance_settings(); - break; - case DOUBLE_Z_UI: - //Clear_DoubleZ(); - break; - case ENABLE_INVERT_UI: - //Clear_EnableInvert(); - break; - case NUMBER_KEY_UI: - lv_clear_number_key(); - break; - case BABY_STEP_UI: - lv_clear_baby_stepping(); - break; - case PAUSE_POS_UI: - lv_clear_pause_position(); - break; + case MACHINE_PARA_UI: lv_clear_machine_para(); break; + case MACHINE_SETTINGS_UI: lv_clear_machine_settings(); break; + case TEMPERATURE_SETTINGS_UI: /* Clear_TemperatureSettings(); */ break; + case MOTOR_SETTINGS_UI: lv_clear_motor_settings(); break; + case MACHINETYPE_UI: /* Clear_MachineType(); */ break; + case STROKE_UI: /* Clear_Stroke(); */ break; + case HOME_DIR_UI: /* Clear_HomeDir(); */ break; + case ENDSTOP_TYPE_UI: /* Clear_EndstopType(); */ break; + case FILAMENT_SETTINGS_UI: lv_clear_filament_settings(); break; + case LEVELING_SETTIGNS_UI: /* Clear_LevelingSettings(); */ break; + case LEVELING_PARA_UI: lv_clear_level_settings(); break; + case DELTA_LEVELING_PARA_UI: /* Clear_DeltaLevelPara(); */ break; + case MANUAL_LEVELING_POSIGION_UI: lv_clear_manual_level_pos_settings(); break; + case MAXFEEDRATE_UI: lv_clear_max_feedrate_settings(); break; + case STEPS_UI: lv_clear_step_settings(); break; + case ACCELERATION_UI: lv_clear_acceleration_settings(); break; + case JERK_UI: TERN_(HAS_CLASSIC_JERK, lv_clear_jerk_settings()); break; + case MOTORDIR_UI: /* Clear_MotorDir(); */ break; + case HOMESPEED_UI: /* Clear_HomeSpeed(); */ break; + case NOZZLE_CONFIG_UI: /* Clear_NozzleConfig(); */ break; + case HOTBED_CONFIG_UI: /* Clear_HotbedConfig(); */ break; + case ADVANCED_UI: lv_clear_advance_settings(); break; + case DOUBLE_Z_UI: /* Clear_DoubleZ(); */ break; + case ENABLE_INVERT_UI: /* Clear_EnableInvert(); */ break; + case NUMBER_KEY_UI: lv_clear_number_key(); break; + case BABY_STEP_UI: lv_clear_baby_stepping(); break; + case PAUSE_POS_UI: lv_clear_pause_position(); break; #if HAS_TRINAMIC_CONFIG - case TMC_CURRENT_UI: - lv_clear_tmc_current_settings(); - break; + case TMC_CURRENT_UI: lv_clear_tmc_current_settings(); break; #endif - case EEPROM_SETTINGS_UI: - lv_clear_eeprom_settings(); - break; + case EEPROM_SETTINGS_UI: lv_clear_eeprom_settings(); break; #if HAS_STEALTHCHOP - case TMC_MODE_UI: - lv_clear_tmc_step_mode_settings(); - break; + case TMC_MODE_UI: lv_clear_tmc_step_mode_settings(); break; #endif #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_SETTINGS_UI: - lv_clear_wifi_settings(); - break; + case WIFI_SETTINGS_UI: lv_clear_wifi_settings(); break; #endif #if USE_SENSORLESS - case HOMING_SENSITIVITY_UI: - lv_clear_homing_sensitivity_settings(); - break; + case HOMING_SENSITIVITY_UI: lv_clear_homing_sensitivity_settings(); break; #endif #if HAS_ROTARY_ENCODER - case ENCODER_SETTINGS_UI: - lv_clear_encoder_settings(); - break; + case ENCODER_SETTINGS_UI: lv_clear_encoder_settings(); break; + #endif + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + case TOUCH_CALIBRATION_UI: lv_clear_touch_calibration_screen(); break; #endif default: break; } @@ -1370,227 +1241,98 @@ void draw_return_ui() { disp_state_stack._disp_index--; switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { - case PRINT_READY_UI: - lv_draw_ready_print(); - break; - case PRINT_FILE_UI: - lv_draw_print_file(); - break; - case PRINTING_UI: - if (gCfgItems.from_flash_pic) flash_preview_begin = true; - else default_preview_flg = true; - lv_draw_printing(); - break; - case MOVE_MOTOR_UI: - lv_draw_move_motor(); - break; - case OPERATE_UI: - lv_draw_operation(); - break; - - #if 1 - case PAUSE_UI: - //draw_pause(); - break; - #endif - - case EXTRUSION_UI: - lv_draw_extrusion(); - break; - case PRE_HEAT_UI: - lv_draw_preHeat(); - break; - case CHANGE_SPEED_UI: - lv_draw_change_speed(); - break; - case FAN_UI: - lv_draw_fan(); - break; - case SET_UI: - lv_draw_set(); - break; - case ZERO_UI: - lv_draw_home(); - break; - case SPRAYER_UI: - //draw_Sprayer(); - break; - case MACHINE_UI: - //draw_Machine(); - break; - case LANGUAGE_UI: - lv_draw_language(); - break; - case ABOUT_UI: - lv_draw_about(); - break; - - case CALIBRATE_UI: - //draw_calibrate(); - break; - case DISK_UI: - //draw_Disk(); - break; + case PRINT_READY_UI: lv_draw_ready_print(); break; + case PRINT_FILE_UI: lv_draw_print_file(); break; + + case PRINTING_UI: if (gCfgItems.from_flash_pic) + flash_preview_begin = true; + else + default_preview_flg = true; + lv_draw_printing(); + break; + + case MOVE_MOTOR_UI: lv_draw_move_motor(); break; + case OPERATE_UI: lv_draw_operation(); break; + case PAUSE_UI: /* draw_pause(); */ break; + case EXTRUSION_UI: lv_draw_extrusion(); break; + case PRE_HEAT_UI: lv_draw_preHeat(); break; + case CHANGE_SPEED_UI: lv_draw_change_speed(); break; + case FAN_UI: lv_draw_fan(); break; + case SET_UI: lv_draw_set(); break; + case ZERO_UI: lv_draw_home(); break; + case SPRAYER_UI: /* draw_Sprayer(); */ break; + case MACHINE_UI: /* draw_Machine(); */ break; + case LANGUAGE_UI: lv_draw_language(); break; + case ABOUT_UI: lv_draw_about(); break; + + case CALIBRATE_UI: /* draw_calibrate(); */ break; + case DISK_UI: /* draw_Disk(); */ break; #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_UI: - lv_draw_wifi(); - break; + case WIFI_UI: lv_draw_wifi(); break; #endif - case MORE_UI: - //draw_More(); - break; - case PRINT_MORE_UI: - //draw_printmore(); - break; - case FILAMENTCHANGE_UI: - lv_draw_filament_change(); - break; - case LEVELING_UI: - lv_draw_manualLevel(); - break; - case BIND_UI: - //draw_bind(); - break; + case MORE_UI: /* draw_More(); */ break; + case PRINT_MORE_UI: /* draw_printmore(); */ break; + case FILAMENTCHANGE_UI: lv_draw_filament_change(); break; + case LEVELING_UI: lv_draw_manualLevel(); break; + case BIND_UI: /* draw_bind(); */ break; #if HAS_BED_PROBE - case NOZZLE_PROBE_OFFSET_UI: - lv_draw_auto_level_offset_settings(); - break; + case NOZZLE_PROBE_OFFSET_UI: lv_draw_auto_level_offset_settings(); break; #endif - case TOOL_UI: - lv_draw_tool(); - break; - case MESHLEVELING_UI: - //draw_meshleveling(); - break; - case HARDWARE_TEST_UI: - //draw_Hardwaretest(); - break; - case WIFI_LIST_UI: - #if ENABLED(USE_WIFI_FUNCTION) - lv_draw_wifi_list(); - #endif - break; - case KEY_BOARD_UI: - lv_draw_keyboard(); - break; - case WIFI_TIPS_UI: - #if ENABLED(USE_WIFI_FUNCTION) - lv_draw_wifi_tips(); - #endif - break; - case MACHINE_PARA_UI: - lv_draw_machine_para(); - break; - case MACHINE_SETTINGS_UI: - lv_draw_machine_settings(); - break; - case TEMPERATURE_SETTINGS_UI: - //draw_TemperatureSettings(); - break; - case MOTOR_SETTINGS_UI: - lv_draw_motor_settings(); - break; - case MACHINETYPE_UI: - //draw_MachineType(); - break; - case STROKE_UI: - //draw_Stroke(); - break; - case HOME_DIR_UI: - //draw_HomeDir(); - break; - case ENDSTOP_TYPE_UI: - //draw_EndstopType(); - break; - case FILAMENT_SETTINGS_UI: - lv_draw_filament_settings(); - break; - case LEVELING_SETTIGNS_UI: - //draw_LevelingSettings(); - break; - case LEVELING_PARA_UI: - lv_draw_level_settings(); - break; - case DELTA_LEVELING_PARA_UI: - //draw_DeltaLevelPara(); - break; - case MANUAL_LEVELING_POSIGION_UI: - lv_draw_manual_level_pos_settings(); - break; - case MAXFEEDRATE_UI: - lv_draw_max_feedrate_settings(); - break; - case STEPS_UI: - lv_draw_step_settings(); - break; - case ACCELERATION_UI: - lv_draw_acceleration_settings(); - break; - case JERK_UI: - #if HAS_CLASSIC_JERK - lv_draw_jerk_settings(); - #endif - break; - case MOTORDIR_UI: - //draw_MotorDir(); - break; - case HOMESPEED_UI: - //draw_HomeSpeed(); - break; - case NOZZLE_CONFIG_UI: - //draw_NozzleConfig(); - break; - case HOTBED_CONFIG_UI: - //draw_HotbedConfig(); - break; - case ADVANCED_UI: - lv_draw_advance_settings(); - break; - case DOUBLE_Z_UI: - //draw_DoubleZ(); - break; - case ENABLE_INVERT_UI: - //draw_EnableInvert(); - break; - case NUMBER_KEY_UI: - lv_draw_number_key(); - break; - case DIALOG_UI: - //draw_dialog(uiCfg.dialogType); - break; - case BABY_STEP_UI: - lv_draw_baby_stepping(); - break; - case PAUSE_POS_UI: - lv_draw_pause_position(); - break; - #if HAS_TRINAMIC_CONFIG - case TMC_CURRENT_UI: - lv_draw_tmc_current_settings(); - break; - #endif - case EEPROM_SETTINGS_UI: - lv_draw_eeprom_settings(); - break; + case TOOL_UI: lv_draw_tool(); break; + case MESHLEVELING_UI: /* draw_meshleveling(); */ break; + case HARDWARE_TEST_UI: /* draw_Hardwaretest(); */ break; + #if ENABLED(USE_WIFI_FUNCTION) + case WIFI_LIST_UI: lv_draw_wifi_list(); break; + #endif + case KEY_BOARD_UI: lv_draw_keyboard(); break; + #if ENABLED(USE_WIFI_FUNCTION) + case WIFI_TIPS_UI: lv_draw_wifi_tips(); break; + #endif + case MACHINE_PARA_UI: lv_draw_machine_para(); break; + case MACHINE_SETTINGS_UI: lv_draw_machine_settings(); break; + case TEMPERATURE_SETTINGS_UI: /* draw_TemperatureSettings(); */ break; + case MOTOR_SETTINGS_UI: lv_draw_motor_settings(); break; + case MACHINETYPE_UI: /* draw_MachineType(); */ break; + case STROKE_UI: /* draw_Stroke(); */ break; + case HOME_DIR_UI: /* draw_HomeDir(); */ break; + case ENDSTOP_TYPE_UI: /* draw_EndstopType(); */ break; + case FILAMENT_SETTINGS_UI: lv_draw_filament_settings(); break; + case LEVELING_SETTIGNS_UI: /* draw_LevelingSettings(); */ break; + case LEVELING_PARA_UI: lv_draw_level_settings(); break; + case DELTA_LEVELING_PARA_UI: /* draw_DeltaLevelPara(); */ break; + case MANUAL_LEVELING_POSIGION_UI: lv_draw_manual_level_pos_settings(); break; + case MAXFEEDRATE_UI: lv_draw_max_feedrate_settings(); break; + case STEPS_UI: lv_draw_step_settings(); break; + case ACCELERATION_UI: lv_draw_acceleration_settings(); break; + #if HAS_CLASSIC_JERK + case JERK_UI: lv_draw_jerk_settings(); break; + #endif + case MOTORDIR_UI: /* draw_MotorDir(); */ break; + case HOMESPEED_UI: /* draw_HomeSpeed(); */ break; + case NOZZLE_CONFIG_UI: /* draw_NozzleConfig(); */ break; + case HOTBED_CONFIG_UI: /* draw_HotbedConfig(); */ break; + case ADVANCED_UI: lv_draw_advance_settings(); break; + case DOUBLE_Z_UI: /* draw_DoubleZ(); */ break; + case ENABLE_INVERT_UI: /* draw_EnableInvert(); */ break; + case NUMBER_KEY_UI: lv_draw_number_key(); break; + case DIALOG_UI: /* draw_dialog(uiCfg.dialogType); */ break; + case BABY_STEP_UI: lv_draw_baby_stepping(); break; + case PAUSE_POS_UI: lv_draw_pause_position(); break; + #if HAS_TRINAMIC_CONFIG + case TMC_CURRENT_UI: lv_draw_tmc_current_settings(); break; + #endif + case EEPROM_SETTINGS_UI: lv_draw_eeprom_settings(); break; #if HAS_STEALTHCHOP - case TMC_MODE_UI: - lv_draw_tmc_step_mode_settings(); - break; + case TMC_MODE_UI: lv_draw_tmc_step_mode_settings(); break; #endif #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_SETTINGS_UI: - lv_draw_wifi_settings(); - break; + case WIFI_SETTINGS_UI: lv_draw_wifi_settings(); break; #endif #if USE_SENSORLESS - case HOMING_SENSITIVITY_UI: - lv_draw_homing_sensitivity_settings(); - break; + case HOMING_SENSITIVITY_UI: lv_draw_homing_sensitivity_settings(); break; #endif #if HAS_ROTARY_ENCODER - case ENCODER_SETTINGS_UI: - lv_draw_encoder_settings(); - break; + case ENCODER_SETTINGS_UI: lv_draw_encoder_settings(); break; #endif default: break; } @@ -1879,15 +1621,11 @@ void LV_TASK_HANDLER() { lv_task_handler(); if (mks_test_flag == 0x1E) mks_hardware_test(); - #if HAS_GCODE_PREVIEW - disp_pre_gcode(2, 36); - #endif + TERN_(HAS_GCODE_PREVIEW, disp_pre_gcode(2, 36)); GUI_RefreshPage(); - #if ENABLED(USE_WIFI_FUNCTION) - get_wifi_commands(); - #endif + TERN_(USE_WIFI_FUNCTION, get_wifi_commands()); //sd_detection(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index eb54b3e4ea3b..6d162676e880 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -313,7 +313,8 @@ typedef enum { EEPROM_SETTINGS_UI, WIFI_SETTINGS_UI, HOMING_SENSITIVITY_UI, - ENCODER_SETTINGS_UI + ENCODER_SETTINGS_UI, + TOUCH_CALIBRATION_UI } DISP_STATE; typedef struct { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 21e3040c2e65..9b8e3e158978 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -51,6 +51,11 @@ XPT2046 touch; #include "../../../../feature/powerloss.h" #endif +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../../../tft_io/touch_calibration.h" + #include "draw_touch_calibration.h" +#endif + #include #ifndef TFT_WIDTH @@ -211,7 +216,14 @@ void tft_lvgl_init() { } #endif - if (ready) lv_draw_ready_print(); + if (ready) { + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + if (touch_calibration.need_calibration()) lv_draw_touch_calibration_screen(); + else lv_draw_ready_print(); + #else + lv_draw_ready_print(); + #endif + } if (mks_test_flag == 0x1E) mks_gpio_test(); @@ -240,17 +252,22 @@ unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { static bool get_point(int16_t *x, int16_t *y) { bool is_touched = touch.getRawPoint(x, y); - if (is_touched) { - *x = int16_t((int32_t(*x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; - *y = int16_t((int32_t(*y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; - } + if (!is_touched) return false; - #if (TFT_ROTATION & TFT_ROTATE_180) - *x = int16_t((TFT_WIDTH) - (int)(*x)); - *y = int16_t((TFT_HEIGHT) - (int)(*y)); + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + const calibrationState state = touch_calibration.get_calibration_state(); + if (state >= CALIBRATION_TOP_LEFT && state <= CALIBRATION_BOTTOM_RIGHT) { + if (touch_calibration.handleTouch(*x, *y)) lv_update_touch_calibration_screen(); + return false; + } + *x = int16_t((int32_t(*x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; + *y = int16_t((int32_t(*y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; + #else + *x = int16_t((int32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + *y = int16_t((int32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; #endif - return is_touched; + return true; } bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index ffaaf2e02ac6..d14880d9772d 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -671,6 +671,15 @@ namespace Language_en { PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z Probe Wizard"); PROGMEM Language_Str MSG_SOUND = _UxGT("Sound"); + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Top Left"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bottom Left"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Top Right"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Bottom Right"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration Completed"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibration Failed"); + #endif } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 661d6b5cc325..90e57ab3fb3d 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -570,4 +570,13 @@ namespace Language_fr { PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" dans:"); PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Lissage"); + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Haut à Gauche"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bas à Gauche"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Haut à Droite"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Bas à Droite"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration Terminée"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Échec de l'étalonnage"); + #endif } diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 37da6216240c..3a002d657ba1 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -160,4 +160,13 @@ namespace Language_pt { PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fim de curso"); PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); + #endif } diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index b52ae51c1cc0..c210425ce8af 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -478,4 +478,13 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Clique p. finalizar")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Continuando...")); #endif + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); + #endif } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 457d3cefd76f..13c85be78728 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -158,7 +158,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_SLOW_BUTTONS volatile uint8_t MarlinUI::slow_buttons; #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS #include "touch/touch_buttons.h" bool MarlinUI::on_edit_screen = false; #endif @@ -241,7 +241,7 @@ millis_t MarlinUI::next_button_update_ms; // = 0 int8_t MarlinUI::encoderDirection = ENCODERBASE; #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS uint8_t MarlinUI::touch_buttons; uint8_t MarlinUI::repeat_delay; #endif @@ -862,7 +862,7 @@ void MarlinUI::update() { quick_feedback(); // - Always make a click sound }; - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS if (touch_buttons) { RESET_STATUS_TIMEOUT(); if (touch_buttons & (EN_A | EN_B)) { // Menu arrows, in priority @@ -883,7 +883,7 @@ void MarlinUI::update() { } else // keep wait_for_unclick value - #endif // HAS_TOUCH_XPT2046 + #endif // HAS_TOUCH_BUTTONS { // Integrated LCD click handling via button_pressed @@ -905,7 +905,7 @@ void MarlinUI::update() { next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS if (on_status_screen()) next_lcd_update_ms += (LCD_UPDATE_INTERVAL) * 2; @@ -1250,7 +1250,7 @@ void MarlinUI::update() { #if HAS_SLOW_BUTTONS | slow_buttons #endif - #if BOTH(HAS_TOUCH_XPT2046, HAS_ENCODER_ACTION) + #if BOTH(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION) | (touch_buttons & TERN(HAS_ENCODER_WHEEL, ~(EN_A | EN_B), 0xFF)) #endif ); @@ -1561,7 +1561,7 @@ void MarlinUI::update() { #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS // // Screen Click diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index ed02f4000ba2..0445c641bad9 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -31,6 +31,10 @@ #include "../sd/cardreader.h" #endif +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "tft_io/touch_calibration.h" +#endif + #if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY) #define HAS_ENCODER_ACTION 1 #endif @@ -74,7 +78,7 @@ uint8_t get_ADC_keyValue(); #endif - #define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_XPT2046, 50, 100) + #define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_BUTTONS, 50, 100) #if HAS_LCD_MENU @@ -146,7 +150,7 @@ #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - #if BUTTON_EXISTS(ENC) || HAS_TOUCH_XPT2046 + #if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS #define BLEN_C 2 #define EN_C _BV(BLEN_C) #endif @@ -212,7 +216,7 @@ #endif -#if BUTTON_EXISTS(BACK) || EITHER(HAS_TOUCH_XPT2046, IS_TFTGLCD_PANEL) +#if BUTTON_EXISTS(BACK) || EITHER(HAS_TOUCH_BUTTONS, IS_TFTGLCD_PANEL) #define BLEN_D 3 #define EN_D _BV(BLEN_D) #define LCD_BACK_CLICKED() (buttons & EN_D) @@ -311,6 +315,12 @@ class MarlinUI { // LCD implementations static void clear_lcd(); + #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) + static void check_touch_calibration() { + if (touch_calibration.need_calibration()) currentScreen = touch_calibration_screen; + } + #endif + #if ENABLED(SDSUPPORT) static void media_changed(const uint8_t old_stat, const uint8_t stat); #endif @@ -452,7 +462,7 @@ class MarlinUI { static void draw_hotend_status(const uint8_t row, const uint8_t extruder); #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS static bool on_edit_screen; static void screen_click(const uint8_t row, const uint8_t col, const uint8_t x, const uint8_t y); #endif @@ -512,7 +522,7 @@ class MarlinUI { static millis_t return_to_status_ms; #endif - #if HAS_TOUCH_XPT2046 + #if HAS_TOUCH_BUTTONS static uint8_t touch_buttons; static uint8_t repeat_delay; #endif @@ -682,7 +692,7 @@ class MarlinUI { #endif #if ENABLED(TOUCH_SCREEN_CALIBRATION) - static void touch_calibration(); + static void touch_calibration_screen(); #endif #if HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 35c736c56074..81ac32a60c8f 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -82,7 +82,7 @@ void MarlinUI::save_previous_screen() { void MarlinUI::_goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back/*=false*/)) { IF_DISABLED(TURBO_BACK_MENU_ITEM, constexpr bool is_back = false); - TERN_(HAS_TOUCH_XPT2046, on_edit_screen = false); + TERN_(HAS_TOUCH_BUTTONS, on_edit_screen = false); if (screen_history_depth > 0) { menuPosition &sh = screen_history[--screen_history_depth]; goto_screen(sh.menu_function, @@ -123,7 +123,7 @@ void MarlinUI::_goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_b * MenuItem_int3::draw(encoderLine == _thisItemNr, _lcdLineNr, plabel, &feedrate_percentage, 10, 999) */ void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { - TERN_(HAS_TOUCH_XPT2046, ui.repeat_delay = BUTTON_DELAY_EDIT); + TERN_(HAS_TOUCH_BUTTONS, ui.repeat_delay = BUTTON_DELAY_EDIT); if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; if (ui.should_draw()) @@ -145,7 +145,7 @@ void MenuEditItemBase::goto_edit_screen( const screenFunc_t cb, // Callback after edit const bool le // Flag to call cb() during editing ) { - TERN_(HAS_TOUCH_XPT2046, ui.on_edit_screen = true); + TERN_(HAS_TOUCH_BUTTONS, ui.on_edit_screen = true); ui.screen_changed = true; ui.save_previous_screen(); ui.refresh(); @@ -175,7 +175,7 @@ bool printer_busy() { void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { - TERN_(HAS_TOUCH_XPT2046, repeat_delay = BUTTON_DELAY_MENU); + TERN_(HAS_TOUCH_BUTTONS, repeat_delay = BUTTON_DELAY_MENU); TERN_(LCD_SET_PROGRESS_MANUALLY, progress_reset()); diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index e19b04ccb517..905d7a07cd5d 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -37,8 +37,10 @@ #endif #if HAS_GRAPHICAL_TFT - #include "../tft/touch.h" #include "../tft/tft.h" + #if ENABLED(TOUCH_SCREEN) + #include "../tft/touch.h" + #endif #endif #if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) diff --git a/Marlin/src/lcd/menu/menu_touch_screen.cpp b/Marlin/src/lcd/menu/menu_touch_screen.cpp index ea610e088639..5fc4b584d51e 100644 --- a/Marlin/src/lcd/menu/menu_touch_screen.cpp +++ b/Marlin/src/lcd/menu/menu_touch_screen.cpp @@ -29,7 +29,7 @@ void touch_screen_calibration() { - ui.touch_calibration(); + ui.touch_calibration_screen(); } diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index adbc2923a466..112ff0b43802 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -48,17 +48,12 @@ millis_t Touch::last_touch_ms = 0, Touch::repeat_delay, Touch::touch_time; TouchControlType Touch::touch_control_type = NONE; -touch_calibration_t Touch::calibration; -#if ENABLED(TOUCH_SCREEN_CALIBRATION) - calibrationState Touch::calibration_state = CALIBRATION_NONE; - touch_calibration_point_t Touch::calibration_points[4]; -#endif #if HAS_RESUME_CONTINUE extern bool wait_for_user; #endif void Touch::init() { - calibration_reset(); + TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); reset(); io.Init(); enable(); @@ -155,52 +150,7 @@ void Touch::touch(touch_control_t *control) { switch (control->type) { #if ENABLED(TOUCH_SCREEN_CALIBRATION) case CALIBRATE: - ui.refresh(); - - if (calibration_state < CALIBRATION_SUCCESS) { - calibration_points[calibration_state].x = int16_t(control->data >> 16); - calibration_points[calibration_state].y = int16_t(control->data & 0xFFFF); - calibration_points[calibration_state].raw_x = x; - calibration_points[calibration_state].raw_y = y; - } - - switch (calibration_state) { - case CALIBRATION_POINT_1: calibration_state = CALIBRATION_POINT_2; break; - case CALIBRATION_POINT_2: calibration_state = CALIBRATION_POINT_3; break; - case CALIBRATION_POINT_3: calibration_state = CALIBRATION_POINT_4; break; - case CALIBRATION_POINT_4: - if (validate_precision_x(0, 1) && validate_precision_x(2, 3) && validate_precision_y(0, 2) && validate_precision_y(1, 3)) { - calibration_state = CALIBRATION_SUCCESS; - calibration.x = ((calibration_points[2].x - calibration_points[0].x) << 17) / (calibration_points[3].raw_x + calibration_points[2].raw_x - calibration_points[1].raw_x - calibration_points[0].raw_x); - calibration.y = ((calibration_points[1].y - calibration_points[0].y) << 17) / (calibration_points[3].raw_y - calibration_points[2].raw_y + calibration_points[1].raw_y - calibration_points[0].raw_y); - calibration.offset_x = calibration_points[0].x - int16_t(((calibration_points[0].raw_x + calibration_points[1].raw_x) * calibration.x) >> 17); - calibration.offset_y = calibration_points[0].y - int16_t(((calibration_points[0].raw_y + calibration_points[2].raw_y) * calibration.y) >> 17); - calibration.orientation = TOUCH_LANDSCAPE; - } - else if (validate_precision_y(0, 1) && validate_precision_y(2, 3) && validate_precision_x(0, 2) && validate_precision_x(1, 3)) { - calibration_state = CALIBRATION_SUCCESS; - calibration.x = ((calibration_points[2].x - calibration_points[0].x) << 17) / (calibration_points[3].raw_y + calibration_points[2].raw_y - calibration_points[1].raw_y - calibration_points[0].raw_y); - calibration.y = ((calibration_points[1].y - calibration_points[0].y) << 17) / (calibration_points[3].raw_x - calibration_points[2].raw_x + calibration_points[1].raw_x - calibration_points[0].raw_x); - calibration.offset_x = calibration_points[0].x - int16_t(((calibration_points[0].raw_y + calibration_points[1].raw_y) * calibration.x) >> 17); - calibration.offset_y = calibration_points[0].y - int16_t(((calibration_points[0].raw_x + calibration_points[2].raw_x) * calibration.y) >> 17); - calibration.orientation = TOUCH_PORTRAIT; - } - else { - calibration_state = CALIBRATION_FAIL; - calibration_reset(); - } - - if (calibration_state == CALIBRATION_SUCCESS) { - SERIAL_ECHOLNPGM("Touch screen calibration completed"); - SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x); - SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y); - SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x); - SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y); - SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT"); - } - break; - default: break; - } + if (touch_calibration.handleTouch(x, y)) ui.refresh(); break; #endif // TOUCH_SCREEN_CALIBRATION @@ -298,12 +248,18 @@ void Touch::hold(touch_control_t *control, millis_t delay) { } bool Touch::get_point(int16_t *x, int16_t *y) { - bool is_touched = (calibration.orientation == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + bool is_touched = (touch_calibration.calibration.orientation == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); - if (is_touched && calibration.orientation != TOUCH_ORIENTATION_NONE) { - *x = int16_t((int32_t(*x) * calibration.x) >> 16) + calibration.offset_x; - *y = int16_t((int32_t(*y) * calibration.y) >> 16) + calibration.offset_y; - } + if (is_touched && touch_calibration.calibration.orientation != TOUCH_ORIENTATION_NONE) { + *x = int16_t((int32_t(*x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; + *y = int16_t((int32_t(*y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; + } + #else + bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); + *x = uint16_t((uint32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + *y = uint16_t((uint32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; + #endif return is_touched; } Touch touch; diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 7cb05891de70..8023f649ce73 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -23,41 +23,15 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(TOUCH_SCREEN) - #include "tft_color.h" #include "tft_image.h" -#include HAL_PATH(../../HAL, tft/xpt2046.h) -#define TOUCH_DRIVER XPT2046 - -#ifndef TOUCH_SCREEN_CALIBRATION_PRECISION - #define TOUCH_SCREEN_CALIBRATION_PRECISION 80 -#endif - -#ifndef TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS - #define TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS 2500 +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../tft_io/touch_calibration.h" #endif -#define TOUCH_ORIENTATION_NONE 0 -#define TOUCH_LANDSCAPE 1 -#define TOUCH_PORTRAIT 2 - -#if !(defined(TOUCH_CALIBRATION_X) || defined(TOUCH_CALIBRATION_Y) || defined(TOUCH_OFFSET_X) || defined(TOUCH_OFFSET_Y) || defined(TOUCH_ORIENTATION)) - #if defined(XPT2046_X_CALIBRATION) && defined(XPT2046_Y_CALIBRATION) && defined(XPT2046_X_OFFSET) && defined(XPT2046_Y_OFFSET) - #define TOUCH_CALIBRATION_X XPT2046_X_CALIBRATION - #define TOUCH_CALIBRATION_Y XPT2046_Y_CALIBRATION - #define TOUCH_OFFSET_X XPT2046_X_OFFSET - #define TOUCH_OFFSET_Y XPT2046_Y_OFFSET - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE - #else - #define TOUCH_CALIBRATION_X 0 - #define TOUCH_CALIBRATION_Y 0 - #define TOUCH_OFFSET_X 0 - #define TOUCH_OFFSET_Y 0 - #define TOUCH_ORIENTATION TOUCH_ORIENTATION_NONE - #endif -#endif +#include HAL_PATH(../../HAL, tft/xpt2046.h) +#define TOUCH_DRIVER XPT2046 // Menu Navigation extern int8_t encoderTopLine, encoderLine, screen_items; @@ -101,31 +75,6 @@ typedef struct __attribute__((__packed__)) { intptr_t data; } touch_control_t; -typedef struct __attribute__((__packed__)) { - int32_t x; - int32_t y; - int16_t offset_x; - int16_t offset_y; - uint8_t orientation; -} touch_calibration_t; - -typedef struct __attribute__((__packed__)) { - uint16_t x; - uint16_t y; - int16_t raw_x; - int16_t raw_y; -} touch_calibration_point_t; - -enum calibrationState : uint8_t { - CALIBRATION_POINT_1 = 0x00, - CALIBRATION_POINT_2, - CALIBRATION_POINT_3, - CALIBRATION_POINT_4, - CALIBRATION_SUCCESS, - CALIBRATION_FAIL, - CALIBRATION_NONE, -}; - #define MAX_CONTROLS 16 #define MINIMUM_HOLD_TIME 15 #define TOUCH_REPEAT_DELAY 75 @@ -150,15 +99,6 @@ class Touch { static void touch(touch_control_t *control); static void hold(touch_control_t *control, millis_t delay = 0); - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - static calibrationState calibration_state; - static touch_calibration_point_t calibration_points[4]; - - static bool validate_precision(int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > TOUCH_SCREEN_CALIBRATION_PRECISION; } - static bool validate_precision_x(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_x, calibration_points[b].raw_x); } - static bool validate_precision_y(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_y, calibration_points[b].raw_y); } - #endif // TOUCH_SCREEN_CALIBRATION - public: static void init(); static void reset() { controls_count = 0; touch_time = 0; current_control = NULL; } @@ -175,17 +115,6 @@ class Touch { static void enable() { enabled = true; } static void add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, intptr_t data = 0); - - static touch_calibration_t calibration; - static void calibration_reset() { calibration = {TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION}; } - - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - static calibrationState calibration_start() { calibration = {0, 0, 0, 0, TOUCH_ORIENTATION_NONE}; return calibration_state = CALIBRATION_POINT_1; } - static void calibration_end() { calibration_state = CALIBRATION_NONE; } - static calibrationState get_calibration_state() { return calibration_state; } - #endif // TOUCH_SCREEN_CALIBRATION }; extern Touch touch; - -#endif // TOUCH_SCREEN diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 559bc5b22233..3444cfe12f89 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -584,33 +584,37 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const #endif // AUTO_BED_LEVELING_UBL #if ENABLED(TOUCH_SCREEN_CALIBRATION) - void MarlinUI::touch_calibration() { - static uint16_t x, y; + void MarlinUI::touch_calibration_screen() { + uint16_t x, y; - calibrationState calibration_stage = touch.get_calibration_state(); + calibrationState calibration_stage = touch_calibration.get_calibration_state(); if (calibration_stage == CALIBRATION_NONE) { defer_status_screen(true); clear_lcd(); - calibration_stage = touch.calibration_start(); + calibration_stage = touch_calibration.calibration_start(); } else { + x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x; + y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y; tft.canvas(x - 15, y - 15, 31, 31); tft.set_background(COLOR_BACKGROUND); } - x = 20; y = 20; touch.clear(); if (calibration_stage < CALIBRATION_SUCCESS) { switch (calibration_stage) { - case CALIBRATION_POINT_1: tft_string.set("Top Left"); break; - case CALIBRATION_POINT_2: y = TFT_HEIGHT - 21; tft_string.set("Bottom Left"); break; - case CALIBRATION_POINT_3: x = TFT_WIDTH - 21; tft_string.set("Top Right"); break; - case CALIBRATION_POINT_4: x = TFT_WIDTH - 21; y = TFT_HEIGHT - 21; tft_string.set("Bottom Right"); break; + case CALIBRATION_TOP_LEFT: tft_string.set(GET_TEXT(MSG_TOP_LEFT)); break; + case CALIBRATION_BOTTOM_LEFT: tft_string.set(GET_TEXT(MSG_BOTTOM_LEFT)); break; + case CALIBRATION_TOP_RIGHT: tft_string.set(GET_TEXT(MSG_TOP_RIGHT)); break; + case CALIBRATION_BOTTOM_RIGHT: tft_string.set(GET_TEXT(MSG_BOTTOM_RIGHT)); break; default: break; } + x = touch_calibration.calibration_points[calibration_stage].x; + y = touch_calibration.calibration_points[calibration_stage].y; + tft.canvas(x - 15, y - 15, 31, 31); tft.set_background(COLOR_BACKGROUND); tft.add_bar(0, 15, 31, 1, COLOR_TOUCH_CALIBRATION); @@ -619,9 +623,9 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const touch.add_control(CALIBRATE, 0, 0, TFT_WIDTH, TFT_HEIGHT, uint32_t(x) << 16 | uint32_t(y)); } else { - tft_string.set(calibration_stage == CALIBRATION_SUCCESS ? "Calibration Completed" : "Calibration Failed"); + tft_string.set(calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED)); defer_status_screen(false); - touch.calibration_end(); + touch_calibration.calibration_end(); touch.add_control(BACK, 0, 0, TFT_WIDTH, TFT_HEIGHT); } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index e2bbdcde7f8e..ac76e81c93bb 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -589,33 +589,37 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const #endif // AUTO_BED_LEVELING_UBL #if ENABLED(TOUCH_SCREEN_CALIBRATION) - void MarlinUI::touch_calibration() { - static uint16_t x, y; + void MarlinUI::touch_calibration_screen() { + uint16_t x, y; - calibrationState calibration_stage = touch.get_calibration_state(); + calibrationState calibration_stage = touch_calibration.get_calibration_state(); if (calibration_stage == CALIBRATION_NONE) { defer_status_screen(true); clear_lcd(); - calibration_stage = touch.calibration_start(); + calibration_stage = touch_calibration.calibration_start(); } else { + x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x; + y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y; tft.canvas(x - 15, y - 15, 31, 31); tft.set_background(COLOR_BACKGROUND); } - x = 20; y = 20; touch.clear(); if (calibration_stage < CALIBRATION_SUCCESS) { switch (calibration_stage) { - case CALIBRATION_POINT_1: tft_string.set("Top Left"); break; - case CALIBRATION_POINT_2: y = TFT_HEIGHT - 21; tft_string.set("Bottom Left"); break; - case CALIBRATION_POINT_3: x = TFT_WIDTH - 21; tft_string.set("Top Right"); break; - case CALIBRATION_POINT_4: x = TFT_WIDTH - 21; y = TFT_HEIGHT - 21; tft_string.set("Bottom Right"); break; + case CALIBRATION_TOP_LEFT: tft_string.set(GET_TEXT(MSG_TOP_LEFT)); break; + case CALIBRATION_BOTTOM_LEFT: tft_string.set(GET_TEXT(MSG_BOTTOM_LEFT)); break; + case CALIBRATION_TOP_RIGHT: tft_string.set(GET_TEXT(MSG_TOP_RIGHT)); break; + case CALIBRATION_BOTTOM_RIGHT: tft_string.set(GET_TEXT(MSG_BOTTOM_RIGHT)); break; default: break; } + x = touch_calibration.calibration_points[calibration_stage].x; + y = touch_calibration.calibration_points[calibration_stage].y; + tft.canvas(x - 15, y - 15, 31, 31); tft.set_background(COLOR_BACKGROUND); tft.add_bar(0, 15, 31, 1, COLOR_TOUCH_CALIBRATION); @@ -624,9 +628,9 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const touch.add_control(CALIBRATE, 0, 0, TFT_WIDTH, TFT_HEIGHT, uint32_t(x) << 16 | uint32_t(y)); } else { - tft_string.set(calibration_stage == CALIBRATION_SUCCESS ? "Calibration Completed" : "Calibration Failed"); + tft_string.set(calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED)); defer_status_screen(false); - touch.calibration_end(); + touch_calibration.calibration_end(); touch.add_control(BACK, 0, 0, TFT_WIDTH, TFT_HEIGHT); } diff --git a/Marlin/src/lcd/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp new file mode 100644 index 000000000000..e4ad8f215ba8 --- /dev/null +++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp @@ -0,0 +1,81 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + +#include "touch_calibration.h" + +TouchCalibration touch_calibration; + +touch_calibration_t TouchCalibration::calibration; +calibrationState TouchCalibration::calibration_state = CALIBRATION_NONE; +touch_calibration_point_t TouchCalibration::calibration_points[4]; + +void TouchCalibration::validate_calibration() { + const bool landscape = validate_precision_x(0, 1) && validate_precision_x(2, 3) && validate_precision_y(0, 2) && validate_precision_y(1, 3); + const bool portrait = validate_precision_y(0, 1) && validate_precision_y(2, 3) && validate_precision_x(0, 2) && validate_precision_x(1, 3); + + if (landscape || portrait) { + calibration_state = CALIBRATION_SUCCESS; + calibration.x = ((calibration_points[2].x - calibration_points[0].x) << 17) / (calibration_points[3].raw_x + calibration_points[2].raw_x - calibration_points[1].raw_x - calibration_points[0].raw_x); + calibration.y = ((calibration_points[1].y - calibration_points[0].y) << 17) / (calibration_points[3].raw_y - calibration_points[2].raw_y + calibration_points[1].raw_y - calibration_points[0].raw_y); + calibration.offset_x = calibration_points[0].x - int16_t(((calibration_points[0].raw_x + calibration_points[1].raw_x) * calibration.x) >> 17); + calibration.offset_y = calibration_points[0].y - int16_t(((calibration_points[0].raw_y + calibration_points[2].raw_y) * calibration.y) >> 17); + calibration.orientation = landscape ? TOUCH_LANDSCAPE : TOUCH_PORTRAIT; + } + else { + calibration_state = CALIBRATION_FAIL; + calibration_reset(); + } + + if (calibration_state == CALIBRATION_SUCCESS) { + SERIAL_ECHOLNPGM("Touch screen calibration completed"); + SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x); + SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y); + SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x); + SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y); + SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT"); + } +} + +bool TouchCalibration::handleTouch(uint16_t x, uint16_t y) { + static millis_t next_button_update_ms = 0; + const millis_t now = millis(); + if (PENDING(now, next_button_update_ms)) return false; + next_button_update_ms = now + BUTTON_DELAY_MENU; + + if (calibration_state < CALIBRATION_SUCCESS) { + calibration_points[calibration_state].raw_x = x; + calibration_points[calibration_state].raw_y = y; + } + + switch (calibration_state) { + case CALIBRATION_TOP_LEFT: calibration_state = CALIBRATION_BOTTOM_LEFT; break; + case CALIBRATION_BOTTOM_LEFT: calibration_state = CALIBRATION_TOP_RIGHT; break; + case CALIBRATION_TOP_RIGHT: calibration_state = CALIBRATION_BOTTOM_RIGHT; break; + case CALIBRATION_BOTTOM_RIGHT: validate_calibration(); break; + default: break; + } + + return true; +} + +#endif // TOUCH_SCREEN_CALIBRATION diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h new file mode 100644 index 000000000000..5bebafffd250 --- /dev/null +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -0,0 +1,93 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../../inc/MarlinConfigPre.h" + +#ifndef TOUCH_SCREEN_CALIBRATION_PRECISION + #define TOUCH_SCREEN_CALIBRATION_PRECISION 80 +#endif + +#ifndef TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS + #define TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS 2500 +#endif + +#define TOUCH_ORIENTATION_NONE 0 +#define TOUCH_LANDSCAPE 1 +#define TOUCH_PORTRAIT 2 + +#ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE +#endif + +typedef struct __attribute__((__packed__)) { + int32_t x, y; + int16_t offset_x, offset_y; + uint8_t orientation; +} touch_calibration_t; + +typedef struct __attribute__((__packed__)) { + uint16_t x, y; + int16_t raw_x, raw_y; +} touch_calibration_point_t; + +enum calibrationState : uint8_t { + CALIBRATION_TOP_LEFT = 0x00, + CALIBRATION_BOTTOM_LEFT, + CALIBRATION_TOP_RIGHT, + CALIBRATION_BOTTOM_RIGHT, + CALIBRATION_SUCCESS, + CALIBRATION_FAIL, + CALIBRATION_NONE, +}; + +class TouchCalibration { +public: + static calibrationState calibration_state; + static touch_calibration_point_t calibration_points[4]; + + static bool validate_precision(int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > TOUCH_SCREEN_CALIBRATION_PRECISION; } + static bool validate_precision_x(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_x, calibration_points[b].raw_x); } + static bool validate_precision_y(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_y, calibration_points[b].raw_y); } + static void validate_calibration(); + + static touch_calibration_t calibration; + static void calibration_reset() { calibration = { TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION }; } + static bool need_calibration() { return !calibration.offset_x && !calibration.offset_y && !calibration.x && !calibration.y; } + + static calibrationState calibration_start() { + calibration = { 0, 0, 0, 0, TOUCH_ORIENTATION_NONE }; + calibration_state = CALIBRATION_TOP_LEFT; + calibration_points[CALIBRATION_TOP_LEFT].x = 30; + calibration_points[CALIBRATION_TOP_LEFT].y = 30; + calibration_points[CALIBRATION_BOTTOM_LEFT].x = 30; + calibration_points[CALIBRATION_BOTTOM_LEFT].y = TFT_HEIGHT - 31; + calibration_points[CALIBRATION_TOP_RIGHT].x = TFT_WIDTH - 31; + calibration_points[CALIBRATION_TOP_RIGHT].y = 30; + calibration_points[CALIBRATION_BOTTOM_RIGHT].x = TFT_WIDTH - 31; + calibration_points[CALIBRATION_BOTTOM_RIGHT].y = TFT_HEIGHT - 31; + return calibration_state; + } + static void calibration_end() { calibration_state = CALIBRATION_NONE; } + static calibrationState get_calibration_state() { return calibration_state; } + + static bool handleTouch(uint16_t x, uint16_t y); +}; + +extern TouchCalibration touch_calibration; diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 4e984869692a..8e231ca9abfe 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -19,7 +19,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_TOUCH_XPT2046 +#if HAS_TOUCH_BUTTONS #include "touch_buttons.h" #include "../scaled_tft.h" @@ -27,7 +27,11 @@ #include HAL_PATH(../../HAL, tft/xpt2046.h) XPT2046 touchIO; -#include "../../lcd/marlinui.h" // For EN_C bit mask +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../tft_io/touch_calibration.h" +#endif + +#include "../marlinui.h" // For EN_C bit mask #define DOGM_AREA_LEFT TFT_PIXEL_OFFSET_X #define DOGM_AREA_TOP TFT_PIXEL_OFFSET_Y @@ -47,14 +51,20 @@ uint8_t TouchButtons::read_buttons() { if (!touchIO.getRawPoint(&x, &y)) return 0; - x = uint16_t((uint32_t(x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; - y = uint16_t((uint32_t(y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; - - #if (TFT_ROTATION & TFT_ROTATE_180) - x = TFT_WIDTH - x; - y = TFT_HEIGHT - y; + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + const calibrationState state = touch_calibration.get_calibration_state(); + if (state >= CALIBRATION_TOP_LEFT && state <= CALIBRATION_BOTTOM_RIGHT) { + if (touch_calibration.handleTouch(x, y)) ui.refresh(); + return 0; + } + x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; + y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; + #else + x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; #endif + // Touch within the button area simulates an encoder button if (y > BUTTON_AREA_TOP && y < BUTTON_AREA_BOT) return WITHIN(x, BUTTOND_X_LO, BUTTOND_X_HI) ? EN_D @@ -77,4 +87,4 @@ uint8_t TouchButtons::read_buttons() { return 0; } -#endif // HAS_TOUCH_XPT2046 +#endif // HAS_TOUCH_BUTTONS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index b1b9bb6e0af5..21997b4740f6 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -146,7 +146,7 @@ #endif #if ENABLED(TOUCH_SCREEN_CALIBRATION) - #include "../lcd/tft/touch.h" + #include "../lcd/tft_io/touch_calibration.h" #endif #if HAS_ETHERNET @@ -443,7 +443,7 @@ typedef struct SettingsDataStruct { // TOUCH_SCREEN_CALIBRATION // #if ENABLED(TOUCH_SCREEN_CALIBRATION) - touch_calibration_t touch_calibration; + touch_calibration_t touch_calibration_data; #endif // Ethernet settings @@ -1410,7 +1410,7 @@ void MarlinSettings::postprocess() { // TOUCH_SCREEN_CALIBRATION // #if ENABLED(TOUCH_SCREEN_CALIBRATION) - EEPROM_WRITE(touch.calibration); + EEPROM_WRITE(touch_calibration.calibration); #endif // @@ -2293,8 +2293,8 @@ void MarlinSettings::postprocess() { // TOUCH_SCREEN_CALIBRATION // #if ENABLED(TOUCH_SCREEN_CALIBRATION) - _FIELD_TEST(touch.calibration); - EEPROM_READ(touch.calibration); + _FIELD_TEST(touch_calibration_data); + EEPROM_READ(touch_calibration.calibration); #endif // @@ -2626,7 +2626,7 @@ void MarlinSettings::reset() { // // TOUCH_SCREEN_CALIBRATION // - TERN_(TOUCH_SCREEN_CALIBRATION, touch.calibration_reset()); + TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); // // Buzzer enable/disable 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 bb2cacd5ba0e..04e9a2f80ad9 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -353,36 +353,7 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - // XPT2046 Touch Screen calibration - #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11245 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8629 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 685 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -285 - #endif - #elif ENABLED(TFT_480x320_SPI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17232 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11196 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1047 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -358 - #endif - - #define TFT_BUFFER_SIZE 2400 - #endif + #define TFT_BUFFER_SIZE 2400 #elif IS_TFTGLCD_PANEL diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index b0d1ec1f03b7..705dd4f9aa3a 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -268,36 +268,7 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - // XPT2046 Touch Screen calibration - #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 689 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -273 - #endif - #elif ENABLED(TFT_COLOR_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -16741 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11258 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1024 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -367 - #endif - - #define TFT_BUFFER_SIZE 2400 - #endif + #define TFT_BUFFER_SIZE 2400 #define BTN_EN1 P3_25 #define BTN_EN2 P3_26 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 dcf0741a7699..8d2ce364b209 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -318,36 +318,7 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - // XPT2046 Touch Screen calibration - #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 689 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -273 - #endif - #elif ENABLED(TFT_COLOR_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17089 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11424 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1044 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -365 - #endif - - #define TFT_BUFFER_SIZE 2400 - #endif + #define TFT_BUFFER_SIZE 2400 #else // !MKS_12864OLED_SSD1306 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index b13fde026c93..32d4e0c9d478 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -158,17 +158,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index a015fb27041f..066a6cc8aa03 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -173,17 +173,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 5f91072440f5..a056aa96e57f 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -286,22 +286,22 @@ // MKS Robin TFT v2.0 with ILI9341 // Read display identification information (0xD3 on ILI9341) -//#define XPT2046_X_CALIBRATION 12013 -//#define XPT2046_Y_CALIBRATION -8711 -//#define XPT2046_X_OFFSET -32 -//#define XPT2046_Y_OFFSET 256 +//#define TOUCH_CALIBRATION_X 12013 +//#define TOUCH_CALIBRATION_Y -8711 +//#define TOUCH_OFFSET_X -32 +//#define TOUCH_OFFSET_Y 256 // MKS Robin TFT v1.1 with ILI9328 -//#define XPT2046_X_CALIBRATION -11792 -//#define XPT2046_Y_CALIBRATION 8947 -//#define XPT2046_X_OFFSET 342 -//#define XPT2046_Y_OFFSET -19 +//#define TOUCH_CALIBRATION_X -11792 +//#define TOUCH_CALIBRATION_Y 8947 +//#define TOUCH_OFFSET_X 342 +//#define TOUCH_OFFSET_Y -19 // MKS Robin TFT v1.1 with R61505 -//#define XPT2046_X_CALIBRATION 12489 -//#define XPT2046_Y_CALIBRATION 9210 -//#define XPT2046_X_OFFSET -52 -//#define XPT2046_Y_OFFSET -17 +//#define TOUCH_CALIBRATION_X 12489 +//#define TOUCH_CALIBRATION_Y 9210 +//#define TOUCH_OFFSET_X -52 +//#define TOUCH_OFFSET_Y -17 // QQS-Pro uses MKS Robin TFT v2.0 @@ -324,42 +324,6 @@ #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 #endif -// XPT2046 Touch Screen calibration -#if EITHER(TFT_LVGL_UI_FSMC, TFT_COLOR_UI) - #define TFT_BUFFER_SIZE 14400 - - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12218 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -8814 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -35 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 256 - #endif - -#elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12149 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -8746 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -35 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 256 - #endif - - #define TFT_MARLINUI_COLOR 0xFFFF // White - #define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow - #define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan -#endif - #if NEED_TOUCH_PINS #define TOUCH_CS_PIN PC2 // SPI2_NSS #define TOUCH_SCK_PIN PB13 // SPI2_SCK diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 9c0f2deeab96..b1f41f9fa7f9 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -282,35 +282,6 @@ #define TFT_BUFFER_SIZE 14400 #endif -// XPT2046 Touch Screen calibration -#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320_SPI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17253 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11579 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 514 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -24 - #endif -#elif HAS_SPI_GRAPHICAL_TFT - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 339 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -18 - #endif -#endif - #if HAS_WIRED_LCD && !HAS_SPI_TFT // NON TFT Displays diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 2406c22d55ae..ca4dd8d7924d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -171,17 +171,17 @@ #endif #if ENABLED(TOUCH_SCREEN) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12033 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 12033 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -9047 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -9047 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -30 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -30 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 254 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 254 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 3c9b2f5b5968..760f27060ec2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -202,35 +202,6 @@ #define TFT_BUFFER_SIZE 14400 #endif -// XPT2046 Touch Screen calibration -#if ANY(HAS_TFT_LVGL_UI_FSMC, TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_480x320) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 17880 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -12234 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -45 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 349 - #endif -#elif EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_320x240) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -12246 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 9453 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 360 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -22 - #endif -#endif - #define HAS_SPI_FLASH 1 #if HAS_SPI_FLASH #define SPI_FLASH_SIZE 0x1000000 // 16MB diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 9c1d073da6ba..8b4129697122 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -285,22 +285,6 @@ #define TFT_BUFFER_SIZE 14400 #endif -// XPT2046 Touch Screen calibration -#if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17253 - #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11579 - #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 514 - #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -24 - #endif -#endif - #if HAS_WIRED_LCD && !HAS_SPI_TFT // NON TFT Displays diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 2fc34ce296ca..543a90b66b91 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -141,17 +141,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif diff --git a/platformio.ini b/platformio.ini index 932d19075dff..626c7d2bec38 100644 --- a/platformio.ini +++ b/platformio.ini @@ -236,7 +236,7 @@ HAS_SPI_TFT = src_filter=+ + DWIN_CREALITY_LCD = src_filter=+ IS_TFTGLCD_PANEL = src_filter=+ -HAS_TOUCH_XPT2046 = src_filter=+ +HAS_TOUCH_BUTTONS = src_filter=+ HAS_LCD_MENU = src_filter=+ HAS_GAMES = src_filter=+ MARLIN_BRICKOUT = src_filter=+ From 101d57d093a6eda49b7feddfba3ff50ee80433bc Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 16 Nov 2020 00:11:06 +0000 Subject: [PATCH 162/443] [cron] Bump distribution date (2020-11-16) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a0ed5f49349c..5fd4b85a3492 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-15" + #define STRING_DISTRIBUTION_DATE "2020-11-16" #endif /** From e955dce3dc08163cd8c83d8a87ddd1357acc1f97 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 16 Nov 2020 00:56:05 -0500 Subject: [PATCH 163/443] Update IDEX menus, add post-M605 event G-code (#20133) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/gcode/control/M605.cpp | 4 ++++ Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/menu/menu_configuration.cpp | 15 +++++++++------ buildroot/tests/mega2560-tests | 6 +++--- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ecc6f9dd891f..2c9ac1aea46a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -637,6 +637,9 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 + + // Default action to execute following M605 mode change commands. Typically G28X to apply new mode. + //#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X" #endif // Activate a solenoid on the active extruder with M380. Disable all with M381. diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index b1e54b25e779..0d7a9f431b23 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -103,6 +103,10 @@ } idex_set_parked(false); set_duplication_enabled(false); + + #ifdef EVENT_GCODE_IDEX_AFTER_MODECHANGE + gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_IDEX_AFTER_MODECHANGE)); + #endif } else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index d14880d9772d..4231eca5ce9a 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -144,6 +144,7 @@ namespace Language_en { PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication"); PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy"); PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Duplicate X-Gap"); PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z"); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index f667242bc171..2c3af1e5ee2d 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -194,16 +194,19 @@ void menu_advanced_settings(); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); + GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605S1\nG28X\nG1X0")); GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28 - ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first - : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100") + ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first + : PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0") ); GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28 - ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first - : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") + ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first + : PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3") ); - GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); + GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X")); + + EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20); + END_MENU(); } diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index 9ae43dcdb5d1..cc9830be361c 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -259,10 +259,10 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home ######## Example Configurations ############## # -# Test a full-featured CR-10S config +# Test a basic DUAL_X_CARRIAGE configuration # -use_example_configs Creality/CR-10S -exec_test $1 $2 "Full-featured CR-10S config" +use_example_configs Formbot/T_Rex_3 +exec_test $1 $2 "Formbot/T_Rex_3 example configuration." # # BQ Hephestos 2 From 110e0d782f50082819101ca39ad4e38300046467 Mon Sep 17 00:00:00 2001 From: FanDjango <51046875+FanDjango@users.noreply.github.com> Date: Mon, 16 Nov 2020 21:56:05 +0100 Subject: [PATCH 164/443] Guards for large BLOCK_BUFFER_SIZE (>=128) (#20130) Co-authored-by: Scott Lahteine --- Marlin/src/inc/SanityCheck.h | 2 ++ Marlin/src/module/planner.cpp | 18 ++++++++---------- Marlin/src/module/planner.h | 6 +++++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 22930a76218c..18506163f50d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2759,6 +2759,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) #error "BLOCK_BUFFER_SIZE must be a power of 2." +#elif BLOCK_BUFFER_SIZE > 64 + #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel." #endif #if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 74535df1f9c9..147adb12e3d2 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -213,7 +213,7 @@ xyze_float_t Planner::previous_speed; float Planner::previous_nominal_speed_sqr; #if ENABLED(DISABLE_INACTIVE_EXTRUDER) - uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; + last_move_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; #endif #ifdef XY_FREQUENCY_LIMIT @@ -2037,22 +2037,20 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder LOOP_L_N(i, EXTRUDERS) - if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; - - #if HAS_DUPLICATION_MODE - if (extruder_duplication_enabled && extruder == 0) { - ENABLE_AXIS_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - } - #endif + if (g_uc_extruder_last_move[i]) g_uc_extruder_last_move[i]--; #define ENABLE_ONE_E(N) do{ \ if (extruder == N) { \ ENABLE_AXIS_E##N(); \ g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \ + if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \ + ENABLE_AXIS_E1(); \ } \ - else if (!g_uc_extruder_last_move[N]) \ + else if (!g_uc_extruder_last_move[N]) { \ DISABLE_AXIS_E##N(); \ + if ((N) == 0 && TERN0(HAS_DUPLICATION_MODE, extruder_duplication_enabled)) \ + DISABLE_AXIS_E1(); \ + } \ }while(0); #else diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index c4e11490b161..ac30938f2a4a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -287,6 +287,10 @@ typedef struct { #endif } skew_factor_t; +#if ENABLED(DISABLE_INACTIVE_EXTRUDER) + typedef IF<(BLOCK_BUFFER_SIZE > 64), uint16_t, uint8_t>::type last_move_t; +#endif + class Planner { public: @@ -435,7 +439,7 @@ class Planner { #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Counters to manage disabling inactive extruders - static uint8_t g_uc_extruder_last_move[EXTRUDERS]; + static last_move_t g_uc_extruder_last_move[EXTRUDERS]; #endif #if HAS_WIRED_LCD From 4dd2496530d3d42205aaf874bcb6f356685aa464 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 16 Nov 2020 12:56:59 -0800 Subject: [PATCH 165/443] Allow dummy thermistors without pin definitions (#20159) --- Marlin/src/inc/Conditionals_post.h | 26 ++++++++++++++++++++++++-- Marlin/src/inc/SanityCheck.h | 16 ++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 9fb3e53c4ea2..f8727dd9630a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -458,6 +458,8 @@ #define HEATER_0_USES_THERMISTOR 1 #if TEMP_SENSOR_0 == 1000 #define HEATER_0_USER_THERMISTOR 1 + #elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999 + #define HEATER_0_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_0_MINTEMP @@ -496,6 +498,8 @@ #define HEATER_1_USES_THERMISTOR 1 #if TEMP_SENSOR_1 == 1000 #define HEATER_1_USER_THERMISTOR 1 + #elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999 + #define HEATER_1_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_1_MINTEMP @@ -515,6 +519,8 @@ #define HEATER_2_USES_THERMISTOR 1 #if TEMP_SENSOR_2 == 1000 #define HEATER_2_USER_THERMISTOR 1 + #elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999 + #define HEATER_2_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_2_MINTEMP @@ -534,6 +540,8 @@ #define HEATER_3_USES_THERMISTOR 1 #if TEMP_SENSOR_3 == 1000 #define HEATER_3_USER_THERMISTOR 1 + #elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999 + #define HEATER_3_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_3_MINTEMP @@ -553,6 +561,8 @@ #define HEATER_4_USES_THERMISTOR 1 #if TEMP_SENSOR_4 == 1000 #define HEATER_4_USER_THERMISTOR 1 + #elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999 + #define HEATER_4_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_4_MINTEMP @@ -572,6 +582,8 @@ #define HEATER_5_USES_THERMISTOR 1 #if TEMP_SENSOR_5 == 1000 #define HEATER_5_USER_THERMISTOR 1 + #elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999 + #define HEATER_5_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_5_MINTEMP @@ -591,6 +603,8 @@ #define HEATER_6_USES_THERMISTOR 1 #if TEMP_SENSOR_6 == 1000 #define HEATER_6_USER_THERMISTOR 1 + #elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999 + #define HEATER_6_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_6_MINTEMP @@ -610,6 +624,8 @@ #define HEATER_7_USES_THERMISTOR 1 #if TEMP_SENSOR_7 == 1000 #define HEATER_7_USER_THERMISTOR 1 + #elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999 + #define HEATER_7_DUMMY_THERMISTOR 1 #endif #else #undef HEATER_7_MINTEMP @@ -629,6 +645,8 @@ #define HEATER_BED_USES_THERMISTOR 1 #if TEMP_SENSOR_BED == 1000 #define HEATER_BED_USER_THERMISTOR 1 + #elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999 + #define HEATER_BED_DUMMY_THERMISTOR 1 #endif #else #undef BED_MINTEMP @@ -648,6 +666,8 @@ #define HEATER_CHAMBER_USES_THERMISTOR 1 #if TEMP_SENSOR_CHAMBER == 1000 #define HEATER_CHAMBER_USER_THERMISTOR 1 + #elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999 + #define HEATER_CHAMBER_DUMMY_THERMISTOR 1 #endif #else #undef CHAMBER_MINTEMP @@ -667,6 +687,8 @@ #define HEATER_PROBE_USES_THERMISTOR 1 #if TEMP_SENSOR_PROBE == 1000 #define HEATER_PROBE_USER_THERMISTOR 1 + #elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999 + #define HEATER_PROBE_DUMMY_THERMISTOR 1 #endif #endif @@ -1754,7 +1776,7 @@ // // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) // -#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) +#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && NONE(HEATER_##P##_USES_MAX6675, HEATER_##P##_DUMMY_THERMISTOR)) #if HAS_ADC_TEST(0) #define HAS_TEMP_ADC_0 1 #endif @@ -1789,7 +1811,7 @@ #define HAS_TEMP_ADC_CHAMBER 1 #endif -#if HAS_HOTEND && EITHER(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675) +#if HAS_HOTEND && ANY(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675, HEATER_0_DUMMY_THERMISTOR) #define HAS_TEMP_HOTEND 1 #endif #define HAS_TEMP_BED HAS_TEMP_ADC_BED diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 18506163f50d..65504ab7952d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1638,7 +1638,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal */ #if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS) #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif HAS_HOTEND && !HAS_TEMP_HOTEND +#elif HAS_HOTEND && !HAS_TEMP_HOTEND && !HEATER_0_DUMMY_THERMISTOR #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." @@ -1649,7 +1649,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." #elif TEMP_SENSOR_1 == 0 #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !ANY_PIN(TEMP_1, MAX6675_SS2) + #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !HEATER_1_DUMMY_THERMISTOR #error "TEMP_1_PIN not defined for this board." #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." @@ -1659,7 +1659,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." #elif !HAS_HEATER_2 #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) + #elif !PIN_EXISTS(TEMP_2) && !HEATER_2_DUMMY_THERMISTOR #error "TEMP_2_PIN not defined for this board." #endif #if HOTENDS > 3 @@ -1667,7 +1667,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." #elif !HAS_HEATER_3 #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) + #elif !PIN_EXISTS(TEMP_3) && !HEATER_3_DUMMY_THERMISTOR #error "TEMP_3_PIN not defined for this board." #endif #if HOTENDS > 4 @@ -1675,7 +1675,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS." #elif !HAS_HEATER_4 #error "HEATER_4_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_4) + #elif !PIN_EXISTS(TEMP_4) && !HEATER_4_DUMMY_THERMISTOR #error "TEMP_4_PIN not defined for this board." #endif #if HOTENDS > 5 @@ -1683,7 +1683,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_5 is required with 6 HOTENDS." #elif !HAS_HEATER_5 #error "HEATER_5_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_5) + #elif !PIN_EXISTS(TEMP_5) && !HEATER_5_DUMMY_THERMISTOR #error "TEMP_5_PIN not defined for this board." #endif #if HOTENDS > 6 @@ -1691,7 +1691,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_6 is required with 6 HOTENDS." #elif !HAS_HEATER_6 #error "HEATER_6_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_6) + #elif !PIN_EXISTS(TEMP_6) && !HEATER_6_DUMMY_THERMISTOR #error "TEMP_6_PIN not defined for this board." #endif #if HOTENDS > 7 @@ -1699,7 +1699,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_7 is required with 7 HOTENDS." #elif !HAS_HEATER_7 #error "HEATER_7_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_7) + #elif !PIN_EXISTS(TEMP_7) && !HEATER_7_DUMMY_THERMISTOR #error "TEMP_7_PIN not defined for this board." #endif #elif TEMP_SENSOR_7 != 0 From 59d2871b5935f1319d80cc47e6febe2f0d9cf702 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 17 Nov 2020 00:10:50 +0000 Subject: [PATCH 166/443] [cron] Bump distribution date (2020-11-17) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 5fd4b85a3492..b03d1b81c964 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-16" + #define STRING_DISTRIBUTION_DATE "2020-11-17" #endif /** From c12e6933f5c25c8bb64b913edaba19903cf8cf55 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 17 Nov 2020 00:37:37 -0800 Subject: [PATCH 167/443] Multi-Hotend Preheat Fixes (#20165) * Return to Status Screen on Multi-Hotend Preheat All Co-authored-by: Victor Oliveira <81722+rhapsodv@users.noreply.github.com> --- Marlin/src/lcd/menu/menu_temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index f91430132838..7b6d7f1a1db6 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -108,8 +108,8 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i HOTEND_LOOP() PREHEAT_ITEMS(editable.int8, e); ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() { - TERN_(HAS_HEATED_BED, []{ _preheat_bed(editable.int8); }); HOTEND_LOOP() thermalManager.setTargetHotend(ui.material_preset[editable.int8].hotend_temp, e); + TERN(HAS_HEATED_BED, _preheat_bed(editable.int8), ui.return_to_status()); }); #endif From 9767e59e6c4d1a71492fde638546dc836befb093 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 17 Nov 2020 00:40:37 -0800 Subject: [PATCH 168/443] Allow overriding servo pin for MKS Robin Mini (#20158) --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index ca4dd8d7924d..ae6835758993 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -111,7 +111,9 @@ #define POWER_LOSS_PIN PA2 // PW_DET #define PS_ON_PIN PA3 // PW_OFF -#define SERVO0_PIN PA8 // Enable BLTOUCH support on IO0 (WIFI connector) +#ifndef SERVO0_PIN + #define SERVO0_PIN PA8 // Enable BLTOUCH support on IO0 (WIFI connector) +#endif #define MT_DET_1_PIN PA4 #define MT_DET_PIN_INVERTING false From 7930fd9ce8409034cf4227c6da53d7f2e7db663a Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 17 Nov 2020 05:45:01 -0300 Subject: [PATCH 169/443] Use intptr types (simulator) (#20142) --- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index d7d09fda5b75..600d7e3faa37 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -458,7 +458,7 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p case U8G_COM_MSG_WRITE_SEQ: tftio.DataTransferBegin(DATASIZE_16BIT); for (uint8_t i = 0; i < arg_val; i += 2) - tftio.WriteData(*(uint16_t *)(((uint32_t)arg_ptr) + i)); + tftio.WriteData(*(uint16_t *)(((uintptr_t)arg_ptr) + i)); tftio.DataTransferEnd(); break; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index ac76e81c93bb..6d1043068d01 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -941,7 +941,7 @@ static void disable_steppers() { queue.inject_P(PSTR("M84")); } -static void drawBtn(int x, int y, const char* label, int32_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { +static void drawBtn(int x, int y, const char* label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { uint16_t width = Images[imgBtn52Rounded].width; uint16_t height = Images[imgBtn52Rounded].height; @@ -982,11 +982,11 @@ void MarlinUI::move_axis_screen() { // ROW 1 -> E- Y- CurY Z+ int x = X_MARGIN, y = Y_MARGIN, spacing = 0; - drawBtn(x, y, "E+", (int32_t)e_plus, imgUp, E_BTN_COLOR, !busy); + drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; x += BTN_WIDTH + spacing; - drawBtn(x, y, "Y+", (int32_t)y_plus, imgUp, Y_BTN_COLOR, !busy); + drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); // Cur Y x += BTN_WIDTH; @@ -995,7 +995,7 @@ void MarlinUI::move_axis_screen() { drawAxisValue(Y_AXIS); x += spacing; - drawBtn(x, y, "Z+", (int32_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step // ROW 2 -> "Ex" X- HOME X+ "Z" y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; @@ -1005,24 +1005,24 @@ void MarlinUI::move_axis_screen() { motionAxisState.eNamePos.x = x; motionAxisState.eNamePos.y = y; drawCurESelection(); - TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (int32_t)e_select)); + TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); x += BTN_WIDTH + spacing; - drawBtn(x, y, "X-", (int32_t)x_minus, imgLeft, X_BTN_COLOR, !busy); + drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); x += BTN_WIDTH + spacing; //imgHome is 64x64 - TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (int32_t)do_home, imgHome, !busy)); + TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); x += BTN_WIDTH + spacing; uint16_t xplus_x = x; - drawBtn(x, y, "X+", (int32_t)x_plus, imgRight, X_BTN_COLOR, !busy); + drawBtn(x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); x += BTN_WIDTH + spacing; motionAxisState.zTypePos.x = x; motionAxisState.zTypePos.y = y; drawCurZSelection(); #if HAS_BED_PROBE - if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (int32_t)z_select); + if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); #endif // ROW 3 -> E- CurX Y- Z- @@ -1030,7 +1030,7 @@ void MarlinUI::move_axis_screen() { x = X_MARGIN; spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; - drawBtn(x, y, "E-", (int32_t)e_minus, imgDown, E_BTN_COLOR, !busy); + drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); // Cur E motionAxisState.eValuePos.x = x; @@ -1043,10 +1043,10 @@ void MarlinUI::move_axis_screen() { drawAxisValue(X_AXIS); x += BTN_WIDTH + spacing; - drawBtn(x, y, "Y-", (int32_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); x += BTN_WIDTH + spacing; - drawBtn(x, y, "Z-", (int32_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step // Cur Z motionAxisState.zValuePos.x = x; @@ -1060,11 +1060,11 @@ void MarlinUI::move_axis_screen() { motionAxisState.stepValuePos.y = y; if (!busy) { drawCurStepValue(); - TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (int32_t)step_size)); + TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); } // alinged with x+ - drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (int32_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } From b57ca6e4accb8d438fa3277de80448fbe9b01823 Mon Sep 17 00:00:00 2001 From: ellensp Date: Tue, 17 Nov 2020 21:45:43 +1300 Subject: [PATCH 170/443] add ethernet to src filter (#20136) Co-authored-by: ellensp --- platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio.ini b/platformio.ini index 626c7d2bec38..1e0b84b6255a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -77,6 +77,7 @@ default_src_filter = + - - + - - - - + - - - - - - From 9b2e810bdf1df853719c6e3c2c2d4af80582263f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E7=AB=8B=E6=9E=AB?= <49380822+FLYmaker@users.noreply.github.com> Date: Tue, 17 Nov 2020 19:35:02 +0800 Subject: [PATCH 171/443] Add FLY_CDY board (#19979) Co-authored-by: FLYmaker Co-authored-by: Scott Lahteine Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 188 +++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 3 files changed, 191 insertions(+) create mode 100644 Marlin/src/pins/lpc1769/pins_FLY_CDY.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index efccc3716de8..b60f73c2dc58 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -243,6 +243,7 @@ #define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 (Power outputs: Hotend0, Hotend1, Bed, Fan) #define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Bed, Fan0, Fan1) +#define BOARD_FLY_CDY 2511 // FLY_CDY (Power outputs: Hotend0, Hotend1, Hotend2, Bed, Fan0, Fan1, Fan2) // // SAM3X8E ARM Cortex M3 diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h new file mode 100644 index 000000000000..b678917734cb --- /dev/null +++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h @@ -0,0 +1,188 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(MCU_LPC1769) + #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." +#endif + +#define BOARD_INFO_NAME "FLY-CDY" +#define BOARD_WEBSITE_URL "https://github.com/FLYmaker/FLY-CDY" + +// +// Servos +// +#define SERVO0_PIN P1_26 + + +// +// Limit Switches +// + +#define X_MIN_PIN P1_29 // X- +#define X_MAX_PIN P1_28 // X+ +#define Y_MIN_PIN P1_27 // Y- +#define Y_MAX_PIN P1_25 // Y+ +#define Z_MIN_PIN P1_22 // Z- +#define Z_MAX_PIN P0_27 // Z+ + + +// +// Steppers +// +#define X_STEP_PIN P2_00 +#define X_DIR_PIN P1_01 +#define X_ENABLE_PIN P1_00 +#ifndef X_CS_PIN + #define X_CS_PIN P1_04 +#endif + +#define Y_STEP_PIN P2_01 +#define Y_DIR_PIN P1_09 +#define Y_ENABLE_PIN P1_08 +#ifndef Y_CS_PIN + #define Y_CS_PIN P1_10 +#endif + +#define Z_STEP_PIN P2_02 +#define Z_DIR_PIN P1_15 +#define Z_ENABLE_PIN P1_14 +#ifndef Z_CS_PIN + #define Z_CS_PIN P1_16 +#endif + +#define E0_STEP_PIN P2_03 +#define E0_DIR_PIN P4_29 +#define E0_ENABLE_PIN P1_17 +#ifndef E0_CS_PIN + #define E0_CS_PIN P4_28 +#endif + +#define E1_STEP_PIN P2_04 +#define E1_DIR_PIN P2_11 +#define E1_ENABLE_PIN P0_04 +#ifndef E1_CS_PIN + #define E1_CS_PIN P2_12 +#endif + +#define E2_STEP_PIN P2_05 +#define E2_DIR_PIN P0_11 +#define E2_ENABLE_PIN P2_13 +#ifndef E2_CS_PIN + #define E2_CS_PIN P0_10 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P0_20 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_19 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_21 + #endif +#endif + + +#if HAS_TMC_UART + #define X_SERIAL_TX_PIN P1_04 + #define X_SERIAL_RX_PIN P1_04 + + #define Y_SERIAL_TX_PIN P1_10 + #define Y_SERIAL_RX_PIN P1_10 + + #define Z_SERIAL_TX_PIN P1_16 + #define Z_SERIAL_RX_PIN P1_16 + + #define E0_SERIAL_TX_PIN P4_28 + #define E0_SERIAL_RX_PIN P4_28 + + #define E1_SERIAL_TX_PIN P2_12 + #define E1_SERIAL_RX_PIN P2_12 + + #define E2_SERIAL_TX_PIN P0_10 + #define E2_SERIAL_RX_PIN P0_10 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + + + +// +// Temperature Sensors +// +#define TEMP_0_PIN P0_26_A3 // (T4) +#define TEMP_1_PIN P0_25_A2 // (T3) +#define TEMP_2_PIN P0_24_A1 // (T2) +#define TEMP_BED_PIN P0_23_A0 // (T1) + +// +// Heaters / Fans +// +#define HEATER_BED_PIN P3_26 +#define HEATER_0_PIN P3_25 +#define HEATER_1_PIN P1_20 +#define HEATER_2_PIN P1_23 +#ifndef FAN_PIN + #define FAN_PIN P1_18 +#endif +#define FAN1_PIN P1_21 +#define FAN2_PIN P1_24 + + +// +// LCD / Controller +// +#define BEEPER_PIN P2_07 +#define LCD_PINS_RS P2_10 +#define LCD_PINS_ENABLE P0_22 +#define LCD_PINS_D4 P1_19 +#define LCD_PINS_D5 P2_08 +#define LCD_PINS_D6 P1_30 +#define LCD_PINS_D7 P1_31 +#define BTN_EN1 P0_00 +#define BTN_EN2 P0_01 +#define BTN_ENC P0_28 + + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SS_PIN P0_06 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SD_DETECT_PIN P0_05 +#elif SD_CONNECTION_IS(LCD) + #define SCK_PIN P0_15 + #define MISO_PIN P0_17 + #define MOSI_PIN P0_18 + #define SS_PIN P0_16 + #define SD_DETECT_PIN P2_06 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5eb4717e7863..b9e12d823315 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -433,6 +433,8 @@ #include "lpc1769/pins_MKS_SGEN_L_V2.h" // LPC1769 env:LPC1769 #elif MB(BTT_SKR_E3_TURBO) #include "lpc1769/pins_BTT_SKR_E3_TURBO.h" // LPC1769 env:LPC1769 +#elif MB(FLY_CDY) + #include "lpc1769/pins_FLY_CDY.h" // LPC1769 env:LPC1769 // // Due (ATSAM) boards From a15ab8555712c1ac7c9a0831b7185700b6979b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Morav=C4=8D=C3=ADk?= Date: Tue, 17 Nov 2020 21:30:06 +0100 Subject: [PATCH 172/443] Update Slovak language (#20181) --- Marlin/src/lcd/language/language_sk.h | 29 +++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index e3de108191d0..77e4b4642429 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -66,7 +66,9 @@ namespace Language_sk { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto-zarovn. Z"); - PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Asist. vyrovnanie"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("Iterácia G34: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Klesajúca presnosť!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Dosiahnutá presnosť"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Parkovanie XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím začnete"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Ďalší bod"); @@ -75,6 +77,10 @@ namespace Language_sk { PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastaviť ofsety"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nastaviť začiatok"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Asist. vyrovnanie"); + PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); + PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); + PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Posl. hodnota "); #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Zahriať ") PREHEAT_1_LABEL; PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Zahriať ") PREHEAT_1_LABEL " ~"; @@ -131,6 +137,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikácia"); PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrkadlená kópia"); PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Duplik. medz.-X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z"); @@ -248,7 +255,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_BED_Z = _UxGT("Výška podl."); PROGMEM Language_Str MSG_NOZZLE = _UxGT("Tryska"); PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Tryska ~"); - PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Tryska zaparkovná"); + PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Tryska zaparkovaná"); PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Záložná tryska"); PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); @@ -259,7 +266,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ~"); PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Vent. riad. jedn."); PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Voľno. rýchl."); - PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Auto-režím"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Auto-režim"); PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Aktív. rýchl."); PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Doba nečinnosti"); PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); @@ -435,6 +442,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("X ofset"); PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Y ofset"); PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); + PROGMEM Language_Str MSG_MOVE_NOZZLE_TO_BED = _UxGT("Pos. trysku k podl."); PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); @@ -588,7 +596,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_PASSWORD_SET = _UxGT("Heslo je "); PROGMEM Language_Str MSG_START_OVER = _UxGT("Začať odznova"); PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Nezabudnite uložiť!"); - PROGMEM Language_Str MSG_PASSWORD_REMOVED = _UxGT("Heslo odstránene"); + PROGMEM Language_Str MSG_PASSWORD_REMOVED = _UxGT("Heslo odstránené"); // // Filament Change screens show up to 3 lines on a 4-line display @@ -643,4 +651,17 @@ namespace Language_sk { #endif PROGMEM Language_Str MSG_REHEAT = _UxGT("Zohriať"); PROGMEM Language_Str MSG_REHEATING = _UxGT("Zohrievanie..."); + + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Sprievodca sondy Z"); + + PROGMEM Language_Str MSG_SOUND = _UxGT("Zvuk"); + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Ľavý horný"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Ľavý dolný"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Pravý horný"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Pravý dolný"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Kalibrácia dokončená"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Kalibrácia zlyhala"); + #endif } From 51a1561ae932383b09254b0139c2ec8ea3d99e13 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 17 Nov 2020 17:32:30 -0300 Subject: [PATCH 173/443] Reduce RAM usage for TFT Color UI on SGen-L (#20179) --- Marlin/src/lcd/tft/tft_queue.cpp | 2 +- Marlin/src/lcd/tft/tft_queue.h | 6 ++++-- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index 43628706a9a4..0b538ef4a87d 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -210,7 +210,7 @@ void TFT_Queue::set_background(uint16_t color) { #define QUEUE_SAFETY_FREE_SPACE 100 void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) { - if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= QUEUE_SIZE) { + if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= TFT_QUEUE_SIZE) { end_of_queue = queue; ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue; } diff --git a/Marlin/src/lcd/tft/tft_queue.h b/Marlin/src/lcd/tft/tft_queue.h index 6cb3caf4a2b2..7eaa0c01c1a2 100644 --- a/Marlin/src/lcd/tft/tft_queue.h +++ b/Marlin/src/lcd/tft/tft_queue.h @@ -25,7 +25,9 @@ #include "tft_string.h" #include "tft_image.h" -#define QUEUE_SIZE 8192 +#ifndef TFT_QUEUE_SIZE + #define TFT_QUEUE_SIZE 8192 +#endif enum QueueTaskType : uint8_t { TASK_END_OF_QUEUE = 0x00, @@ -118,7 +120,7 @@ typedef struct __attribute__((__packed__)) { class TFT_Queue { private: - static uint8_t queue[QUEUE_SIZE]; + static uint8_t queue[TFT_QUEUE_SIZE]; static uint8_t *end_of_queue; static uint8_t *current_task; static uint8_t *last_task; diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 705dd4f9aa3a..7f9efcdb16c4 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -268,7 +268,8 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - #define TFT_BUFFER_SIZE 2400 + #define TFT_BUFFER_SIZE 1200 + #define TFT_QUEUE_SIZE 6144 #define BTN_EN1 P3_25 #define BTN_EN2 P3_26 From 8c4a06d85513c0aaa0301b01b9ed195e543ece3e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 18 Nov 2020 00:10:44 +0000 Subject: [PATCH 174/443] [cron] Bump distribution date (2020-11-18) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b03d1b81c964..34636856b7c9 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-17" + #define STRING_DISTRIBUTION_DATE "2020-11-18" #endif /** From 26ac992242a12441fcac306c462f69e94d46d4f6 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 17 Nov 2020 21:44:53 -0300 Subject: [PATCH 175/443] Prevent #div0 error (#20183) --- Marlin/src/feature/leds/printer_event_leds.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/feature/leds/printer_event_leds.cpp b/Marlin/src/feature/leds/printer_event_leds.cpp index 31c628c2816a..3a6b91a258b9 100644 --- a/Marlin/src/feature/leds/printer_event_leds.cpp +++ b/Marlin/src/feature/leds/printer_event_leds.cpp @@ -41,6 +41,7 @@ PrinterEventLEDs printerEventLEDs; uint8_t PrinterEventLEDs::old_intensity = 0; inline uint8_t pel_intensity(const float &start, const float ¤t, const float &target) { + if (uint16_t(start) == uint16_t(target)) return 255; return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f); } From 1cceae89cd7bed44b6de483d79517ca55694b13d Mon Sep 17 00:00:00 2001 From: Costas Basdekis Date: Wed, 18 Nov 2020 02:04:28 +0000 Subject: [PATCH 176/443] Local testing via Makefile & Docker (#19981) --- .github/workflows/test-builds.yml | 6 +- Makefile | 56 ++++ README.md | 5 + buildroot/share/git/mftest | 293 +++++++++++-------- buildroot/tests/ARMED-tests | 2 +- buildroot/tests/BIGTREE_BTT002-tests | 2 +- buildroot/tests/BIGTREE_GTR_V1_0-tests | 4 +- buildroot/tests/BIGTREE_SKR_PRO-tests | 4 +- buildroot/tests/DUE-tests | 6 +- buildroot/tests/DUE_archim-tests | 4 +- buildroot/tests/FLYF407ZG-tests | 2 +- buildroot/tests/FYSETC_F6_13-tests | 2 +- buildroot/tests/FYSETC_S6-tests | 2 +- buildroot/tests/LERDGEX-tests | 2 +- buildroot/tests/LPC1768-tests | 6 +- buildroot/tests/LPC1769-tests | 8 +- buildroot/tests/NUCLEO_F767ZI-tests | 2 +- buildroot/tests/SAMD51_grandcentral_m4-tests | 2 +- buildroot/tests/STM32F070CB_malyan-tests | 2 +- buildroot/tests/STM32F070RB_malyan-tests | 2 +- buildroot/tests/STM32F103CB_malyan-tests | 2 +- buildroot/tests/STM32F103RC_btt-tests | 2 +- buildroot/tests/STM32F103RC_btt_USB-tests | 2 +- buildroot/tests/STM32F103RC_fysetc-tests | 2 +- buildroot/tests/STM32F103RC_meeb-tests | 2 +- buildroot/tests/STM32F103RE-tests | 2 +- buildroot/tests/STM32F103RET6_creality-tests | 2 +- buildroot/tests/STM32F103RE_btt-tests | 2 +- buildroot/tests/STM32F103RE_btt_USB-tests | 2 +- buildroot/tests/STM32F103VE_longer-tests | 2 +- buildroot/tests/STM32F4-tests | 2 +- buildroot/tests/STM32F401VE_STEVAL-tests | 2 +- buildroot/tests/STM32F407VE_black-tests | 2 +- buildroot/tests/STM32F7-tests | 2 +- buildroot/tests/at90usb1286_cdc-tests | 2 +- buildroot/tests/at90usb1286_dfu-tests | 4 +- buildroot/tests/esp32-tests | 4 +- buildroot/tests/jgaurora_a5s_a1-tests | 2 +- buildroot/tests/linux_native-tests | 2 +- buildroot/tests/malyan_M300-tests | 2 +- buildroot/tests/mega1280-tests | 8 +- buildroot/tests/mega2560-tests | 20 +- buildroot/tests/mks_robin-tests | 2 +- buildroot/tests/mks_robin_lite-tests | 2 +- buildroot/tests/mks_robin_mini-tests | 2 +- buildroot/tests/mks_robin_nano35-tests | 12 +- buildroot/tests/mks_robin_pro-tests | 2 +- buildroot/tests/mks_robin_stm32-tests | 2 +- buildroot/tests/rambo-tests | 6 +- buildroot/tests/rumba32-tests | 6 +- buildroot/tests/run_tests | 48 ++- buildroot/tests/sanguino1284p-tests | 2 +- buildroot/tests/sanguino644p-tests | 2 +- buildroot/tests/teensy31-tests | 4 +- buildroot/tests/teensy35-tests | 16 +- buildroot/tests/teensy41-tests | 16 +- docker-compose.yml | 19 ++ docker/Dockerfile | 7 + get_test_targets.py | 12 + 59 files changed, 418 insertions(+), 226 deletions(-) create mode 100644 Makefile create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile create mode 100644 get_test_targets.py diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 41b3047485f2..d87d10569d57 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -119,8 +119,4 @@ jobs: - name: Run ${{ matrix.test-platform }} Tests run: | - # Inline tests script - chmod +x buildroot/bin/* - chmod +x buildroot/tests/* - export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} - run_tests . ${{ matrix.test-platform }} + make tests-single-ci TEST_TARGET=${{ matrix.test-platform }} diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..8e1c77aa9935 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +help: + @echo "Tasks for local development:" + @echo "* tests-single-ci: Run a single test from inside the CI" + @echo "* tests-single-local: Run a single test locally" + @echo "* tests-single-local-docker: Run a single test locally, using docker-compose" + @echo "* tests-all-local: Run all tests locally" + @echo "* tests-all-local-docker: Run all tests locally, using docker-compose" + @echo "* setup-local-docker: Setup local docker-compose" + @echo "" + @echo "Options for testing:" + @echo " TEST_TARGET Set when running tests-single-*, to select the" + @echo " test. If you set it to ALL it will run all " + @echo " tests, but some of them are broken: use " + @echo " tests-all-* instead to run only the ones that " + @echo " run on GitHub CI" + @echo " ONLY_TEST Limit tests to only those that contain this, or" + @echo " the index of the test (1-based)" + @echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value" + @echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:" + @echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!" +.PHONY: help + +tests-single-ci: + export GIT_RESET_HARD=true + $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) +.PHONY: tests-single-ci + +tests-single-local: + @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET= or use make tests-all-local" ; return 1; fi + chmod +x buildroot/bin/* + chmod +x buildroot/tests/* + export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ + && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ + && run_tests . $(TEST_TARGET) "$(ONLY_TEST)" +.PHONY: tests-single-local + +tests-single-local-docker: + @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET= or use make tests-all-local-docker" ; return 1; fi + docker-compose run --rm marlin $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)" +.PHONY: tests-single-local-docker + +tests-all-local: + chmod +x buildroot/bin/* + chmod +x buildroot/tests/* + export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ + && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ + && for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done +.PHONY: tests-all-local + +tests-all-local-docker: + docker-compose run --rm marlin $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) +.PHONY: tests-all-local-docker + +setup-local-docker: + docker-compose build +.PHONY: setup-local-docker diff --git a/README.md b/README.md index f70b7c409acb..8b623b382e78 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,11 @@ Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0. - This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle. - Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. - Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). Support resources are also listed there. +- Whenever you add new features, be sure to add tests to `buildroot/tests` and then run your tests locally, if possible. + - It's optional: Running all the tests on Windows might take a long time, and they will run anyway on GitHub. + - If you're running the tests on Linux (or on WSL with the code on a Linux volume) the speed is much faster. + - You can use `make tests-all-local` or `make tests-single-local TEST_TARGET=...`. + - If you prefer Docker you can use `make tests-all-local-docker` or `make tests-all-local-docker TEST_TARGET=...`. ### [RepRap.org Wiki Page](https://reprap.org/wiki/Marlin) diff --git a/buildroot/share/git/mftest b/buildroot/share/git/mftest index cfb5dd05f357..fda864672ac6 100755 --- a/buildroot/share/git/mftest +++ b/buildroot/share/git/mftest @@ -7,7 +7,33 @@ # MFINFO=$(mfinfo) || exit 1 -[[ -d Marlin/src ]] || { echo "Please 'cd' up to repo root." ; exit 1 ; } +[[ -d Marlin/src ]] || { echo "Please 'cd' to the Marlin repo root." ; exit 1 ; } + +perror() { echo -e "$0: \033[0;31m$1 -- $2\033[0m" ; } +errout() { echo -e "\033[0;31m$1\033[0m" ; } +bugout() { ((DEBUG)) && echo -e "\033[0;32m$1\033[0m" ; } + +usage() { + echo " +Usage: mftest [-t|--env=] [-n|--num=] [-m|--make] [-y|--build=] + mftest [-a|--autobuild] + mftest [-r|--rebuild] + mftest [-u|--autoupload] [-n|--num=] + +OPTIONS + -t --env The environment of the test to apply / run. (As named in platformio.ini.) + -n --num The index of the test to run. (In *-tests file order.) + -m --make Use the make / Docker method for the build. + -y --build Skip 'Do you want to build this test?' and assume YES. + -h --help Print this help. + -a --autobuild PIO Build using the MOTHERBOARD environment. + -u --autoupload PIO Upload using the MOTHERBOARD environment. + -v --verbose Extra output for debugging. + +env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 + +" +} TESTPATH=buildroot/tests @@ -22,111 +48,146 @@ ISCMD='^(restore|opt|exec|use|pins|env)_' ISEXEC='^exec_' ISCONT='\\ *$' -# Get the environment and test number from the command -TESTENV=${1:-'-'} -CHOICE=${2:-0} -AUTOENV=0 +# Get environment, test number, etc. from the command +TESTENV='-' +CHOICE=0 +DEBUG=0 + +while getopts 'abhmruvyn:t:-:' OFLAG; do + case "${OFLAG}" in + a) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;; + h) EXIT_USAGE=1 ;; + m) USE_MAKE=1 ; bugout "Using make with Docker..." ;; + n) case "$OPTARG" in + *[!0-9]*) perror "option requires a number" $OFLAG ; EXIT_USAGE=1 ;; + *) CHOICE="$OPTARG" ; bugout "Got a number: $CHOICE" ;; + esac + ;; + r) REBUILD=1 ; bugout "Rebuilding previous..." ;; + t) TESTENV="$OPTARG" ; bugout "Got a target: $TESTENV" ;; + u) AUTO_BUILD=2 ; bugout "Auto-Upload target..." ;; + v) DEBUG=1 ; bugout "Debug ON" ;; + y) BUILD_YES='Y' ; bugout "Build will initiate..." ;; + -) IFS="=" read -r ONAM OVAL <<< "$OPTARG" + case "$ONAM" in + help) [[ -z "$OVAL" ]] || perror "option can't take value $OVAL" $ONAM ; EXIT_USAGE=1 ;; + autobuild) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;; + autoupload) AUTO_BUILD=2 ; bugout "Auto-Upload target..." ;; + env) case "$OVAL" in + '') perror "option requires a value" $ONAM ; EXIT_USAGE=1 ;; + *) TESTENV="$OVAL" ; bugout "Got a target: $TESTENV" ;; + esac + ;; + num) case "$OVAL" in + [0-9]+) CHOICE="$OVAL" ; bugout "Got a number: $CHOICE" ;; + *) perror "option requires a value" $ONAM ; EXIT_USAGE=1 ;; + esac + ;; + rebuild) REBUILD=1 ; bugout "Rebuilding previous..." ;; + make) USE_MAKE=1 ; bugout "Using make with Docker..." ;; +debug|verbose) DEBUG=1 ; bugout "Debug ON" ;; + build) case "$OVAL" in + ''|y|yes) BUILD_YES='Y' ;; + n|no) BUILD_YES='N' ;; + *) perror "option value must be y, n, yes, or no" $ONAM ; EXIT_USAGE=1 ;; + esac + bugout "Build will initiate? ($BUILD_YES)" + ;; + *) perror "Unknown flag" "$OPTARG" ; EXIT_USAGE=1 ;; + esac + ;; + esac +done + +((EXIT_USAGE)) && { usage ; exit 1 ; } + +if ((REBUILD)); then + bugout "Rebuilding previous..." + # Build with the last-built env + [[ -f "$STATE_FILE" ]] || { errout "No previous (-r) build state found." ; exit 1 ; } + read TESTENV <"$STATE_FILE" + pio run -d . -e $TESTENV + exit +fi -# Allow shorthand for test name case $TESTENV in - tree) pio run -d . -e include_tree ; exit 1 ;; - due) TESTENV='DUE' ;; - esp) TESTENV='esp32' ;; - lin*) TESTENV='linux_native' ;; - lpc?(8)) TESTENV='LPC1768' ;; - lpc9) TESTENV='LPC1769' ;; - m128) TESTENV='mega1280' ;; - m256) TESTENV='mega2560' ;; - mega) TESTENV='mega2560' ;; - stm) TESTENV='STM32F103RE' ;; - f1) TESTENV='STM32F103RE' ;; - f4) TESTENV='STM32F4' ;; - f7) TESTENV='STM32F7' ;; - s6) TESTENV='FYSETC_S6' ;; - teensy) TESTENV='teensy31' ;; - t31) TESTENV='teensy31' ;; - t32) TESTENV='teensy31' ;; - t35) TESTENV='teensy35' ;; - t36) TESTENV='teensy35' ;; - t40) TESTENV='teensy41' ;; - t41) TESTENV='teensy41' ;; - --h|--help) echo -e "$(basename $0) : Marlin Firmware test, build, and upload\n" - echo "Usage: $(basename $0) ................. Select env and test to apply / run" - echo " $(basename $0) [-y] env ........ Select a test for env to apply / run" - echo " $(basename $0) [-y] env test ... Apply / run the specified env test" - echo " $(basename $0) -b [variant] .... Auto-build the specified variant" - echo " $(basename $0) -u [variant] .... Auto-build and upload the specified variant" - echo - echo "env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41" - exit - ;; - - # Build with the last-built env - -r) [[ -f "$STATE_FILE" ]] || { echo "No previous (-r) build state found." ; exit 1 ; } - read TESTENV <"$STATE_FILE" - pio run -d . -e $TESTENV - exit - ;; - - -[bu]) MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//' ) - [[ -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" ) - BDESC=$( $SED -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" ) - [[ -z $BNUM ]] && { echo "Error - Can't find $MB in boards list." ; exit 1 ; } - readarray -t ENVS <<< $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E '#include.+//.+env:.+' | grep -oE 'env:[^ ]+' | $SED -E 's/env://' ) - [[ -z $ENVS ]] && { echo "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; } - ECOUNT=${#ENVS[*]} - - if [[ $ECOUNT == 1 ]]; then - TARGET=$ENVS - else - if [[ $CHOICE == 0 ]]; then - # - # List env names and numbers. Get selection. - # - echo "Available targets for \"$BDESC\" | $MB ($BNUM):" - - IND=0 ; for ENV in "${ENVS[@]}"; do let IND++ ; echo " $IND) $ENV" ; done - - if [[ $ECOUNT > 1 ]]; then - for (( ; ; )) - do - read -p "Select a target for '$MB' (1-$ECOUNT) : " CHOICE - [[ -z "$CHOICE" ]] && { echo '(canceled)' ; exit 1 ; } - [[ $CHOICE =~ $ISNUM ]] && ((CHOICE >= 1 && CHOICE <= ECOUNT)) && break - echo ">>> Invalid environment choice '$CHOICE'." - done - echo - fi - else - echo "Detected \"$BDESC\" | $MB ($BNUM)." - [[ $CHOICE > $ECOUNT ]] && { echo "Environment selection out of range." ; exit 1 ; } - fi - TARGET="${ENVS[$CHOICE-1]}" - echo "Selected $TARGET" - fi - - echo "$TARGET" >"$STATE_FILE" - - if [[ $TESTENV == "-u" ]]; then - echo "Build/Uploading environment $TARGET for board $MB ($BNUM)..." ; echo - pio run -t upload -e $TARGET - else - echo "Building environment $TARGET for board $MB ($BNUM)..." ; echo - pio run -e $TARGET - fi - exit - ;; - - # The -y flag may come first - -y) TESTENV=${2:-'-'} ; CHOICE=${3:-0} ;; - - -[a-z]) echo "Unknown flag $TESTENV" ; exit 1 ;; - -) ;; + tree) pio run -d . -e include_tree ; exit 1 ;; + due) TESTENV='DUE' ;; + esp) TESTENV='esp32' ;; + lin*) TESTENV='linux_native' ;; +lpc?(8)) TESTENV='LPC1768' ;; + lpc9) TESTENV='LPC1769' ;; + m128) TESTENV='mega1280' ;; + m256) TESTENV='mega2560' ;; + mega) TESTENV='mega2560' ;; + stm) TESTENV='STM32F103RE' ;; + f1) TESTENV='STM32F103RE' ;; + f4) TESTENV='STM32F4' ;; + f7) TESTENV='STM32F7' ;; + s6) TESTENV='FYSETC_S6' ;; + teensy) TESTENV='teensy31' ;; + t31) TESTENV='teensy31' ;; + t32) TESTENV='teensy31' ;; + t35) TESTENV='teensy35' ;; + t36) TESTENV='teensy35' ;; + t40) TESTENV='teensy41' ;; + t41) TESTENV='teensy41' ;; esac +if ((AUTO_BUILD)); then + # + # List environments that apply to the current MOTHERBOARD. + # + 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_//' ) + [[ -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" ) + BDESC=$( $SED -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" ) + [[ -z $BNUM ]] && { echo "Error - Can't find $MB in boards list." ; exit 1 ; } + ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E '#include.+//.+env:[^ ]+' | grep -oE 'env:[^ ]+' | $SED -E 's/env://' ) ) + [[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; } + ECOUNT=${#ENVS[*]} + + if [[ $ECOUNT == 1 ]]; then + TARGET=$ENVS + else + if [[ $CHOICE == 0 ]]; then + # List env names and numbers. Get selection. + echo "Available targets for \"$BDESC\" | $MB ($BNUM):" + + IND=0 ; for ENV in "${ENVS[@]}"; do let IND++ ; echo " $IND) $ENV" ; done + + if [[ $ECOUNT > 1 ]]; then + for (( ; ; )) + do + read -p "Select a target for '$MB' (1-$ECOUNT) : " CHOICE + [[ -z "$CHOICE" ]] && { echo '(canceled)' ; exit 1 ; } + [[ $CHOICE =~ $ISNUM ]] && ((CHOICE >= 1 && CHOICE <= ECOUNT)) && break + errout ">>> Invalid environment choice '$CHOICE'." + done + echo + fi + else + echo "Detected \"$BDESC\" | $MB ($BNUM)." + [[ $CHOICE > $ECOUNT ]] && { echo "Environment selection out of range." ; exit 1 ; } + fi + TARGET="${ENVS[$CHOICE-1]}" + echo "Selected $TARGET" + fi + + echo "$TARGET" >"$STATE_FILE" + + if ((AUTO_BUILD == 2)); then + echo "Uploading environment $TARGET for board $MB ($BNUM)..." ; echo + pio run -t upload -e $TARGET + else + echo "Building environment $TARGET for board $MB ($BNUM)..." ; echo + pio run -e $TARGET + fi + exit +fi + # # List available tests and ask for selection # @@ -148,20 +209,20 @@ if [[ $TESTENV == '-' ]]; then for (( ; ; )) do read -p "Select a test to apply (1-$IND) : " NAMEIND - [[ -z "$NAMEIND" ]] && { echo '(canceled)' ; exit 1 ; } + [[ -z "$NAMEIND" ]] && { errout "(canceled)" ; exit 1 ; } [[ $NAMEIND =~ $ISNUM ]] && ((NAMEIND >= 1 && NAMEIND <= IND)) && { TESTENV=${NAMES[$NAMEIND-1]} ; echo ; break ; } - echo "Invalid selection." + errout "Invalid selection." done fi # Get the contents of the test file -OUT=$( cat $TESTPATH/$TESTENV-tests 2>/dev/null ) || { echo "Can't find test '$TESTENV'." ; exit 1 ; } +OUT=$( cat $TESTPATH/$TESTENV-tests 2>/dev/null ) || { errout "Can't find test '$TESTENV'." ; exit 1 ; } # Count up the number of tests TESTCOUNT=$( awk "/$ISEXEC/{a++}END{print a}" <<<"$OUT" ) # User entered a number? -(( CHOICE && CHOICE > TESTCOUNT )) && { echo "Invalid test selection '$CHOICE' (1-$TESTCOUNT)." ; exit 1 ; } +(( CHOICE && CHOICE > TESTCOUNT )) && { errout "Invalid test selection '$CHOICE' (1-$TESTCOUNT)." ; exit 1 ; } if [[ $CHOICE == 0 ]]; then # @@ -172,7 +233,7 @@ if [[ $CHOICE == 0 ]]; then while IFS= read -r LINE do if [[ $LINE =~ $ISEXEC ]]; then - DESC=$( "$SED" -E 's/^.+"(.*)".*$/\1/g' <<<"$LINE" ) + DESC=$( "$SED" -E 's/^exec_test \$1 \$2 "([^"]+)".*$/\1/g' <<<"$LINE" ) (( ++IND < 10 )) && echo -n " " echo " $IND) $DESC" fi @@ -183,9 +244,9 @@ if [[ $CHOICE == 0 ]]; then for (( ; ; )) do read -p "Select a '$TESTENV' test (1-$TESTCOUNT) : " CHOICE - [[ -z "$CHOICE" ]] && { echo '(canceled)' ; exit 1 ; } + [[ -z "$CHOICE" ]] && { errout "(canceled)" ; exit 1 ; } [[ $CHOICE =~ $ISNUM ]] && ((CHOICE >= 1 && CHOICE <= TESTCOUNT)) && break - echo ">>> Invalid test selection '$CHOICE'." + errout ">>> Invalid test selection '$CHOICE'." done fi fi @@ -193,6 +254,7 @@ fi # # Run the specified test lines # +echo -ne "\033[0;33m" echo "$OUT" | { IND=0 GOTX=0 @@ -210,27 +272,26 @@ echo "$OUT" | { } ((IND == CHOICE)) && { GOTX=1 - [[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | $SED -e 's/\\//g' ) - [[ $LINE =~ $ISCONT ]] || { echo $CMD ; eval "$CMD" ; CMD="" ; } + [[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | $SED -e 's/\\//g' | $SED -E 's/ +/ /g' ) + [[ $LINE =~ $ISCONT ]] || { echo "$CMD" ; eval "$CMD" ; CMD="" ; } } fi fi done } +echo -ne "\033[0m" # Make clear it's a TEST opt_set CUSTOM_MACHINE_NAME "\"$TESTENV-tests ($CHOICE)\"" -# Get a -y parameter the lazy way -[[ "$2" == "-y" || "$3" == "-y" ]] && BUILD_YES='Y' - # Build the test too? -if [[ $BUILD_YES != 'Y' ]]; then +if [[ -z "$BUILD_YES" ]]; then echo read -p "Build $TESTENV test #$CHOICE (y/N) ? " BUILD_YES fi [[ $BUILD_YES == 'Y' || $BUILD_YES == 'Yes' ]] && { - pio run -d . -e $TESTENV + ((USE_MAKE)) && make tests-single-local TEST_TARGET=$TESTENV ONLY_TEST=$CHOICE + ((USE_MAKE)) || pio run -d . -e $TESTENV echo "$TESTENV" >"$STATE_FILE" } diff --git a/buildroot/tests/ARMED-tests b/buildroot/tests/ARMED-tests index e5959a4383a7..6aa1308ca41c 100644 --- a/buildroot/tests/ARMED-tests +++ b/buildroot/tests/ARMED-tests @@ -13,7 +13,7 @@ restore_configs use_example_configs ArmEd opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2208 -exec_test $1 $2 "ArmEd Example Configuration with mixed TMC Drivers" +exec_test $1 $2 "ArmEd Example Configuration with mixed TMC Drivers" "$3" # clean up restore_configs diff --git a/buildroot/tests/BIGTREE_BTT002-tests b/buildroot/tests/BIGTREE_BTT002-tests index 64e6322ecad4..90e033e96958 100644 --- a/buildroot/tests/BIGTREE_BTT002-tests +++ b/buildroot/tests/BIGTREE_BTT002-tests @@ -14,7 +14,7 @@ opt_set MOTHERBOARD BOARD_BTT_BTT002_V1_0 opt_set SERIAL_PORT 1 opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 -exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" +exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" "$3" # clean up restore_configs diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests index 1db0bcffd2e7..9750b8fc2c7a 100644 --- a/buildroot/tests/BIGTREE_GTR_V1_0-tests +++ b/buildroot/tests/BIGTREE_GTR_V1_0-tests @@ -37,7 +37,7 @@ opt_set FIL_RUNOUT4_STATE HIGH opt_enable FIL_RUNOUT4_PULL opt_set FIL_RUNOUT8_STATE HIGH opt_enable FIL_RUNOUT8_PULL -exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" +exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 @@ -53,7 +53,7 @@ opt_set DEFAULT_Kp_LIST "{ 22.2, 20.0, 21.0, 19.0, 18.0, 17.0 }" opt_set DEFAULT_Ki_LIST "{ 1.08 }" opt_set DEFAULT_Kd_LIST "{ 114.0, 112.0, 110.0, 108.0 }" opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_INIT_BEFORE_SWAP TOOLCHANGE_FS_PRIME_FIRST_USED PID_PARAMS_PER_HOTEND -exec_test $1 $2 "BigTreeTech GTR 6 Extruders Triple Z" +exec_test $1 $2 "BigTreeTech GTR 6 Extruders Triple Z" "$3" # clean up restore_configs diff --git a/buildroot/tests/BIGTREE_SKR_PRO-tests b/buildroot/tests/BIGTREE_SKR_PRO-tests index 1295f5858c7e..3d0000ccc4f7 100644 --- a/buildroot/tests/BIGTREE_SKR_PRO-tests +++ b/buildroot/tests/BIGTREE_SKR_PRO-tests @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 opt_set SERIAL_PORT 1 -exec_test $1 $2 "BigTreeTech SKR Pro Default Configuration" +exec_test $1 $2 "BigTreeTech SKR Pro Default Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 @@ -26,7 +26,7 @@ opt_set E2_AUTO_FAN_PIN PC12 opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 opt_enable BLTOUCH EEPROM_SETTINGS AUTO_BED_LEVELING_3POINT Z_SAFE_HOMING -exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders, Auto-Fan, BLTOUCH, mixed TMC drivers" +exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders, Auto-Fan, BLTOUCH, mixed TMC drivers" "$3" # clean up restore_configs diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index 4a7c492d7b72..ccb49bf4828b 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -33,7 +33,7 @@ opt_set EXTRUDER_AUTO_FAN_SPEED 100 opt_set TEMP_SENSOR_CHAMBER 3 opt_add TEMP_CHAMBER_PIN 6 opt_set HEATER_CHAMBER_PIN 45 -exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options." +exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options." "$3" # # RADDS with BLTouch, ABL(B), 3 x Z auto-align @@ -51,7 +51,7 @@ opt_add Z2_MAX_PIN 2 opt_add Z3_MAX_PIN 3 pins_set ramps/RAMPS X_MAX_PIN -1 pins_set ramps/RAMPS Y_MAX_PIN -1 -exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN" +exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN" "$3" # # Test SWITCHING_EXTRUDER @@ -62,4 +62,4 @@ opt_set MOTHERBOARD BOARD_RAMPS4DUE_EEF opt_set EXTRUDERS 2 opt_set NUM_SERVOS 1 opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE POWER_LOSS_RECOVERY -exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, POWER_LOSS_RECOVERY" +exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, POWER_LOSS_RECOVERY" "$3" diff --git a/buildroot/tests/DUE_archim-tests b/buildroot/tests/DUE_archim-tests index 4d9eb364198b..f1711a8f3d70 100755 --- a/buildroot/tests/DUE_archim-tests +++ b/buildroot/tests/DUE_archim-tests @@ -10,12 +10,12 @@ set -e # Test Archim 1 # use_example_configs UltiMachine/Archim1 -exec_test $1 $2 "Archim 1 base configuration" +exec_test $1 $2 "Archim 1 base configuration" "$3" # # Test Archim 2 # use_example_configs UltiMachine/Archim2 -exec_test $1 $2 "Archim 2 base configuration" +exec_test $1 $2 "Archim 2 base configuration" "$3" restore_configs diff --git a/buildroot/tests/FLYF407ZG-tests b/buildroot/tests/FLYF407ZG-tests index f1a65da6cbb3..2c915eb48b39 100644 --- a/buildroot/tests/FLYF407ZG-tests +++ b/buildroot/tests/FLYF407ZG-tests @@ -12,7 +12,7 @@ opt_set MOTHERBOARD BOARD_FLYF407ZG opt_set SERIAL_PORT -1 opt_set X_DRIVER_TYPE TMC2208 opt_set Y_DRIVER_TYPE TMC2130 -exec_test $1 $2 "FLYF407ZG Default Config with mixed TMC Drivers" +exec_test $1 $2 "FLYF407ZG Default Config with mixed TMC Drivers" "$3" # cleanup restore_configs diff --git a/buildroot/tests/FYSETC_F6_13-tests b/buildroot/tests/FYSETC_F6_13-tests index 631a11778502..a3e9f4ef39a6 100644 --- a/buildroot/tests/FYSETC_F6_13-tests +++ b/buildroot/tests/FYSETC_F6_13-tests @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_FYSETC_F6_13 opt_enable DGUS_LCD_UI_FYSETC -exec_test $1 $2 "FYSETC F6 1.3 with DGUS" +exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3" # clean up restore_configs diff --git a/buildroot/tests/FYSETC_S6-tests b/buildroot/tests/FYSETC_S6-tests index c75629156b08..18951ebb79b4 100644 --- a/buildroot/tests/FYSETC_S6-tests +++ b/buildroot/tests/FYSETC_S6-tests @@ -11,7 +11,7 @@ restore_configs use_example_configs FYSETC/S6 opt_set Y_DRIVER_TYPE TMC2209 opt_set Z_DRIVER_TYPE TMC2130 -exec_test $1 $2 "FYSETC S6 Example" +exec_test $1 $2 "FYSETC S6 Example" "$3" # cleanup restore_configs diff --git a/buildroot/tests/LERDGEX-tests b/buildroot/tests/LERDGEX-tests index c2d72e0d77e6..7fcdb2684f98 100644 --- a/buildroot/tests/LERDGEX-tests +++ b/buildroot/tests/LERDGEX-tests @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_LERDGE_X opt_set SERIAL_PORT 1 -exec_test $1 $2 "LERDGE X with Default Configuration" +exec_test $1 $2 "LERDGE X with Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/LPC1768-tests b/buildroot/tests/LPC1768-tests index 7877b60721a7..9604ca2403f5 100755 --- a/buildroot/tests/LPC1768-tests +++ b/buildroot/tests/LPC1768-tests @@ -17,7 +17,7 @@ restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB opt_enable VIKI2 SDSUPPORT SDCARD_READONLY SERIAL_PORT_2 NEOPIXEL_LED opt_set NEOPIXEL_PIN P1_16 -exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" +exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" "$3" #restore_configs #use_example_configs Mks/Sbase @@ -30,7 +30,7 @@ opt_set TEMP_SENSOR_1 1 opt_set NUM_SERVOS 2 opt_set SERVO_DELAY "{ 300, 300 }" opt_enable SWITCHING_NOZZLE SWITCHING_NOZZLE_E1_SERVO_NR ULTIMAKERCONTROLLER -exec_test $1 $2 "MKS SBASE with SWITCHING_NOZZLE" +exec_test $1 $2 "MKS SBASE with SWITCHING_NOZZLE" "$3" restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB @@ -47,7 +47,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER opt_set GRID_MAX_POINTS_X 16 opt_set NOZZLE_TO_PROBE_OFFSET "{ 0, 0, 0 }" -exec_test $1 $2 "Re-ARM with NOZZLE_AS_PROBE and many features." +exec_test $1 $2 "Re-ARM with NOZZLE_AS_PROBE and many features." "$3" # clean up restore_configs diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index df66f0ab75bd..e4787f82daf6 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # use_example_configs Azteeg/X5GT -exec_test $1 $2 "Azteeg X5GT Example Configuration" +exec_test $1 $2 "Azteeg X5GT Example Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD @@ -25,7 +25,7 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER opt_disable SD_PROCEDURE_DEPTH opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard with many features" +exec_test $1 $2 "Smoothieboard with many features" "$3" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD @@ -39,7 +39,7 @@ opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PI Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI" +exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI" "$3" #restore_configs #opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI @@ -67,7 +67,7 @@ opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT MECHANICAL SENSORLESS_PROBING Z_SAFE_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG \ EXPERIMENTAL_I2CBUS opt_disable PSU_CONTROL -exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING" +exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING" "$3" # clean up restore_configs diff --git a/buildroot/tests/NUCLEO_F767ZI-tests b/buildroot/tests/NUCLEO_F767ZI-tests index 05125a453902..1a2e7c8362db 100644 --- a/buildroot/tests/NUCLEO_F767ZI-tests +++ b/buildroot/tests/NUCLEO_F767ZI-tests @@ -15,7 +15,7 @@ opt_set SERIAL_PORT -1 opt_enable BLTOUCH Z_SAFE_HOMING SPEAKER opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2208 -exec_test $1 $2 "Mixed timer usage" +exec_test $1 $2 "Mixed timer usage" "$3" # clean up restore_configs diff --git a/buildroot/tests/SAMD51_grandcentral_m4-tests b/buildroot/tests/SAMD51_grandcentral_m4-tests index fbaf5fb7e55b..a98929520ec1 100644 --- a/buildroot/tests/SAMD51_grandcentral_m4-tests +++ b/buildroot/tests/SAMD51_grandcentral_m4-tests @@ -33,7 +33,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ SQUARE_WAVE_STEPPING TMC_DEBUG EXPERIMENTAL_SCURVE -exec_test $1 $2 "Build Grand Central M4 Default Configuration" +exec_test $1 $2 "Build Grand Central M4 Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F070CB_malyan-tests b/buildroot/tests/STM32F070CB_malyan-tests index 20bd111fa9c0..eeec7e9b1f12 100644 --- a/buildroot/tests/STM32F070CB_malyan-tests +++ b/buildroot/tests/STM32F070CB_malyan-tests @@ -9,7 +9,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_MALYAN_M200_V2 opt_set SERIAL_PORT -1 -exec_test $1 $2 "Malyan M200 v2 Default Config" +exec_test $1 $2 "Malyan M200 v2 Default Config" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F070RB_malyan-tests b/buildroot/tests/STM32F070RB_malyan-tests index 58237a70eb5f..493dd5fdbd00 100644 --- a/buildroot/tests/STM32F070RB_malyan-tests +++ b/buildroot/tests/STM32F070RB_malyan-tests @@ -9,7 +9,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_MALYAN_M200_V2 opt_set SERIAL_PORT -1 -exec_test $1 $2 "Malyan M200 v2 Default Config" +exec_test $1 $2 "Malyan M200 v2 Default Config" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F103CB_malyan-tests b/buildroot/tests/STM32F103CB_malyan-tests index e594cb43dbae..6624b6c3c263 100644 --- a/buildroot/tests/STM32F103CB_malyan-tests +++ b/buildroot/tests/STM32F103CB_malyan-tests @@ -7,7 +7,7 @@ set -e use_example_configs Malyan/M200 -exec_test $1 $2 "Malyan M200" +exec_test $1 $2 "Malyan M200" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F103RC_btt-tests b/buildroot/tests/STM32F103RC_btt-tests index ad15ee723767..77044dcb364e 100644 --- a/buildroot/tests/STM32F103RC_btt-tests +++ b/buildroot/tests/STM32F103RC_btt-tests @@ -22,7 +22,7 @@ opt_set Y_SLAVE_ADDRESS 1 opt_set Z_SLAVE_ADDRESS 2 opt_set E0_SLAVE_ADDRESS 3 -exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" +exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RC_btt_USB-tests b/buildroot/tests/STM32F103RC_btt_USB-tests index 8f7fff0b322a..d752c87d1820 100644 --- a/buildroot/tests/STM32F103RC_btt_USB-tests +++ b/buildroot/tests/STM32F103RC_btt_USB-tests @@ -13,7 +13,7 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_V1_1 opt_set SERIAL_PORT 1 opt_set SERIAL_PORT_2 -1 -exec_test $1 $2 "BigTreeTech SKR Mini v1.1 - Basic Configuration" +exec_test $1 $2 "BigTreeTech SKR Mini v1.1 - Basic Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RC_fysetc-tests b/buildroot/tests/STM32F103RC_fysetc-tests index dfa85d9bb616..0e78c731888c 100644 --- a/buildroot/tests/STM32F103RC_fysetc-tests +++ b/buildroot/tests/STM32F103RC_fysetc-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # use_example_configs "Creality/Ender-3/FYSETC Cheetah 1.2/base" -exec_test $1 $2 "Cheetah 1.2 Configuration" +exec_test $1 $2 "Cheetah 1.2 Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RC_meeb-tests b/buildroot/tests/STM32F103RC_meeb-tests index 74e770d3c895..4fcb6e8118d3 100644 --- a/buildroot/tests/STM32F103RC_meeb-tests +++ b/buildroot/tests/STM32F103RC_meeb-tests @@ -17,7 +17,7 @@ opt_set X_DRIVER_TYPE TMC2208 opt_set Y_DRIVER_TYPE TMC2208 opt_set Z_DRIVER_TYPE TMC2208 opt_set E0_DRIVER_TYPE TMC2208 -exec_test $1 $2 "MEEB_3DP - Basic Config with TMC2208 SW Serial" +exec_test $1 $2 "MEEB_3DP - Basic Config with TMC2208 SW Serial" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RE-tests b/buildroot/tests/STM32F103RE-tests index 63fe5ba393b8..909c362d066d 100755 --- a/buildroot/tests/STM32F103RE-tests +++ b/buildroot/tests/STM32F103RE-tests @@ -16,7 +16,7 @@ opt_set SERIAL_PORT -1 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \ PAREN_COMMENTS GCODE_MOTION_MODES SINGLENOZZLE TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_PARK \ BAUD_RATE_GCODE GCODE_MACROS NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE -exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" +exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index ca723c7aa229..954827ddd9ca 100644 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -11,6 +11,6 @@ set -e # use_example_configs "Creality/Ender-3 V2" opt_enable MARLIN_DEV_MODE -exec_test $1 $2 "Ender 3 v2" +exec_test $1 $2 "Ender 3 v2" "$3" restore_configs diff --git a/buildroot/tests/STM32F103RE_btt-tests b/buildroot/tests/STM32F103RE_btt-tests index 9a829a553efe..ab8681c7f527 100644 --- a/buildroot/tests/STM32F103RE_btt-tests +++ b/buildroot/tests/STM32F103RE_btt-tests @@ -15,7 +15,7 @@ opt_set SERIAL_PORT 1 opt_set SERIAL_PORT_2 -1 opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 -exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Config with mixed TMC Drivers" +exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Config with mixed TMC Drivers" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RE_btt_USB-tests b/buildroot/tests/STM32F103RE_btt_USB-tests index 77751d776e9c..e35d68898cf4 100644 --- a/buildroot/tests/STM32F103RE_btt_USB-tests +++ b/buildroot/tests/STM32F103RE_btt_USB-tests @@ -13,7 +13,7 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_E3_DIP opt_set SERIAL_PORT 1 opt_set SERIAL_PORT_2 -1 -exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" +exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103VE_longer-tests b/buildroot/tests/STM32F103VE_longer-tests index 8eb9e4cd1b0f..461f128873b8 100755 --- a/buildroot/tests/STM32F103VE_longer-tests +++ b/buildroot/tests/STM32F103VE_longer-tests @@ -8,7 +8,7 @@ set -e use_example_configs Alfawise/U20 opt_enable BAUD_RATE_GCODE -exec_test $1 $2 "Full-featured U20 config" +exec_test $1 $2 "Full-featured U20 config" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F4-tests b/buildroot/tests/STM32F4-tests index b5beb7366377..89281860f65f 100644 --- a/buildroot/tests/STM32F4-tests +++ b/buildroot/tests/STM32F4-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # use_example_configs STM32/STM32F4 -exec_test $1 $2 "STM32F4 Default Configuration" +exec_test $1 $2 "STM32F4 Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F401VE_STEVAL-tests b/buildroot/tests/STM32F401VE_STEVAL-tests index 2811014c13b2..d7c90e7907f9 100644 --- a/buildroot/tests/STM32F401VE_STEVAL-tests +++ b/buildroot/tests/STM32F401VE_STEVAL-tests @@ -10,7 +10,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_STEVAL_3DP001V1 opt_set SERIAL_PORT -1 -exec_test $1 $2 "STM32F401VE_STEVAL Default Config" +exec_test $1 $2 "STM32F401VE_STEVAL Default Config" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F407VE_black-tests b/buildroot/tests/STM32F407VE_black-tests index 908382ec2a04..6b7a3cfe7c67 100755 --- a/buildroot/tests/STM32F407VE_black-tests +++ b/buildroot/tests/STM32F407VE_black-tests @@ -9,7 +9,7 @@ set -e restore_configs use_example_configs STM32/Black_STM32F407VET6 opt_enable BAUD_RATE_GCODE -exec_test $1 $2 "Full-featured Sample Black STM32F407VET6 config" +exec_test $1 $2 "Full-featured Sample Black STM32F407VET6 config" "$3" # cleanup restore_configs diff --git a/buildroot/tests/STM32F7-tests b/buildroot/tests/STM32F7-tests index 281222f15634..b23a16467edc 100644 --- a/buildroot/tests/STM32F7-tests +++ b/buildroot/tests/STM32F7-tests @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_REMRAM_V1 opt_set SERIAL_PORT 1 -exec_test $1 $2 "Default Configuration" +exec_test $1 $2 "Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/at90usb1286_cdc-tests b/buildroot/tests/at90usb1286_cdc-tests index 812e2ebcae32..01d752db8b4c 100644 --- a/buildroot/tests/at90usb1286_cdc-tests +++ b/buildroot/tests/at90usb1286_cdc-tests @@ -11,7 +11,7 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_BRAINWAVE_PRO -exec_test $1 $2 "Default Configuration" +exec_test $1 $2 "Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/at90usb1286_dfu-tests b/buildroot/tests/at90usb1286_dfu-tests index a9b7e2bbb094..75672a6a5150 100644 --- a/buildroot/tests/at90usb1286_dfu-tests +++ b/buildroot/tests/at90usb1286_dfu-tests @@ -11,12 +11,12 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_PRINTRBOARD -exec_test $1 $2 "Printrboard Configuration" +exec_test $1 $2 "Printrboard Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_PRINTRBOARD_REVF opt_enable MINIPANEL -exec_test $1 $2 "Printrboard RevF with MiniPanel and Stepper DAC (in pins file)" +exec_test $1 $2 "Printrboard RevF with MiniPanel and Stepper DAC (in pins file)" "$3" # clean up restore_configs diff --git a/buildroot/tests/esp32-tests b/buildroot/tests/esp32-tests index 204e7aa708eb..283d02f7e046 100755 --- a/buildroot/tests/esp32-tests +++ b/buildroot/tests/esp32-tests @@ -15,7 +15,7 @@ opt_enable WIFISUPPORT WEBSUPPORT GCODE_MACROS BAUD_RATE_GCODE M115_GEOMETRY_REP opt_add WIFI_SSID "\"ssid\"" opt_add WIFI_PWD "\"password\"" opt_set TX_BUFFER_SIZE 64 -exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" +exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" "$3" # # Build with TMC drivers using hardware serial @@ -35,7 +35,7 @@ opt_set Y_SLAVE_ADDRESS 1 opt_set Z_SLAVE_ADDRESS 2 opt_set E0_SLAVE_ADDRESS 3 opt_enable HOTEND_IDLE_TIMEOUT -exec_test $1 $2 "ESP32, TMC HW Serial, Hotend Idle" +exec_test $1 $2 "ESP32, TMC HW Serial, Hotend Idle" "$3" # cleanup restore_configs diff --git a/buildroot/tests/jgaurora_a5s_a1-tests b/buildroot/tests/jgaurora_a5s_a1-tests index c6cc9e3f9c9e..e9be89eb30b8 100644 --- a/buildroot/tests/jgaurora_a5s_a1-tests +++ b/buildroot/tests/jgaurora_a5s_a1-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # use_example_configs JGAurora/A5S -exec_test $1 $2 "JGAurora/A5S Configuration" +exec_test $1 $2 "JGAurora/A5S Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/linux_native-tests b/buildroot/tests/linux_native-tests index 38f531dadc4d..711691fb9d83 100755 --- a/buildroot/tests/linux_native-tests +++ b/buildroot/tests/linux_native-tests @@ -13,7 +13,7 @@ restore_configs opt_set MOTHERBOARD BOARD_LINUX_RAMPS opt_set TEMP_SENSOR_BED 1 opt_enable PIDTEMPBED EEPROM_SETTINGS BAUD_RATE_GCODE -exec_test $1 $2 "Linux with EEPROM" +exec_test $1 $2 "Linux with EEPROM" "$3" # cleanup restore_configs diff --git a/buildroot/tests/malyan_M300-tests b/buildroot/tests/malyan_M300-tests index 1955accaa5f6..27bdcfb05901 100755 --- a/buildroot/tests/malyan_M300-tests +++ b/buildroot/tests/malyan_M300-tests @@ -10,7 +10,7 @@ restore_configs use_example_configs "delta/Malyan M300" opt_disable AUTO_BED_LEVELING_3POINT opt_set LCD_SERIAL_PORT 1 -exec_test $1 $2 "Malyan M300 (delta)" +exec_test $1 $2 "Malyan M300 (delta)" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mega1280-tests b/buildroot/tests/mega1280-tests index ce13d4a6e8bb..1f0676724831 100644 --- a/buildroot/tests/mega1280-tests +++ b/buildroot/tests/mega1280-tests @@ -27,7 +27,7 @@ opt_set POWER_MONITOR_CURRENT_PIN 14 opt_set POWER_MONITOR_VOLTAGE_PIN 15 opt_set CLOSED_LOOP_ENABLE_PIN 44 opt_set CLOSED_LOOP_MOVE_COMPLETE_PIN 45 -exec_test $1 $2 "Spindle, MESH_BED_LEVELING, closed loop, Power Monitor, and LCD" +exec_test $1 $2 "Spindle, MESH_BED_LEVELING, closed loop, Power Monitor, and LCD" "$3" # # Test DUAL_X_CARRIAGE @@ -39,21 +39,21 @@ opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 opt_enable USE_XMAX_PLUG DUAL_X_CARRIAGE REPRAPWORLD_KEYPAD opt_set REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 -exec_test $1 $2 "TT Oscar | DUAL_X_CARRIAGE" +exec_test $1 $2 "TT Oscar | DUAL_X_CARRIAGE" "$3" # # Delta Config (generic) + Probeless # use_example_configs delta/generic opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_AUTO_CALIBRATION DELTA_CALIBRATION_MENU -exec_test $1 $2 "RAMPS | DELTA | RRD LCD | DELTA_AUTO_CALIBRATION | DELTA_CALIBRATION_MENU" +exec_test $1 $2 "RAMPS | DELTA | RRD LCD | DELTA_AUTO_CALIBRATION | DELTA_CALIBRATION_MENU" "$3" # # Delta Config (generic) + ABL bilinear + BLTOUCH use_example_configs delta/generic opt_set LCD_LANGUAGE cz opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH -exec_test $1 $2 "DELTA | RRD LCD | ABL Bilinear | BLTOUCH" +exec_test $1 $2 "DELTA | RRD LCD | ABL Bilinear | BLTOUCH" "$3" # clean up restore_configs diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index cc9830be361c..113ec9ed1bd0 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -32,7 +32,7 @@ opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE EXTRA_LIN_ADVANCE_K QUICK_HOME \ LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL -exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." +exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." "$3" # # Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language @@ -58,7 +58,7 @@ opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU opt_set LCD_LANGUAGE jp_kana opt_disable SEGMENT_LEVELED_MOVES opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL M114_DETAIL -exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sled Probe | Skew | JP-Kana | Babystep offsets ..." +exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sled Probe | Skew | JP-Kana | Babystep offsets ..." "$3" # # Test a Servo Probe @@ -73,7 +73,7 @@ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING -exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." +exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." "$3" # # 5 runout sensors with distinct states @@ -110,7 +110,7 @@ opt_add M100_FREE_MEMORY_DUMPER opt_add M100_FREE_MEMORY_CORRUPTOR opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" opt_set I2C_SLAVE_ADDRESS 63 -exec_test $1 $2 "MEGACONTROLLER | Minipanel | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." +exec_test $1 $2 "MEGACONTROLLER | Minipanel | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." "$3" # # Mixing Extruder with 5 steppers, Greek @@ -122,7 +122,7 @@ opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \ USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_IGNORE_Z opt_set MIXING_STEPPERS 5 opt_set LCD_LANGUAGE ru -exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" +exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3" # # Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER @@ -163,7 +163,7 @@ opt_set FAN_MIN_PWM 50 opt_set FAN_KICKSTART_TIME 100 opt_set XY_FREQUENCY_LIMIT 15 opt_add FILWIDTH_PIN 5 -exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." +exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." "$3" ######## Other Standard LCD/Panels ############## # @@ -286,13 +286,13 @@ opt_add L6470_CHAIN_MISO_PIN 49 opt_add L6470_CHAIN_MOSI_PIN 40 opt_add L6470_CHAIN_SS_PIN 42 opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP" -exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." +exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." "$3" # # Delta Config (FLSUN AC because it's complex) # use_example_configs delta/FLSUN/auto_calibrate -exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" +exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" "$3" # # Makibox Config need to check board type for Teensy++ 2.0 @@ -315,7 +315,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG M114_DETAIL -exec_test $1 $2 "RAMPS | Mixed TMC | Sensorless | RRDFGSC | Games" +exec_test $1 $2 "RAMPS | Mixed TMC | Sensorless | RRDFGSC | Games" "$3" # # SCARA with Mixed TMC @@ -330,7 +330,7 @@ opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130_STANDALONE opt_set E0_DRIVER_TYPE TMC2660 -exec_test $1 $2 "RAMPS | SCARA | Mixed TMC | EEPROM" +exec_test $1 $2 "RAMPS | SCARA | Mixed TMC | EEPROM" "$3" # # tvrrug Config need to check board type for sanguino atmega644p diff --git a/buildroot/tests/mks_robin-tests b/buildroot/tests/mks_robin-tests index 424623107097..3fccc87c5919 100644 --- a/buildroot/tests/mks_robin-tests +++ b/buildroot/tests/mks_robin-tests @@ -8,7 +8,7 @@ set -e use_example_configs Mks/Robin -exec_test $1 $2 "MKS Robin config (FSMC Color UI)" +exec_test $1 $2 "MKS Robin config (FSMC Color UI)" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_lite-tests b/buildroot/tests/mks_robin_lite-tests index d54627e06980..c4be4f206d2a 100644 --- a/buildroot/tests/mks_robin_lite-tests +++ b/buildroot/tests/mks_robin_lite-tests @@ -11,7 +11,7 @@ opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE opt_set SERIAL_PORT 1 opt_enable EEPROM_SETTINGS opt_enable SDSUPPORT -exec_test $1 $2 "Default Configuration with Fallback SD EEPROM" +exec_test $1 $2 "Default Configuration with Fallback SD EEPROM" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_mini-tests b/buildroot/tests/mks_robin_mini-tests index 1c40ea453554..6675634f3068 100644 --- a/buildroot/tests/mks_robin_mini-tests +++ b/buildroot/tests/mks_robin_mini-tests @@ -11,7 +11,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_MINI opt_set EXTRUDERS 1 opt_set TEMP_SENSOR_1 0 -exec_test $1 $2 "MKS Robin mini" +exec_test $1 $2 "MKS Robin mini" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index 426f29d47358..5dcf79b1ae10 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -12,7 +12,7 @@ set -e # use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO -exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" +exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" "$3" # # MKS Robin v2 nano Emulated DOGM SPI @@ -22,7 +22,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC opt_enable TFT_INTERFACE_SPI -exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" +exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" "$3" # # MKS Robin nano v1.2 LVGL FSMC @@ -31,7 +31,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 opt_enable TFT_LVGL_UI TFT_RES_480x320 -exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" +exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" "$3" # # MKS Robin v2 nano LVGL SPI @@ -41,7 +41,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 -exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" +exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" "$3" # # MKS Robin v2 nano New Color UI 480x320 SPI @@ -51,7 +51,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 -exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" +exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" "$3" # # MKS Robin v2 nano LVGL SPI + TMC @@ -63,7 +63,7 @@ opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2209 -exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" +exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_pro-tests b/buildroot/tests/mks_robin_pro-tests index 3cafc6142f84..3503d0ce1f7d 100644 --- a/buildroot/tests/mks_robin_pro-tests +++ b/buildroot/tests/mks_robin_pro-tests @@ -15,7 +15,7 @@ opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 opt_set TEMP_SENSOR_BED 1 opt_disable THERMAL_PROTECTION_HOTENDS -exec_test $1 $2 "MKS Robin Pro, TMC Drivers, no thermal protection" +exec_test $1 $2 "MKS Robin Pro, TMC Drivers, no thermal protection" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_stm32-tests b/buildroot/tests/mks_robin_stm32-tests index 4aa146fa5288..e250dceca255 100644 --- a/buildroot/tests/mks_robin_stm32-tests +++ b/buildroot/tests/mks_robin_stm32-tests @@ -7,7 +7,7 @@ set -e use_example_configs Mks/Robin -exec_test $1 $2 "MKS Robin base configuration" +exec_test $1 $2 "MKS Robin base configuration" "$3" # cleanup restore_configs diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index 6fc720d1e14a..231a21747b00 100644 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -42,7 +42,7 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TE SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL opt_add DEBUG_POWER_LOSS_RECOVERY -exec_test $1 $2 "RAMBO | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..." +exec_test $1 $2 "RAMBO | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..." "$3" # # Full size Rambo Dual Endstop CNC @@ -58,7 +58,7 @@ opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ S_CURVE_ACCELERATION X_DUAL_STEPPER_DRIVERS X_DUAL_ENDSTOPS Y_DUAL_STEPPER_DRIVERS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS -exec_test $1 $2 "Rambo CNC Configuration" +exec_test $1 $2 "Rambo CNC Configuration" "$3" # # Rambo heated bed only @@ -79,7 +79,7 @@ opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 opt_set E0_DRIVER_TYPE TMC2130 -exec_test $1 $2 "Einsy RAMBo with TMC2130" +exec_test $1 $2 "Einsy RAMBo with TMC2130" "$3" # clean up restore_configs diff --git a/buildroot/tests/rumba32-tests b/buildroot/tests/rumba32-tests index 42f9beb9afde..20a640efed46 100644 --- a/buildroot/tests/rumba32-tests +++ b/buildroot/tests/rumba32-tests @@ -15,7 +15,7 @@ opt_enable PIDTEMPBED opt_set TEMP_SENSOR_BED 1 opt_disable THERMAL_PROTECTION_BED opt_set X_DRIVER_TYPE TMC2130 -exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" +exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" "$3" # Build examples restore_configs @@ -25,7 +25,7 @@ opt_enable PIDTEMPBED EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPH opt_set TEMP_SENSOR_BED 1 opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2208 -exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" +exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" "$3" # Build examples restore_configs @@ -33,7 +33,7 @@ opt_set MOTHERBOARD BOARD_RUMBA32_MKS opt_set SERIAL_PORT -1 opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2208 -exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" +exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" "$3" # cleanup restore_configs diff --git a/buildroot/tests/run_tests b/buildroot/tests/run_tests index d01107f45a15..a0eef6a05ff0 100755 --- a/buildroot/tests/run_tests +++ b/buildroot/tests/run_tests @@ -10,11 +10,27 @@ set -e exec_test () { printf "\n\033[0;32m[Test $2] \033[0m$3...\n" - if platformio run --project-dir $1 -e $2 --silent; then + # Check to see if we should skip tests + if [[ -n "$4" ]] ; then + if [[ ! "$3" =~ $4 ]] ; then + printf "\033[1;33mSkipped\033[0m\n" + return 0 + fi + fi + if [[ -z "$VERBOSE_PLATFORMIO" ]] ; then + silent="--silent" + else + silent="" + fi + if platformio run --project-dir $1 -e $2 $silent; then printf "\033[0;32mPassed\033[0m\n" return 0 else - git reset --hard HEAD + if [[ -n $GIT_RESET_HARD ]]; then + git reset --hard HEAD + else + restore_configs + fi printf "\033[0;31mFailed!\033[0m\n" return 1 fi @@ -30,12 +46,32 @@ if [[ $2 = "ALL" ]]; then testenv=$(basename $f | cut -d"-" -f1) printf "Running \033[0;32m$f\033[0m Tests\n" exec_test $1 "$testenv --target clean" "Setup Build Environment" - $f $1 $testenv - git reset --hard HEAD + if [[ $GIT_RESET_HARD == "true" ]]; then + git reset --hard HEAD + else + restore_configs + fi done else exec_test $1 "$2 --target clean" "Setup Build Environment" - $2-tests $1 $2 - git reset --hard HEAD + test_name="$3" + # If the test name is 1 or 2 digits, treat it as an index + if [[ "$test_name" =~ ^[0-9][0-9]?$ ]] ; then + # Find the test name that corresponds to that index + test_name="$(cat buildroot/tests/$2-tests | grep -e '^exec_test' | sed -n "$3p" | sed "s/.*\$1 \$2 \"\([^\"]*\).*/\1/g")" + if [[ -z "$test_name" ]] ; then + # Fail if none matches + printf "\033[0;31mCould not find test \033[0m#$3\033[0;31m in \033[0mbuildroot/tests/$2-tests\n" + exit 1 + else + printf "\033[0;32mMatching test \033[0m#$3\033[0;32m: '\033[0m$test_name\033[0;32m'\n" + fi + fi + $2-tests $1 $2 "$test_name" + if [[ $GIT_RESET_HARD == "true" ]]; then + git reset --hard HEAD + else + restore_configs + fi fi printf "\033[0;32mAll tests completed successfully\033[0m\n" diff --git a/buildroot/tests/sanguino1284p-tests b/buildroot/tests/sanguino1284p-tests index 7181f961c483..748d2a8fa3ba 100644 --- a/buildroot/tests/sanguino1284p-tests +++ b/buildroot/tests/sanguino1284p-tests @@ -11,7 +11,7 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 -exec_test $1 $2 "Default Configuration" +exec_test $1 $2 "Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/sanguino644p-tests b/buildroot/tests/sanguino644p-tests index 41626b23f705..12910a76fab8 100644 --- a/buildroot/tests/sanguino644p-tests +++ b/buildroot/tests/sanguino644p-tests @@ -11,7 +11,7 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 -exec_test $1 $2 "Default Configuration" +exec_test $1 $2 "Default Configuration" "$3" # clean up restore_configs diff --git a/buildroot/tests/teensy31-tests b/buildroot/tests/teensy31-tests index be377b15afa5..448a8860c7a0 100755 --- a/buildroot/tests/teensy31-tests +++ b/buildroot/tests/teensy31-tests @@ -8,7 +8,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_TEENSY31_32 -exec_test $1 $2 "Teensy3.1 with default config" +exec_test $1 $2 "Teensy3.1 with default config" "$3" # # Test many features together @@ -27,4 +27,4 @@ opt_enable EEPROM_SETTINGS FILAMENT_WIDTH_SENSOR CALIBRATION_GCODE BAUD_RATE_GCO HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT opt_set I2C_SLAVE_ADDRESS 63 opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Teensy3.1 with many features" +exec_test $1 $2 "Teensy3.1 with many features" "$3" diff --git a/buildroot/tests/teensy35-tests b/buildroot/tests/teensy35-tests index 39ee4faf4988..79998a26d33e 100755 --- a/buildroot/tests/teensy35-tests +++ b/buildroot/tests/teensy35-tests @@ -8,7 +8,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 -exec_test $1 $2 "Teensy3.5 with default config" +exec_test $1 $2 "Teensy3.5 with default config" "$3" # # Test as many features together as possible @@ -29,7 +29,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LCD_INFO_MENU SDSUPPORT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT opt_set I2C_SLAVE_ADDRESS 63 opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Teensy3.5 with many features" +exec_test $1 $2 "Teensy3.5 with many features" "$3" # # Test a Sled Z Probe with Linear leveling @@ -37,7 +37,7 @@ exec_test $1 $2 "Teensy3.5 with many features" restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 opt_enable EEPROM_SETTINGS Z_PROBE_SLED Z_SAFE_HOMING AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE GCODE_MACROS -exec_test $1 $2 "Sled Z Probe with Linear leveling" +exec_test $1 $2 "Sled Z Probe with Linear leveling" "$3" # # Test a Servo Probe @@ -63,7 +63,7 @@ opt_set MOTHERBOARD BOARD_TEENSY35_36 opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 opt_enable MAGNETIC_PARKING_EXTRUDER ULTIMAKERCONTROLLER -exec_test $1 $2 "MAGNETIC_PARKING_EXTRUDER with LCD" +exec_test $1 $2 "MAGNETIC_PARKING_EXTRUDER with LCD" "$3" # # Mixing Extruder @@ -72,7 +72,7 @@ restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 opt_enable MIXING_EXTRUDER DIRECT_MIXING_IN_G1 GRADIENT_MIX GRADIENT_VTOOL REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER opt_set MIXING_STEPPERS 2 -exec_test $1 $2 "Mixing Extruder" +exec_test $1 $2 "Mixing Extruder" "$3" # # Test SWITCHING_EXTRUDER @@ -97,7 +97,7 @@ opt_set Y_MIN_ENDSTOP_INVERTING true opt_add X_CS_PIN 46 opt_add Y_CS_PIN 47 opt_enable USE_ZMIN_PLUG MONITOR_DRIVER_STATUS SENSORLESS_HOMING -exec_test $1 $2 "Teensy 3.5/3.6 COREXY" +exec_test $1 $2 "Teensy 3.5/3.6 COREXY" "$3" # # Enable COREXZ @@ -105,7 +105,7 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXY" restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 opt_enable COREXZ -exec_test $1 $2 "Teensy 3.5/3.6 COREXZ" +exec_test $1 $2 "Teensy 3.5/3.6 COREXZ" "$3" # # Enable Dual Z with Dual Z endstops @@ -116,7 +116,7 @@ opt_set NUM_Z_STEPPER_DRIVERS 2 opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -exec_test $1 $2 "Dual Z with Dual Z endstops" +exec_test $1 $2 "Dual Z with Dual Z endstops" "$3" # Clean up restore_configs diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 628b295a7fda..135891940e18 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -8,7 +8,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 -exec_test $1 $2 "Teensy4.1 with default config" +exec_test $1 $2 "Teensy4.1 with default config" "$3" # # Test as many features together as possible @@ -30,7 +30,7 @@ opt_enable EXTENSIBLE_UI LCD_INFO_MENU SDSUPPORT SDCARD_SORT_ALPHA \ opt_add EXTUI_EXAMPLE opt_set I2C_SLAVE_ADDRESS 63 opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Teensy4.1 with many features" +exec_test $1 $2 "Teensy4.1 with many features" "$3" # # Test a Sled Z Probe with Linear leveling @@ -38,7 +38,7 @@ exec_test $1 $2 "Teensy4.1 with many features" restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 opt_enable EEPROM_SETTINGS Z_PROBE_SLED Z_SAFE_HOMING AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE GCODE_MACROS -exec_test $1 $2 "Sled Z Probe with Linear leveling" +exec_test $1 $2 "Sled Z Probe with Linear leveling" "$3" # # Test a Servo Probe @@ -65,7 +65,7 @@ opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 opt_set SERIAL_PORT_2 -2 opt_enable EEPROM_SETTINGS MAGNETIC_PARKING_EXTRUDER -exec_test $1 $2 "Ethernet, EEPROM, Magnetic Parking Extruder, No LCD" +exec_test $1 $2 "Ethernet, EEPROM, Magnetic Parking Extruder, No LCD" "$3" # # Mixing Extruder @@ -74,7 +74,7 @@ restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 opt_enable MIXING_EXTRUDER DIRECT_MIXING_IN_G1 GRADIENT_MIX GRADIENT_VTOOL opt_set MIXING_STEPPERS 2 -exec_test $1 $2 "Mixing Extruder" +exec_test $1 $2 "Mixing Extruder" "$3" # # Test SWITCHING_EXTRUDER @@ -99,7 +99,7 @@ opt_set Y_MIN_ENDSTOP_INVERTING true opt_add X_CS_PIN 46 opt_add Y_CS_PIN 47 opt_enable USE_ZMIN_PLUG MONITOR_DRIVER_STATUS SENSORLESS_HOMING -exec_test $1 $2 "Teensy 4.0/4.1 COREXY" +exec_test $1 $2 "Teensy 4.0/4.1 COREXY" "$3" # # Enable COREXZ @@ -107,7 +107,7 @@ exec_test $1 $2 "Teensy 4.0/4.1 COREXY" restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 opt_enable COREXZ -exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" +exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" "$3" # # Enable Dual Z with Dual Z endstops @@ -118,7 +118,7 @@ opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG opt_set NUM_Z_STEPPER_DRIVERS 2 pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -exec_test $1 $2 "Dual Z with Dual Z endstops" +exec_test $1 $2 "Dual Z with Dual Z endstops" "$3" # Clean up restore_configs diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000000..a85e0f831507 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3.8" +services: + # The main image: this doesn't run any particular command, but is mainly used + # for running tests locally + marlin: + image: marlin-dev + build: + dockerfile: Dockerfile + context: docker + working_dir: /code + volumes: + - .:/code + - platformio-cache:/root/.platformio + +volumes: + # This volume holds installed libraries for PlatformIO. If this is deleted you + # will have to download all the dependencies again, which can be a very slow + # process + platformio-cache: diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000000..903b8b71fd32 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.9.0-buster + +RUN pip install -U https://github.com/platformio/platformio-core/archive/develop.zip +RUN platformio update +# To get the test platforms +RUN pip install PyYaml +#ENV PATH /code/buildroot/bin/:/code/buildroot/tests/:${PATH} diff --git a/get_test_targets.py b/get_test_targets.py new file mode 100644 index 000000000000..ce2080eba016 --- /dev/null +++ b/get_test_targets.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python +""" +Extract the builds used in Github CI, so that we can run them locally +""" +import yaml + + +with open('.github/workflows/test-builds.yml') as f: + github_configuration = yaml.safe_load(f) +test_platforms = github_configuration\ + ['jobs']['test_builds']['strategy']['matrix']['test-platform'] +print(' '.join(test_platforms)) From 75924edcf8e129e90119b86ec8a61176bff12c95 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 17 Nov 2020 23:07:34 -0300 Subject: [PATCH 177/443] =?UTF-8?q?COLOR=5FUI=20without=20TOUCH=5FSCREEN?= =?UTF-8?q?=20=F0=9F=91=8D=F0=9F=8F=BB=20(#20178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 4 +- Marlin/src/lcd/tft/ui_480x320.cpp | 60 ++++++++++++----------- buildroot/tests/mks_robin_nano35-tests | 9 ++++ 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 905d7a07cd5d..d089b2125ac7 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -169,7 +169,9 @@ if (ui.should_draw()) { MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); // Color UI needs a control to detect a touch - TERN_(HAS_GRAPHICAL_TFT, touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT)); + #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT) + touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT); + #endif } if (ui.use_click()) { manual_probe_index = 0; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 6d1043068d01..285e55631ab2 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -49,7 +49,9 @@ #error "Seriously? High resolution TFT screen without menu?" #endif -static bool draw_menu_navigation = false; +#if ENABLED(TOUCH_SCREEN) + static bool draw_menu_navigation = false; +#endif void MarlinUI::tft_idle() { #if ENABLED(TOUCH_SCREEN) @@ -897,35 +899,37 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } -static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { - motionAxisState.e_selection = 0; - } +#if ENABLED(TOUCH_SCREEN) + static void e_select() { + motionAxisState.e_selection++; + if (motionAxisState.e_selection >= EXTRUDERS) { + motionAxisState.e_selection = 0; + } - quick_feedback(); - drawCurESelection(); - drawAxisValue(E_AXIS); -} + quick_feedback(); + drawCurESelection(); + drawAxisValue(E_AXIS); + } -static void do_home() { - quick_feedback(); - drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); - queue.inject_P(G28_STR); - // Disable touch until home is done - TERN_(HAS_TFT_XPT2046, touch.disable()); - drawAxisValue(E_AXIS); - drawAxisValue(X_AXIS); - drawAxisValue(Y_AXIS); - drawAxisValue(Z_AXIS); -} + static void do_home() { + quick_feedback(); + drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); + queue.inject_P(G28_STR); + // Disable touch until home is done + TERN_(HAS_TFT_XPT2046, touch.disable()); + drawAxisValue(E_AXIS); + drawAxisValue(X_AXIS); + drawAxisValue(Y_AXIS); + drawAxisValue(Z_AXIS); + } -static void step_size() { - motionAxisState.currentStepSize = motionAxisState.currentStepSize / 10.0; - if (motionAxisState.currentStepSize < 0.0015) motionAxisState.currentStepSize = 10.0; - quick_feedback(); - drawCurStepValue(); -} + static void step_size() { + motionAxisState.currentStepSize = motionAxisState.currentStepSize / 10.0; + if (motionAxisState.currentStepSize < 0.0015) motionAxisState.currentStepSize = 10.0; + quick_feedback(); + drawCurStepValue(); + } +#endif #if HAS_BED_PROBE static void z_select() { @@ -1021,7 +1025,7 @@ void MarlinUI::move_axis_screen() { motionAxisState.zTypePos.x = x; motionAxisState.zTypePos.y = y; drawCurZSelection(); - #if HAS_BED_PROBE + #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); #endif diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index 5dcf79b1ae10..69f370ea694f 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -65,5 +65,14 @@ opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2209 exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" "$3" +# +# MKS Robin v2 nano New Color UI 480x320 SPI Without Touch Screen +# +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 +opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 TOUCH_SCREEN +opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 TFT_COLOR_UI +exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI without TOUCH_SCREEN" + # cleanup restore_configs From 50a77ef7f05dd4ac8b5ed3e9f3e380c5da7ef50c Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 17 Nov 2020 19:11:13 -0800 Subject: [PATCH 178/443] Fix NAN mesh entries with ABL_BILINEAR_SUBDIVISION (#20143) --- Marlin/src/feature/bedlevel/abl/abl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index 39d8815fad98..44e4fc38a1bd 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -161,6 +161,14 @@ void print_bilinear_leveling_grid() { #define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I)) float bed_level_virt_coord(const uint8_t x, const uint8_t y) { uint8_t ep = 0, ip = 1; + if (x > GRID_MAX_POINTS_X + 1 || y > GRID_MAX_POINTS_Y + 1) { + // The requested point requires extrapolating two points beyond the mesh. + // These values are only requested for the edges of the mesh, which are always an actual mesh point, + // and do not require interpolation. When interpolation is not needed, this "Mesh + 2" point is + // cancelled out in bed_level_virt_cmr and does not impact the result. Return 0.0 rather than + // making this function more complex by extrapolating two points. + return 0.0; + } if (!x || x == ABL_TEMP_POINTS_X - 1) { if (x) { ep = GRID_MAX_POINTS_X - 1; From 5768ee0f9ebb09b69b6e3acfe4f1b4876291f169 Mon Sep 17 00:00:00 2001 From: wmariz <11435639+wmariz@users.noreply.github.com> Date: Wed, 18 Nov 2020 00:54:21 -0300 Subject: [PATCH 179/443] Probe Wizard XY position (#20167) --- Marlin/Configuration_adv.h | 3 ++- Marlin/src/inc/Conditionals_post.h | 1 + Marlin/src/lcd/marlinui.h | 2 +- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 33 +++++++++++++++-------- 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2c9ac1aea46a..0951dfaa6d4b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1085,6 +1085,7 @@ //#define PROBE_OFFSET_WIZARD #if ENABLED(PROBE_OFFSET_WIZARD) #define PROBE_OFFSET_START -4.0 // Estimated nozzle-to-probe Z offset, plus a little extra + //#define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER // Set a convenient position to do the measurement #endif #endif @@ -3447,7 +3448,7 @@ #define GANTRY_CALIBRATION_FEEDRATE 500 // Feedrate for correction move //#define GANTRY_CALIBRATION_TO_MIN // Enable to calibrate Z in the MIN direction - //#define GANTRY_CALIBRATION_SAFE_POSITION { X_CENTER, Y_CENTER } // Safe position for nozzle + //#define GANTRY_CALIBRATION_SAFE_POSITION XY_CENTER // Safe position for nozzle //#define GANTRY_CALIBRATION_XY_PARK_FEEDRATE 3000 // XY Park Feedrate - MMM //#define GANTRY_CALIBRATION_COMMANDS_PRE "" #define GANTRY_CALIBRATION_COMMANDS_POST "G28" // G28 highly recommended to ensure an accurate position diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index f8727dd9630a..acb5cc235123 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -100,6 +100,7 @@ #define _Y_HALF_BED ((Y_BED_SIZE) / 2) #define X_CENTER TERN(BED_CENTER_AT_0_0, 0, _X_HALF_BED) #define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED) +#define XY_CENTER { X_CENTER, Y_CENTER } // Get the linear boundaries of the bed #define X_MIN_BED (X_CENTER - _X_HALF_BED) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 0445c641bad9..6ce59132bf70 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -622,7 +622,7 @@ class MarlinUI { // // Special handling if a move is underway // - #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) + #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) || (ENABLED(PROBE_OFFSET_WIZARD) && defined(PROBE_OFFSET_WIZARD_XY_POS)) #define LCD_HAS_WAIT_FOR_MOVE 1 static bool wait_for_move; #else diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 4dd66637f1a2..66fe73cec1cd 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -220,7 +220,7 @@ void _lcd_draw_homing(); #endif #if ENABLED(PROBE_OFFSET_WIZARD) - void goto_probe_offset_wizard(); + void home_and_goto_probe_offset_wizard(); #endif #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index fdddf1781a9b..12f9d57b464d 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -488,7 +488,7 @@ void menu_backlash(); EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #if ENABLED(PROBE_OFFSET_WIZARD) - SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard); + SUBMENU(MSG_PROBE_WIZARD, home_and_goto_probe_offset_wizard); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 8a6cbaaf318c..9f215500982d 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -36,6 +36,7 @@ #include "menu_item.h" #include "menu_addon.h" +#include "../../gcode/queue.h" #include "../../module/motion.h" #include "../../module/planner.h" #include "../../module/probe.h" @@ -120,22 +121,32 @@ void probe_offset_wizard_menu() { END_MENU(); } -void goto_probe_offset_wizard() { - ui.defer_status_screen(); - - prepare_for_calibration(); +#ifdef PROBE_OFFSET_WIZARD_XY_POS + + #define HAS_PROBE_OFFSET_WIZARD_XY_POS 1 + + inline void goto_probe_offset_wizard() { + if (ui.wait_for_move) return; + constexpr xy_pos_t wizard_pos = PROBE_OFFSET_WIZARD_XY_POS; + current_position = wizard_pos; + ui.wait_for_move = true; + line_to_current_position(MMM_TO_MMS(HOMING_FEEDRATE_XY)); // Could invoke idle() + ui.wait_for_move = false; + ui.synchronize(); + prepare_for_calibration(); + probe.offset.z = PROBE_OFFSET_START; + ui.goto_screen(probe_offset_wizard_menu); + ui.defer_status_screen(); + } - probe.offset.z = PROBE_OFFSET_START; +#endif - set_all_unhomed(); +void home_and_goto_probe_offset_wizard() { queue.inject_P(G28_STR); - ui.goto_screen([]{ _lcd_draw_homing(); - if (all_axes_homed()) { - ui.goto_screen(probe_offset_wizard_menu); - ui.defer_status_screen(); - } + if (all_axes_homed()) + ui.goto_screen(TERN(HAS_PROBE_OFFSET_WIZARD_XY_POS, goto_probe_offset_wizard, probe_offset_wizard_menu)); }); } From ecd8227de0c17427f9f8d76cfc279acbc5a0a188 Mon Sep 17 00:00:00 2001 From: Thomas Niccolo Reyes Date: Wed, 18 Nov 2020 12:30:32 +0800 Subject: [PATCH 180/443] Open File Browser on Media Insert (option) (#20151) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 2 ++ Marlin/src/feature/password/password.h | 2 +- Marlin/src/gcode/gcode.h | 8 ++------ Marlin/src/lcd/marlinui.cpp | 11 ++++++++++- Marlin/src/lcd/marlinui.h | 1 + Marlin/src/lcd/menu/menu_item.h | 1 + Marlin/src/lcd/menu/menu_main.cpp | 4 ++-- Marlin/src/lcd/menu/menu_media.cpp | 4 +++- Marlin/src/lcd/menu/menu_password.cpp | 8 +++----- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0951dfaa6d4b..fa7323a66642 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1193,6 +1193,8 @@ //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + //#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted + #define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") #if ENABLED(PRINTER_EVENT_LEDS) diff --git a/Marlin/src/feature/password/password.h b/Marlin/src/feature/password/password.h index 97c31745578a..1382d6df405f 100644 --- a/Marlin/src/feature/password/password.h +++ b/Marlin/src/feature/password/password.h @@ -47,7 +47,7 @@ class Password { static void start_over(); static void digit_entered(); - static void set_password_done(); + static void set_password_done(const bool with_set=true); static void menu_password_report(); static void remove_password(); diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index ddd48a389d30..3fbb88829e09 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -769,12 +769,8 @@ class GcodeSuite { #if ENABLED(PASSWORD_FEATURE) static void M510(); - #if ENABLED(PASSWORD_UNLOCK_GCODE) - static void M511(); - #endif - #if ENABLED(PASSWORD_CHANGE_GCODE) - static void M512(); - #endif + TERN_(PASSWORD_UNLOCK_GCODE, static void M511()); + TERN_(PASSWORD_CHANGE_GCODE, static void M512()); #endif TERN_(SDSUPPORT, static void M524()); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 13c85be78728..9d0ebe27e4ba 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -30,6 +30,10 @@ #include "../feature/host_actions.h" #endif +#if ENABLED(BROWSE_MEDIA_ON_INSERT, PASSWORD_ON_SD_PRINT_MENU) + #include "../feature/password/password.h" +#endif + // All displays share the MarlinUI class #include "marlinui.h" MarlinUI ui; @@ -1620,7 +1624,12 @@ void MarlinUI::update() { if (status) { if (old_status < 2) { TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response - set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); + #if ENABLED(BROWSE_MEDIA_ON_INSERT) + quick_feedback(); + goto_screen(MEDIA_MENU_GATEWAY); + #else + set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); + #endif } } else { diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 6ce59132bf70..3311f55ed575 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -322,6 +322,7 @@ class MarlinUI { #endif #if ENABLED(SDSUPPORT) + #define MEDIA_MENU_GATEWAY TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media) static void media_changed(const uint8_t old_stat, const uint8_t stat); #endif diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 3ebe38235ddb..6430021223c1 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -354,6 +354,7 @@ class MenuItem_bool : public MenuEditItemBase { #define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, false, PLABEL, ##V) #define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) +#define BACK_ITEM_P(PLABEL) MENU_ITEM_P(back, PLABEL) #define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) #define ACTION_ITEM_N_S_P(N, S, PLABEL, ACTION) MENU_ITEM_N_S_P(function, N, S, PLABEL, ACTION) diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 992303b7913e..bb65ce61e260 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -141,7 +141,7 @@ void menu_main() { if (card_detected) { if (!card_open) { - SUBMENU(MSG_MEDIA_MENU, TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media)); + SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); #if PIN_EXISTS(SD_DETECT) GCODES_ITEM(MSG_CHANGE_MEDIA, M21_STR); #else @@ -248,7 +248,7 @@ void menu_main() { #else GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22")); #endif - SUBMENU(MSG_MEDIA_MENU, TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media)); + SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); } } else { diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 93ecc49d9859..59cb2baa231c 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -104,6 +104,8 @@ class MenuItem_sdfolder : public MenuItem_sdbase { } }; +extern uint8_t screen_history_depth; + void menu_media() { ui.encoder_direction_menus(); @@ -115,7 +117,7 @@ void menu_media() { #endif START_MENU(); - BACK_ITEM(MSG_MAIN); + BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK)); if (card.flag.workDirIsRoot) { #if !PIN_EXISTS(SD_DETECT) ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); }); diff --git a/Marlin/src/lcd/menu/menu_password.cpp b/Marlin/src/lcd/menu/menu_password.cpp index c3924b568699..c58931cf2e37 100644 --- a/Marlin/src/lcd/menu/menu_password.cpp +++ b/Marlin/src/lcd/menu/menu_password.cpp @@ -152,19 +152,17 @@ void Password::menu_password_report() { END_SCREEN(); } -void Password::set_password_done() { - is_set = true; +void Password::set_password_done(const bool with_set/*=true*/) { + is_set = with_set; value = value_entry; ui.completion_feedback(true); ui.goto_screen(menu_password_report); } void Password::remove_password() { - is_set = false; string[0] = '0'; string[1] = '\0'; - ui.completion_feedback(true); - ui.goto_screen(menu_password_report); + set_password_done(false); } // From c1920f31cac6d955cb9b366185fdadbe269cf7df Mon Sep 17 00:00:00 2001 From: Foxies Date: Wed, 18 Nov 2020 05:32:34 +0100 Subject: [PATCH 181/443] FLSun Hispeedv1 Board update (#19959) Co-authored-by: Scott Lahteine --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 188 +++++++++---------- 1 file changed, 86 insertions(+), 102 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index a056aa96e57f..05b8b19a8a54 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -50,15 +50,16 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #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 // 2KB #endif +// // SPI // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // SPI Flash #define HAS_SPI_FLASH 1 @@ -108,49 +109,26 @@ #define E0_STEP_PIN PD6 // E0_STEP #define E0_DIR_PIN PD3 // E0_DIR +/** + * FLSUN Hi-Speed has no hard-wired UART pins for TMC drivers. + * Several wiring options are provided below, defaulting to + * to the most compatible. + */ + // // Drivers // #if HAS_TMC220x - - #if ENABLED(HARDWARE_SERIAL) /* TMC2209 */ - #define X_SLAVE_ADDRESS 3 // | | : - #define Y_SLAVE_ADDRESS 2 // : | : - #define Z_SLAVE_ADDRESS 1 // | : : - //#define E0_SLAVE_ADDRESS 0 // : : : - - #define X_SERIAL_TX_PIN PA9 // TXD1 - #define X_SERIAL_RX_PIN PA9 // TXD1 - - #define Y_SERIAL_TX_PIN PA9 // TXD1 - #define Y_SERIAL_RX_PIN PA9 // TXD1 - - #define Z_SERIAL_TX_PIN PA9 // TXD1 - #define Z_SERIAL_RX_PIN PA9 // TXD1 - - #elif ENABLED(SOFTWARE_SERIAL) /* TMC220x */ - /** - * TMC2208 stepper UART-configurable by PDN_UART pin - * Software serial - */ - #define X_SLAVE_ADDRESS 0 - #define Y_SLAVE_ADDRESS 0 - #define Z_SLAVE_ADDRESS 0 - - #define X_SERIAL_TX_PIN PA10 // RXD1 - #define X_SERIAL_RX_PIN PA10 // RXD1 - - #define Y_SERIAL_TX_PIN PA9 // TXD1 - #define Y_SERIAL_RX_PIN PA9 // TXD1 - - #define Z_SERIAL_TX_PIN PC7 // IO1 - #define Z_SERIAL_RX_PIN PC7 // IO1 - - #endif - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 + // SoftwareSerial with one pin per driver + // Compatible with TMC2208 and TMC2209 drivers + #define X_SERIAL_TX_PIN PA10 // RXD1 + #define X_SERIAL_RX_PIN PA10 // RXD1 + #define Y_SERIAL_TX_PIN PA9 // TXD1 + #define Y_SERIAL_RX_PIN PA9 // TXD1 + #define Z_SERIAL_TX_PIN PC7 // IO1 + #define Z_SERIAL_RX_PIN PC7 // IO1 + #define TMC_BAUD_RATE 19200 #else - // Motor current PWM pins #define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY #define MOTOR_CURRENT_PWM_Z_PIN PA7 // VREF4 CONTROL Z @@ -159,33 +137,33 @@ #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } #endif - /** - * src: MKS Robin_Mini V2 - * __ESP(M1)__ -J1- - * GND| 15 | | 08 |+3v3 (22)=>RXD1(PA10) // - * | 16 | | 07 |MOSI (21)=>TXD1(PA9) // active low, probably OK to leave floating - * IO2| 17 | | 06 |MISO (19)=>IO1(PC7) // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * IO0| 18 | | 05 |CLK (18)=>IO0(PA8) // must be high (ESP3D software configures this with a pullup so OK to leave as floating) - * IO1| 19 | | 03 |EN (03)=>WIFI_EN() // Must be high for module to run - * | nc | | nc | (01)=>WIFI_CTRL(PA5) - * RX| 21 | | nc | - * TX| 22 | | 01 |RST - *  ̄ ̄ AE ̄ ̄ - * - */ - #ifdef ESP_WIFI - #define WIFI_IO0_PIN PA8 // PC13 MKS ESP WIFI IO0 PIN - #define WIFI_IO1_PIN PC7 // MKS ESP WIFI IO1 PIN - #define WIFI_RESET_PIN PA5 // MKS ESP WIFI RESET PIN - #endif +/** + * MKS Robin_Wifi or another ESP8266 module + * + * __ESP(M1)__ -J1- + * GND| 15 | | 08 |+3v3 (22) RXD1 (PA10) + * | 16 | | 07 |MOSI (21) TXD1 (PA9) Active LOW, probably OK to leave floating + * IO2| 17 | | 06 |MISO (19) IO1 (PC7) Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * IO0| 18 | | 05 |CLK (18) IO0 (PA8) Must be HIGH (ESP3D software configures this with a pullup so OK to leave as floating) + * IO1| 19 | | 03 |EN (03) WIFI_EN Must be HIGH for module to run + * | nc | | nc | (01) WIFI_CTRL (PA5) + * RX| 21 | | nc | + * TX| 22 | | 01 |RST + *  ̄ ̄ AE ̄ ̄ + */ + // Module ESP-WIFI + #define ESP_WIFI_MODULE_COM 2 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this + #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 + #define ESP_WIFI_MODULE_RESET_PIN PA5 // WIFI CTRL/RST + #define ESP_WIFI_MODULE_ENABLE_PIN -1 + #define ESP_WIFI_MODULE_TXD_PIN PA9 // MKS or ESP WIFI RX PIN + #define ESP_WIFI_MODULE_RXD_PIN PA10 // MKS or ESP WIFI TX PIN #endif // // EXTRUDER // -#if AXIS_DRIVER_TYPE(E0,TMC2208)||AXIS_DRIVER_TYPE(E0,TMC2209) - #define E0_SLAVE_ADDRESS 0 - +#if AXIS_DRIVER_TYPE_E0(TMC2208) || AXIS_DRIVER_TYPE_E0(TMC2209) #define E0_SERIAL_TX_PIN PA8 // IO0 #define E0_SERIAL_RX_PIN PA8 // IO0 #define TMC_BAUD_RATE 19200 @@ -199,7 +177,7 @@ #endif // -// Temperature Sensors(THM) +// Temperature Sensors (THM) // #define TEMP_0_PIN PC1 // TEMP_E0 #define TEMP_BED_PIN PC0 // TEMP_BED @@ -211,7 +189,6 @@ #define HEATER_BED_PIN PA0 // HEATER_BED-WKUP #define FAN_PIN PB1 // E_FAN -//#define CONTROLLER_FAN_PIN PD6 // BOARD FAN // // Misc. Functions @@ -221,12 +198,24 @@ #define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC #endif +/** + * Connector J2 + * ------- + * DIO O|1 2|O 3v3 + * CSK O|3 5|O GND + * RST O|5 6|O GND + * ------- + */ +//#define SW_DIO PA13 +//#define SW_CLK PA14 +//#define SW_RST NRST // (14) + // // Power Supply Control // #if ENABLED(PSU_CONTROL) #define KILL_PIN PA2 // PW_DET - #define KILL_PIN_INVERTING true // + #define KILL_PIN_INVERTING true //#define PS_ON_PIN PA3 // PW_CN /PW_OFF #endif @@ -240,28 +229,33 @@ //#define LED_PIN PB2 // BOOT1 #if ENABLED(NEOPIXEL_LED) - #define LED_PWM PA8 + #define LED_PWM PC7 // IO1 #ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1/TX/RX PIN + #define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1 PIN #endif #endif -//Others test. -//#define SERVO0_PIN PA5 // WIFI CRTL -//#define GPIO_CLEAR PA8 // IO0 -//#define GPIO_SET PA5 - // // SD Card // -#define SDIO_SUPPORT -#define SDIO_CLOCK 4500000 // 4.5 MHz /* 18 MHz (18000000) or 4.5MHz (450000) */ -//#define SDIO_CLOCK 18000000 // 18 MHz (18000000) -#if ENABLED(SDIO_SUPPORT) - #define SCK_PIN PB13 // SPI2 - #define MISO_PIN PB14 // SPI2 - #define MOSI_PIN PB15 // SPI2 - #define SD_DETECT_PIN PD12 // SD_CD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// Use the on-board card socket labeled SD_Extender +#if SD_CONNECTION_IS(CUSTOM_CABLE) + #define SCK_PIN PC12 + #define MISO_PIN PC8 + #define MOSI_PIN PD2 + #define SS_PIN -1 + #define SD_DETECT_PIN PD12 // SD_CD (if -1 no detection) +#else + #define SDIO_SUPPORT + #define SDIO_CLOCK 4500000 // 4.5 MHz + #define SDIO_READ_RETRIES 16 + #define ONBOARD_SPI_DEVICE 1 // SPI1 + #define ONBOARD_SD_CS_PIN PC11 + #define SD_DETECT_PIN -1 // SD_CD (-1 active refresh) #endif // @@ -271,6 +265,10 @@ #define BEEPER_PIN PC5 #endif +#if ENABLED(SPEAKER) && BEEPER_PIN == PC5 + #error "FLSun HiSpeed default BEEPER_PIN is not a SPEAKER." +#endif + /** * Note: MKS Robin TFT screens use various TFT controllers * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240) @@ -284,26 +282,7 @@ * because Marlin uses the reset as a failsafe to revive a glitchy LCD. */ -// MKS Robin TFT v2.0 with ILI9341 -// Read display identification information (0xD3 on ILI9341) -//#define TOUCH_CALIBRATION_X 12013 -//#define TOUCH_CALIBRATION_Y -8711 -//#define TOUCH_OFFSET_X -32 -//#define TOUCH_OFFSET_Y 256 - -// MKS Robin TFT v1.1 with ILI9328 -//#define TOUCH_CALIBRATION_X -11792 -//#define TOUCH_CALIBRATION_Y 8947 -//#define TOUCH_OFFSET_X 342 -//#define TOUCH_OFFSET_Y -19 - -// MKS Robin TFT v1.1 with R61505 -//#define TOUCH_CALIBRATION_X 12489 -//#define TOUCH_CALIBRATION_Y 9210 -//#define TOUCH_OFFSET_X -52 -//#define TOUCH_OFFSET_Y -17 - -// QQS-Pro uses MKS Robin TFT v2.0 +// QQS-Pro uses MKS Robin TFT v2.0 320x240 // Shared FSMC Configs #if HAS_FSMC_TFT @@ -320,8 +299,13 @@ #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - #define TOUCH_BUTTONS_HW_SPI - #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 + #define TFT_BUFFER_SIZE 14400 + #if ENABLED(TFT_CLASSIC_UI) + #define TFT_MARLINBG_COLOR 0x3186 // White + #define TFT_MARLINUI_COLOR 0xC7B6 // green + #define TFT_BTARROWS_COLOR 0xDEE6 // Yellow + #define TFT_BTOKMENU_COLOR 0x145F // Cyan + #endif #endif #if NEED_TOUCH_PINS From f1cdd02d4cf616da632bf2b7735e1ef7546a936a Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 18 Nov 2020 02:48:14 -0300 Subject: [PATCH 182/443] Improve USB Media Host conditions (#20176) Co-authored-by: Scott Lahteine --- Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h | 4 ++++ Marlin/src/HAL/LPC1768/main.cpp | 4 ++-- .../src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp | 2 +- Marlin/src/HAL/STM32/inc/Conditionals_adv.h | 4 ++++ Marlin/src/HAL/STM32F1/HAL.cpp | 24 +++++++++---------- Marlin/src/HAL/STM32F1/HAL.h | 4 ++-- Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h | 5 ---- Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h | 8 +++++++ Marlin/src/HAL/STM32F1/msc_sd.cpp | 4 ++-- Marlin/src/HAL/STM32F1/onboard_sd.cpp | 9 +++---- Marlin/src/inc/Conditionals_post.h | 4 +--- 11 files changed, 40 insertions(+), 32 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h index 5f1c4b16019d..8e7cab185f2a 100644 --- a/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h @@ -20,3 +20,7 @@ * */ #pragma once + +#if DISABLED(NO_SD_HOST_DRIVE) + #define HAS_SD_HOST_DRIVE 1 +#endif diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index 0b4045cb9927..645d6942ebb3 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -122,7 +122,7 @@ void HAL_init() { delay(1000); // Give OS time to notice USB_Connect(TRUE); - #if DISABLED(NO_SD_HOST_DRIVE) + #if HAS_SD_HOST_DRIVE MSC_SD_Init(0); // Enable USB SD card access #endif @@ -140,7 +140,7 @@ void HAL_init() { // HAL idle task void HAL_idletask() { - #if HAS_SHARED_MEDIA + #if HAS_SD_HOST_DRIVE // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp index 6e73e87c2123..9c2666ed26f4 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp @@ -31,7 +31,7 @@ #error "ERROR - Only STM32F103xE, STM32F103xG, STM32F4xx or STM32F7xx CPUs supported" #endif -#ifdef USBD_USE_CDC_COMPOSITE +#if HAS_SD_HOST_DRIVE // use USB drivers diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h index 5f1c4b16019d..e07c0d9cda5e 100644 --- a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h @@ -20,3 +20,7 @@ * */ #pragma once + +#if defined(USBD_USE_CDC_COMPOSITE) && DISABLED(NO_SD_HOST_DRIVE) + #define HAS_SD_HOST_DRIVE 1 +#endif diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index 6733aead6d7c..e6ac87b0eb1f 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -82,7 +82,7 @@ // Public Variables // ------------------------ -#if (defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE)) +#if defined(SERIAL_USB) && !HAS_SD_HOST_DRIVE USBSerial SerialUSB; #endif @@ -251,7 +251,7 @@ void HAL_init() { #if PIN_EXISTS(LED) OUT_WRITE(LED_PIN, LOW); #endif - #ifdef USE_USB_COMPOSITE + #if HAS_SD_HOST_DRIVE MSC_SD_init(); #endif #if PIN_EXISTS(USB_CONNECT) @@ -263,17 +263,15 @@ void HAL_init() { // HAL idle task void HAL_idletask() { - #ifdef USE_USB_COMPOSITE - #if HAS_SHARED_MEDIA - // If Marlin is using the SD card we need to lock it to prevent access from - // a PC via USB. - // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but - // this will not reliably detect delete operations. To be safe we will lock - // the disk if Marlin has it mounted. Unfortunately there is currently no way - // to unmount the disk from the LCD menu. - // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) - /* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/ - #endif + #if HAS_SD_HOST_DRIVE + // If Marlin is using the SD card we need to lock it to prevent access from + // a PC via USB. + // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but + // this will not reliably detect delete operations. To be safe we will lock + // the disk if Marlin has it mounted. Unfortunately there is currently no way + // to unmount the disk from the LCD menu. + // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) + /* copy from lpc1768 framework, should be fixed later for process HAS_SD_HOST_DRIVE*/ // process USB mass storage device class loop MarlinMSC.loop(); #endif diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index b77539d7b6c3..2880865dbbcc 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -42,7 +42,7 @@ #include "../../inc/MarlinConfigPre.h" -#ifdef USE_USB_COMPOSITE +#if HAS_SD_HOST_DRIVE #include "msc_sd.h" #endif @@ -61,7 +61,7 @@ #endif #ifdef SERIAL_USB - #ifndef USE_USB_COMPOSITE + #if !HAS_SD_HOST_DRIVE #define UsbSerial Serial #else #define UsbSerial MarlinCompositeSerial diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h index f52e6fec2b1e..5f1c4b16019d 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h @@ -20,8 +20,3 @@ * */ #pragma once - -#if ENABLED(USE_USB_COMPOSITE) - //#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE." - #undef SD_CHECK_AND_RETRY -#endif diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h index 5f1c4b16019d..0fe79247658c 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h @@ -20,3 +20,11 @@ * */ #pragma once + +#ifdef USE_USB_COMPOSITE + //#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE." + #undef SD_CHECK_AND_RETRY + #if DISABLED(NO_SD_HOST_DRIVE) + #define HAS_SD_HOST_DRIVE 1 + #endif +#endif diff --git a/Marlin/src/HAL/STM32F1/msc_sd.cpp b/Marlin/src/HAL/STM32F1/msc_sd.cpp index 4f44f2ee905f..44242358eeb8 100644 --- a/Marlin/src/HAL/STM32F1/msc_sd.cpp +++ b/Marlin/src/HAL/STM32F1/msc_sd.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . * */ -#if defined(__STM32F1__) && defined(USE_USB_COMPOSITE) +#if defined(__STM32F1__) && HAS_SD_HOST_DRIVE #include "msc_sd.h" #include "SPI.h" @@ -77,4 +77,4 @@ void MSC_SD_init() { #endif } -#endif // __STM32F1__ && USE_USB_COMPOSITE +#endif // __STM32F1__ && HAS_SD_HOST_DRIVE diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.cpp b/Marlin/src/HAL/STM32F1/onboard_sd.cpp index 9c2b128ddc9a..6092aea32054 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.cpp +++ b/Marlin/src/HAL/STM32F1/onboard_sd.cpp @@ -21,10 +21,11 @@ #include "SPI.h" #include "fastio.h" -#if HAS_SHARED_MEDIA - #ifndef ONBOARD_SPI_DEVICE - #define ONBOARD_SPI_DEVICE SPI_DEVICE - #endif +#ifndef ONBOARD_SPI_DEVICE + #define ONBOARD_SPI_DEVICE SPI_DEVICE +#endif + +#if HAS_SD_HOST_DRIVE #define ONBOARD_SD_SPI SPI #else SPIClass OnboardSPI(ONBOARD_SPI_DEVICE); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index acb5cc235123..cae7544fa39c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -360,14 +360,13 @@ */ #if ENABLED(SDSUPPORT) - #if SD_CONNECTION_IS(ONBOARD) && DISABLED(NO_SD_HOST_DRIVE) && !defined(ARDUINO_GRAND_CENTRAL_M4) + #if HAS_SD_HOST_DRIVE && SD_CONNECTION_IS(ONBOARD) // // The external SD card is not used. Hardware SPI is used to access the card. // When sharing the SD card with a PC we want the menu options to // mount/unmount the card and refresh it. So we disable card detect. // #undef SD_DETECT_PIN - #define HAS_SHARED_MEDIA 1 #endif #if PIN_EXISTS(SD_DETECT) @@ -381,7 +380,6 @@ #define SD_DETECT_STATE LOW #endif #endif - #endif #if ANY(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT) || !PIN_EXISTS(SD_DETECT) From 04a3ece3e03d0de7d9e34775a0c38cfe2f06b164 Mon Sep 17 00:00:00 2001 From: Thomas Niccolo Reyes Date: Wed, 18 Nov 2020 13:49:56 +0800 Subject: [PATCH 183/443] Remaining Time for Prusa-style LCD layout (#20148) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 72 +++++++++++---------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 81862e1ddf11..b85d5adf2aba 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -707,6 +707,35 @@ void MarlinUI::draw_status_message(const bool blink) { * |01234567890123456789| */ +inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos) { + char buffer[14]; + + #if ENABLED(SHOW_REMAINING_TIME) + const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && (printingIsActive() || marlin_state == MF_SD_COMPLETE); + if (show_remain) { + #if ENABLED(USE_M73_REMAINING_TIME) + duration_t remaining = get_remaining_time(); + #else + uint8_t progress = get_progress_percent(); + uint32_t elapsed = print_job_timer.duration(); + duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0; + #endif + timepos -= remaining.toDigital(buffer); + lcd_put_wchar(timepos, 2, 'R'); + } + #else + constexpr bool show_remain = false; + #endif + + if (!show_remain) { + duration_t elapsed = print_job_timer.duration(); + timepos -= elapsed.toDigital(buffer); + lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]); + } + lcd_put_u8str(buffer); + return timepos; +} + void MarlinUI::draw_status_screen() { const bool blink = get_blink(); @@ -845,33 +874,7 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(i16tostr3rj(feedrate_percentage)); lcd_put_wchar('%'); - char buffer[14]; - uint8_t timepos = 0; - #if ENABLED(SHOW_REMAINING_TIME) - const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && (printingIsActive() || marlin_state == MF_SD_COMPLETE); - if (show_remain) { - #if ENABLED(USE_M73_REMAINING_TIME) - duration_t remaining = get_remaining_time(); - #else - uint8_t progress = get_progress_percent(); - uint32_t elapsed = print_job_timer.duration(); - duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0; - #endif - const uint8_t len = remaining.toDigital(buffer); - timepos = LCD_WIDTH - 1 - len; - lcd_put_wchar(timepos, 2, 'R'); - } - #else - constexpr bool show_remain = false; - #endif - - if (!show_remain) { - duration_t elapsed = print_job_timer.duration(); - const uint8_t len = elapsed.toDigital(buffer); - timepos = LCD_WIDTH - 1 - len; - lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]); - } - lcd_put_u8str(buffer); + const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1); #if LCD_WIDTH >= 20 lcd_moveto(timepos - 7, 2); @@ -955,7 +958,7 @@ void MarlinUI::draw_status_screen() { #elif HAS_MULTI_HOTEND && HAS_HEATED_BED _draw_bed_status(blink); #elif HAS_PRINT_PROGRESS - #define DREW_PRINT_PROGRESS + #define DREW_PRINT_PROGRESS 1 _draw_print_progress(); #endif @@ -963,14 +966,15 @@ void MarlinUI::draw_status_screen() { // Elapsed Time or SD Percent // lcd_moveto(LCD_WIDTH - 9, 2); - #if HAS_PRINT_PROGRESS && !defined(DREW_PRINT_PROGRESS) + + #if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS + _draw_print_progress(); + #else - duration_t elapsed = print_job_timer.duration(); - char buffer[14]; - (void)elapsed.toDigital(buffer); - lcd_put_wchar(LCD_STR_CLOCK[0]); - lcd_put_u8str(buffer); + + (void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4); + #endif #endif // LCD_INFO_SCREEN_STYLE 1 From caeac3851ab74ff16bd57003135d30272b25da5f Mon Sep 17 00:00:00 2001 From: Philippe Cayrol <58492957+phcay@users.noreply.github.com> Date: Wed, 18 Nov 2020 06:56:51 +0100 Subject: [PATCH 184/443] Better edit range for Linear Advance K (#20155) --- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 8 ++++---- Marlin/src/lcd/menu/menu_tune.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index ac8e6ebf88ba..1583db41e90b 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -626,7 +626,7 @@ namespace ExtUI { void setLinearAdvance_mm_mm_s(const float value, const extruder_t extruder) { if (extruder < EXTRUDERS) - planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 999); + planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 10); } #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 12f9d57b464d..268573beb028 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -110,10 +110,10 @@ void menu_backlash(); #if ENABLED(LIN_ADVANCE) #if EXTRUDERS == 1 - EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); #elif HAS_MULTI_EXTRUDER LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); + EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); #endif #endif @@ -587,10 +587,10 @@ void menu_advanced_settings() { SUBMENU(MSG_FILAMENT, menu_advanced_filament); #elif ENABLED(LIN_ADVANCE) #if EXTRUDERS == 1 - EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); #elif HAS_MULTI_EXTRUDER LOOP_L_N(n, E_STEPPERS) - EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); + EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); #endif #endif diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 041786794eee..87168ba1e769 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -202,10 +202,10 @@ void menu_tune() { // #if ENABLED(LIN_ADVANCE) && DISABLED(SLIM_LCD_MENUS) #if EXTRUDERS == 1 - EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); #elif HAS_MULTI_EXTRUDER LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999); + EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); #endif #endif From 39305aa47c74822badee716996369b12976ba668 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 17 Nov 2020 21:59:48 -0800 Subject: [PATCH 185/443] Use MANUAL_PROBE_START_Z for UBL manual probing (#20160) --- Marlin/src/feature/bedlevel/ubl/ubl.h | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 6 +++--- Marlin/src/inc/Conditionals_post.h | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 22ca1f69ecce..c90b1f7ac155 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -62,7 +62,7 @@ class unified_bed_leveling { #if IS_NEWPANEL static void move_z_with_encoder(const float &multiplier); static float measure_point_with_encoder(); - static float measure_business_card_thickness(float in_height); + static float measure_business_card_thickness(); static void manually_probe_remaining_mesh(const xy_pos_t&, const float&, const float&, const bool) _O0; static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0; #endif diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index ea2e62dd51e0..e8524da36886 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -484,7 +484,7 @@ } if (parser.seen('B')) { - g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness(float(Z_CLEARANCE_BETWEEN_PROBES)); + g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness(); if (ABS(g29_card_thickness) > 1.5f) { SERIAL_ECHOLNPGM("?Error in Business Card measurement."); return; @@ -837,11 +837,11 @@ static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); } - float unified_bed_leveling::measure_business_card_thickness(float in_height) { + float unified_bed_leveling::measure_business_card_thickness() { ui.capture(); save_ubl_active_state_and_disable(); // Disable bed level correction for probing - do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); + do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), MANUAL_PROBE_START_Z); //, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f); planner.synchronize(); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index cae7544fa39c..99a40b016a52 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2603,6 +2603,10 @@ #endif #endif +#if !defined(MANUAL_PROBE_START_Z) && defined(Z_CLEARANCE_BETWEEN_PROBES) + #define MANUAL_PROBE_START_Z Z_CLEARANCE_BETWEEN_PROBES +#endif + #ifndef __SAM3X8E__ //todo: hal: broken hal encapsulation #undef UI_VOLTAGE_LEVEL #undef RADDS_DISPLAY From 11b811820fc09ad0a183ae275006849309f8ec78 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 18 Nov 2020 00:13:17 -0600 Subject: [PATCH 186/443] USB Media Host followup Restore HAS_SHARED_MEDIA --- Marlin/src/HAL/LPC1768/main.cpp | 5 +++-- Marlin/src/HAL/STM32F1/HAL.cpp | 2 +- Marlin/src/inc/Conditionals_post.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index 645d6942ebb3..085b8ce04bcf 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -35,10 +35,11 @@ extern "C" { #include } -#include "../../sd/cardreader.h" #include "../../inc/MarlinConfig.h" #include "../../core/millis_t.h" +#include "../../sd/cardreader.h" + extern uint32_t MSC_SD_Init(uint8_t pdrv); extern "C" int isLPC1769(); extern "C" void disk_timerproc(); @@ -140,7 +141,7 @@ void HAL_init() { // HAL idle task void HAL_idletask() { - #if HAS_SD_HOST_DRIVE + #if HAS_SHARED_MEDIA // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index e6ac87b0eb1f..dfa99d83f4cf 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -263,7 +263,7 @@ void HAL_init() { // HAL idle task void HAL_idletask() { - #if HAS_SD_HOST_DRIVE + #if HAS_SHARED_MEDIA // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 99a40b016a52..994d83ffb3cb 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -367,6 +367,7 @@ // mount/unmount the card and refresh it. So we disable card detect. // #undef SD_DETECT_PIN + #define HAS_SHARED_MEDIA 1 #endif #if PIN_EXISTS(SD_DETECT) From 41529b65988a58ba512977e0fe1692aaeeb6c811 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 18 Nov 2020 08:27:21 +0100 Subject: [PATCH 187/443] SMUFF (MMU2 clone) support (#19912) --- Marlin/Configuration.h | 34 +- Marlin/Configuration_adv.h | 60 ++- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 4 +- Marlin/src/MarlinCore.cpp | 21 +- Marlin/src/feature/{snmm.cpp => mmu/mmu.cpp} | 4 +- Marlin/src/feature/{snmm.h => mmu/mmu.h} | 0 .../mmu2-serial-protocol.md} | 0 Marlin/src/feature/{mmu2 => mmu}/mmu2.cpp | 474 +++++++++--------- Marlin/src/feature/{mmu2 => mmu}/mmu2.h | 22 +- Marlin/src/gcode/config/M220.cpp | 4 +- Marlin/src/gcode/control/T.cpp | 8 +- Marlin/src/gcode/feature/pause/M701_M702.cpp | 16 +- Marlin/src/gcode/feature/prusa_MMU2/M403.cpp | 6 +- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 4 +- Marlin/src/gcode/parser.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 42 +- Marlin/src/inc/SanityCheck.h | 140 +++--- Marlin/src/lcd/menu/menu_main.cpp | 2 +- Marlin/src/lcd/menu/menu_mmu2.cpp | 34 +- Marlin/src/module/settings.cpp | 243 ++++----- Marlin/src/module/stepper/indirection.h | 7 +- Marlin/src/module/tool_change.cpp | 16 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 4 +- Marlin/src/pins/pins.h | 7 +- Marlin/src/pins/pins_postprocess.h | 10 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 4 +- buildroot/tests/mega2560-tests | 18 +- platformio.ini | 10 +- 29 files changed, 602 insertions(+), 596 deletions(-) rename Marlin/src/feature/{snmm.cpp => mmu/mmu.cpp} (95%) rename Marlin/src/feature/{snmm.h => mmu/mmu.h} (100%) rename Marlin/src/feature/{mmu2/serial-protocol.md => mmu/mmu2-serial-protocol.md} (100%) rename Marlin/src/feature/{mmu2 => mmu}/mmu2.cpp (75%) rename Marlin/src/feature/{mmu2 => mmu}/mmu2.h (84%) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index be512e371cba..4521895fdce2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -158,33 +158,19 @@ #endif /** - * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. - * - * This device allows one stepper driver on a control board to drive - * two to eight stepper motors, one at a time, in a manner suitable - * for extruders. - * - * This option only allows the multiplexer to switch on tool-change. - * Additional options to configure custom E moves are pending. - */ -//#define MK2_MULTIPLEXER -#if ENABLED(MK2_MULTIPLEXER) - // Override the default DIO selector pins here, if needed. - // Some pins files may provide defaults for these pins. - //#define E_MUX0_PIN 40 // Always Required - //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs - //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs -#endif - -/** - * Průša Multi-Material Unit v2 + * Multi-Material Unit + * Set to one of these predefined models: * - * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. - * Requires EXTRUDERS = 5 + * PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version) + * PRUSA_MMU2 : Průša MMU2 + * PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5) + * SMUFF_EMU_MMU2 : Technik Gegg SMUFF (Průša MMU2 emulation mode) + * SMUFF_EMU_MMU2S : Technik Gegg SMUFF (Průša MMU2S emulation mode) * - * For additional configuration see Configuration_adv.h + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * See additional options in Configuration_adv.h. */ -//#define PRUSA_MMU2 +//#define MMU_MODEL PRUSA_MMU2 // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fa7323a66642..68d31ceaff9f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3532,11 +3532,24 @@ #endif /** - * Průša Multi-Material Unit v2 + * Průša Multi-Material Unit (MMU) * Enable in Configuration.h + * + * These devices allow a single stepper driver on the board to drive + * multi-material feeders with any number of stepper motors. */ -#if ENABLED(PRUSA_MMU2) - +#if HAS_PRUSA_MMU1 + /** + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + * + * Override the default DIO selector pins here, if needed. + * Some pins files may provide defaults for these pins. + */ + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#elif HAS_PRUSA_MMU2 // Serial port used for communication with MMU2. // For AVR enable the UART port used for the MMU. (e.g., mmuSerial) // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) @@ -3554,7 +3567,7 @@ // Add an LCD menu for MMU2 //#define MMU2_MENUS - #if ENABLED(MMU2_MENUS) + #if EITHER(MMU2_MENUS, HAS_PRUSA_MMU2S) // Settings for filament load / unload from the LCD menu. // This is for Průša MK3-style extruders. Customize for your hardware. #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 @@ -3579,29 +3592,12 @@ { -50.0, 2000 } #endif - /** - * MMU Extruder Sensor - * - * Support for a Průša (or other) IR Sensor to detect filament near the extruder - * and make loading more reliable. Suitable for an extruder equipped with a filament - * sensor less than 38mm from the gears. - * - * During loading the extruder will stop when the sensor is triggered, then do a last - * move up to the gears. If no filament is detected, the MMU2 can make some more attempts. - * If all attempts fail, a filament runout will be triggered. - */ - //#define MMU_EXTRUDER_SENSOR - #if ENABLED(MMU_EXTRUDER_SENSOR) - #define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail - #endif - /** * Using a sensor like the MMU2S * This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S. * See https://help.prusa3d.com/en/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560, step 11 */ - //#define PRUSA_MMU2_S_MODE - #if ENABLED(PRUSA_MMU2_S_MODE) + #if HAS_PRUSA_MMU2S #define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries) #define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/min) @@ -3617,11 +3613,29 @@ #define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \ { -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE } + #else + + /** + * MMU1 Extruder Sensor + * + * Support for a Průša (or other) IR Sensor to detect filament near the extruder + * and make loading more reliable. Suitable for an extruder equipped with a filament + * sensor less than 38mm from the gears. + * + * During loading the extruder will stop when the sensor is triggered, then do a last + * move up to the gears. If no filament is detected, the MMU2 can make some more attempts. + * If all attempts fail, a filament runout will be triggered. + */ + //#define MMU_EXTRUDER_SENSOR + #if ENABLED(MMU_EXTRUDER_SENSOR) + #define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail + #endif + #endif //#define MMU2_DEBUG // Write debug info to serial output -#endif // PRUSA_MMU2 +#endif // HAS_PRUSA_MMU2 /** * Advanced Print Counter settings diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 8b7d27742d40..21d149fcafe6 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -97,8 +97,8 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #define IS_RX0(P) (P == P0_03) #if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI) #error "Serial port pins (0) conflict with Trinamic SPI pins!" - #elif ENABLED(MK2_MULTIPLEXER) && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN)) - #error "Serial port pins (0) conflict with MK2 multiplexer pins!" + #elif HAS_PRUSA_MMU1 && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN)) + #error "Serial port pins (0) conflict with Multi-Material-Unit multiplexer pins!" #elif (AXIS_HAS_SPI(X) && IS_TX0(X_CS_PIN)) || (AXIS_HAS_SPI(Y) && IS_RX0(Y_CS_PIN)) #error "Serial port pins (0) conflict with X/Y axis SPI pins!" #endif diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index acd1321af45e..60765c98331e 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -213,8 +213,8 @@ #include "feature/controllerfan.h" #endif -#if ENABLED(PRUSA_MMU2) - #include "feature/mmu2/mmu2.h" +#if HAS_PRUSA_MMU2 + #include "feature/mmu/mmu2.h" #endif #if HAS_L64XX @@ -713,9 +713,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { TERN_(HAS_FILAMENT_SENSOR, runout.run()); // Run HAL idle tasks - #ifdef HAL_IDLETASK - HAL_idletask(); - #endif + TERN_(HAL_IDLETASK, HAL_idletask()); // Check network connection TERN_(HAS_ETHERNET, ethernet.check()); @@ -772,7 +770,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { #endif // Update the Průša MMU2 - TERN_(PRUSA_MMU2, mmu2.mmu_loop()); + TERN_(HAS_PRUSA_MMU2, mmu2.mmu_loop()); // Handle Joystick jogging TERN_(POLL_JOG, joystick.inject_jog_moves()); @@ -780,9 +778,8 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { // Direct Stepping TERN_(DIRECT_STEPPING, page_manager.write_responses()); - #if HAS_TFT_LVGL_UI - LV_TASK_HANDLER(); - #endif + // Update the LVGL interface + TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER()); } /** @@ -1187,8 +1184,8 @@ void setup() { SETUP_RUN(caselight.update_brightness()); #endif - #if ENABLED(MK2_MULTIPLEXER) - SETUP_LOG("MK2_MULTIPLEXER"); + #if HAS_PRUSA_MMU1 + SETUP_LOG("Prusa MMU1"); SET_OUTPUT(E_MUX0_PIN); SET_OUTPUT(E_MUX1_PIN); SET_OUTPUT(E_MUX2_PIN); @@ -1268,7 +1265,7 @@ void setup() { SETUP_RUN(test_tmc_connection(true, true, true, true)); #endif - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 SETUP_RUN(mmu2.init()); #endif diff --git a/Marlin/src/feature/snmm.cpp b/Marlin/src/feature/mmu/mmu.cpp similarity index 95% rename from Marlin/src/feature/snmm.cpp rename to Marlin/src/feature/mmu/mmu.cpp index 25723f7b38c3..2b48823ee799 100644 --- a/Marlin/src/feature/snmm.cpp +++ b/Marlin/src/feature/mmu/mmu.cpp @@ -22,7 +22,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(MK2_MULTIPLEXER) +#if HAS_PRUSA_MMU1 #include "../module/stepper.h" @@ -35,4 +35,4 @@ void select_multiplexed_stepper(const uint8_t e) { safe_delay(100); } -#endif // MK2_MULTIPLEXER +#endif // HAS_PRUSA_MMU1 diff --git a/Marlin/src/feature/snmm.h b/Marlin/src/feature/mmu/mmu.h similarity index 100% rename from Marlin/src/feature/snmm.h rename to Marlin/src/feature/mmu/mmu.h diff --git a/Marlin/src/feature/mmu2/serial-protocol.md b/Marlin/src/feature/mmu/mmu2-serial-protocol.md similarity index 100% rename from Marlin/src/feature/mmu2/serial-protocol.md rename to Marlin/src/feature/mmu/mmu2-serial-protocol.md diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp similarity index 75% rename from Marlin/src/feature/mmu2/mmu2.cpp rename to Marlin/src/feature/mmu/mmu2.cpp index d76476e719f3..61adcfca72a7 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(PRUSA_MMU2) +#if HAS_PRUSA_MMU2 #include "mmu2.h" #include "../../lcd/menu/menu_mmu2.h" @@ -94,7 +94,7 @@ MMU2 mmu2; #define mmuSerial MMU2_SERIAL bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; -#if ENABLED(PRUSA_MMU2_S_MODE) +#if HAS_PRUSA_MMU2S bool MMU2::mmu2s_triggered; #endif uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder; @@ -105,23 +105,19 @@ int16_t MMU2::version = -1, MMU2::buildnr = -1; millis_t MMU2::prev_request, MMU2::prev_P0_request; char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; -#if BOTH(HAS_LCD_MENU, MMU2_MENUS) - - struct E_Step { - float extrude; //!< extrude distance in mm - feedRate_t feedRate; //!< feed rate in mm/s - }; - - static constexpr E_Step - ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE } - , load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE } - #if ENABLED(PRUSA_MMU2_S_MODE) - , can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE } - , can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE } - #endif - ; - -#endif // MMU2_MENUS +struct E_Step { + float extrude; //!< extrude distance in mm + feedRate_t feedRate; //!< feed rate in mm/s +}; + +static constexpr E_Step + ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE } + , load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE } + #if HAS_PRUSA_MMU2S + , can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE } + , can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE } + #endif +; MMU2::MMU2() { rx_buffer[0] = '\0'; @@ -162,7 +158,7 @@ uint8_t MMU2::get_current_tool() { return extruder == MMU2_NO_TOOL ? -1 : extruder; } -#if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) +#if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR) #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif @@ -188,7 +184,7 @@ void MMU2::mmu_loop() { case -2: if (rx_ok()) { - sscanf(rx_buffer, "%uok\n", &version); + sscanf(rx_buffer, "%huok\n", &version); DEBUG_ECHOLNPAIR("MMU => ", version, "\nMMU <= 'S2'"); @@ -199,7 +195,7 @@ void MMU2::mmu_loop() { case -3: if (rx_ok()) { - sscanf(rx_buffer, "%uok\n", &buildnr); + sscanf(rx_buffer, "%huok\n", &buildnr); DEBUG_ECHOLNPAIR("MMU => ", buildnr); @@ -242,7 +238,7 @@ void MMU2::mmu_loop() { enabled = true; state = 1; - TERN_(PRUSA_MMU2_S_MODE, mmu2s_triggered = false); + TERN_(HAS_PRUSA_MMU2S, mmu2s_triggered = false); } break; @@ -307,7 +303,7 @@ void MMU2::mmu_loop() { state = 2; // wait for response } - TERN_(PRUSA_MMU2_S_MODE, check_filament()); + TERN_(HAS_PRUSA_MMU2S, check_filament()); break; case 2: // response to command P0 @@ -324,7 +320,7 @@ void MMU2::mmu_loop() { else if (ELAPSED(millis(), prev_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s) state = 1; - TERN_(PRUSA_MMU2_S_MODE, check_filament()); + TERN_(HAS_PRUSA_MMU2S, check_filament()); break; case 3: // response to mmu commands @@ -340,9 +336,9 @@ void MMU2::mmu_loop() { #endif if (rx_ok()) { - // Response to C0 mmu command in PRUSA_MMU2_S_MODE + // Response to C0 mmu command in MMU2S model bool can_reset = true; - #if ENABLED(PRUSA_MMU2_S_MODE) + #if HAS_PRUSA_MMU2S if (!mmu2s_triggered && last_cmd == MMU_CMD_C0) { can_reset = false; // MMU ok received but filament sensor not triggered, retrying... @@ -367,7 +363,7 @@ void MMU2::mmu_loop() { } state = 1; } - TERN_(PRUSA_MMU2_S_MODE, check_filament()); + TERN_(HAS_PRUSA_MMU2S, check_filament()); break; } } @@ -487,7 +483,7 @@ static void mmu2_not_responding() { BUZZ(100, 659); } -#if ENABLED(PRUSA_MMU2_S_MODE) +#if HAS_PRUSA_MMU2S bool MMU2::load_to_gears() { command(MMU_CMD_C0); @@ -541,33 +537,38 @@ static void mmu2_not_responding() { * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. */ void MMU2::tool_change(const char* special) { - - if (!enabled) return; - - #if ENABLED(MMU2_MENUS) + if (!enabled) return; set_runout_valid(false); switch (*special) { case '?': { - uint8_t index = mmu2_choose_filament(); - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); - load_filament_to_nozzle(index); + #if ENABLED(MMU2_MENUS) + const uint8_t index = mmu2_choose_filament(); + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); + load_filament_to_nozzle(index); + #else + BUZZ(400, 40); + #endif } break; case 'x': { - planner.synchronize(); - uint8_t index = mmu2_choose_filament(); - DISABLE_AXIS_E0(); - command(MMU_CMD_T0 + index); - manage_response(true, true); - - if (load_to_gears()) { - mmu_loop(); - ENABLE_AXIS_E0(); - extruder = index; - active_extruder = 0; - } + #if ENABLED(MMU2_MENUS) + planner.synchronize(); + const uint8_t index = mmu2_choose_filament(); + DISABLE_AXIS_E0(); + command(MMU_CMD_T0 + index); + manage_response(true, true); + + if (load_to_gears()) { + mmu_loop(); + ENABLE_AXIS_E0(); + extruder = index; + active_extruder = 0; + } + #else + BUZZ(400, 40); + #endif } break; case 'c': { @@ -577,8 +578,6 @@ static void mmu2_not_responding() { } set_runout_valid(true); - - #endif // MMU2_MENUS } #elif ENABLED(MMU_EXTRUDER_SENSOR) @@ -628,20 +627,23 @@ static void mmu2_not_responding() { void MMU2::tool_change(const char* special) { if (!enabled) return; - #if ENABLED(MMU2_MENUS) - - set_runout_valid(false); + set_runout_valid(false); - switch (*special) { - case '?': { - DEBUG_ECHOLNPGM("case ?\n"); + switch (*special) { + case '?': { + DEBUG_ECHOLNPGM("case ?\n"); + #if ENABLED(MMU2_MENUS) uint8_t index = mmu2_choose_filament(); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); load_filament_to_nozzle(index); - } break; + #else + BUZZ(400, 40); + #endif + } break; - case 'x': { - DEBUG_ECHOLNPGM("case x\n"); + case 'x': { + DEBUG_ECHOLNPGM("case x\n"); + #if ENABLED(MMU2_MENUS) planner.synchronize(); uint8_t index = mmu2_choose_filament(); DISABLE_AXIS_E0(); @@ -654,18 +656,19 @@ static void mmu2_not_responding() { ENABLE_AXIS_E0(); extruder = index; active_extruder = 0; - } break; - - case 'c': { - DEBUG_ECHOLNPGM("case c\n"); - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); - execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); - } break; - } + #else + BUZZ(400, 40); + #endif + } break; - set_runout_valid(true); + case 'c': { + DEBUG_ECHOLNPGM("case c\n"); + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); + execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); + } break; + } - #endif // MMU2_MENUS + set_runout_valid(true); } void MMU2::mmu_continue_loading() { @@ -682,68 +685,74 @@ static void mmu2_not_responding() { mmu_idl_sens = 0; } -#elif DISABLED(MMU_EXTRUDER_SENSOR) && DISABLED(PRUSA_MMU2_S_MODE) +#else // !HAS_PRUSA_MMU2S && !MMU_EXTRUDER_SENSOR -/** - * Handle tool change - */ -void MMU2::tool_change(const uint8_t index) { - if (!enabled) return; - - set_runout_valid(false); + /** + * Handle tool change + */ + void MMU2::tool_change(const uint8_t index) { + if (!enabled) return; - if (index != extruder) { - DISABLE_AXIS_E0(); - ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); - command(MMU_CMD_T0 + index); - manage_response(true, true); - command(MMU_CMD_C0); - extruder = index; //filament change is finished - active_extruder = 0; - ENABLE_AXIS_E0(); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(extruder)); - ui.reset_status(); - } + set_runout_valid(false); - set_runout_valid(true); -} + if (index != extruder) { + DISABLE_AXIS_E0(); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + command(MMU_CMD_T0 + index); + manage_response(true, true); + command(MMU_CMD_C0); + extruder = index; //filament change is finished + active_extruder = 0; + ENABLE_AXIS_E0(); + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(extruder)); + ui.reset_status(); + } -/** - * Handle special T?/Tx/Tc commands - * - * T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically - * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. - * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. - */ -void MMU2::tool_change(const char* special) { - if (!enabled) return; + set_runout_valid(true); + } - #if ENABLED(MMU2_MENUS) + /** + * Handle special T?/Tx/Tc commands + * + * T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically + * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. + * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. + */ + void MMU2::tool_change(const char* special) { + if (!enabled) return; set_runout_valid(false); switch (*special) { case '?': { DEBUG_ECHOLNPGM("case ?\n"); - uint8_t index = mmu2_choose_filament(); - while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); - load_filament_to_nozzle(index); + #if ENABLED(MMU2_MENUS) + uint8_t index = mmu2_choose_filament(); + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); + load_filament_to_nozzle(index); + #else + BUZZ(400, 40); + #endif } break; case 'x': { DEBUG_ECHOLNPGM("case x\n"); - planner.synchronize(); - uint8_t index = mmu2_choose_filament(); - DISABLE_AXIS_E0(); - command(MMU_CMD_T0 + index); - manage_response(true, true); - command(MMU_CMD_C0); - mmu_loop(); + #if ENABLED(MMU2_MENUS) + planner.synchronize(); + uint8_t index = mmu2_choose_filament(); + DISABLE_AXIS_E0(); + command(MMU_CMD_T0 + index); + manage_response(true, true); + command(MMU_CMD_C0); + mmu_loop(); - ENABLE_AXIS_E0(); - extruder = index; - active_extruder = 0; + ENABLE_AXIS_E0(); + extruder = index; + active_extruder = 0; + #else + BUZZ(400, 40); + #endif } break; case 'c': { @@ -754,11 +763,9 @@ void MMU2::tool_change(const char* special) { } set_runout_valid(true); - - #endif } -#endif // MMU_EXTRUDER_SENSOR +#endif // HAS_PRUSA_MMU2S /** * Set next command @@ -866,7 +873,7 @@ void MMU2::filament_runout() { planner.synchronize(); } -#if ENABLED(PRUSA_MMU2_S_MODE) +#if HAS_PRUSA_MMU2S void MMU2::check_filament() { const bool present = FILAMENT_PRESENT(); @@ -907,162 +914,159 @@ void MMU2::filament_runout() { DEBUG_ECHOLNPGM(" succeeded."); return true; } + #endif -#if BOTH(HAS_LCD_MENU, MMU2_MENUS) +// Load filament into MMU2 +void MMU2::load_filament(const uint8_t index) { + if (!enabled) return; + command(MMU_CMD_L0 + index); + manage_response(false, false); + BUZZ(200, 404); +} - // Load filament into MMU2 - void MMU2::load_filament(const uint8_t index) { - if (!enabled) return; - command(MMU_CMD_L0 + index); - manage_response(false, false); +/** + * Switch material and load to nozzle + */ +bool MMU2::load_filament_to_nozzle(const uint8_t index) { + + if (!enabled) return false; + + if (thermalManager.tooColdToExtrude(active_extruder)) { BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; } - /** - * Switch material and load to nozzle - */ - bool MMU2::load_filament_to_nozzle(const uint8_t index) { + command(MMU_CMD_T0 + index); + manage_response(true, true); - if (!enabled) return false; + const bool success = load_to_gears(); + if (success) { + mmu_loop(); + extruder = index; + active_extruder = 0; + load_to_nozzle(); + BUZZ(200, 404); + } + return success; +} - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } +/** + * Load filament to nozzle of multimaterial printer + * + * This function is used only only after T? (user select filament) and M600 (change filament). + * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading + * filament to nozzle. + */ +void MMU2::load_to_nozzle() { + if (!enabled) return; + execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); +} - command(MMU_CMD_T0 + index); - manage_response(true, true); +bool MMU2::eject_filament(const uint8_t index, const bool recover) { - const bool success = load_to_gears(); - if (success) { - mmu_loop(); - extruder = index; - active_extruder = 0; - load_to_nozzle(); - BUZZ(200, 404); - } - return success; - } + if (!enabled) return false; - /** - * Load filament to nozzle of multimaterial printer - * - * This function is used only only after T? (user select filament) and M600 (change filament). - * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading - * filament to nozzle. - */ - void MMU2::load_to_nozzle() { - if (!enabled) return; - execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); + if (thermalManager.tooColdToExtrude(active_extruder)) { + BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; } - bool MMU2::eject_filament(const uint8_t index, const bool recover) { + LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); - if (!enabled) return false; - - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } + ENABLE_AXIS_E0(); + current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; + line_to_current_position(MMM_TO_MMS(2500)); + planner.synchronize(); + command(MMU_CMD_E0 + index); + manage_response(false, false); - LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); + if (recover) { + LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER); + BUZZ(200, 404); + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR)); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"))); + wait_for_user_response(); + BUZZ(200, 404); + BUZZ(200, 404); - ENABLE_AXIS_E0(); - current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; - line_to_current_position(2500 / 60); - planner.synchronize(); - command(MMU_CMD_E0 + index); + command(MMU_CMD_R0); manage_response(false, false); + } - if (recover) { - LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER); - BUZZ(200, 404); - TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR)); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"))); - wait_for_user_response(); - BUZZ(200, 404); - BUZZ(200, 404); - - command(MMU_CMD_R0); - manage_response(false, false); - } - - ui.reset_status(); + ui.reset_status(); - // no active tool - extruder = MMU2_NO_TOOL; + // no active tool + extruder = MMU2_NO_TOOL; - set_runout_valid(false); + set_runout_valid(false); - BUZZ(200, 404); + BUZZ(200, 404); - DISABLE_AXIS_E0(); + DISABLE_AXIS_E0(); - return true; - } + return true; +} - /** - * Unload from hotend and retract to MMU - */ - bool MMU2::unload() { +/** + * Unload from hotend and retract to MMU + */ +bool MMU2::unload() { - if (!enabled) return false; + if (!enabled) return false; - if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); - LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); - return false; - } - - filament_ramming(); + if (thermalManager.tooColdToExtrude(active_extruder)) { + BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; + } - command(MMU_CMD_U0); - manage_response(false, true); + filament_ramming(); - BUZZ(200, 404); + command(MMU_CMD_U0); + manage_response(false, true); - // no active tool - extruder = MMU2_NO_TOOL; + BUZZ(200, 404); - set_runout_valid(false); + // no active tool + extruder = MMU2_NO_TOOL; - return true; - } + set_runout_valid(false); - /** - * Unload sequence to optimize shape of the tip of the unloaded filament - */ - void MMU2::filament_ramming() { - execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); - } + return true; +} - void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { +/** + * Unload sequence to optimize shape of the tip of the unloaded filament + */ +void MMU2::filament_ramming() { + execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); +} - planner.synchronize(); - ENABLE_AXIS_E0(); +void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { - const E_Step* step = sequence; + planner.synchronize(); + ENABLE_AXIS_E0(); - LOOP_L_N(i, steps) { - const float es = pgm_read_float(&(step->extrude)); - const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); + const E_Step* step = sequence; - DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("E step ", es, "/", fr_mm_m); + LOOP_L_N(i, steps) { + const float es = pgm_read_float(&(step->extrude)); + const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); - current_position.e += es; - line_to_current_position(MMM_TO_MMS(fr_mm_m)); - planner.synchronize(); + DEBUG_ECHO_START(); + DEBUG_ECHOLNPAIR("E step ", es, "/", fr_mm_m); - step++; - } + current_position.e += es; + line_to_current_position(MMM_TO_MMS(fr_mm_m)); + planner.synchronize(); - DISABLE_AXIS_E0(); + step++; } -#endif // HAS_LCD_MENU && MMU2_MENUS + DISABLE_AXIS_E0(); +} -#endif // PRUSA_MMU2 +#endif // HAS_PRUSA_MMU2 diff --git a/Marlin/src/feature/mmu2/mmu2.h b/Marlin/src/feature/mmu/mmu2.h similarity index 84% rename from Marlin/src/feature/mmu2/mmu2.h rename to Marlin/src/feature/mmu/mmu2.h index 678f65d0720d..09ff3b668366 100644 --- a/Marlin/src/feature/mmu2/mmu2.h +++ b/Marlin/src/feature/mmu/mmu2.h @@ -49,13 +49,11 @@ class MMU2 { static uint8_t get_current_tool(); static void set_filament_type(const uint8_t index, const uint8_t type); - #if BOTH(HAS_LCD_MENU, MMU2_MENUS) - static bool unload(); - static void load_filament(uint8_t); - static void load_all(); - static bool load_filament_to_nozzle(const uint8_t index); - static bool eject_filament(const uint8_t index, const bool recover); - #endif + static bool unload(); + static void load_filament(uint8_t); + static void load_all(); + static bool load_filament_to_nozzle(const uint8_t index); + static bool eject_filament(const uint8_t index, const bool recover); private: static bool rx_str_P(const char* str); @@ -72,15 +70,13 @@ class MMU2 { static bool get_response(); static void manage_response(const bool move_axes, const bool turn_off_nozzle); - #if BOTH(HAS_LCD_MENU, MMU2_MENUS) - static void load_to_nozzle(); - static void filament_ramming(); - static void execute_extruder_sequence(const E_Step * sequence, int steps); - #endif + static void load_to_nozzle(); + static void filament_ramming(); + static void execute_extruder_sequence(const E_Step * sequence, int steps); static void filament_runout(); - #if ENABLED(PRUSA_MMU2_S_MODE) + #if HAS_PRUSA_MMU2S static bool mmu2s_triggered; static void check_filament(); static bool can_load(); diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index 1bec6a778204..37fe7d3a5f28 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -31,13 +31,13 @@ * * Report the current speed percentage factor if no parameter is specified * - * With PRUSA_MMU2... + * For MMU2 and MMU2S devices... * B : Flag to back up the current factor * R : Flag to restore the last-saved factor */ void GcodeSuite::M220() { - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 static int16_t backup_feedrate_percentage = 100; if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index d95e60ff8d70..592b2b3dcefb 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -27,8 +27,8 @@ #include "../../module/motion.h" #endif -#if ENABLED(PRUSA_MMU2) - #include "../../feature/mmu2/mmu2.h" +#if HAS_PRUSA_MMU2 + #include "../../feature/mmu/mmu2.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -40,7 +40,7 @@ * F[units/min] Set the movement feedrate * S1 Don't move the tool in XY after change * - * For PRUSA_MMU2: + * For PRUSA_MMU2(S) and SMUFF_EMU_MMU2(S) * T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. * T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically. * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load. @@ -54,7 +54,7 @@ void GcodeSuite::T(const int8_t tool_index) { // Count this command as movement / activity reset_stepper_timeout(); - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 if (parser.string_arg) { mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc return; diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index a193d83d40f6..a100d462da7e 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -38,8 +38,8 @@ #include "../../../lcd/marlinui.h" #endif -#if ENABLED(PRUSA_MMU2) - #include "../../../feature/mmu2/mmu2.h" +#if HAS_PRUSA_MMU2 + #include "../../../feature/mmu/mmu2.h" #endif #if ENABLED(MIXING_EXTRUDER) @@ -86,7 +86,7 @@ void GcodeSuite::M701() { // Show initial "wait for load" message TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder)); - #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) + #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Change toolhead if specified uint8_t active_extruder_before_filament_change = active_extruder; if (active_extruder != target_extruder) @@ -98,7 +98,7 @@ void GcodeSuite::M701() { do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Load filament - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 mmu2.load_filament_to_nozzle(target_extruder); #else constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH, @@ -121,7 +121,7 @@ void GcodeSuite::M701() { if (park_point.z > 0) do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) + #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Restore toolhead if it was changed if (active_extruder_before_filament_change != active_extruder) tool_change(active_extruder_before_filament_change, false); @@ -186,7 +186,7 @@ void GcodeSuite::M702() { // Show initial "wait for unload" message TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder)); - #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) + #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Change toolhead if specified uint8_t active_extruder_before_filament_change = active_extruder; if (active_extruder != target_extruder) @@ -198,7 +198,7 @@ void GcodeSuite::M702() { do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Unload filament - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 mmu2.unload(); #else #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS) @@ -227,7 +227,7 @@ void GcodeSuite::M702() { if (park_point.z > 0) do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); - #if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) + #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Restore toolhead if it was changed if (active_extruder_before_filament_change != active_extruder) tool_change(active_extruder_before_filament_change, false); diff --git a/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp index 91e35dbf657c..31d076337a44 100644 --- a/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp +++ b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp @@ -22,10 +22,10 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(PRUSA_MMU2) +#if HAS_PRUSA_MMU2 #include "../../gcode.h" -#include "../../../feature/mmu2/mmu2.h" +#include "../../../feature/mmu/mmu2.h" /** * M403: Set filament type for MMU2 @@ -46,4 +46,4 @@ void GcodeSuite::M403() { SERIAL_ECHO_MSG("M403 - bad arguments."); } -#endif // PRUSA_MMU2 +#endif // HAS_PRUSA_MMU2 diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 544d7b777dd7..3bce34c1f323 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -702,7 +702,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 402: M402(); break; // M402: Stow probe #endif - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 case 403: M403(); break; #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 3fbb88829e09..1d74ac371960 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -181,7 +181,7 @@ * M217 - Set filament swap parameters: "M217 S P R". (Requires SINGLENOZZLE) * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) - * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires PRUSA_MMU2) + * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires an MMU_MODEL version 2 or 2S) * M221 - Set Flow Percentage: "M221 S" * M226 - Wait until a pin is in a given state: "M226 P S" (Requires DIRECT_PIN_CONTROL) * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE) @@ -735,7 +735,7 @@ class GcodeSuite { static void M402(); #endif - TERN_(PRUSA_MMU2, static void M403()); + TERN_(HAS_PRUSA_MMU2, static void M403()); #if ENABLED(FILAMENT_WIDTH_SENSOR) static void M404(); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 4bff045e304d..a513c4b59611 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -155,7 +155,7 @@ void GCodeParser::parse(char *p) { // Skip spaces to get the numeric part while (*p == ' ') p++; - #if ENABLED(PRUSA_MMU2) + #if HAS_PRUSA_MMU2 if (letter == 'T') { // check for special MMU2 T?/Tx/Tc commands if (*p == '?' || *p == 'x' || *p == 'c') { diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b784e12b9992..5fe73a9467cc 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -495,6 +495,36 @@ #endif #endif +/** + * Multi-Material-Unit supported models + */ +#define PRUSA_MMU1 1 +#define PRUSA_MMU2 2 +#define PRUSA_MMU2S 3 +#define SMUFF_EMU_MMU2 12 +#define SMUFF_EMU_MMU2S 13 + +#ifdef MMU_MODEL + #define HAS_MMU 1 + #if MMU_MODEL == PRUSA_MMU1 + #define HAS_PRUSA_MMU1 1 + #elif MMU_MODEL % 10 == PRUSA_MMU2 + #define HAS_PRUSA_MMU2 1 + #elif MMU_MODEL % 10 == PRUSA_MMU2S + #define HAS_PRUSA_MMU2 1 + #define HAS_PRUSA_MMU2S 1 + #endif + #if MMU_MODEL >= SMUFF_EMU_MMU2 + #define HAS_SMUFF 1 + #endif +#endif + +#undef PRUSA_MMU1 +#undef PRUSA_MMU2 +#undef PRUSA_MMU2S +#undef SMUFF_EMU_MMU2 +#undef SMUFF_EMU_MMU2S + /** * Extruders have some combination of stepper motors and hotends * so we separate these concepts into the defines: @@ -512,8 +542,6 @@ #undef SWITCHING_EXTRUDER #undef SWITCHING_NOZZLE #undef MIXING_EXTRUDER - #undef MK2_MULTIPLEXER - #undef PRUSA_MMU2 #undef HOTEND_IDLE_TIMEOUT #elif EXTRUDERS > 1 #define HAS_MULTI_EXTRUDER 1 @@ -539,17 +567,17 @@ #elif ENABLED(SWITCHING_TOOLHEAD) #define E_STEPPERS EXTRUDERS #define E_MANUAL EXTRUDERS -#elif ENABLED(PRUSA_MMU2) +#elif HAS_PRUSA_MMU2 #define E_STEPPERS 1 #endif -// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE -#if EITHER(MK2_MULTIPLEXER, SWITCHING_NOZZLE) +// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1 +#if ENABLED(SWITCHING_NOZZLE) || HAS_PRUSA_MMU1 #undef DISABLE_INACTIVE_EXTRUDER #endif -// Průša MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE -#if EITHER(MK2_MULTIPLEXER, PRUSA_MMU2) +// Průša MMU1, MMU 2.0, MMUS 2.0 and SMUFF force SINGLENOZZLE +#if HAS_MMU #define SINGLENOZZLE #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 65504ab7952d..4215f225e3eb 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -804,7 +804,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if !PIN_EXISTS(FIL_RUNOUT) #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif NUM_RUNOUT_SENSORS > E_STEPPERS - #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." + #if HAS_PRUSA_MMU2 + #error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S." + #else + #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." + #endif #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2) #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2." #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3) @@ -867,6 +871,42 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." #endif +/** + * Sanity checking for all Průša MMU + */ +#ifdef SNMM + #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." +#elif ENABLED(MK2_MULTIPLEXER) + #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." +#elif ENABLED(PRUSA_MMU2) + #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead." +#elif ENABLED(PRUSA_MMU2_S_MODE) + #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead." +#endif + +/** + * Multi-Material-Unit 2 / SMUFF requirements + */ +#if HAS_PRUSA_MMU2 + #if EXTRUDERS != 5 + #undef SINGLENOZZLE + #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration." + #elif DISABLED(NOZZLE_PARK_FEATURE) + #error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue." + #elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR) + #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." + #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR) + #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." + #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU + #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled." + #elif DISABLED(ADVANCED_PAUSE_FEATURE) + static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / SMUFF_EMU_MMU2(S)."); + #endif +#endif +#if HAS_SMUFF && EXTRUDERS > 12 + #error "Too many extruders for SMUFF_EMU_MMU2(S). (12 maximum)." +#endif + /** * Options only for EXTRUDERS > 1 */ @@ -902,17 +942,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1." #endif -#elif ENABLED(MK2_MULTIPLEXER) - #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS." +#elif HAS_PRUSA_MMU1 || HAS_SMUFF + + #error "Multi-Material-Unit requires 2 or more EXTRUDERS." + #elif ENABLED(SINGLENOZZLE) + #error "SINGLENOZZLE requires 2 or more EXTRUDERS." -#endif -/** - * Sanity checking for the Průša MK2 Multiplexer - */ -#ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER." #endif /** @@ -1870,48 +1907,46 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * Test Extruder Stepper Pins */ -#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only - #if E_STEPPERS - #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE) - #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." +#if E_STEPPERS + #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE) + #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." + #endif + #if E_STEPPERS > 1 + #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE) + #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 1 - #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 2 + #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE) + #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 2 - #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 3 + #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE) + #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 3 - #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 4 + #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE) + #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 4 - #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE) - #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 5 + #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE) + #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 5 - #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE) - #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 6 + #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE) + #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 6 - #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE) - #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board." + #if E_STEPPERS > 7 + #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE) + #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board." #endif - #if E_STEPPERS > 7 - #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE) - #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board." - #endif - #endif // E_STEPPERS > 7 - #endif // E_STEPPERS > 6 - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - #endif // E_STEPPERS -#endif + #endif // E_STEPPERS > 7 + #endif // E_STEPPERS > 6 + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 +#endif // E_STEPPERS /** * Endstop Tests @@ -2977,23 +3012,6 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif -/** - * Průša MMU2 requirements - */ -#if ENABLED(PRUSA_MMU2) - #if EXTRUDERS != 5 - #error "PRUSA_MMU2 requires EXTRUDERS = 5." - #elif DISABLED(NOZZLE_PARK_FEATURE) - #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE. Enable it to continue." - #elif EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR) - #error "PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." - #elif BOTH(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) - #error "Enable only one of PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR." - #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2."); - #endif -#endif - /** * Advanced PRINTCOUNTER settings */ diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index bb65ce61e260..cda11bfc57cc 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -46,7 +46,7 @@ #define MACHINE_CAN_PAUSE 1 #endif -#if ENABLED(PRUSA_MMU2) +#if ENABLED(MMU2_MENUS) #include "../../lcd/menu/menu_mmu2.h" #endif diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index 0a63d90c6370..8a34e7d296fb 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -24,13 +24,10 @@ #if BOTH(HAS_LCD_MENU, MMU2_MENUS) -#include "../../feature/mmu2/mmu2.h" +#include "../../feature/mmu/mmu2.h" #include "menu_mmu2.h" #include "menu_item.h" -uint8_t currentTool; -bool mmuMenuWait; - // // Load Filament // @@ -123,9 +120,12 @@ void menu_mmu2() { // T* Choose Filament // -inline void action_mmu2_choose(const uint8_t tool) { - currentTool = tool; - mmuMenuWait = false; +uint8_t feeder_index; +bool wait_for_mmu_menu; + +inline void action_mmu2_chosen(const uint8_t index) { + feeder_index = index; + wait_for_mmu_menu = false; } void menu_mmu2_choose_filament() { @@ -133,7 +133,7 @@ void menu_mmu2_choose_filament() { #if LCD_HEIGHT > 2 STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT); #endif - LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); }); + LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); }); END_MENU(); } @@ -142,32 +142,32 @@ void menu_mmu2_choose_filament() { // void menu_mmu2_pause() { - currentTool = mmu2.get_current_tool(); + feeder_index = mmu2.get_current_tool(); START_MENU(); #if LCD_HEIGHT > 2 STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT); #endif - ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; }); + ACTION_ITEM(MSG_MMU2_RESUME, []{ wait_for_mmu_menu = false; }); ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); }); - ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(currentTool); }); - ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(currentTool); }); + ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(feeder_index); }); + ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(feeder_index); }); END_MENU(); } void mmu2_M600() { ui.defer_status_screen(); ui.goto_screen(menu_mmu2_pause); - mmuMenuWait = true; - while (mmuMenuWait) idle(); + wait_for_mmu_menu = true; + while (wait_for_mmu_menu) idle(); } uint8_t mmu2_choose_filament() { ui.defer_status_screen(); ui.goto_screen(menu_mmu2_choose_filament); - mmuMenuWait = true; - while (mmuMenuWait) idle(); + wait_for_mmu_menu = true; + while (wait_for_mmu_menu) idle(); ui.return_to_status(); - return currentTool; + return feeder_index; } #endif // HAS_LCD_MENU && MMU2_MENUS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 21997b4740f6..6614aec35b8a 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1068,46 +1068,30 @@ void MarlinSettings::postprocess() { #if AXIS_IS_TMC(Z4) tmc_stepper_current.Z4 = stepperZ4.getMilliamps(); #endif - #if MAX_EXTRUDERS - #if AXIS_IS_TMC(E0) - tmc_stepper_current.E0 = stepperE0.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_IS_TMC(E1) - tmc_stepper_current.E1 = stepperE1.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_IS_TMC(E2) - tmc_stepper_current.E2 = stepperE2.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_IS_TMC(E3) - tmc_stepper_current.E3 = stepperE3.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_IS_TMC(E4) - tmc_stepper_current.E4 = stepperE4.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_IS_TMC(E5) - tmc_stepper_current.E5 = stepperE5.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 6 - #if AXIS_IS_TMC(E6) - tmc_stepper_current.E6 = stepperE6.getMilliamps(); - #endif - #if MAX_EXTRUDERS > 7 - #if AXIS_IS_TMC(E7) - tmc_stepper_current.E7 = stepperE7.getMilliamps(); - #endif - #endif // MAX_EXTRUDERS > 7 - #endif // MAX_EXTRUDERS > 6 - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS + #if AXIS_IS_TMC(E0) + tmc_stepper_current.E0 = stepperE0.getMilliamps(); + #endif + #if AXIS_IS_TMC(E1) + tmc_stepper_current.E1 = stepperE1.getMilliamps(); + #endif + #if AXIS_IS_TMC(E2) + tmc_stepper_current.E2 = stepperE2.getMilliamps(); + #endif + #if AXIS_IS_TMC(E3) + tmc_stepper_current.E3 = stepperE3.getMilliamps(); + #endif + #if AXIS_IS_TMC(E4) + tmc_stepper_current.E4 = stepperE4.getMilliamps(); + #endif + #if AXIS_IS_TMC(E5) + tmc_stepper_current.E5 = stepperE5.getMilliamps(); + #endif + #if AXIS_IS_TMC(E6) + tmc_stepper_current.E6 = stepperE6.getMilliamps(); + #endif + #if AXIS_IS_TMC(E7) + tmc_stepper_current.E7 = stepperE7.getMilliamps(); + #endif #endif EEPROM_WRITE(tmc_stepper_current); } @@ -1144,46 +1128,30 @@ void MarlinSettings::postprocess() { #if AXIS_HAS_STEALTHCHOP(Z4) tmc_hybrid_threshold.Z4 = stepperZ4.get_pwm_thrs(); #endif - #if MAX_EXTRUDERS - #if AXIS_HAS_STEALTHCHOP(E0) - tmc_hybrid_threshold.E0 = stepperE0.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_HAS_STEALTHCHOP(E1) - tmc_hybrid_threshold.E1 = stepperE1.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_HAS_STEALTHCHOP(E2) - tmc_hybrid_threshold.E2 = stepperE2.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_HAS_STEALTHCHOP(E3) - tmc_hybrid_threshold.E3 = stepperE3.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_HAS_STEALTHCHOP(E4) - tmc_hybrid_threshold.E4 = stepperE4.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_HAS_STEALTHCHOP(E5) - tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 6 - #if AXIS_HAS_STEALTHCHOP(E6) - tmc_hybrid_threshold.E6 = stepperE6.get_pwm_thrs(); - #endif - #if MAX_EXTRUDERS > 7 - #if AXIS_HAS_STEALTHCHOP(E7) - tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs(); - #endif - #endif // MAX_EXTRUDERS > 7 - #endif // MAX_EXTRUDERS > 6 - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS + #if AXIS_HAS_STEALTHCHOP(E0) + tmc_hybrid_threshold.E0 = stepperE0.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E1) + tmc_hybrid_threshold.E1 = stepperE1.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E2) + tmc_hybrid_threshold.E2 = stepperE2.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E3) + tmc_hybrid_threshold.E3 = stepperE3.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E4) + tmc_hybrid_threshold.E4 = stepperE4.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E5) + tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E6) + tmc_hybrid_threshold.E6 = stepperE6.get_pwm_thrs(); + #endif + #if AXIS_HAS_STEALTHCHOP(E7) + tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs(); + #endif #else const tmc_hybrid_threshold_t tmc_hybrid_threshold = { .X = 100, .Y = 100, .Z = 3, @@ -1219,73 +1187,54 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(tmc_stealth_enabled); - tmc_stealth_enabled_t tmc_stealth_enabled = { false, false, false, false, false, false, false, false, false, false, false, false, false }; - - #if HAS_STEALTHCHOP - #if AXIS_HAS_STEALTHCHOP(X) - tmc_stealth_enabled.X = stepperX.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - tmc_stealth_enabled.X2 = stepperX2.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - tmc_stealth_enabled.Y2 = stepperY2.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - tmc_stealth_enabled.Z2 = stepperZ2.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - tmc_stealth_enabled.Z3 = stepperZ3.get_stored_stealthChop(); - #endif - #if AXIS_HAS_STEALTHCHOP(Z4) - tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS - #if AXIS_HAS_STEALTHCHOP(E0) - tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 1 - #if AXIS_HAS_STEALTHCHOP(E1) - tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 2 - #if AXIS_HAS_STEALTHCHOP(E2) - tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 3 - #if AXIS_HAS_STEALTHCHOP(E3) - tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 4 - #if AXIS_HAS_STEALTHCHOP(E4) - tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 5 - #if AXIS_HAS_STEALTHCHOP(E5) - tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 6 - #if AXIS_HAS_STEALTHCHOP(E6) - tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop(); - #endif - #if MAX_EXTRUDERS > 7 - #if AXIS_HAS_STEALTHCHOP(E7) - tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop(); - #endif - #endif // MAX_EXTRUDERS > 7 - #endif // MAX_EXTRUDERS > 6 - #endif // MAX_EXTRUDERS > 5 - #endif // MAX_EXTRUDERS > 4 - #endif // MAX_EXTRUDERS > 3 - #endif // MAX_EXTRUDERS > 2 - #endif // MAX_EXTRUDERS > 1 - #endif // MAX_EXTRUDERS + tmc_stealth_enabled_t tmc_stealth_enabled = { false }; + #if AXIS_HAS_STEALTHCHOP(X) + tmc_stealth_enabled.X = stepperX.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Y) + tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Z) + tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(X2) + tmc_stealth_enabled.X2 = stepperX2.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Y2) + tmc_stealth_enabled.Y2 = stepperY2.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Z2) + tmc_stealth_enabled.Z2 = stepperZ2.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Z3) + tmc_stealth_enabled.Z3 = stepperZ3.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(Z4) + tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E0) + tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E1) + tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E2) + tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E3) + tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E4) + tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E5) + tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E6) + tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop(); + #endif + #if AXIS_HAS_STEALTHCHOP(E7) + tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop(); #endif EEPROM_WRITE(tmc_stealth_enabled); } diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index ec0d63a89d97..dfdd63b05ba2 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -417,12 +417,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) #endif -#elif ENABLED(PRUSA_MMU2) + +#elif HAS_PRUSA_MMU2 + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) -#elif ENABLED(MK2_MULTIPLEXER) // One multiplexed stepper driver, reversed on odd index +#elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index d77901f029d4..a98193191758 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -73,10 +73,6 @@ #include "../feature/solenoid.h" #endif -#if ENABLED(MK2_MULTIPLEXER) - #include "../feature/snmm.h" -#endif - #if ENABLED(MIXING_EXTRUDER) #include "../feature/mixing.h" #endif @@ -89,8 +85,10 @@ #include "../feature/fanmux.h" #endif -#if ENABLED(PRUSA_MMU2) - #include "../feature/mmu2/mmu2.h" +#if HAS_PRUSA_MMU1 + #include "../feature/mmu/mmu.h" +#elif HAS_PRUSA_MMU2 + #include "../feature/mmu/mmu2.h" #endif #if HAS_LCD_MENU @@ -863,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { mixer.T(new_tool); #endif - #elif ENABLED(PRUSA_MMU2) + #elif HAS_PRUSA_MMU2 UNUSED(no_move); @@ -1171,8 +1169,6 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); #endif - TERN_(PRUSA_MMU2, mmu2.tool_change(new_tool)); - TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool)); } // (new_tool != old_tool) @@ -1184,7 +1180,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { enable_solenoid_on_active_extruder(); #endif - #if ENABLED(MK2_MULTIPLEXER) + #if HAS_PRUSA_MMU1 if (new_tool >= E_STEPPERS) return invalid_extruder_error(new_tool); select_multiplexed_stepper(new_tool); #endif diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 2430958895ea..b993e3846087 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -131,9 +131,9 @@ #define PIN_P2_11 P2_11 // Interrupt Capable // -// Průša i3 MK2 Multi Material Multiplexer Support +// Průša i3 MMU1 (Multi Material Multiplexer) Support // -#if ENABLED(MK2_MULTIPLEXER) +#if HAS_PRUSA_MMU1 #define E_MUX0_PIN P1_23 // J8-3 #define E_MUX1_PIN P2_12 // J8-4 #define E_MUX2_PIN P2_11 // J8-5 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index b9e12d823315..e9eee4f37126 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -35,7 +35,12 @@ * These numbers are the same in any pin mapping. */ -#define MAX_EXTRUDERS 8 +#if HAS_SMUFF + #define MAX_EXTRUDERS 12 +#else + #define MAX_EXTRUDERS 8 +#endif +#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 IS_RAMPS_EFB diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index 788f2093c117..de70248d4d02 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -521,7 +521,7 @@ #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR) #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE) - #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) + #if X2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(X2_STEP) #error "No E stepper plug left for X2!" #endif #endif @@ -594,7 +594,7 @@ #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) - #if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP) + #if Y2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Y2_STEP) #error "No E stepper plug left for Y2!" #endif #endif @@ -662,7 +662,7 @@ #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) - #if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP) + #if Z2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z2_STEP) #error "No E stepper plug left for Z2!" #endif #endif @@ -729,7 +729,7 @@ #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) - #if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP) + #if Z3_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z3_STEP) #error "No E stepper plug left for Z3!" #endif #endif @@ -796,7 +796,7 @@ #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) #define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR) #define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE) - #if Z4_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z4_STEP) + #if Z4_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z4_STEP) #error "No E stepper plug left for Z4!" #endif #endif 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 eaf90da1aee4..eb1e886fa4fe 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -25,8 +25,8 @@ #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 8 || E_STEPPERS > 8 #error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers." -#elif HOTENDS > MAX_EXTRUDERS || E_STEPPERS > MAX_EXTRUDERS - #error "Marlin extruder/hotends limit! Increase MAX_EXTRUDERS to continue." +#elif HOTENDS > MAX_E_STEPPERS || E_STEPPERS > MAX_E_STEPPERS + #error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue." #endif #define BOARD_INFO_NAME "BTT GTR V1.0" diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index 113ec9ed1bd0..294de2a767d1 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -66,28 +66,38 @@ exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sle # restore_configs opt_set LCD_LANGUAGE zh_CN +opt_set MMU_MODEL PRUSA_MMU2S opt_set EXTRUDERS 5 opt_set NUM_SERVOS 1 opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ - PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ + MMU2_MENUS DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING -exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." "$3" +exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2S | Servo | 3-Point + Debug | G38 ..." "$3" # # 5 runout sensors with distinct states # restore_configs +opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO opt_set EXTRUDERS 5 opt_set NUM_SERVOS 1 +opt_set TEMP_SENSOR_1 1 +opt_set TEMP_SENSOR_2 1 +opt_set TEMP_SENSOR_3 1 +opt_set TEMP_SENSOR_4 1 opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ - PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ + DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL -opt_set MIXING_STEPPERS 5 +opt_set NUM_RUNOUT_SENSORS 5 +opt_set FIL_RUNOUT2_PIN 44 +opt_set FIL_RUNOUT3_PIN 45 opt_set FIL_RUNOUT3_STATE HIGH +opt_set FIL_RUNOUT4_PIN 46 +opt_set FIL_RUNOUT5_PIN 47 exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" # diff --git a/platformio.ini b/platformio.ini index 1e0b84b6255a..862c42b01b79 100644 --- a/platformio.ini +++ b/platformio.ini @@ -93,7 +93,8 @@ default_src_filter = + - - + - - - - - - + - + - - - - - - @@ -101,7 +102,6 @@ default_src_filter = + - - + - - - - - - - - - - - - - @@ -304,7 +304,8 @@ PRINTER_EVENT_LEDS = src_filter=+ TEMP_STAT_LEDS = src_filter=+ MAX7219_DEBUG = src_filter=+ + MIXING_EXTRUDER = src_filter=+ + -PRUSA_MMU2 = src_filter=+ + +HAS_PRUSA_MMU1 = src_filter=+ +HAS_PRUSA_MMU2 = src_filter=+ + PASSWORD_FEATURE = src_filter=+ + ADVANCED_PAUSE_FEATURE = src_filter=+ + + AUTO_POWER_CONTROL = src_filter=+ @@ -312,8 +313,7 @@ HAS_POWER_MONITOR = src_filter=+ + + PROBE_TEMP_COMPENSATION = src_filter=+ + HAS_FILAMENT_SENSOR = src_filter=+ + -MK2_MULTIPLEXER = src_filter=+ -EXT_SOLENOID|MANUAL_SOLENOID_CONTROL = src_filter=+ + +(EXT|MANUAL)_SOLENOID.* = src_filter=+ + HAS_CUTTER = src_filter=+ + EXPERIMENTAL_I2CBUS = src_filter=+ + MECHANICAL_GANTRY_CAL.+ = src_filter=+ From 8b72cbebde8dbae671467e8d49193c1298051404 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 19 Nov 2020 00:10:51 +0000 Subject: [PATCH 188/443] [cron] Bump distribution date (2020-11-19) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 34636856b7c9..0898d2218467 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-18" + #define STRING_DISTRIBUTION_DATE "2020-11-19" #endif /** From acdfbbeb869c5d5cae6f83d0a5588fbbdf7a982d Mon Sep 17 00:00:00 2001 From: bosd Date: Thu, 19 Nov 2020 02:32:52 +0100 Subject: [PATCH 189/443] Fix broken #include (#20193) --- Marlin/src/feature/mmu/mmu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/mmu/mmu.cpp b/Marlin/src/feature/mmu/mmu.cpp index 2b48823ee799..9a448296bbe2 100644 --- a/Marlin/src/feature/mmu/mmu.cpp +++ b/Marlin/src/feature/mmu/mmu.cpp @@ -20,7 +20,7 @@ * */ -#include "../inc/MarlinConfig.h" +#include "../../inc/MarlinConfig.h" #if HAS_PRUSA_MMU1 From cb2ec628df4ae2cb79b39aa3d51273927c849340 Mon Sep 17 00:00:00 2001 From: JoAnn Manges Date: Wed, 18 Nov 2020 21:12:03 -0800 Subject: [PATCH 190/443] Use RTD for MAX31865 reading (#20188) --- Marlin/src/module/temperature.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 167b35cc2bac..19de70b31c52 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2248,10 +2248,7 @@ void Temperature::disable_all_heaters() { #if HAS_MAX31865 Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1); - max6675_temp = int(maxref.temperature( - MAX6675_SEL(MAX31865_SENSOR_OHMS_0, MAX31865_SENSOR_OHMS_1), - MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1) - )); + const uint16_t max31865_ohms = (uint32_t(maxref.readRTD()) * MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1)) >> 16; #endif // @@ -2325,6 +2322,9 @@ void Temperature::disable_all_heaters() { if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature #endif + // Return the RTD resistance for MAX31865 for display in SHOW_TEMP_ADC_VALUES + TERN_(HAS_MAX31865, max6675_temp = max31865_ohms); + MAX6675_TEMP(hindex) = max6675_temp; return int(max6675_temp); From 08c5557026e3cb008955181e7d07b04a8cae2a35 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 19 Nov 2020 02:32:33 -0300 Subject: [PATCH 191/443] Abort print on media removal (#20200) --- Marlin/src/sd/cardreader.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 1be5f4f2f6bd..4416f4e90792 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -454,8 +454,17 @@ void CardReader::manage_media() { DEBUG_ECHOLNPGM("SD: No UI Detected."); } +/** + * "Release" the media by clearing the 'mounted' flag. + * Used by M22, "Release Media", manage_media. + */ void CardReader::release() { - endFilePrint(); + // Card removed while printing? Abort! + if (IS_SD_PRINTING()) + card.flag.abort_sd_printing = true; + else + endFilePrint(); + flag.mounted = false; flag.workDirIsRoot = true; #if ALL(SDCARD_SORT_ALPHA, SDSORT_USES_RAM, SDSORT_CACHE_NAMES) @@ -463,6 +472,10 @@ void CardReader::release() { #endif } +/** + * Open a G-code file and set Marlin to start processing it. + * Enqueues M23 and M24 commands to initiate a media print. + */ void CardReader::openAndPrintFile(const char *name) { char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null extern const char M23_STR[]; @@ -472,6 +485,12 @@ void CardReader::openAndPrintFile(const char *name) { queue.enqueue_now_P(M24_STR); } +/** + * Start or resume a media print by setting the sdprinting flag. + * The file browser pre-sort is also purged to free up memory, + * since you cannot browse files during active printing. + * Used by M24 and anywhere Start / Resume applies. + */ void CardReader::startFileprint() { if (isMounted()) { flag.sdprinting = true; @@ -479,6 +498,9 @@ void CardReader::startFileprint() { } } +// +// Run tasks upon finishing or aborting a file print. +// void CardReader::endFilePrint(TERN_(SD_RESORT, const bool re_sort/*=false*/)) { TERN_(ADVANCED_PAUSE_FEATURE, did_pause_print = 0); TERN_(DWIN_CREALITY_LCD, HMI_flag.print_finish = flag.sdprinting); From 6a8ac21f8021d6975883aa283672564ce98a0aa2 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 19 Nov 2020 03:05:05 -0300 Subject: [PATCH 192/443] Fix Filament Change menu item labels (#20201) --- Marlin/src/lcd/menu/menu_filament.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 5f0afa47688a..af8a4fc2b504 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -91,7 +91,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { BACK_ITEM(MSG_BACK); #if PREHEAT_COUNT LOOP_L_N(m, PREHEAT_COUNT) - ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + ACTION_ITEM_N_S(extruder, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); #endif EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, From c059ea0ea058f7206847e5dc37fe6d6085fd8f4f Mon Sep 17 00:00:00 2001 From: ellensp Date: Thu, 19 Nov 2020 19:09:51 +1300 Subject: [PATCH 193/443] Remaining Time followup (#20199) --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index b85d5adf2aba..00968f4ba0e9 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -707,7 +707,7 @@ void MarlinUI::draw_status_message(const bool blink) { * |01234567890123456789| */ -inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos) { +inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) { char buffer[14]; #if ENABLED(SHOW_REMAINING_TIME) @@ -716,7 +716,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos) { #if ENABLED(USE_M73_REMAINING_TIME) duration_t remaining = get_remaining_time(); #else - uint8_t progress = get_progress_percent(); + uint8_t progress = ui.get_progress_percent(); uint32_t elapsed = print_job_timer.duration(); duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0; #endif @@ -874,7 +874,7 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(i16tostr3rj(feedrate_percentage)); lcd_put_wchar('%'); - const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1); + const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1, blink); #if LCD_WIDTH >= 20 lcd_moveto(timepos - 7, 2); @@ -973,7 +973,7 @@ void MarlinUI::draw_status_screen() { #else - (void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4); + (void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4, blink); #endif From 4c5a58a5db6f2407b7d38518fdbd7caea6fbef33 Mon Sep 17 00:00:00 2001 From: Maciej Rutkowski Date: Thu, 19 Nov 2020 11:49:44 +0100 Subject: [PATCH 194/443] Fix GTR NeoPixel pin with FYSETC Mini12864 (#20203) --- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 eb1e886fa4fe..60b2adbfa8d2 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -381,7 +381,7 @@ #define RGB_LED_B_PIN PG5 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PF13 + #define NEOPIXEL_PIN PG7 #endif #endif // !FYSETC_MINI_12864 From d7aea9608e433c2fc3ca7a837b48afe362ad2c13 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 19 Nov 2020 16:47:49 -0300 Subject: [PATCH 195/443] Reduce RAM usage for TFT Color UI on SGen-L V2 (#20209) --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 8 ++++++-- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 7f9efcdb16c4..502c9375881a 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -268,8 +268,12 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - #define TFT_BUFFER_SIZE 1200 - #define TFT_QUEUE_SIZE 6144 + #ifndef TFT_BUFFER_SIZE + #define TFT_BUFFER_SIZE 1200 + #endif + #ifndef TFT_QUEUE_SIZE + #define TFT_QUEUE_SIZE 6144 + #endif #define BTN_EN1 P3_25 #define BTN_EN2 P3_26 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 8d2ce364b209..6dc0c1e8ff45 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -251,7 +251,7 @@ * _____ _____ * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · 0.9 (SD_MOSI) + * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- @@ -318,7 +318,12 @@ #define LCD_PINS_ENABLE -1 #define LCD_PINS_RS -1 - #define TFT_BUFFER_SIZE 2400 + #ifndef TFT_BUFFER_SIZE + #define TFT_BUFFER_SIZE 1200 + #endif + #ifndef TFT_QUEUE_SIZE + #define TFT_QUEUE_SIZE 6144 + #endif #else // !MKS_12864OLED_SSD1306 From fcc29fc189d6289d01f3983867a17b63191035b2 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 19 Nov 2020 21:07:47 +0100 Subject: [PATCH 196/443] Add Thermistor 20-21 notes (#19246) --- Marlin/Configuration.h | 6 ++++-- Marlin/src/module/thermistor/thermistor_21.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4521895fdce2..9d2dd0b710ba 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -375,8 +375,10 @@ * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 15 : 100k thermistor calibration for JGAurora A5 hotend * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR) - * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....) + * 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage. + * NOTES: (1) Must use an ADC input with no pullup. (2) Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21. + * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply. + * NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C. * 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB) * 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB) * 30 : Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K / B3950 (4.7k pullup) diff --git a/Marlin/src/module/thermistor/thermistor_21.h b/Marlin/src/module/thermistor/thermistor_21.h index cd867df29103..2ca705b95005 100644 --- a/Marlin/src/module/thermistor/thermistor_21.h +++ b/Marlin/src/module/thermistor/thermistor_21.h @@ -26,7 +26,8 @@ #undef OV_SCALE #define OV_SCALE(N) (float((N) * 5) / 3.3f) -// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" +// Pt100 with INA826 amplifier board with 5v supply based on Thermistor 20, with 3v3 ADC reference on the mainboard. +// If the ADC reference and INA826 board supply voltage are identical, Thermistor 20 instead. const temp_entry_t temptable_21[] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, From 3893114c86c195d227e023c9e702197b54b2636f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Nov 2020 15:51:53 -0600 Subject: [PATCH 197/443] MKS WiFi preliminary changes --- Marlin/src/HAL/STM32F1/MarlinSerial.cpp | 4 +- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/gcode/feature/L6470/M916-918.cpp | 4 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 2 +- .../ftdi_eve_lib/extended/dl_cache.h | 13 ++--- .../ftdi_eve_lib/extended/tiny_timer.cpp | 6 +-- .../screens/bed_mesh_screen.cpp | 9 ++-- .../ftdi_eve_touch_ui/screens/boot_screen.cpp | 3 +- .../screens/files_screen.cpp | 14 ++--- .../ftdi_eve_touch_ui/screens/lock_screen.cpp | 31 +++++------ .../screens/save_settings_dialog_box.cpp | 5 +- .../lib/mks_ui/draw_advance_settings.cpp | 4 +- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 6 +-- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 4 +- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 12 ++--- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 6 +-- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 35 ++++++------ Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 8 ++- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 4 +- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 5 +- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 12 ++--- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 4 +- .../src/lcd/extui/lib/mks_ui/irq_overrid.cpp | 4 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 2 +- .../extui/lib/mks_ui/printer_operation.cpp | 2 +- .../lcd/extui/lib/mks_ui/tft_Language_en.h | 54 +++++++++---------- .../lib/mks_ui/tft_lvgl_configuration.cpp | 3 +- .../extui/lib/mks_ui/tft_lvgl_configuration.h | 2 +- .../extui/lib/mks_ui/tft_multi_language.cpp | 4 +- .../src/lcd/extui/lib/mks_ui/wifiSerial.cpp | 4 +- Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h | 8 +-- .../src/lcd/extui/lib/mks_ui/wifi_module.cpp | 10 ++-- 33 files changed, 132 insertions(+), 156 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp index ebf11cb429fa..7c9625d64cd2 100644 --- a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp @@ -111,7 +111,9 @@ constexpr bool serial_handles_emergency(int port) { // Instantiate all UARTs even if they are not needed // This avoids a bunch of logic to figure out every serial // port which may be in use on the system. -DEFINE_HWSERIAL_MARLIN(MSerial1, 1); +#if DISABLED(MKS_WIFI_MODULE) + DEFINE_HWSERIAL_MARLIN(MSerial1, 1); +#endif DEFINE_HWSERIAL_MARLIN(MSerial2, 2); DEFINE_HWSERIAL_MARLIN(MSerial3, 3); #if EITHER(STM32_HIGH_DENSITY, STM32_XL_DENSITY) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 60765c98331e..5769da05d0f2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -979,7 +979,7 @@ void setup() { #endif SERIAL_ECHO_MSG("start"); - #if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION) + #if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE) mks_esp_wifi_init(); WIFISERIAL.begin(WIFI_BAUDRATE); serial_connect_timeout = millis() + 1000UL; diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 8165b71e4490..2672f9123987 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -308,8 +308,8 @@ void GcodeSuite::M917() { L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } DEBUG_ECHOLNPGM("."); - gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered - watchdog_refresh();; // beat the dog + gcode.reset_stepper_timeout(); // keep steppers powered + watchdog_refresh(); safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 9c36cca253f1..74be828c727e 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -204,7 +204,7 @@ void TFTGLCD::print_line() { #endif } -void TFTGLCD::print_screen(){ +void TFTGLCD::print_screen() { if (!PanelDetected) return; framebuffer[FBSIZE - 2] = picBits & PIC_MASK; framebuffer[FBSIZE - 1] = ledBits; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h index 44934f909a26..73b4b0bbc868 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h @@ -29,15 +29,12 @@ * * The DLCache can be used like so: * - * void some_function() { - * DLCache dlcache(UNIQUE_ID); + * DLCache dlcache(UNIQUE_ID); * - * if (dlcache.hasData()) { - * dlcache.append(); - * } else { - * // Add stuff to the DL - * dlcache.store(); - * } + * if (dlcache.hasData()) + * dlcache.append(); + * else + * dlcache.store(); // Add stuff to the DL */ class DLCache { private: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp index 84233c5ce39c..2147dd7c8fd7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -32,11 +32,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) { #endif ); uint8_t elapsed = now - _start; - if (elapsed >= duration._duration) { - return true; - } else { - return false; - } + return elapsed >= duration._duration; } void tiny_timer_t::start() { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index eb8f74231338..c54a7e04b5e2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -78,9 +78,9 @@ void BedMeshScreen::drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI:: } } } - if (val_cnt) { + if (val_cnt) val_mean /= val_cnt; - } else { + else { val_mean = 0; val_min = 0; val_max = 0; @@ -327,11 +327,10 @@ void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::pr screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_NONE; break; case ExtUI::MESH_FINISH: - if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray())) { + if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray())) screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_COMPLETE; - } else { + else screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_INCOMPLETE; - } screen_data.BedMeshScreen.count = GRID_MAX_POINTS; break; case ExtUI::PROBE_START: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp index e79f25fcb52d..40e49672d40b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -72,7 +72,8 @@ void BootScreen::onIdle() { GOTO_SCREEN(TouchCalibrationScreen); current_screen.forget(); PUSH_SCREEN(StatusScreen); - } else { + } + else { if (!UIFlashStorage::is_valid()) { StatusScreen::loadBitmaps(); SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT)); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index 90e304007959..aed81045f4de 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -152,11 +152,11 @@ void FilesScreen::drawFooter() { #undef MARGIN_T #undef MARGIN_B #ifdef TOUCH_UI_PORTRAIT - #define MARGIN_T 15 - #define MARGIN_B 5 + #define MARGIN_T 15 + #define MARGIN_B 5 #else - #define MARGIN_T 5 - #define MARGIN_B 5 + #define MARGIN_T 5 + #define MARGIN_B 5 #endif const bool has_selection = screen_data.FilesScreen.selected_tag != 0xFF; const uint8_t back_tag = screen_data.FilesScreen.flags.is_root ? 240 : 245; @@ -170,11 +170,11 @@ void FilesScreen::drawFooter() { .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK)) .enabled(has_selection) .colors(has_selection ? action_btn : normal_btn); - if (screen_data.FilesScreen.flags.is_dir) { + + if (screen_data.FilesScreen.flags.is_dir) cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN)); - } else { + else cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT)); - } } void FilesScreen::onRedraw(draw_mode_t what) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp index 35bbd7ad906c..193bb681ecf4 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -122,28 +122,25 @@ char &LockScreen::message_style() { } void LockScreen::onPasscodeEntered() { - if (passcode == 0) { - // We are defining a passcode + if (passcode == 0) { // We are defining a passcode message_style() = 0; onRefresh(); sound.play(twinkle, PLAY_SYNCHRONOUS); passcode = compute_checksum(); GOTO_PREVIOUS(); - } else { - // We are verifying a passcode - if (passcode == compute_checksum()) { - message_style() = 'g'; - onRefresh(); - sound.play(twinkle, PLAY_SYNCHRONOUS); - GOTO_PREVIOUS(); - } - else { - message_style() = 'w'; - onRefresh(); - sound.play(sad_trombone, PLAY_SYNCHRONOUS); - current_screen.forget(); // Discard the screen the user was trying to go to. - GOTO_PREVIOUS(); - } + } + else if (passcode == compute_checksum()) { // We are verifying a passcode + message_style() = 'g'; + onRefresh(); + sound.play(twinkle, PLAY_SYNCHRONOUS); + GOTO_PREVIOUS(); + } + else { + message_style() = 'w'; + onRefresh(); + sound.play(sad_trombone, PLAY_SYNCHRONOUS); + current_screen.forget(); // Discard the screen the user was trying to go to. + GOTO_PREVIOUS(); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp index 350e2de7eb64..eff0431a940d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp @@ -56,10 +56,9 @@ void SaveSettingsDialogBox::promptToSaveSettings() { // so SaveSettingsDialogBox doesn't return here. GOTO_SCREEN(SaveSettingsDialogBox); current_screen.forget(); - } else { - // No save needed. - GOTO_PREVIOUS(); } + else + GOTO_PREVIOUS(); // No save needed. } #endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp index dd6e484921a4..534fd6072ce0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp @@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { lv_clear_advance_settings(); lv_draw_filament_settings(); break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case ID_WIFI_PARA: lv_clear_advance_settings(); lv_draw_wifi_settings(); @@ -75,7 +75,7 @@ void lv_draw_advance_settings(void) { int index = 0; lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++); lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++); - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++); #endif #if HAS_ROTARY_ENCODER diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 0a36b09ce767..1fcb1bd2e21a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -239,7 +239,7 @@ void lv_draw_dialog(uint8_t type) { lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); } - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { if (upload_result == 2) { btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); @@ -377,7 +377,7 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { if (upload_result == 1) { lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN); @@ -418,7 +418,7 @@ void lv_draw_dialog(uint8_t type) { lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } } - #endif // USE_WIFI_FUNCTION + #endif // MKS_WIFI_MODULE else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index acf1d153253f..9f7c936fb3fb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -122,7 +122,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { //if (res != LV_RES_OK) return; const char * ret_ta_txt = lv_ta_get_text(ext->ta); switch (keyboard_value) { - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case wifiName: memcpy(uiCfg.wifi_name,ret_ta_txt,sizeof(uiCfg.wifi_name)); lv_clear_keyboard(); @@ -158,7 +158,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { wifi_tips_type = TIPS_TYPE_JOINING; lv_draw_wifi_tips(); break; - #endif // USE_WIFI_FUNCTION + #endif // MKS_WIFI_MODULE case gcodeCommand: uint8_t buf[100]; strncpy((char *)buf,ret_ta_txt,sizeof(buf)); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index 07df598d8fc9..518ddbd25145 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -180,10 +180,7 @@ void lv_draw_operation(void) { label_PowerOff = lv_label_create_empty(buttonPowerOff); if (uiCfg.print_state != WORKING) { - /* - label_Filament = lv_label_create_empty(buttonFilament); - } else { - */ + //label_Filament = lv_label_create_empty(buttonFilament); labelExtrusion = lv_label_create_empty(buttonExtrusion); label_Move = lv_label_create_empty(buttonMove); } @@ -210,11 +207,8 @@ void lv_draw_operation(void) { lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); if (uiCfg.print_state != WORKING) { - /* - lv_label_set_text(label_Filament, operation_menu.filament); - lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); - } else { - */ + //lv_label_set_text(label_Filament, operation_menu.filament); + //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelExtrusion, operation_menu.extr); lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index cee02cc47a6d..51d8cea15e80 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -219,7 +219,7 @@ void lv_draw_ready_print(void) { void lv_clear_ready_print() { #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) lv_group_remove_all_objs(g); + if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); #endif lv_obj_del(scr); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index b2211e563140..939d91b7f178 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -54,7 +54,7 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) char buf[6] = { 0 }; #endif switch (obj->mks_obj_id) { @@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { lv_draw_ready_print(); break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case ID_S_WIFI: if (gCfgItems.wifi_mode_sel == STA_MODEL) { if (wifi_link_state == WIFI_CONNECTED) { @@ -135,7 +135,7 @@ void lv_draw_set(void) { #if HAS_LANG_SELECT_SCREEN lv_big_button_create(scr, "F:/bmp_language.bin", set_menu.language, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE); #endif - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) lv_big_button_create(scr, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI); #endif lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index a6c96d679903..102234b09062 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -138,7 +138,7 @@ void gCfgItems_init() { gCfgItems.levelingPos[4][0] = X_BED_SIZE / 2; gCfgItems.levelingPos[4][1] = Y_BED_SIZE / 2; gCfgItems.cloud_enable = true; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) gCfgItems.wifi_mode_sel = STA_MODEL; gCfgItems.fileSysType = FILE_SYS_SD; gCfgItems.wifi_type = ESP_WIFI; @@ -203,7 +203,7 @@ void ui_cfg_init() { uiCfg.filament_unloading_time_flg = 0; uiCfg.filament_unloading_time_cnt = 0; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) memset(&wifiPara, 0, sizeof(wifiPara)); memset(&ipPara, 0, sizeof(ipPara)); strcpy(wifiPara.ap_name, WIFI_AP_NAME); @@ -542,7 +542,7 @@ char *getDispText(int index) { strcpy(public_buf_l, tool_menu.title); break; case WIFI_LIST_UI: - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) strcpy(public_buf_l, list_menu.title); break; #endif @@ -1040,7 +1040,7 @@ void GUI_RefreshPage() { */ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: if (temps_update_flag) { disp_wifi_state(); @@ -1061,7 +1061,7 @@ void GUI_RefreshPage() { break; case DIALOG_UI: filament_dialog_handle(); - TERN_(USE_WIFI_FUNCTION, wifi_scan_handle()); + TERN_(MKS_WIFI_MODULE, wifi_scan_handle()); break; case MESHLEVELING_UI: /*disp_zpos();*/ @@ -1069,7 +1069,7 @@ void GUI_RefreshPage() { case HARDWARE_TEST_UI: break; case WIFI_LIST_UI: - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) if (printing_rate_update_flag) { disp_wifi_list(); printing_rate_update_flag = false; @@ -1080,7 +1080,7 @@ void GUI_RefreshPage() { /*update_password_disp(); update_join_state_disp();*/ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_TIPS_UI: switch (wifi_tips_type) { case TIPS_TYPE_JOINING: @@ -1216,11 +1216,11 @@ void clear_cur_ui() { case TMC_CURRENT_UI: lv_clear_tmc_current_settings(); break; #endif case EEPROM_SETTINGS_UI: lv_clear_eeprom_settings(); break; - #if HAS_STEALTHCHOP - case TMC_MODE_UI: lv_clear_tmc_step_mode_settings(); break; - #endif + #if HAS_STEALTHCHOP + case TMC_MODE_UI: lv_clear_tmc_step_mode_settings(); break; + #endif #if ENABLED(USE_WIFI_FUNCTION) - case WIFI_SETTINGS_UI: lv_clear_wifi_settings(); break; + case WIFI_SETTINGS_UI: lv_clear_wifi_settings(); break; #endif #if USE_SENSORLESS case HOMING_SENSITIVITY_UI: lv_clear_homing_sensitivity_settings(); break; @@ -1516,10 +1516,8 @@ lv_obj_t* lv_big_button_create(lv_obj_t *par, const char *img, const char *text, else lv_obj_align(label, btn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) - lv_group_add_obj(g, btn); - #endif + if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable)) + lv_group_add_obj(g, btn); return btn; } @@ -1535,11 +1533,8 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_ lv_label_set_text(label, text); lv_obj_align(label, btn, LV_ALIGN_IN_LEFT_MID, 0, 0); } - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable == true) { - lv_group_add_obj(g, btn); - } - #endif + if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable)) + lv_group_add_obj(g, btn); if (drawArrow) (void)lv_imgbtn_create(par, "F:/bmp_arrow.bin", x + PARA_UI_SIZE_X, y + PARA_UI_ARROW_V, cb, id); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 6d162676e880..a888217b9a3f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -76,7 +76,7 @@ #include "draw_keyboard.h" #include "draw_encoder_settings.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "wifiSerial.h" #include "wifi_module.h" #include "wifi_upload.h" @@ -378,14 +378,12 @@ typedef enum { level_pos_x4, level_pos_y4, level_pos_x5, - level_pos_y5 + level_pos_y5, #if HAS_BED_PROBE - , x_offset, y_offset, - z_offset + z_offset, #endif - , load_length, load_speed, unload_length, diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 6f14c20d29aa..47a5dff04839 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -26,7 +26,7 @@ #include #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" @@ -159,5 +159,5 @@ void lv_clear_wifi() { lv_obj_del(scr); } -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index c826e36d428d..f902edce7c3e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -26,7 +26,7 @@ #include #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" @@ -170,6 +170,5 @@ void lv_clear_wifi_list() { lv_obj_del(scr); } -#endif // USE_WIFI_FUNCTION - +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp index 441720df8223..9c8c094e4c1d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp @@ -26,7 +26,7 @@ #include #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" @@ -96,7 +96,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_wifi_settings(void) { scr = lv_screen_create(WIFI_SETTINGS_UI, machine_menu.WifiConfTitle); - lv_obj_t *labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); + lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode); lv_obj_t *buttonModelValue = lv_imgbtn_create(scr, "F:/bmp_blank_sel.bin", PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, event_handler, ID_WIFI_MODEL); lv_btn_set_style_both(buttonModelValue, &style_para_value_pre); @@ -119,7 +119,7 @@ void lv_draw_wifi_settings(void) { lv_obj_t *line3 = lv_line_create(scr, nullptr); lv_ex_line(line3, line_points[2]); - lv_obj_t *labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud); + lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud); lv_obj_t *buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD); labelCloudValue = lv_label_create_empty(buttonCloudValue); @@ -141,14 +141,14 @@ void lv_draw_wifi_settings(void) { lv_label_set_text(labelModelValue, WIFI_STA_TEXT); lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0); } - strcat(public_buf_m, machine_menu.wifiName); + strcpy(public_buf_m, machine_menu.wifiName); strcat(public_buf_m, (const char *)uiCfg.wifi_name); lv_label_set_text(labelNameText, public_buf_m); lv_label_set_text(labelNameValue, machine_menu.wifiEdit); lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER, 0, 0); - strcat(public_buf_m, machine_menu.wifiPassWord); + strcpy(public_buf_m, machine_menu.wifiPassWord); strcat(public_buf_m, (const char *)uiCfg.wifi_key); lv_label_set_text(labelPassWordText, public_buf_m); @@ -184,5 +184,5 @@ void lv_clear_wifi_settings() { lv_obj_del(scr); } -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp index a9e562499679..7428d364881d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp @@ -26,7 +26,7 @@ #include #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" @@ -64,5 +64,5 @@ void lv_draw_wifi_tips(void) { void lv_clear_wifi_tips() { lv_obj_del(scr); } -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp b/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp index b9c7ccd9e653..128bf0b2d46b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp @@ -25,7 +25,7 @@ #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" #include "wifiSerial.h" @@ -66,5 +66,5 @@ void __irq_usart1(void) { } /* C-declarations for C++ */ #endif -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 5ba7722f5509..4dd84d0212c9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -205,7 +205,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_enable.bin", "bmp_return.bin", - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) // wifi screen "bmp_wifi.bin", #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp index 4f700a16dc51..58f9f4fce6c7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -148,7 +148,7 @@ void printer_state_polling() { if (uiCfg.print_state == WORKING) filament_check(); - TERN_(USE_WIFI_FUNCTION, wifi_looping()); + TERN_(MKS_WIFI_MODULE, wifi_looping()); } void filament_pin_setup() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h index fa8d5a52a496..bb537527bea4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -48,7 +48,7 @@ #define MACHINE_TYPE_CNOFIG_EN "Machine settings" #define MOTOR_CONFIG_EN "Motor settings" #define MACHINE_LEVELING_CONFIG_EN "Leveling settings" -#define ADVANCE_CONFIG_EN "Adavance settings" +#define ADVANCE_CONFIG_EN "Advanced settings" #define MACHINE_CONFIG_TITLE_EN "Machine Settings" #define MACHINE_TYPE_EN "Machine type" @@ -82,9 +82,9 @@ #define MIN_ENDSTOP_X_EN "X-axis minimum Endstop" #define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop" #define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop" -#define MAX_ENDSTOP_X_EN "X axis maximum Endstop" -#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop" -#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop" +#define MAX_ENDSTOP_X_EN "X-axis maximum Endstop" +#define MAX_ENDSTOP_Y_EN "Y-axis maximum Endstop" +#define MAX_ENDSTOP_Z_EN "Z-axis maximum Endstop" #define ENDSTOP_FIL_EN "Filament sensor" #define ENDSTOP_LEVEL_EN "Leveling sensor" #define ENDSTOP_OPENED_EN "Open" @@ -107,11 +107,11 @@ #define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" #define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch" #define PROBE_PORT_EN "Probe connector" -#define PROBE_X_OFFSET_EN "Probe x axis offset" -#define PROBE_Y_OFFSET_EN "Probe y axis offset" -#define PROBE_Z_OFFSET_EN "Probe z axis offset" -#define PROBE_XY_SPEED_EN "Probe xy axis speed" -#define PROBE_Z_SPEED_EN "Probe z axis speed" +#define PROBE_X_OFFSET_EN "Probe X-axis offset" +#define PROBE_Y_OFFSET_EN "Probe Y-axis offset" +#define PROBE_Z_OFFSET_EN "Probe Z-axis offset" +#define PROBE_XY_SPEED_EN "Probe XY-axis speed" +#define PROBE_Z_SPEED_EN "Probe Z-axis speed" #define ENABLE_EN "YES" #define DISABLE_EN "NO" #define Z_MIN_EN "ZMin" @@ -162,11 +162,11 @@ #define HOMEFEEDRATECONF_EN "Home speed setting" #define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed" -#define X_MAXFEEDRATE_EN "X axis maximum speed" -#define Y_MAXFEEDRATE_EN "Y axis maximum speed" -#define Z_MAXFEEDRATE_EN "Z axis maximum speed" -#define E0_MAXFEEDRATE_EN "E0 axis maximum speed" -#define E1_MAXFEEDRATE_EN "E1 axis maximum speed" +#define X_MAXFEEDRATE_EN "X-axis maximum speed" +#define Y_MAXFEEDRATE_EN "Y-axis maximum speed" +#define Z_MAXFEEDRATE_EN "Z-axis maximum speed" +#define E0_MAXFEEDRATE_EN "E0-axis maximum speed" +#define E1_MAXFEEDRATE_EN "E1-axis maximum speed" #define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" #define PRINT_ACCELERATION_EN "Print acceleration" @@ -192,18 +192,18 @@ #define E1_STEPS_EN "E1-axis steps" #define TMC_CURRENT_CONF_TITLE_EN "Machine Settings>TMC current settings" -#define X_TMC_CURRENT_EN "X axis current (mA)" -#define Y_TMC_CURRENT_EN "Y axis current (mA)" -#define Z_TMC_CURRENT_EN "Z axis current (mA)" -#define E0_TMC_CURRENT_EN "E0 axis current (mA)" -#define E1_TMC_CURRENT_EN "E1 axis current (mA)" +#define X_TMC_CURRENT_EN "X-axis current (mA)" +#define Y_TMC_CURRENT_EN "Y-axis current (mA)" +#define Z_TMC_CURRENT_EN "Z-axis current (mA)" +#define E0_TMC_CURRENT_EN "E0-axis current (mA)" +#define E1_TMC_CURRENT_EN "E1-axis current (mA)" #define TMC_MODE_CONF_TITLE_EN "Machine Settings>TMC step mode settings" -#define X_TMC_MODE_EN "Whether X axis enable stealthChop modes" -#define Y_TMC_MODE_EN "Whether Y axis enable stealthChop modes" -#define Z_TMC_MODE_EN "Whether Z axis enable stealthChop modes" -#define E0_TMC_MODE_EN "Whether E0 axis enable stealthChop modes" -#define E1_TMC_MODE_EN "Whether E1 axis enable stealthChop modes" +#define X_TMC_MODE_EN "Whether X-axis enable stealthChop modes" +#define Y_TMC_MODE_EN "Whether Y-axis enable stealthChop modes" +#define Z_TMC_MODE_EN "Whether Z-axis enable stealthChop modes" +#define E0_TMC_MODE_EN "Whether E0-axis enable stealthChop modes" +#define E1_TMC_MODE_EN "Whether E1-axis enable stealthChop modes" #define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" #define X_MOTORDIR_EN "X-axis motor direction invert" @@ -241,9 +241,9 @@ #define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT" #define PAUSE_POSITION_EN "Printing pause position settings" -#define PAUSE_POSITION_X_EN "X axis position (Absolute position,-1 invalid)" -#define PAUSE_POSITION_Y_EN "Y axis position (Absolute position,-1 invalid)" -#define PAUSE_POSITION_Z_EN "Z axis position (Relative position,-1 invalid)" +#define PAUSE_POSITION_X_EN "X-axis position (Absolute position,-1 invalid)" +#define PAUSE_POSITION_Y_EN "Y-axis position (Absolute position,-1 invalid)" +#define PAUSE_POSITION_Z_EN "Z-axis position (Relative position,-1 invalid)" #define WIFI_SETTINGS_TITLE_EN "Machine Settings>Wi-Fi Parameter" #define WIFI_SETTINGS_MODE_EN "Wi-Fi Mode" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 9b8e3e158978..9e383a6abd79 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -84,7 +84,7 @@ uint8_t bmp_public_buf[17 * 1024]; void SysTick_Callback() { lv_tick_inc(1); print_time_count(); - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) if (tips_disp.timer == TIPS_TIMER_START) tips_disp.timer_count++; #endif @@ -523,7 +523,6 @@ void lv_encoder_pin_init() { const uint8_t enc_c = (buttons & EN_C) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; if (enc_c != last_button_state) { state = enc_c ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - last_button_state = enc_c; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h index 727ab33aea30..df28893f41aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -33,7 +33,7 @@ #include //#define TFT_ROTATION TFT_ROTATE_180 -#define USE_WIFI_FUNCTION 0 +#define MKS_WIFI_MODULE 0 extern void tft_lvgl_init(); extern void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp index e230195eabac..c3c0f37365fa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -853,7 +853,7 @@ void disp_language_init() { machine_menu.key_point = KEYBOARD_KEY_POINT_EN; machine_menu.negative = KEYBOARD_KEY_NEGATIVE_EN; // wifi-list - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) list_menu.title = TEXT_WIFI_MENU_TITLE_EN; list_menu.file_pages = FILE_PAGES_EN; @@ -861,7 +861,7 @@ void disp_language_init() { tips_menu.joining = TEXT_WIFI_JOINING_EN; tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; - #endif //USE_WIFI_FUNCTION + #endif //MKS_WIFI_MODULE machine_setting_disp(); operation_menu.babystep = TEXT_BABY_STEP_EN; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp index 16b65c7ea3d8..93fce6af30aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp @@ -25,7 +25,7 @@ #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "draw_ui.h" #include "wifiSerial.h" @@ -118,5 +118,5 @@ int WifiSerial::wifi_rb_is_full(void) { return rb_is_full(this->usart_device->rb); } -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h index 9d3946fee79b..3206666bef2b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h @@ -23,10 +23,10 @@ #include "tft_lvgl_configuration.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) -#if SERIAL_PORT_2 != -1 - #error "SERIAL_PORT_2 must be set to -1 with HAS_TFT_LVGL_UI and USE_WIFI_FUNCTION." +#ifdef SERIAL_PORT_2 + #error "SERIAL_PORT_2 must be disabled with HAS_TFT_LVGL_UI and MKS_WIFI_MODULE." #endif #define WIFI_BAUDRATE 115200 @@ -99,4 +99,4 @@ extern WifiSerial WifiSerial1; #define WIFISERIAL WifiSerial1 -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp index bfc23f238ca5..eeeff4fa31aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp @@ -27,7 +27,7 @@ #include "wifi_module.h" #include "wifi_upload.h" -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) #include "../../../../MarlinCore.h" #include "../../../../module/temperature.h" @@ -283,7 +283,7 @@ void esp_port_begin(uint8_t interrupt) { } #endif if (interrupt) { - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) WIFISERIAL.end(); for (uint16_t i = 0; i < 65535; i++); WIFISERIAL.begin(WIFI_BAUDRATE); @@ -293,7 +293,7 @@ void esp_port_begin(uint8_t interrupt) { #endif } else { - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) WIFISERIAL.end(); for (uint16_t i = 0; i < 65535; i++); WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE); @@ -305,7 +305,7 @@ void esp_port_begin(uint8_t interrupt) { } } -#if ENABLED(USE_WIFI_FUNCTION) +#if ENABLED(MKS_WIFI_MODULE) int raw_send_to_wifi(char *buf, int len) { if (buf == 0 || len <= 0) return 0; @@ -1811,5 +1811,5 @@ int readWifiBuf(int8_t *buf, int32_t len) { return i; } -#endif // USE_WIFI_FUNCTION +#endif // MKS_WIFI_MODULE #endif // HAS_TFT_LVGL_UI From b51c6d4737f7987d551cea1096dca049e277c15b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Nov 2020 17:28:45 -0600 Subject: [PATCH 198/443] More MKS WiFi --- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 18 +++++++++--------- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 102234b09062..46c1ab8279cd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1161,7 +1161,7 @@ void clear_cur_ui() { case ABOUT_UI: lv_clear_about(); break; case LOG_UI: /* Clear_Connect(); */ break; case DISK_UI: /* Clear_Disk(); */ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_clear_wifi(); break; #endif case MORE_UI: /* Clear_more(); */ break; @@ -1178,11 +1178,11 @@ void clear_cur_ui() { case TOOL_UI: lv_clear_tool(); break; case MESHLEVELING_UI: /* Clear_MeshLeveling(); */ break; case HARDWARE_TEST_UI: /* Clear_Hardwaretest(); */ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_clear_wifi_list(); break; #endif case KEY_BOARD_UI: lv_clear_keyboard(); break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_TIPS_UI: lv_clear_wifi_tips(); break; #endif case MACHINE_PARA_UI: lv_clear_machine_para(); break; @@ -1219,7 +1219,7 @@ void clear_cur_ui() { #if HAS_STEALTHCHOP case TMC_MODE_UI: lv_clear_tmc_step_mode_settings(); break; #endif - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_SETTINGS_UI: lv_clear_wifi_settings(); break; #endif #if USE_SENSORLESS @@ -1267,7 +1267,7 @@ void draw_return_ui() { case CALIBRATE_UI: /* draw_calibrate(); */ break; case DISK_UI: /* draw_Disk(); */ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_draw_wifi(); break; #endif case MORE_UI: /* draw_More(); */ break; @@ -1281,11 +1281,11 @@ void draw_return_ui() { case TOOL_UI: lv_draw_tool(); break; case MESHLEVELING_UI: /* draw_meshleveling(); */ break; case HARDWARE_TEST_UI: /* draw_Hardwaretest(); */ break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_draw_wifi_list(); break; #endif case KEY_BOARD_UI: lv_draw_keyboard(); break; - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_TIPS_UI: lv_draw_wifi_tips(); break; #endif case MACHINE_PARA_UI: lv_draw_machine_para(); break; @@ -1325,7 +1325,7 @@ void draw_return_ui() { #if HAS_STEALTHCHOP case TMC_MODE_UI: lv_draw_tmc_step_mode_settings(); break; #endif - #if ENABLED(USE_WIFI_FUNCTION) + #if ENABLED(MKS_WIFI_MODULE) case WIFI_SETTINGS_UI: lv_draw_wifi_settings(); break; #endif #if USE_SENSORLESS @@ -1620,7 +1620,7 @@ void LV_TASK_HANDLER() { GUI_RefreshPage(); - TERN_(USE_WIFI_FUNCTION, get_wifi_commands()); + TERN_(MKS_WIFI_MODULE, get_wifi_commands()); //sd_detection(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index d67cb8cc29ba..1de5571276ce 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -21,7 +21,7 @@ */ #include "../../../../inc/MarlinConfigPre.h" -#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION) +#if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE) #include "draw_ui.h" #include "wifi_module.h" @@ -822,4 +822,4 @@ int32_t wifi_upload(int type) { return esp_upload.uploadResult == success ? 0 : -1; } -#endif // HAS_TFT_LVGL_UI && USE_WIFI_FUNCTION +#endif // HAS_TFT_LVGL_UI && MKS_WIFI_MODULE From 931df1231af94f3219b7344ef82294f1578e2171 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Nov 2020 17:37:43 -0600 Subject: [PATCH 199/443] MKS WiFi strings --- .../lcd/extui/lib/mks_ui/tft_Language_en.h | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h index bb537527bea4..36aa21e1263e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -165,8 +165,8 @@ #define X_MAXFEEDRATE_EN "X-axis maximum speed" #define Y_MAXFEEDRATE_EN "Y-axis maximum speed" #define Z_MAXFEEDRATE_EN "Z-axis maximum speed" -#define E0_MAXFEEDRATE_EN "E0-axis maximum speed" -#define E1_MAXFEEDRATE_EN "E1-axis maximum speed" +#define E0_MAXFEEDRATE_EN "E0 maximum speed" +#define E1_MAXFEEDRATE_EN "E1 maximum speed" #define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration" #define PRINT_ACCELERATION_EN "Print acceleration" @@ -175,49 +175,49 @@ #define X_ACCELERATION_EN "X-axis acceleration" #define Y_ACCELERATION_EN "Y-axis acceleration" #define Z_ACCELERATION_EN "Z-axis acceleration" -#define E0_ACCELERATION_EN "E0-axis acceleration" -#define E1_ACCELERATION_EN "E1-axis acceleration" +#define E0_ACCELERATION_EN "E0 acceleration" +#define E1_ACCELERATION_EN "E1 acceleration" #define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" #define X_JERK_EN "X-axis jerk speed" #define Y_JERK_EN "Y-axis jerk speed" #define Z_JERK_EN "J-axis jerk speed" -#define E_JERK_EN "E-axis jerk speed" +#define E_JERK_EN "Extruder jerk speed" #define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" #define X_STEPS_EN "X-axis steps" -#define Y_STEPS_EN "Y-axis stepS" -#define Z_STEPS_EN "Z-axis stepS" -#define E0_STEPS_EN "E0-axis steps" -#define E1_STEPS_EN "E1-axis steps" +#define Y_STEPS_EN "Y-axis steps" +#define Z_STEPS_EN "Z-axis steps" +#define E0_STEPS_EN "E0 steps" +#define E1_STEPS_EN "E1 steps" #define TMC_CURRENT_CONF_TITLE_EN "Machine Settings>TMC current settings" #define X_TMC_CURRENT_EN "X-axis current (mA)" #define Y_TMC_CURRENT_EN "Y-axis current (mA)" #define Z_TMC_CURRENT_EN "Z-axis current (mA)" -#define E0_TMC_CURRENT_EN "E0-axis current (mA)" -#define E1_TMC_CURRENT_EN "E1-axis current (mA)" +#define E0_TMC_CURRENT_EN "E0 current (mA)" +#define E1_TMC_CURRENT_EN "E1 current (mA)" #define TMC_MODE_CONF_TITLE_EN "Machine Settings>TMC step mode settings" -#define X_TMC_MODE_EN "Whether X-axis enable stealthChop modes" -#define Y_TMC_MODE_EN "Whether Y-axis enable stealthChop modes" -#define Z_TMC_MODE_EN "Whether Z-axis enable stealthChop modes" -#define E0_TMC_MODE_EN "Whether E0-axis enable stealthChop modes" -#define E1_TMC_MODE_EN "Whether E1-axis enable stealthChop modes" +#define X_TMC_MODE_EN "Whether X-axis enables stealthChop mode" +#define Y_TMC_MODE_EN "Whether Y-axis enables stealthChop mode" +#define Z_TMC_MODE_EN "Whether Z-axis enables stealthChop mode" +#define E0_TMC_MODE_EN "Whether E0 enables stealthChop mode" +#define E1_TMC_MODE_EN "Whether E1 enables stealthChop mode" #define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction" #define X_MOTORDIR_EN "X-axis motor direction invert" #define Y_MOTORDIR_EN "Y-axis motor direction invert" #define Z_MOTORDIR_EN "Z-axis motor direction invert" -#define E0_MOTORDIR_EN "E0-axis motor direction invert" -#define E1_MOTORDIR_EN "E1-axis motor direction invert" +#define E0_MOTORDIR_EN "E0 motor direction invert" +#define E1_MOTORDIR_EN "E1 motor direction invert" #define INVERT_P_EN "YES" #define INVERT_N_EN "NO" #define HOMEFEEDRATE_CONF_TITLE_EN "Machine Settings>Home speed" -#define X_HOMESPEED_EN "XY-axis Home speed" -#define Y_HOMESPEED_EN "Y-axis Home speed" -#define Z_HOMESPEED_EN "Z-axis Home speed" +#define X_HOMESPEED_EN "XY-axis home speed" +#define Y_HOMESPEED_EN "Y-axis home speed" +#define Z_HOMESPEED_EN "Z-axis home speed" #define ADVANCED_CONF_TITLE_EN "Machine Settings>Advance" #define PWROFF_DECTION_EN "power off dection module" @@ -260,10 +260,10 @@ #define OFFSET_Z_EN "Z offset" #define HOMING_SENSITIVITY_CONF_TITLE_EN "Machine Settings>Sensitivity" -#define X_SENSITIVITY_EN "X Axis Sensitivity" -#define Y_SENSITIVITY_EN "Y Axis Sensitivity" -#define Z_SENSITIVITY_EN "Z Axis Sensitivity" -#define Z2_SENSITIVITY_EN "Z2 Axis Sensitivity" +#define X_SENSITIVITY_EN "X-axis sensitivity" +#define Y_SENSITIVITY_EN "Y-axis sensitivity" +#define Z_SENSITIVITY_EN "Z-axis sensitivity" +#define Z2_SENSITIVITY_EN "Z2-axis sensitivity" #define ENCODER_CONF_TITLE_EN "Machine Settings>Rotary encoder settings" #define ENCODER_CONF_TEXT_EN "Is the encoder function used?" From 4a0fc4d69999f485816b8324178650d8a08667c1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Nov 2020 17:41:16 -0600 Subject: [PATCH 200/443] Fix Z label --- Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h index 36aa21e1263e..41bf82e80f20 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -181,7 +181,7 @@ #define JERK_CONF_TITLE_EN "Machine Settings>Jerk speed" #define X_JERK_EN "X-axis jerk speed" #define Y_JERK_EN "Y-axis jerk speed" -#define Z_JERK_EN "J-axis jerk speed" +#define Z_JERK_EN "Z-axis jerk speed" #define E_JERK_EN "Extruder jerk speed" #define STEPS_CONF_TITLE_EN "Machine Settings>Steps settings" From 19d0c985be10845ffd7ab8f5267f927aa8d086ae Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 20 Nov 2020 04:49:12 +0500 Subject: [PATCH 201/443] Windows LPC Upload for non-admins (#20208) Co-authored-by: Victor Mateus Oliveira Co-authored-by: Scott Lahteine --- Marlin/src/HAL/LPC1768/upload_extra_script.py | 88 +++++++------------ 1 file changed, 33 insertions(+), 55 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/upload_extra_script.py b/Marlin/src/HAL/LPC1768/upload_extra_script.py index 9b0d0617a0c9..1daaa883ed6b 100755 --- a/Marlin/src/HAL/LPC1768/upload_extra_script.py +++ b/Marlin/src/HAL/LPC1768/upload_extra_script.py @@ -23,63 +23,50 @@ def print_error(e): %(e, env.get('PIOENV'))) try: + # + # Find a disk for upload + # + upload_disk = 'Disk not found' + target_file_found = False + target_drive_found = False if current_OS == 'Windows': # # platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:' # Windows - doesn't care about the disk's name, only cares about the drive letter - # - - # - # get all drives on this computer - # import subprocess - # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - driveStr = str(subprocess.check_output("fsutil fsinfo drives")) - # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - # driveStr = driveStr.strip().lstrip('Drives: ') <- Doesn't work in other Languages as English. In German is "Drives:" = "Laufwerke:" - FirstFound = driveStr.find(':',0,-1) # Find the first ":" and - driveStr = driveStr[FirstFound + 1 : -1] # truncate to the rest - # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\', - # 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\'] - drives = driveStr.split() + from ctypes import windll + import string + + # getting list of drives + # https://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-drive-letters-in-python + drives = [] + bitmask = windll.kernel32.GetLogicalDrives() + for letter in string.ascii_uppercase: + if bitmask & 1: + drives.append(letter) + bitmask >>= 1 - upload_disk = 'Disk not found' - target_file_found = False - target_drive_found = False for drive in drives: - final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:' + final_drive_name = drive + ':\\' + # print ('disc check: {}'.format(final_drive_name)) try: volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT)) except Exception as e: + print ('error:{}'.format(e)) continue else: - if target_drive in volume_info and target_file_found == False: # set upload if not found target file yet + if target_drive in volume_info and not target_file_found: # set upload if not found target file yet target_drive_found = True upload_disk = final_drive_name if target_filename in volume_info: - if target_file_found == False: + if not target_file_found: upload_disk = final_drive_name target_file_found = True - # - # set upload_port to drive if found - # - - if target_file_found == True or target_drive_found == True: - env.Replace( - UPLOAD_PORT=upload_disk - ) - print('upload disk: ', upload_disk) - else: - print_error('Autodetect Error') - elif current_OS == 'Linux': # # platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive' # - upload_disk = 'Disk not found' - target_file_found = False - target_drive_found = False drives = os.listdir(os.path.join(os.sep, 'media', getpass.getuser())) if target_drive in drives: # If target drive is found, use it. target_drive_found = True @@ -101,22 +88,15 @@ def print_error(e): if target_file_found or target_drive_found: env.Replace( - UPLOAD_FLAGS="-P$UPLOAD_PORT", - UPLOAD_PORT=upload_disk + UPLOAD_FLAGS="-P$UPLOAD_PORT" ) - print('upload disk: ', upload_disk) - else: - print_error('Autodetect Error') elif current_OS == 'Darwin': # MAC # # platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive' # - upload_disk = 'Disk not found' drives = os.listdir('/Volumes') # human readable names - target_file_found = False - target_drive_found = False - if target_drive in drives and target_file_found == False: # set upload if not found target file yet + if target_drive in drives and not target_file_found: # set upload if not found target file yet target_drive_found = True upload_disk = '/Volumes/' + target_drive + '/' for drive in drives: @@ -126,20 +106,18 @@ def print_error(e): continue else: if target_filename in filenames: - if target_file_found == False: + if not target_file_found: upload_disk = '/Volumes/' + drive + '/' target_file_found = True - # - # set upload_port to drive if found - # - if target_file_found == True or target_drive_found == True: - env.Replace( - UPLOAD_PORT=upload_disk - ) - print('\nupload disk: ', upload_disk, '\n') - else: - print_error('Autodetect Error') + # + # Set upload_port to drive if found + # + if target_file_found or target_drive_found: + env.Replace(UPLOAD_PORT=upload_disk) + print('\nUpload disk: ', upload_disk, '\n') + else: + print_error('Autodetect Error') except Exception as e: print_error(str(e)) From fe88fb7ed96390962afd900352381d951b5005c3 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Fri, 20 Nov 2020 01:08:21 +0100 Subject: [PATCH 202/443] Fix DAC setDrvPct (#20205) --- Marlin/src/feature/dac/dac_mcp4728.cpp | 4 ++-- Marlin/src/feature/dac/dac_mcp4728.h | 2 +- Marlin/src/feature/dac/stepper_dac.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin/src/feature/dac/dac_mcp4728.cpp index c7a6370e1742..4f33c4e0502a 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.cpp +++ b/Marlin/src/feature/dac/dac_mcp4728.cpp @@ -123,8 +123,8 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v * Receives all Drive strengths as 0-100 percent values, updates * DAC Values array and calls fastwrite to update the DAC. */ -void MCP4728::setDrvPct(xyze_uint8_t &pct) { - dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX); +void MCP4728::setDrvPct(xyze_uint_t &pct) { + dac_values = pct * (DAC_STEPPER_MAX) * 0.01f; fastWrite(); } diff --git a/Marlin/src/feature/dac/dac_mcp4728.h b/Marlin/src/feature/dac/dac_mcp4728.h index 571716d4834e..3a7d5f10f65c 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.h +++ b/Marlin/src/feature/dac/dac_mcp4728.h @@ -76,7 +76,7 @@ class MCP4728 { static uint8_t fastWrite(); static uint8_t simpleCommand(const byte simpleCommand); static uint8_t getDrvPct(const uint8_t channel); - static void setDrvPct(xyze_uint8_t &pct); + static void setDrvPct(xyze_uint_t &pct); }; extern MCP4728 mcp4728; diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index 5f10b4ccfbdc..5170a3551108 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -33,7 +33,7 @@ bool dac_present = false; constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; -xyze_uint8_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT; +xyze_uint_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT; StepperDAC stepper_dac; @@ -72,8 +72,8 @@ void StepperDAC::set_current_percent(const uint8_t channel, float val) { set_current_value(channel, _MIN(val, 100.0f) * (DAC_STEPPER_MAX) / 100.0f); } -static float dac_perc(int8_t n) { return 100.0 * mcp4728.getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); } -static float dac_amps(int8_t n) { return mcp4728.getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } +static float dac_perc(int8_t n) { return mcp4728.getDrvPct(dac_order[n]); } +static float dac_amps(int8_t n) { return mcp4728.getValue(dac_order[n]) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE * 1000); } uint8_t StepperDAC::get_current_percent(const AxisEnum axis) { return mcp4728.getDrvPct(dac_order[axis]); } void StepperDAC::set_current_percents(xyze_uint8_t &pct) { From d8557547dd6ef8a64e926902e4206d20da79adb6 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 20 Nov 2020 00:11:02 +0000 Subject: [PATCH 203/443] [cron] Bump distribution date (2020-11-20) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0898d2218467..a1c3a315d250 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-19" + #define STRING_DISTRIBUTION_DATE "2020-11-20" #endif /** From a26a21d19a3f0f5eaa05c85583618a34aaf2019d Mon Sep 17 00:00:00 2001 From: Ajtak Date: Fri, 20 Nov 2020 01:25:27 +0100 Subject: [PATCH 204/443] Longer LK Pro / Alfawise PRO board (#20185) --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 ++ Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h | 38 ++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index b60f73c2dc58..e68ba196ee81 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -113,6 +113,7 @@ #define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) #define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) +#define BOARD_RAMPS_LONGER3D_LK4PRO 1160 // Longer LKxxPRO/ Alfawise UxxPro (PRO version) // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index e9eee4f37126..af3b72475660 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -220,6 +220,8 @@ #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 #elif MB(RAMPS_S_12_EFFB) #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 +#elif MB(RAMPS_LONGER3D_LKPRO) + #include "ramps/pins_LONGER3D_LK4PRO.h" // ATmega2560 env:mega2560 // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h new file mode 100644 index 000000000000..8acf4e2f4f01 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// Longer UI assumptions +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "Longer UI supports only 1 hotend / E-stepper." +#endif + +#define BOARD_INFO_NAME "LGT Kit 1.0" + +#define SD_DETECT_PIN 49 +#define FIL_RUNOUT_PIN 2 +#define Z_MIN_PIN 35 + +// +// Import RAMPS 1.4 pins +// +#include "pins_RAMPS.h" From 0e3d86579bca76e7e47a0fb89064e33514519a67 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 19 Nov 2020 23:09:33 -0300 Subject: [PATCH 205/443] Missing header to use suicide() on LVGL UI (#20214) --- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 939d91b7f178..0ccb274153b6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -37,6 +37,10 @@ #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" +#if HAS_SUICIDE + #include "../../../../MarlinCore.h" +#endif + static lv_obj_t *scr; extern lv_group_t* g; From 28e315cd69ba3b5c2049f31937b5876abb1a0578 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 20 Nov 2020 10:46:18 -0300 Subject: [PATCH 206/443] SINGLE_TOUCH_NAVIGATION Follow Up (#20213) --- Marlin/src/lcd/tft/touch.cpp | 3 ++- Marlin/src/lcd/tft/touch.h | 1 + Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 112ff0b43802..7a45851a5da8 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -156,10 +156,11 @@ void Touch::touch(touch_control_t *control) { case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break; case BACK: ui.goto_previous_screen(); break; - case CLICK: + case MENU_CLICK: TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data); ui.lcd_clicked = true; break; + case CLICK: ui.lcd_clicked = true; break; #if HAS_RESUME_CONTINUE case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break; #endif diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 8023f649ce73..6726f031ff99 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -45,6 +45,7 @@ enum TouchControlType : uint16_t { PAGE_UP, PAGE_DOWN, CLICK, + MENU_CLICK, RESUME_CONTINUE, SLIDER, INCREASE, diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 3444cfe12f89..45a91cd5e5c2 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -652,7 +652,7 @@ void menu_item(const uint8_t row, bool sel ) { menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); #if ENABLED(TOUCH_SCREEN) - const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; + const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM; touch.add_control(tct, 0, 2 + 34 * row, TFT_WIDTH, 32, encoderTopLine + row); #endif } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 285e55631ab2..d152acdf7726 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -659,7 +659,7 @@ void menu_item(const uint8_t row, bool sel ) { menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); #if ENABLED(TOUCH_SCREEN) - const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; + const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM; touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row); #endif } From b3bd47b4b2d966af1241d63768c151559222cf78 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Nov 2020 17:41:01 -0600 Subject: [PATCH 207/443] Printrboard labels --- Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h | 2 +- platformio.ini | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h index 22edb7021302..ea4b950a1793 100644 --- a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h +++ b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h @@ -30,7 +30,7 @@ #endif #ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "PRINTRBOARD_G2" + #define BOARD_INFO_NAME "Printrboard G2" #endif // diff --git a/platformio.ini b/platformio.ini index 862c42b01b79..9fb49040209a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -587,8 +587,8 @@ lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet # # AT90USB1286 boards using DFU bootloader -# - PrintrBoard -# - PrintrBoard Rev.F +# - Printrboard +# - Printrboard Rev.F # - ? 5DPRINT ? # [env:at90usb1286_dfu] From fb3f6a46c1d76cfe9e64b36812fde73c71e073e3 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 21 Nov 2020 00:11:06 +0000 Subject: [PATCH 208/443] [cron] Bump distribution date (2020-11-21) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a1c3a315d250..eaa6edfdd534 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-20" + #define STRING_DISTRIBUTION_DATE "2020-11-21" #endif /** From 474be6058ba3f2d9c2d962d23ef10f14db52cf45 Mon Sep 17 00:00:00 2001 From: Kurt Haenen Date: Sat, 21 Nov 2020 02:48:53 +0100 Subject: [PATCH 209/443] Fix backward Filament (Presence) Sensor pulls (#20228) Co-authored-by: Kurt Haenen Co-authored-by: Scott Lahteine --- Marlin/src/feature/runout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index aa1ccc9cc52a..e1b9ca11b74e 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -149,7 +149,7 @@ class FilamentSensorBase { public: static inline void setup() { - #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0) + #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLUP(P); else SET_INPUT_PULLDOWN(P); }while(0) #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL) #if NUM_RUNOUT_SENSORS >= 1 INIT_RUNOUT_PIN(1); From 615bf2a6f170ddbe4fb393600b743dafb944e9e9 Mon Sep 17 00:00:00 2001 From: Simone Primarosa Date: Sat, 21 Nov 2020 02:53:04 +0100 Subject: [PATCH 210/443] Fix bad SET_FAST_PWM_FREQ calls (#20227) --- Marlin/src/module/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 19de70b31c52..d9ce6e151e62 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1683,12 +1683,12 @@ void Temperature::updateTemperaturesFromRawValues() { #endif #define INIT_FAN_PIN(P) do{ _INIT_FAN_PIN(P); SET_FAST_PWM_FREQ(P); }while(0) #if EXTRUDER_AUTO_FAN_SPEED != 255 - #define INIT_E_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(FAST_PWM_FAN_FREQUENCY); } else SET_OUTPUT(P); }while(0) + #define INIT_E_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(P); } else SET_OUTPUT(P); }while(0) #else #define INIT_E_AUTO_FAN_PIN(P) SET_OUTPUT(P) #endif #if CHAMBER_AUTO_FAN_SPEED != 255 - #define INIT_CHAMBER_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(FAST_PWM_FAN_FREQUENCY); } else SET_OUTPUT(P); }while(0) + #define INIT_CHAMBER_AUTO_FAN_PIN(P) do{ if (P == FAN1_PIN || P == FAN2_PIN) { SET_PWM(P); SET_FAST_PWM_FREQ(P); } else SET_OUTPUT(P); }while(0) #else #define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P) #endif From f8e83f79c5012c70bae788308f8665f117c4f93c Mon Sep 17 00:00:00 2001 From: Simone Primarosa Date: Sat, 21 Nov 2020 03:36:19 +0100 Subject: [PATCH 211/443] Superscript substitution (#20219) Co-authored-by: Scott Lahteine --- Marlin/src/core/language.h | 4 ++++ Marlin/src/lcd/language/language_an.h | 2 +- Marlin/src/lcd/language/language_bg.h | 2 +- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 2 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_de.h | 4 ++-- Marlin/src/lcd/language/language_el.h | 2 +- Marlin/src/lcd/language/language_el_gr.h | 2 +- Marlin/src/lcd/language/language_en.h | 4 ++-- Marlin/src/lcd/language/language_es.h | 2 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 4 ++-- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 4 ++-- Marlin/src/lcd/language/language_jp_kana.h | 6 +++--- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 +- Marlin/src/lcd/language/language_pt.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 2 +- Marlin/src/lcd/language/language_ro.h | 4 ++-- Marlin/src/lcd/language/language_ru.h | 4 ++-- Marlin/src/lcd/language/language_sk.h | 4 ++-- Marlin/src/lcd/language/language_tr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 4 ++-- Marlin/src/lcd/language/language_vi.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 4 ++-- Marlin/src/lcd/language/language_zh_TW.h | 2 +- 30 files changed, 44 insertions(+), 40 deletions(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 60d9aa6b720a..f1e477933ad9 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -380,6 +380,10 @@ #define LCD_STR_E6 "E" LCD_STR_N6 #define LCD_STR_E7 "E" LCD_STR_N7 +// Use superscripts, if possible. Evaluated at point of use. +#define SUPERSCRIPT_TWO TERN(NOT_EXTENDED_ISO10646_1_5X7, "^2", "²") +#define SUPERSCRIPT_THREE TERN(NOT_EXTENDED_ISO10646_1_5X7, "^3", "³") + #include "multi_language.h" // Allow multiple languages #include "../lcd/language/language_en.h" diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 13400f84592d..8eb6ab5794c7 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -121,7 +121,7 @@ namespace Language_an { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index b774cc29a2ba..62b291b7c3e3 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -106,7 +106,7 @@ namespace Language_bg { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Нишка"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. нишка"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диам. нишка *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD контраст"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 0ad725262df1..b924e3472d89 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -111,7 +111,7 @@ namespace Language_ca { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Moviment"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. Fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. Fil. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrast de LCD"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 073d46bad26c..97bc2a30cc48 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -301,7 +301,7 @@ namespace Language_cz { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Prum."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Prum. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Vysunout mm"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index be9ad758ce92..ff0751aebfad 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -101,7 +101,7 @@ namespace Language_da { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); PROGMEM Language_Str MSG_MOTION = _UxGT("Bevægelse"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E i mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E i mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrast"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 1ca23d604418..17dabddb3a86 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -318,8 +318,8 @@ namespace Language_de { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); PROGMEM Language_Str MSG_MOTION = _UxGT("Bewegung"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filamentdurchmesser"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filamentdurchmesser *"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 885f74570849..d1dce1b958c1 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -132,7 +132,7 @@ namespace Language_el { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index fe36b6d6633e..db67540ffba1 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -134,7 +134,7 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 4231eca5ce9a..0355f2f51249 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -337,8 +337,8 @@ namespace Language_en { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); PROGMEM Language_Str MSG_MOTION = _UxGT("Motion"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index d4cf5fe54b89..1ec1e3dbda1a 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -313,7 +313,7 @@ namespace Language_es { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diámetro Fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diámetro Fil. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarga mm"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index c8633ce0aaac..4f10adfc3e43 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -95,7 +95,7 @@ namespace Language_fi { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Lämpötila"); PROGMEM Language_Str MSG_MOTION = _UxGT("Liike"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrasti"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Tallenna muistiin"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Lataa muistista"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 90e57ab3fb3d..3a741a605797 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -281,8 +281,8 @@ namespace Language_fr { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Température"); PROGMEM Language_Str MSG_MOTION = _UxGT("Mouvement"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("Limite en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("Limite en mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("Limite *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diamètre fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diamètre fil. *"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index d1d170417424..5b0da33649c9 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -316,7 +316,7 @@ namespace Language_gl { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movemento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. fil. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarga mm"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index dba0e6df6790..0ef2ad6c351a 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -94,7 +94,7 @@ namespace Language_hr { PROGMEM Language_Str MSG_SELECT_E = _UxGT("Odaberi *"); PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); PROGMEM Language_Str MSG_MOTION = _UxGT("Gibanje"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD-a"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index a5eae451a6b0..94a7ba485846 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -318,7 +318,7 @@ namespace Language_hu { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Höfok"); PROGMEM Language_Str MSG_MOTION = _UxGT("Mozgatások"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Nyomtatószál"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E mm³-ben"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E mm") SUPERSCRIPT_THREE _UxGT("-ben"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Szál. Átm."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Szál. Átm. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Kiadás mm"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 5a3d8f4c52fb..6a10afec07d5 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -333,8 +333,8 @@ namespace Language_it { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("Limite E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("Limite E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("Limite E *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. filo"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. filo *"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index ef288bd3966a..d17d3aaf2d8e 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -113,7 +113,7 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("オフ"); // "Off" PROGMEM Language_Str MSG_SELECT = _UxGT("センタク"); // "Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("センタク *"); - PROGMEM Language_Str MSG_ACC = _UxGT("カソクド mm/s²"); // "Accel" + PROGMEM Language_Str MSG_ACC = _UxGT("カソクド mm/s") SUPERSCRIPT_TWO; // "Accel" PROGMEM Language_Str MSG_JERK = _UxGT("ヤクドウ mm/s"); // "Jerk" PROGMEM Language_Str MSG_VA_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_A; // "Va-jerk" PROGMEM Language_Str MSG_VB_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_B; // "Vb-jerk" @@ -129,14 +129,14 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_VMAX_EN = _UxGT("サイダイオクリソクド *"); // "Vmax E1" PROGMEM Language_Str MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" - PROGMEM Language_Str MSG_ACCELERATION = _UxGT("カソクド mm/s²"); // "Accel" + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("カソクド mm/s") SUPERSCRIPT_TWO; // "Accel" PROGMEM Language_Str MSG_AMAX = _UxGT("サイダイカソクド "); // "Amax " PROGMEM Language_Str MSG_A_RETRACT = _UxGT("ヒキコミカソクド"); // "A-retract" PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("イドウカソクド"); // "A-travel" PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("オンド"); // "Temperature" PROGMEM Language_Str MSG_MOTION = _UxGT("ウゴキセッテイ"); // "Motion" PROGMEM Language_Str MSG_FILAMENT = _UxGT("フィラメント"); // "Filament" - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("フィラメントチョッケイ"); // "Fil. Dia." PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("フィラメントチョッケイ *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCDコントラスト"); // "LCD contrast" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 9cbebe1bb35d..c4e0b7f1619a 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -115,7 +115,7 @@ namespace Language_nl { PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); // accepted english dutch PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); // accepted english dutch - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD contrast"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 9b764c86a71c..3b6479dfa89b 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -289,7 +289,7 @@ namespace Language_pl { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Ruch"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E w mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E w mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Śr. fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Śr. fil. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Wysuń mm"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 3a002d657ba1..fb41cb99a58a 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -109,7 +109,7 @@ namespace Language_pt { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E em mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E em mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Diam."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Diam. *"); PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index c210425ce8af..05fc639f8395 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -259,7 +259,7 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Extrusão em mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Extrusão em mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diâmetro Fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diâmetro Fil. *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarr. mm"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index c4d2bea07369..c2e50fc69807 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -315,8 +315,8 @@ namespace Language_ro { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); PROGMEM Language_Str MSG_MOTION = _UxGT("Motion"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 37341853578f..0be6cb5eb3bd 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -369,8 +369,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Филамент"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E огран.,мм³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E огран.,мм") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E огран. *"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. филамента"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 77e4b4642429..2e05ee45132f 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -320,8 +320,8 @@ namespace Language_sk { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E v mm³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit v mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E v mm") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit v mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Priem. fil."); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Priem. fil. *"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index cca3a7eda739..307abf118a8c 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -306,7 +306,7 @@ namespace Language_tr { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Sıcaklık"); PROGMEM Language_Str MSG_MOTION = _UxGT("Hareket"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filaman"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ekstrüzyon/mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ekstrüzyon/mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filaman Çapı"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filaman Çapı *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Çıkart mm"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index ac79b0b820fc..71b4cd018d7d 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -372,8 +372,8 @@ namespace Language_uk { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); PROGMEM Language_Str MSG_MOTION = _UxGT("Рух"); PROGMEM Language_Str MSG_FILAMENT = _UxGT("Пруток"); - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм³"); - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E обмеж.,мм³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм") SUPERSCRIPT_THREE; + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E обмеж.,мм") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E обмеж. *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Діам. прутка"); PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Діам. прутка *"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 8a1cfad92ac2..fad32507cee5 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -257,7 +257,7 @@ namespace Language_vi { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Nhiệt độ"); // Temperature PROGMEM Language_Str MSG_MOTION = _UxGT("Chuyển động"); // Motion PROGMEM Language_Str MSG_FILAMENT = _UxGT("Vật liệu in"); // dây nhựa - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E bằng mm³"); // E in mm + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E bằng mm") SUPERSCRIPT_THREE; // E in mm PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Đường kính nhựa"); // Fil. Dai. PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Đường kính nhựa *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Dỡ mm"); // unload mm diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 56fd8a22f62a..0e1de36b57cd 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -313,8 +313,8 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("温度"); //"Temperature" PROGMEM Language_Str MSG_MOTION = _UxGT("运动"); //"Motion" PROGMEM Language_Str MSG_FILAMENT = _UxGT("料丝"); //"Filament" menu_advanced_filament - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E 在 mm³"); //"E in mm3" volumetric_enabled - PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E 限制 在 mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E 在 mm") SUPERSCRIPT_THREE; //"E in mm3" volumetric_enabled + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E 限制 在 mm") SUPERSCRIPT_THREE; PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E 限制 *"); PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("丝料直径"); //"Fil. Dia." PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("丝料直径 *"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index ac061e9b818d..9708bbda9c0c 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -287,7 +287,7 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("溫度"); //"Temperature" PROGMEM Language_Str MSG_MOTION = _UxGT("運作"); //"Motion" PROGMEM Language_Str MSG_FILAMENT = _UxGT("絲料測容"); //"Filament" menu_control_volumetric - PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("測容積mm³"); //"E in mm3" volumetric_enabled + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("測容積mm") SUPERSCRIPT_THREE; //"E in mm3" volumetric_enabled PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("絲料直徑"); //"Fil. Dia." PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("絲料直徑 *"); PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("卸載 mm"); // "Unload mm" From 7e902b7e295870bc3d4b69132be5d7e2c2634902 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Nov 2020 21:25:51 -0600 Subject: [PATCH 212/443] Power-Loss cleanup --- Marlin/src/feature/powerloss.cpp | 22 ++++++++-------- Marlin/src/feature/powerloss.h | 45 +++++++++----------------------- 2 files changed, 24 insertions(+), 43 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index bef2309449d3..c4e0ef694abe 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -180,10 +180,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/ // Machine state info.current_position = current_position; + info.feedrate = uint16_t(feedrate_mm_s * 60.0f); info.zraise = zraise; TERN_(HAS_HOME_OFFSET, info.home_offset = home_offset); TERN_(HAS_POSITION_SHIFT, info.position_shift = position_shift); - info.feedrate = uint16_t(feedrate_mm_s * 60.0f); #if HAS_MULTI_EXTRUDER info.active_extruder = active_extruder; @@ -209,7 +209,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/ #endif #if HAS_LEVELING - info.leveling = planner.leveling_active; + info.flag.leveling = planner.leveling_active; info.fade = TERN0(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height); #endif @@ -220,12 +220,12 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/ info.retract_hop = fwretract.current_hop; #endif - // Relative axis modes - info.axis_relative = gcode.axis_relative; - // Elapsed print job time info.print_job_elapsed = print_job_timer.duration(); + // Relative axis modes + info.axis_relative = gcode.axis_relative; + // Misc. Marlin flags info.flag.dryrun = !!(marlin_debug_flags & MARLIN_DEBUG_DRYRUN); info.flag.allow_cold_extrusion = TERN0(PREVENT_COLD_EXTRUSION, thermalManager.allow_cold_extrude); @@ -457,8 +457,8 @@ void PrintJobRecovery::resume() { #if HAS_LEVELING // Restore leveling state before 'G92 Z' to ensure // the Z stepper count corresponds to the native Z. - if (info.fade || info.leveling) { - sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.leveling), dtostrf(info.fade, 1, 1, str_1)); + if (info.fade || info.flag.leveling) { + sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.flag.leveling), dtostrf(info.fade, 1, 1, str_1)); gcode.process_subcommands_now(cmd); } #endif @@ -507,15 +507,15 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("G92.9 E%s"), dtostrf(info.current_position.e, 1, 3, str_1)); gcode.process_subcommands_now(cmd); - // Relative axis modes - gcode.axis_relative = info.axis_relative; - TERN_(HAS_HOME_OFFSET, home_offset = info.home_offset); TERN_(HAS_POSITION_SHIFT, position_shift = info.position_shift); #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT LOOP_XYZ(i) update_workspace_offset((AxisEnum)i); #endif + // Relative axis modes + gcode.axis_relative = info.axis_relative; + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) const uint8_t old_flags = marlin_debug_flags; marlin_debug_flags |= MARLIN_DEBUG_ECHO; @@ -598,7 +598,7 @@ void PrintJobRecovery::resume() { #endif #if HAS_LEVELING - DEBUG_ECHOLNPAIR("leveling: ", int(info.leveling), " fade: ", info.fade); + DEBUG_ECHOLNPAIR("leveling: ", int(info.flag.leveling), " fade: ", info.fade); #endif #if ENABLED(FWRETRACT) DEBUG_ECHOPGM("retract: "); diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index e31b2ec915c3..60923c6b3e9c 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -47,42 +47,24 @@ typedef struct { // Machine state xyze_pos_t current_position; + uint16_t feedrate; float zraise; - #if HAS_HOME_OFFSET - xyz_pos_t home_offset; - #endif - #if HAS_POSITION_SHIFT - xyz_pos_t position_shift; - #endif - - uint16_t feedrate; - #if HAS_MULTI_EXTRUDER - uint8_t active_extruder; - #endif + TERN_(HAS_HOME_OFFSET, xyz_pos_t home_offset); + TERN_(HAS_POSITION_SHIFT, xyz_pos_t position_shift); + TERN_(HAS_MULTI_EXTRUDER, uint8_t active_extruder); #if DISABLED(NO_VOLUMETRICS) bool volumetric_enabled; float filament_size[EXTRUDERS]; #endif - #if HAS_HOTEND - int16_t target_temperature[HOTENDS]; - #endif + TERN_(HAS_HOTEND, int16_t target_temperature[HOTENDS]); + TERN_(HAS_HEATED_BED, int16_t target_temperature_bed); + TERN_(HAS_FAN, uint8_t fan_speed[FAN_COUNT]); - #if HAS_HEATED_BED - int16_t target_temperature_bed; - #endif - - #if HAS_FAN - uint8_t fan_speed[FAN_COUNT]; - #endif - - #if HAS_LEVELING - bool leveling; - float fade; - #endif + TERN_(HAS_LEVELING, float fade); #if ENABLED(FWRETRACT) float retract[EXTRUDERS], retract_hop; @@ -92,14 +74,9 @@ typedef struct { #if ENABLED(MIXING_EXTRUDER) //uint_fast8_t selected_vtool; //mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - #if ENABLED(GRADIENT_MIX) - gradient_t gradient; - #endif + TERN_(GRADIENT_MIX, gradient_t gradient); #endif - // Relative axis modes - uint8_t axis_relative; - // SD Filename and position char sd_filename[MAXPATHNAMELENGTH]; volatile uint32_t sdpos; @@ -107,10 +84,14 @@ typedef struct { // Job elapsed time millis_t print_job_elapsed; + // Relative axis modes + uint8_t axis_relative; + // Misc. Marlin flags struct { bool dryrun:1; // M111 S8 bool allow_cold_extrusion:1; // M302 P1 + TERN_(HAS_LEVELING, bool leveling:1); } flag; uint8_t valid_foot; From 6851909f9031ab79fb5ab4492189edac85904496 Mon Sep 17 00:00:00 2001 From: Gurmeet Athwal Date: Sat, 21 Nov 2020 13:17:04 +0530 Subject: [PATCH 213/443] BTN_ENC_EN for many boards (#19890) Enables CHECK_ENCODER_ACTIVE_SIGNAL for many more boards. Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 5 +++++ Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 5 +++++ Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 5 +++++ Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 5 +++++ Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h | 5 +++++ Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 5 +++++ Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 5 +++++ Marlin/src/pins/mega/pins_CHEAPTRONICv2.h | 4 ++++ Marlin/src/pins/mega/pins_GT2560_REV_A.h | 4 ++++ Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 5 +++++ Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 4 ++++ Marlin/src/pins/rambo/pins_MINIRAMBO.h | 4 ++++ Marlin/src/pins/rambo/pins_RAMBO.h | 4 ++++ Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 4 ++++ Marlin/src/pins/ramps/pins_RAMPS.h | 4 ++++ Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 5 +++++ Marlin/src/pins/ramps/pins_TT_OSCAR.h | 4 ++++ Marlin/src/pins/sam/pins_ARCHIM1.h | 5 +++++ Marlin/src/pins/sam/pins_DUE3DOM.h | 5 +++++ Marlin/src/pins/sam/pins_DUE3DOM_MINI.h | 5 +++++ Marlin/src/pins/sam/pins_RADDS.h | 4 ++++ Marlin/src/pins/sam/pins_RAMPS_DUO.h | 4 ++++ Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 4 ++++ Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 4 ++++ Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 4 ++++ Marlin/src/pins/samd/pins_RAMPS_144.h | 4 ++++ Marlin/src/pins/sanguino/pins_ANET_10.h | 4 ++++ Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 5 +++++ Marlin/src/pins/stm32f1/pins_CHITU3D.h | 4 ++++ Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 4 ++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 5 +++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 5 +++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 5 +++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 5 +++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 5 +++++ Marlin/src/pins/stm32f1/pins_STM32F1R.h | 4 ++++ Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h | 4 ++++ Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 5 +++++ Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 5 +++++ Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h | 5 +++++ Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 5 +++++ Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 5 +++++ 42 files changed, 191 insertions(+) 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 6f84a2a44d06..c621f93a2ac5 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -353,6 +353,11 @@ #define LCD_PINS_D5 EXPA1_05_PIN #define LCD_PINS_D6 EXPA1_04_PIN #define LCD_PINS_D7 EXPA1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !FYSETC_MINI_12864 diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 3562619f5c09..997723009489 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -136,6 +136,11 @@ #define LCD_PINS_D5 P0_22 #define LCD_PINS_D6 P1_29 #define LCD_PINS_D7 P1_28 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 502c9375881a..68cfe65601d1 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -352,6 +352,11 @@ #define LCD_PINS_D5 P0_17 #define LCD_PINS_D6 P1_00 #define LCD_PINS_D7 P1_22 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !FYSETC_MINI_12864 diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 674bd6b0ff9f..f746064991c8 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -420,6 +420,11 @@ #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h index 4e3b2ef4258a..700e79de9cce 100644 --- a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h @@ -110,4 +110,9 @@ #define BTN_ENC P1_30 #define SD_DETECT_PIN -1 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // IS_RRD_FG_SC diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 6fddc162248e..ac1d9f690680 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -175,6 +175,11 @@ #endif #define BEEPER_PIN P1_30 // (37) not 5V tolerant #define DOGLCD_CS P0_16 // (16) + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #if ENABLED(MINIPANEL) 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 6dc0c1e8ff45..638268a546a4 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -371,6 +371,11 @@ #define LCD_PINS_D5 P0_17 #define LCD_PINS_D6 P1_00 #define LCD_PINS_D7 P1_22 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !FYSETC_MINI_12864 diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h index af9f683c7d33..3f18bc8bbea0 100644 --- a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h @@ -119,6 +119,10 @@ #define LCD_PINS_D6 41 #define LCD_PINS_D7 40 +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder +#endif + // // Beeper, SD Card, Encoder // diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index 2db030804c43..e1752c1f8564 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -158,6 +158,10 @@ #define LCD_PINS_D6 20 #define LCD_PINS_D7 19 + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #define SD_DETECT_PIN -1 #endif // !IS_NEWPANEL diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index c2cc24943ab2..2ca2cc9c8d07 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -181,6 +181,11 @@ #define LCD_PINS_D7 71 #define BTN_EN1 14 #define BTN_EN2 72 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #define BTN_ENC 9 // AUX-2 diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 7e532461812c..a6a4b65e05bc 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -194,6 +194,10 @@ #define SD_DETECT_PIN 15 + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index 8b034820cfdb..4dcf35827cba 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -187,6 +187,10 @@ #endif // !MINIRAMBO_10A + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 62e7565c14cf..7dcaeb8e57e4 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -228,6 +228,10 @@ #endif // !VIKI2 && !miniVIKI + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #else // !IS_NEWPANEL - old style panel with shift register // No Beeper added diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 66714240e79b..15ac2f447b18 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -275,6 +275,10 @@ #define DOGLCD_A0 27 #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #if IS_NEWPANEL diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 69a80d6b27a9..57d4c047e2e2 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -512,6 +512,10 @@ #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + // // LCD Display input pins // diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h index 1e063c269d9b..42b665ce8659 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h @@ -263,6 +263,11 @@ #ifndef SD_DETECT_PIN #define SD_DETECT_PIN 38 #endif + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 725d36466c25..e6a95fdab9ee 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -350,6 +350,10 @@ #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + // // LCD Display input pins // diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h index 347afe9ebdf2..1fda0ccb44f4 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -198,4 +198,9 @@ #define BTN_EN2 13 // D13 PB27_TIOB0 #define BTN_ENC 16 // D16 PA13_TXD1 #endif // IS_NEWPANEL + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h index a5c22ff3f2ba..90d6bdc3403d 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -168,4 +168,9 @@ #define BEEPER_PIN -1 #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 + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index b3e76199dcc5..5a205423ed5b 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -171,4 +171,9 @@ #define DOGLCD_CS 45 #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 + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index cd895365d041..7b9c7f1b2818 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -287,6 +287,10 @@ #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 + #endif + #endif // HAS_WIRED_LCD #ifndef SDSS diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index 44e2695a5358..d2ab5c96b22d 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -127,6 +127,10 @@ #endif #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index a0dbddf56792..80e8f0dc7e9d 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -203,6 +203,10 @@ #define DOGLCD_MISO 74 // MISO_PIN #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD #if HAS_TMC_UART diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 49378541a9c2..6a283401f453 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -271,4 +271,8 @@ #define BTN_ENC 40 #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 1cc2eee6b0b2..6ec10f64af7d 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -253,4 +253,8 @@ #define BTN_ENC 40 #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 1948acf8971e..d72b55d3afe0 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -594,6 +594,10 @@ #endif #endif // IS_NEWPANEL + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD // diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 81c0fe562dee..10fee8bcf17e 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -198,6 +198,10 @@ #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #else #define SERVO0_PIN 27 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 16c247cc8770..410424f6b551 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 @@ -179,6 +179,11 @@ #define LCD_PINS_D5 PB7 #define LCD_PINS_D6 PC15 #define LCD_PINS_D7 PC14 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !FYSETC_MINI_12864 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index aa83a0cb04c8..b18c9dd91406 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -283,4 +283,8 @@ #endif #endif // IS_NEWPANEL + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 073d6c73687b..859f9fab1ecd 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -154,6 +154,10 @@ #define BTN_EN2 PB3 #define BTN_ENC PC13 +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder +#endif + // // Filament runout // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index b1f41f9fa7f9..b9283a060f86 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -309,6 +309,11 @@ #define LCD_PINS_D5 PE15 #define LCD_PINS_D6 PD11 #define LCD_PINS_D7 PD10 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #ifndef BOARD_ST7920_DELAY_1 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 2dcd7780af0e..c2b7e52067c1 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -160,6 +160,11 @@ #define LCD_PINS_D5 PA7 #define LCD_PINS_D6 PC4 #define LCD_PINS_D7 PC5 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index f8b8a891bed6..27bd4033cd98 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -129,6 +129,11 @@ #define LCD_PINS_D5 PA7 #define LCD_PINS_D6 PC4 #define LCD_PINS_D7 PC5 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 8b4129697122..1816d6bd41f0 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -321,6 +321,11 @@ #define LCD_PINS_D5 PE15 #define LCD_PINS_D6 PD11 #define LCD_PINS_D7 PD10 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #ifndef BOARD_ST7920_DELAY_1 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 8f1a405e8c61..65aa5cc39e59 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -258,6 +258,11 @@ #define LCD_PINS_D5 PF15 #define LCD_PINS_D6 PF12 #define LCD_PINS_D7 PF13 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index 1b9a62fe9ed7..6f252fbef612 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -258,4 +258,8 @@ #endif #endif // IS_NEWPANEL + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index b13d495542f8..4b981c92519e 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -132,6 +132,10 @@ #define DOGLCD_CS LCD_PINS_D5 #define DOGLCD_A0 LCD_PINS_D6 +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder +#endif + // // Onboard SD support // 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 6f9c3d309588..19ff2a34e222 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -232,6 +232,11 @@ #define LCD_PINS_D5 PE11 #define LCD_PINS_D6 PE12 #define LCD_PINS_D7 PE13 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif 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 60b2adbfa8d2..6c475faeb558 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -389,6 +389,11 @@ #define LCD_PINS_D5 PG7 #define LCD_PINS_D6 PG6 #define LCD_PINS_D7 PG5 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index e1d28f34de95..235ed1edcc4c 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -426,6 +426,11 @@ #define LCD_PINS_D5 EXPA1_05_PIN #define LCD_PINS_D6 EXPA1_04_PIN #define LCD_PINS_D7 EXPA1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 656849487aaf..a8105c37a244 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -256,6 +256,11 @@ #define LCD_PINS_D5 PC12 #define LCD_PINS_D6 PD0 #define LCD_PINS_D7 PD1 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index eee0094ea894..24c32d6d818c 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -164,6 +164,11 @@ #define LCD_PINS_D5 PE13 #define LCD_PINS_D6 PE14 #define LCD_PINS_D7 PE15 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif // Alter timing for graphical display From 8db72d027e8189130e6f03244abe337cbfd6dcf4 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Sat, 21 Nov 2020 23:27:06 +0100 Subject: [PATCH 214/443] Skip unnecessary (costly) SW Stepper Enable (#20218) Co-authored-by: Jason Smith Co-authored-by: Scott Lahteine --- Marlin/src/module/stepper/indirection.cpp | 5 +++++ Marlin/src/module/stepper/indirection.h | 26 ++++++++++++++++------- buildroot/tests/NUCLEO_F767ZI-tests | 2 +- buildroot/tests/esp32-tests | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index 6f9ac9ba0ab1..6297d8336695 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -43,3 +43,8 @@ void reset_stepper_drivers() { TERN_(HAS_L64XX, L64xxManager.init_to_defaults()); TERN_(HAS_TRINAMIC_CONFIG, reset_trinamic_drivers()); } + +#if ENABLED(SOFTWARE_DRIVER_ENABLE) + // Flags to optimize XYZ Enabled state + xyz_bool_t axis_sw_enabled; // = { false, false, false } +#endif diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index dfdd63b05ba2..04cebc216fec 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -843,22 +843,32 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // // Axis steppers enable / disable macros // -#define FORGET_AXIS(A) TERN(HOME_AFTER_DEACTIVATE, set_axis_never_homed(A), CBI(axis_known_position, A)) - -#define ENABLE_AXIS_X() do{ ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); }while(0) -#define DISABLE_AXIS_X() do{ DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); FORGET_AXIS(X_AXIS); }while(0) +#if ENABLED(SOFTWARE_DRIVER_ENABLE) + // Avoid expensive calls to enable / disable steppers + extern xyz_bool_t axis_sw_enabled; + #define SHOULD_ENABLE(N) !axis_sw_enabled.N + #define SHOULD_DISABLE(N) axis_sw_enabled.N + #define AFTER_CHANGE(N,TF) axis_sw_enabled.N = TF +#else + #define SHOULD_ENABLE(N) true + #define SHOULD_DISABLE(N) true + #define AFTER_CHANGE(N,TF) NOOP +#endif -#define ENABLE_AXIS_Y() do{ ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); }while(0) -#define DISABLE_AXIS_Y() do{ DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); FORGET_AXIS(Y_AXIS); }while(0) +#define ENABLE_AXIS_X() if (SHOULD_ENABLE(x)) { ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); AFTER_CHANGE(x, true); } +#define DISABLE_AXIS_X() if (SHOULD_DISABLE(x)) { DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); AFTER_CHANGE(x, false); FORGET_AXIS(X_AXIS); } +#define ENABLE_AXIS_Y() if (SHOULD_ENABLE(y)) { ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); AFTER_CHANGE(y, true); } +#define DISABLE_AXIS_Y() if (SHOULD_DISABLE(y)) { DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); AFTER_CHANGE(y, false); FORGET_AXIS(Y_AXIS); } +#define ENABLE_AXIS_Z() if (SHOULD_ENABLE(z)) { ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); AFTER_CHANGE(z, true); } +#define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); AFTER_CHANGE(z, false); FORGET_AXIS(Z_AXIS); Z_RESET(); } -#define ENABLE_AXIS_Z() do{ ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); ENABLE_STEPPER_Z4(); }while(0) +#define FORGET_AXIS(A) TERN(HOME_AFTER_DEACTIVATE, set_axis_never_homed(A), CBI(axis_known_position, A)) #ifdef Z_AFTER_DEACTIVATE #define Z_RESET() do{ current_position.z = Z_AFTER_DEACTIVATE; sync_plan_position(); }while(0) #else #define Z_RESET() #endif -#define DISABLE_AXIS_Z() do{ DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); FORGET_AXIS(Z_AXIS); Z_RESET(); }while(0) // // Extruder steppers enable / disable macros diff --git a/buildroot/tests/NUCLEO_F767ZI-tests b/buildroot/tests/NUCLEO_F767ZI-tests index 1a2e7c8362db..bd5ca8697095 100644 --- a/buildroot/tests/NUCLEO_F767ZI-tests +++ b/buildroot/tests/NUCLEO_F767ZI-tests @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_NUCLEO_F767ZI opt_set SERIAL_PORT -1 -opt_enable BLTOUCH Z_SAFE_HOMING SPEAKER +opt_enable BLTOUCH Z_SAFE_HOMING SPEAKER SOFTWARE_DRIVER_ENABLE opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2208 exec_test $1 $2 "Mixed timer usage" "$3" diff --git a/buildroot/tests/esp32-tests b/buildroot/tests/esp32-tests index 283d02f7e046..310eea298e11 100755 --- a/buildroot/tests/esp32-tests +++ b/buildroot/tests/esp32-tests @@ -34,7 +34,7 @@ opt_set X_SLAVE_ADDRESS 0 opt_set Y_SLAVE_ADDRESS 1 opt_set Z_SLAVE_ADDRESS 2 opt_set E0_SLAVE_ADDRESS 3 -opt_enable HOTEND_IDLE_TIMEOUT +opt_enable HOTEND_IDLE_TIMEOUT SOFTWARE_DRIVER_ENABLE exec_test $1 $2 "ESP32, TMC HW Serial, Hotend Idle" "$3" # cleanup From 7a04df47f254dc80defaec376d76c113f50dfee6 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 21 Nov 2020 20:16:03 -0300 Subject: [PATCH 215/443] Fix Load Filament wait (#20243) --- Marlin/src/feature/pause.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 0a3609b3a15e..024338f2422e 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -199,7 +199,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l first_impatient_beep(max_beep_count); KEEPALIVE_STATE(PAUSED_FOR_USER); - + wait_for_user = true; // LCD click or M108 will clear this #if ENABLED(HOST_PROMPT_SUPPORT) const char tool = '0' #if NUM_RUNOUT_SENSORS > 1 From ca83e1a26f1a386344803cf5326016a8f8335008 Mon Sep 17 00:00:00 2001 From: Kurt Haenen Date: Sun, 22 Nov 2020 00:56:56 +0100 Subject: [PATCH 216/443] Proper pullup/pulldown configurability (#20242) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 34 ++++++++--- Marlin/Configuration_adv.h | 3 +- Marlin/src/feature/powerloss.h | 10 ++-- Marlin/src/feature/runout.h | 4 +- Marlin/src/inc/Conditionals_LCD.h | 56 +++++++++++++------ Marlin/src/inc/SanityCheck.h | 26 ++++++++- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 2 +- buildroot/tests/BIGTREE_GTR_V1_0-tests | 4 +- buildroot/tests/mega2560-tests | 2 +- 9 files changed, 102 insertions(+), 39 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 9d2dd0b710ba..c64569d2bf91 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1176,25 +1176,41 @@ #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. - #define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. // Override individually if the runout sensors vary //#define FIL_RUNOUT1_STATE LOW - //#define FIL_RUNOUT1_PULL + //#define FIL_RUNOUT1_PULLUP + //#define FIL_RUNOUT1_PULLDOWN + //#define FIL_RUNOUT2_STATE LOW - //#define FIL_RUNOUT2_PULL + //#define FIL_RUNOUT2_PULLUP + //#define FIL_RUNOUT2_PULLDOWN + //#define FIL_RUNOUT3_STATE LOW - //#define FIL_RUNOUT3_PULL + //#define FIL_RUNOUT3_PULLUP + //#define FIL_RUNOUT3_PULLDOWN + //#define FIL_RUNOUT4_STATE LOW - //#define FIL_RUNOUT4_PULL + //#define FIL_RUNOUT4_PULLUP + //#define FIL_RUNOUT4_PULLDOWN + //#define FIL_RUNOUT5_STATE LOW - //#define FIL_RUNOUT5_PULL + //#define FIL_RUNOUT5_PULLUP + //#define FIL_RUNOUT5_PULLDOWN + //#define FIL_RUNOUT6_STATE LOW - //#define FIL_RUNOUT6_PULL + //#define FIL_RUNOUT6_PULLUP + //#define FIL_RUNOUT6_PULLDOWN + //#define FIL_RUNOUT7_STATE LOW - //#define FIL_RUNOUT7_PULL + //#define FIL_RUNOUT7_PULLUP + //#define FIL_RUNOUT7_PULLDOWN + //#define FIL_RUNOUT8_STATE LOW - //#define FIL_RUNOUT8_PULL + //#define FIL_RUNOUT8_PULLUP + //#define FIL_RUNOUT8_PULLDOWN // Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 68d31ceaff9f..baa0433f19b9 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1217,7 +1217,8 @@ //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor + //#define POWER_LOSS_PULLDOWN //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 60923c6b3e9c..73cd0b70faf4 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -120,12 +120,10 @@ class PrintJobRecovery { static inline void setup() { #if PIN_EXISTS(POWER_LOSS) - #if ENABLED(POWER_LOSS_PULL) - #if POWER_LOSS_STATE == LOW - SET_INPUT_PULLUP(POWER_LOSS_PIN); - #else - SET_INPUT_PULLDOWN(POWER_LOSS_PIN); - #endif + #if ENABLED(POWER_LOSS_PULLUP) + SET_INPUT_PULLUP(POWER_LOSS_PIN); + #elif ENABLED(POWER_LOSS_PULLDOWN) + SET_INPUT_PULLDOWN(POWER_LOSS_PIN); #else SET_INPUT(POWER_LOSS_PIN); #endif diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index e1b9ca11b74e..09443e6e2b2d 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -149,8 +149,8 @@ class FilamentSensorBase { public: static inline void setup() { - #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLUP(P); else SET_INPUT_PULLDOWN(P); }while(0) - #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL) + #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0) + #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN) #if NUM_RUNOUT_SENSORS >= 1 INIT_RUNOUT_PIN(1); #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5fe73a9467cc..42a4e037d8c3 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -708,64 +708,88 @@ #ifndef FIL_RUNOUT1_STATE #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT1_PULL - #define FIL_RUNOUT1_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT1_PULLUP + #define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT1_PULLDOWN + #define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 2 #ifndef FIL_RUNOUT2_STATE #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT2_PULL - #define FIL_RUNOUT2_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT2_PULLUP + #define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT2_PULLDOWN + #define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 3 #ifndef FIL_RUNOUT3_STATE #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT3_PULL - #define FIL_RUNOUT3_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT3_PULLUP + #define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT3_PULLDOWN + #define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 4 #ifndef FIL_RUNOUT4_STATE #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT4_PULL - #define FIL_RUNOUT4_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT4_PULLUP + #define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT4_PULLDOWN + #define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 5 #ifndef FIL_RUNOUT5_STATE #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT5_PULL - #define FIL_RUNOUT5_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT5_PULLUP + #define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT5_PULLDOWN + #define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 6 #ifndef FIL_RUNOUT6_STATE #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT6_PULL - #define FIL_RUNOUT6_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT6_PULLUP + #define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT6_PULLDOWN + #define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 7 #ifndef FIL_RUNOUT7_STATE #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT7_PULL - #define FIL_RUNOUT7_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT7_PULLUP + #define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT7_PULLDOWN + #define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #if NUM_RUNOUT_SENSORS >= 8 #ifndef FIL_RUNOUT8_STATE #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE #endif - #ifndef FIL_RUNOUT8_PULL - #define FIL_RUNOUT8_PULL FIL_RUNOUT_PULL + #ifndef FIL_RUNOUT8_PULLUP + #define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT8_PULLDOWN + #define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN #endif #endif #endif // FILAMENT_RUNOUT_SENSOR diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4215f225e3eb..072bb26bfe7a 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -111,7 +111,7 @@ #elif defined(FILAMENT_SENSOR) #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR." #elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL." + #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP." #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #elif defined(LANGUAGE_INCLUDE) @@ -525,6 +525,8 @@ #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT." #elif defined(GRAPHICAL_TFT_ROTATE_180) #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180." +#elif defined(POWER_LOSS_PULL) + #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)." #elif defined(FIL_RUNOUT_INVERTING) #if FIL_RUNOUT_INVERTING #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH." @@ -653,6 +655,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." +#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) + #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN." #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX) #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX." #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX) @@ -823,6 +827,22 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7." #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8) #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8." + #elif BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN) + #error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN) + #error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN) + #error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN) + #error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN) + #error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN) + #error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN) + #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time." + #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN) + #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time." #elif FILAMENT_RUNOUT_DISTANCE_MM < 0 #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero." #elif DISABLED(ADVANCED_PAUSE_FEATURE) @@ -2824,6 +2844,10 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." #endif +#if BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN) + #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time." +#endif + #if ENABLED(Z_STEPPER_AUTO_ALIGN) #if NUM_Z_STEPPER_DRIVERS <= 1 #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1." diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index b6086b82ed4f..226fb7291e28 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -77,7 +77,7 @@ namespace Anycubic { // Filament runout is handled by Marlin settings in Configuration.h // opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. - // opt_enable FIL_RUNOUT_PULL + // opt_enable FIL_RUNOUT_PULLUP TFTSer.begin(115200); diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests index 9750b8fc2c7a..ef245143a818 100644 --- a/buildroot/tests/BIGTREE_GTR_V1_0-tests +++ b/buildroot/tests/BIGTREE_GTR_V1_0-tests @@ -34,9 +34,9 @@ opt_set FIL_RUNOUT6_PIN 8 opt_set FIL_RUNOUT7_PIN 9 opt_set FIL_RUNOUT8_PIN 10 opt_set FIL_RUNOUT4_STATE HIGH -opt_enable FIL_RUNOUT4_PULL +opt_enable FIL_RUNOUT4_PULLUP opt_set FIL_RUNOUT8_STATE HIGH -opt_enable FIL_RUNOUT8_PULL +opt_enable FIL_RUNOUT8_PULLUP exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" "$3" restore_configs diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index 294de2a767d1..01ade82891e1 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -91,7 +91,7 @@ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ - FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL + FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULLUP opt_set NUM_RUNOUT_SENSORS 5 opt_set FIL_RUNOUT2_PIN 44 opt_set FIL_RUNOUT3_PIN 45 From 89b56ca5c2b68412c282b7b0bd29390f940f5594 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 22 Nov 2020 00:12:03 +0000 Subject: [PATCH 217/443] [cron] Bump distribution date (2020-11-22) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index eaa6edfdd534..213b389e1635 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-21" + #define STRING_DISTRIBUTION_DATE "2020-11-22" #endif /** From e19c016c74c9627afe7c4527dfc08d5c77539261 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Sun, 22 Nov 2020 01:21:43 +0100 Subject: [PATCH 218/443] Clear menu history for browse media on insert (#20236) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/marlinui.cpp | 1 + Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/menu/menu.h | 3 +++ Marlin/src/lcd/menu/menu_media.cpp | 2 -- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 9d0ebe27e4ba..acf35afb1807 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1625,6 +1625,7 @@ void MarlinUI::update() { if (old_status < 2) { TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response #if ENABLED(BROWSE_MEDIA_ON_INSERT) + clear_menu_history(); quick_feedback(); goto_screen(MEDIA_MENU_GATEWAY); #else diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 81ac32a60c8f..1497940ffe55 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -206,8 +206,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co screen_items = items; if (on_status_screen()) { defer_status_screen(false); + clear_menu_history(); TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false); - screen_history_depth = 0; } clear_lcd(); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 66fe73cec1cd..5782d2070a15 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -249,3 +249,6 @@ void _lcd_draw_homing(); #if ENABLED(TOUCH_SCREEN_CALIBRATION) void touch_screen_calibration(); #endif + +extern uint8_t screen_history_depth; +inline void clear_menu_history() { screen_history_depth = 0; } diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 59cb2baa231c..7a525d06b5a0 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -104,8 +104,6 @@ class MenuItem_sdfolder : public MenuItem_sdbase { } }; -extern uint8_t screen_history_depth; - void menu_media() { ui.encoder_direction_menus(); From 60e8c7afb26c0816f353a81cb73c0115ac7dae51 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 Nov 2020 22:32:56 -0600 Subject: [PATCH 219/443] Put "$3" on all tests --- buildroot/tests/LPC1768-tests | 4 +- buildroot/tests/LPC1769-tests | 2 +- buildroot/tests/mega1280-tests | 2 +- buildroot/tests/mega2560-tests | 40 ++++++++++---------- buildroot/tests/mks_robin_nano35-tests | 2 +- buildroot/tests/mks_robin_nano35_stm32-tests | 12 +++--- buildroot/tests/rambo-tests | 2 +- buildroot/tests/teensy41-tests | 6 +-- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/buildroot/tests/LPC1768-tests b/buildroot/tests/LPC1768-tests index 9604ca2403f5..b8d073031409 100755 --- a/buildroot/tests/LPC1768-tests +++ b/buildroot/tests/LPC1768-tests @@ -11,7 +11,7 @@ set -e # #restore_configs #opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -#exec_test $1 $2 "Default Configuration" +#exec_test $1 $2 "Default Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB @@ -21,7 +21,7 @@ exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), N #restore_configs #use_example_configs Mks/Sbase -#exec_test $1 $2 "MKS SBASE Example Config" +#exec_test $1 $2 "MKS SBASE Example Config" "$3" restore_configs opt_set MOTHERBOARD BOARD_MKS_SBASE diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index e4787f82daf6..702f8035ecb3 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -54,7 +54,7 @@ exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI" "$3" #opt_set FAN_MIN_PWM 50 #opt_set FAN_KICKSTART_TIME 100 #opt_set XY_FREQUENCY_LIMIT 15 -#exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" +#exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" "$3" restore_configs use_example_configs delta/generic diff --git a/buildroot/tests/mega1280-tests b/buildroot/tests/mega1280-tests index 1f0676724831..ac1b5f692d89 100644 --- a/buildroot/tests/mega1280-tests +++ b/buildroot/tests/mega1280-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # #restore_configs -#exec_test $1 $2 "Default Configuration" +#exec_test $1 $2 "Default Configuration" "$3" # # Test MESH_BED_LEVELING feature, with LCD diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index 01ade82891e1..a968a5d21316 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -10,7 +10,7 @@ set -e # Build with the default configurations # #restore_configs -#exec_test $1 $2 "Default Configuration" +#exec_test $1 $2 "Default Configuration" "$3" # # Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders @@ -98,7 +98,7 @@ opt_set FIL_RUNOUT3_PIN 45 opt_set FIL_RUNOUT3_STATE HIGH opt_set FIL_RUNOUT4_PIN 46 opt_set FIL_RUNOUT5_PIN 47 -exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" +exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" "$3" # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features @@ -148,7 +148,7 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3" # #restore_configs #opt_enable COREXY -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # Test many less common options @@ -181,27 +181,27 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home # #restore_configs #opt_enable ULTRA_LCD -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # DOGLCD # #restore_configs #opt_enable DOGLCD -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # MAKRPANEL # Needs to use Melzi and Sanguino hardware # #restore_configs #opt_enable MAKRPANEL -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, BABYSTEPPING, RIGIDBOARD_V2, and DAC_MOTOR_CURRENT_DEFAULT # #restore_configs #opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2 #opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # # G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING # @@ -211,20 +211,20 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home #opt_set SDSORT_USES_RAM true #opt_set SDSORT_USES_STACK true #opt_set SDSORT_CACHE_NAMES true -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # REPRAPWORLD_KEYPAD # # Cant find configuration details to get it to compile #restore_configs #opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # RA_CONTROL_PANEL # #restore_configs #opt_enable RA_CONTROL_PANEL PINS_DEBUGGING -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" ######## I2C LCD/PANELS ############## # @@ -236,49 +236,49 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home # #restore_configs #opt_enable LCD_SAINSMART_I2C_1602 -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # LCD_I2C_PANELOLU2 # #restore_configs #opt_enable LCD_I2C_PANELOLU2 -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # LCD_I2C_VIKI # #restore_configs #opt_enable LCD_I2C_VIKI -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # LCM1602 # #restore_configs #opt_enable LCM1602 -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER # #restore_configs #opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT -#for lang in an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done +#for lang in an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff" "$3"; done # #restore_configs #opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT -#for lang in an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done +#for lang in an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff" "$3"; done ######## Example Configurations ############## # # Test a basic DUAL_X_CARRIAGE configuration # use_example_configs Formbot/T_Rex_3 -exec_test $1 $2 "Formbot/T_Rex_3 example configuration." +exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3" # # BQ Hephestos 2 #restore_configs #use_example_configs Hephestos_2 -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2 @@ -308,7 +308,7 @@ exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" "$3" # Makibox Config need to check board type for Teensy++ 2.0 # #use_example_configs makibox -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # # Test mixed TMC config @@ -346,7 +346,7 @@ exec_test $1 $2 "RAMPS | SCARA | Mixed TMC | EEPROM" "$3" # tvrrug Config need to check board type for sanguino atmega644p # #use_example_configs tvrrug/Round2 -#exec_test $1 $2 "Stuff" +#exec_test $1 $2 "Stuff" "$3" # clean up restore_configs diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index 69f370ea694f..391566f6d7c1 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -72,7 +72,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 TOUCH_SCREEN opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 TFT_COLOR_UI -exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI without TOUCH_SCREEN" +exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI without TOUCH_SCREEN" "$3" # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_nano35_stm32-tests b/buildroot/tests/mks_robin_nano35_stm32-tests index 58912b85a34c..696fb9406952 100644 --- a/buildroot/tests/mks_robin_nano35_stm32-tests +++ b/buildroot/tests/mks_robin_nano35_stm32-tests @@ -12,7 +12,7 @@ set -e # use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO -exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" +exec_test $1 $2 "MKS Robin nano v1.2 Emulated DOGM FSMC" "$3" # # MKS Robin v2 nano Emulated DOGM SPI @@ -22,7 +22,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC opt_enable TFT_INTERFACE_SPI -exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" +exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" "$3" # # MKS Robin nano v1.2 LVGL FSMC @@ -31,7 +31,7 @@ exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" # opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO # opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 # opt_enable TFT_LVGL_UI TFT_RES_480x320 -# exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" +# exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" "$3" # # MKS Robin v2 nano LVGL SPI @@ -41,7 +41,7 @@ exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" # opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 # opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 # opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 -# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" +# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI" "$3" # # MKS Robin v2 nano New Color UI 480x320 SPI @@ -51,7 +51,7 @@ use_example_configs Mks/Robin opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 -exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" +exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" "$3" # # MKS Robin v2 nano LVGL SPI + TMC @@ -63,7 +63,7 @@ exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI" # opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 # opt_set X_DRIVER_TYPE TMC2209 # opt_set Y_DRIVER_TYPE TMC2209 -# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" +# exec_test $1 $2 "MKS Robin v2 nano LVGL SPI + TMC" "$3" # cleanup restore_configs diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index 231a21747b00..6d2ef4f58a6d 100644 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -68,7 +68,7 @@ opt_set MOTHERBOARD BOARD_RAMBO opt_set EXTRUDERS 0 opt_set TEMP_SENSOR_BED 1 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -exec_test $1 $2 "Rambo heated bed only" +exec_test $1 $2 "Rambo heated bed only" "$3" # # Build with the default configurations diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 135891940e18..6829045496c0 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -48,13 +48,13 @@ exec_test $1 $2 "Sled Z Probe with Linear leveling" "$3" # opt_enable Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ # AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS # opt_set NUM_SERVOS 1 -# exec_test $1 $2 "Servo Probe" +# exec_test $1 $2 "Servo Probe" "$3" # # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # # opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS \ # EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES -# exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" +# exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" "$3" # # Test MAGNETIC_PARKING_EXTRUDER with no LCD @@ -84,7 +84,7 @@ exec_test $1 $2 "Mixing Extruder" "$3" # opt_set EXTRUDERS 2 # opt_set NUM_SERVOS 1 # opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER -# exec_test $1 $2 "SWITCHING_EXTRUDER" +# exec_test $1 $2 "SWITCHING_EXTRUDER" "$3" # # Enable COREXY From d8a3b9eb3a891258ef3ba75052b0f2ee78a167b9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 1 Nov 2020 20:30:58 -0600 Subject: [PATCH 220/443] Move core conditionals earlier --- Marlin/src/inc/Conditionals_LCD.h | 59 +++++++++++++++++++++++++----- Marlin/src/inc/Conditionals_post.h | 37 ------------------- 2 files changed, 49 insertions(+), 47 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 42a4e037d8c3..952ff2bbd6f9 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -26,16 +26,6 @@ * Conditionals that need to be set before Configuration_adv.h or pins.h */ -// Kinematics -#if ENABLED(MORGAN_SCARA) - #define IS_SCARA 1 - #define IS_KINEMATIC 1 -#elif ENABLED(DELTA) - #define IS_KINEMATIC 1 -#else - #define IS_CARTESIAN 1 -#endif - // MKS_LCD12864 is a variant of MKS_MINI_12864 #if ENABLED(MKS_LCD12864) #define MKS_MINI_12864 @@ -888,6 +878,55 @@ #define BOOT_MARLIN_LOGO_SMALL #endif +/** + * CoreXY, CoreXZ, and CoreYZ - and their reverse + */ +#if EITHER(COREXY, COREYX) + #define CORE_IS_XY 1 +#endif +#if EITHER(COREXZ, COREZX) + #define CORE_IS_XZ 1 +#endif +#if EITHER(COREYZ, COREZY) + #define CORE_IS_YZ 1 +#endif +#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ + #define IS_CORE 1 +#endif +#if IS_CORE + #if CORE_IS_XY + #define CORE_AXIS_1 A_AXIS + #define CORE_AXIS_2 B_AXIS + #define NORMAL_AXIS Z_AXIS + #elif CORE_IS_XZ + #define CORE_AXIS_1 A_AXIS + #define NORMAL_AXIS Y_AXIS + #define CORE_AXIS_2 C_AXIS + #elif CORE_IS_YZ + #define NORMAL_AXIS X_AXIS + #define CORE_AXIS_1 B_AXIS + #define CORE_AXIS_2 C_AXIS + #endif + #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n)) +#elif ENABLED(MARKFORGED_XY) + // Markforged kinematics + #define CORE_AXIS_1 A_AXIS + #define CORE_AXIS_2 B_AXIS + #define NORMAL_AXIS Z_AXIS +#endif + +#if ENABLED(MORGAN_SCARA) + #define IS_SCARA 1 + #define IS_KINEMATIC 1 +#elif ENABLED(DELTA) + #define IS_KINEMATIC 1 +#else + #define IS_CARTESIAN 1 + #if !IS_CORE + #define IS_FULL_CARTESIAN 1 + #endif +#endif + // This flag indicates some kind of jerk storage is needed #if EITHER(CLASSIC_JERK, IS_KINEMATIC) #define HAS_CLASSIC_JERK 1 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 994d83ffb3cb..4f4787855cbf 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -120,43 +120,6 @@ #endif #endif -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#if EITHER(COREXY, COREYX) - #define CORE_IS_XY 1 -#endif -#if EITHER(COREXZ, COREZX) - #define CORE_IS_XZ 1 -#endif -#if EITHER(COREYZ, COREZY) - #define CORE_IS_YZ 1 -#endif -#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ - #define IS_CORE 1 -#endif -#if IS_CORE - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS - #endif - #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n)) -#elif ENABLED(MARKFORGED_XY) - // Markforged kinematics - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS -#endif - // Calibration codes only for non-core axes #if EITHER(BACKLASH_GCODE, CALIBRATION_GCODE) #if EITHER(IS_CORE, MARKFORGED_XY) From 48b0abc3a887abcde2d1b33e936a31de24acb99d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 Nov 2020 23:00:17 -0600 Subject: [PATCH 221/443] Hide docker droppings --- buildroot/share/sublime/MarlinFirmware.sublime-project | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildroot/share/sublime/MarlinFirmware.sublime-project b/buildroot/share/sublime/MarlinFirmware.sublime-project index 1e9275f64623..e0cf953fa813 100644 --- a/buildroot/share/sublime/MarlinFirmware.sublime-project +++ b/buildroot/share/sublime/MarlinFirmware.sublime-project @@ -19,7 +19,8 @@ "Marlin/.gitignore", "Marlin/*/platformio.ini", "Marlin/*/.travis.yml", - "Marlin/*/.gitignore" + "Marlin/*/.gitignore", + "*.d" ], "path": "../../.." } From 315cb6d001a4c5a9f7ba30831f97565518a13ad9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 23 Nov 2020 00:11:32 +0000 Subject: [PATCH 222/443] [cron] Bump distribution date (2020-11-23) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 213b389e1635..73897eed0e17 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-22" + #define STRING_DISTRIBUTION_DATE "2020-11-23" #endif /** From 9dedd121bf789b5289380978979e2aed5ce58b38 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 22 Nov 2020 16:20:33 -0800 Subject: [PATCH 223/443] Fix UBL manual mesh adjust behavior (#20248) --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index e8524da36886..94bec99194b7 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -949,7 +949,7 @@ g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; + const float h_offset = parser.seenval('H') ? parser.value_linear_units() : MANUAL_PROBE_START_Z; if (!WITHIN(h_offset, 0, 10)) { SERIAL_ECHOLNPGM("Offset out of bounds. (0 to 10mm)\n"); return; @@ -970,8 +970,6 @@ do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset)); // Move Z to the given 'H' offset - MeshFlags done_flags{0}; const xy_int8_t &lpos = location.pos; do { From 6f272e13c5ce132c0bd7fdc2401ceadad5f3b06c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 Nov 2020 18:44:17 -0600 Subject: [PATCH 224/443] Allow Status Message without LCD (#20246) --- Marlin/src/gcode/temp/M303.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 4 + Marlin/src/lcd/marlinui.cpp | 213 ++++++++++++++++-------------- Marlin/src/lcd/marlinui.h | 47 +++---- 4 files changed, 143 insertions(+), 123 deletions(-) diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 52e34fc47357..a066ddc88df5 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -77,7 +77,7 @@ void GcodeSuite::M303() { KEEPALIVE_STATE(NOT_BUSY); #endif - ui.set_status_P(GET_TEXT(MSG_PID_AUTOTUNE)); + LCD_MESSAGEPGM(MSG_PID_AUTOTUNE); thermalManager.PID_autotune(temp, e, c, u); ui.reset_status(); } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 952ff2bbd6f9..9c080ee2869d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -472,6 +472,10 @@ #endif #endif +#if EITHER(HAS_DISPLAY, GLOBAL_STATUS_MESSAGE) + #define HAS_STATUS_MESSAGE 1 +#endif + #if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS) #define HAS_LCD_MENU 1 #endif diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index acf35afb1807..241d3a171213 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1332,59 +1332,16 @@ void MarlinUI::update() { #endif // HAS_WIRED_LCD -#if HAS_DISPLAY - - #if ENABLED(EXTENSIBLE_UI) - #include "extui/ui_api.h" - #endif +#if HAS_STATUS_MESSAGE //////////////////////////////////////////// - /////////////// Status Line //////////////// + ////////////// Status Message ////////////// //////////////////////////////////////////// - #if ENABLED(STATUS_MESSAGE_SCROLLING) - void MarlinUI::advance_status_scroll() { - // Advance by one UTF8 code-word - if (status_scroll_offset < utf8_strlen(status_message)) - while (!START_OF_UTF8_CHAR(status_message[++status_scroll_offset])); - else - status_scroll_offset = 0; - } - char* MarlinUI::status_and_len(uint8_t &len) { - char *out = status_message + status_scroll_offset; - len = utf8_strlen(out); - return out; - } + #if ENABLED(EXTENSIBLE_UI) + #include "extui/ui_api.h" #endif - void MarlinUI::finish_status(const bool persist) { - - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE) > 0) - UNUSED(persist); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - const millis_t ms = millis(); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL - progress_bar_ms = ms; - #if PROGRESS_MSG_EXPIRE > 0 - expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE; - #endif - #endif - - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) - next_filament_display = ms + 5000UL; // Show status message for 5s - #endif - - #if BOTH(HAS_WIRED_LCD, STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif - - TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); - } - bool MarlinUI::has_status() { return (status_message[0] != '\0'); } void MarlinUI::set_status(const char * const message, const bool persist) { @@ -1414,16 +1371,45 @@ void MarlinUI::update() { finish_status(persist); } - #include + /** + * Reset the status message + */ + void MarlinUI::reset_status(const bool no_welcome) { + #if SERVICE_INTERVAL_1 > 0 + static PGMSTR(service1, "> " SERVICE_NAME_1 "!"); + #endif + #if SERVICE_INTERVAL_2 > 0 + static PGMSTR(service2, "> " SERVICE_NAME_2 "!"); + #endif + #if SERVICE_INTERVAL_3 > 0 + static PGMSTR(service3, "> " SERVICE_NAME_3 "!"); + #endif + PGM_P msg; + if (printingIsPaused()) + msg = GET_TEXT(MSG_PRINT_PAUSED); + #if ENABLED(SDSUPPORT) + else if (IS_SD_PRINTING()) + return set_status(card.longest_filename(), true); + #endif + else if (print_job_timer.isRunning()) + msg = GET_TEXT(MSG_PRINTING); - void MarlinUI::status_printf_P(const uint8_t level, PGM_P const fmt, ...) { - if (level < alert_level) return; - alert_level = level; - va_list args; - va_start(args, fmt); - vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args); - va_end(args); - finish_status(level > 0); + #if SERVICE_INTERVAL_1 > 0 + else if (print_job_timer.needsService(1)) msg = service1; + #endif + #if SERVICE_INTERVAL_2 > 0 + else if (print_job_timer.needsService(2)) msg = service2; + #endif + #if SERVICE_INTERVAL_3 > 0 + else if (print_job_timer.needsService(3)) msg = service3; + #endif + + else if (!no_welcome) + msg = GET_TEXT(WELCOME_MSG); + else + return; + + set_status_P(msg, -1); } void MarlinUI::set_status_P(PGM_P const message, int8_t level) { @@ -1459,51 +1445,76 @@ void MarlinUI::update() { TERN_(HAS_LCD_MENU, return_to_status()); } - PGM_P print_paused = GET_TEXT(MSG_PRINT_PAUSED); + #include - /** - * Reset the status message - */ - void MarlinUI::reset_status(const bool no_welcome) { - PGM_P printing = GET_TEXT(MSG_PRINTING); - PGM_P welcome = GET_TEXT(WELCOME_MSG); - #if SERVICE_INTERVAL_1 > 0 - static PGMSTR(service1, "> " SERVICE_NAME_1 "!"); - #endif - #if SERVICE_INTERVAL_2 > 0 - static PGMSTR(service2, "> " SERVICE_NAME_2 "!"); - #endif - #if SERVICE_INTERVAL_3 > 0 - static PGMSTR(service3, "> " SERVICE_NAME_3 "!"); - #endif - PGM_P msg; - if (printingIsPaused()) - msg = print_paused; - #if ENABLED(SDSUPPORT) - else if (IS_SD_PRINTING()) - return set_status(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; + void MarlinUI::status_printf_P(const uint8_t level, PGM_P const fmt, ...) { + if (level < alert_level) return; + alert_level = level; + va_list args; + va_start(args, fmt); + vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args); + va_end(args); + finish_status(level > 0); + } - #if SERVICE_INTERVAL_1 > 0 - else if (print_job_timer.needsService(1)) msg = service1; - #endif - #if SERVICE_INTERVAL_2 > 0 - else if (print_job_timer.needsService(2)) msg = service2; - #endif - #if SERVICE_INTERVAL_3 > 0 - else if (print_job_timer.needsService(3)) msg = service3; - #endif + void MarlinUI::finish_status(const bool persist) { - else if (!no_welcome) - msg = welcome; - else - return; + #if HAS_SPI_LCD - set_status_P(msg, -1); + #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE) > 0) + UNUSED(persist); + #endif + + #if ENABLED(LCD_PROGRESS_BAR) || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + const millis_t ms = millis(); + #endif + + #if ENABLED(LCD_PROGRESS_BAR) + progress_bar_ms = ms; + #if PROGRESS_MSG_EXPIRE > 0 + expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE; + #endif + #endif + + #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + next_filament_display = ms + 5000UL; // Show status message for 5s + #endif + + #if ENABLED(STATUS_MESSAGE_SCROLLING) + status_scroll_offset = 0; + #endif + + #endif + + TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); } + #if ENABLED(STATUS_MESSAGE_SCROLLING) + + void MarlinUI::advance_status_scroll() { + // Advance by one UTF8 code-word + if (status_scroll_offset < utf8_strlen(status_message)) + while (!START_OF_UTF8_CHAR(status_message[++status_scroll_offset])); + else + status_scroll_offset = 0; + } + + char* MarlinUI::status_and_len(uint8_t &len) { + char *out = status_message + status_scroll_offset; + len = utf8_strlen(out); + return out; + } + + #endif + +#endif + +#if HAS_DISPLAY + + #if ENABLED(SDSUPPORT) + extern bool wait_for_user, wait_for_heatup; + #endif + void MarlinUI::abort_print() { #if ENABLED(SDSUPPORT) wait_for_heatup = wait_for_user = false; @@ -1514,7 +1525,7 @@ void MarlinUI::update() { #endif TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), DISMISS_STR)); print_job_timer.stop(); - set_status_P(GET_TEXT(MSG_PRINT_ABORTED)); + LCD_MESSAGEPGM(MSG_PRINT_ABORTED); TERN_(HAS_LCD_MENU, return_to_status()); } @@ -1530,7 +1541,7 @@ void MarlinUI::update() { TERN_(HOST_PROMPT_SUPPORT, host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume"))); - set_status_P(print_paused); + LCD_MESSAGEPGM(MSG_PRINT_PAUSED); #if ENABLED(PARK_HEAD_ON_PAUSE) TERN_(HAS_WIRED_LCD, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); // Show message immediately to let user know about pause in progress @@ -1615,6 +1626,10 @@ void MarlinUI::update() { #if ENABLED(SDSUPPORT) + #if ENABLED(EXTENSIBLE_UI) + #include "extui/ui_api.h" + #endif + void MarlinUI::media_changed(const uint8_t old_status, const uint8_t status) { if (old_status == status) { TERN_(EXTENSIBLE_UI, ExtUI::onMediaError()); // Failed to mount/unmount @@ -1629,7 +1644,7 @@ void MarlinUI::update() { quick_feedback(); goto_screen(MEDIA_MENU_GATEWAY); #else - set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); + LCD_MESSAGEPGM(MSG_MEDIA_INSERTED); #endif } } @@ -1637,7 +1652,7 @@ void MarlinUI::update() { if (old_status < 2) { TERN_(EXTENSIBLE_UI, ExtUI::onMediaRemoved()); // ExtUI response #if PIN_EXISTS(SD_DETECT) - set_status_P(GET_TEXT(MSG_MEDIA_REMOVED)); + LCD_MESSAGEPGM(MSG_MEDIA_REMOVED); #if HAS_LCD_MENU if (!defer_return_to_status) return_to_status(); #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 3311f55ed575..ccf995bd7131 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -373,17 +373,9 @@ class MarlinUI { static constexpr uint8_t get_progress_percent() { return 0; } #endif - #if HAS_DISPLAY - - static void init(); - static void update(); - static void set_alert_status_P(PGM_P const message); - + #if HAS_STATUS_MESSAGE static char status_message[]; - static bool has_status(); - static uint8_t alert_level; // Higher levels block lower levels - static inline void reset_alert_level() { alert_level = 0; } #if ENABLED(STATUS_MESSAGE_SCROLLING) static uint8_t status_scroll_offset; @@ -391,6 +383,28 @@ class MarlinUI { static char* status_and_len(uint8_t &len); #endif + static bool has_status(); + static void reset_status(const bool no_welcome=false); + static void set_status(const char* const message, const bool persist=false); + static void set_status_P(PGM_P const message, const int8_t level=0); + static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); + static void set_alert_status_P(PGM_P const message); + static inline void reset_alert_level() { alert_level = 0; } + #else + static constexpr bool has_status() { return false; } + static inline void reset_status(const bool=false) {} + static void set_status(const char* message, const bool=false); + static void set_status_P(PGM_P message, const int8_t=0); + static void status_printf_P(const uint8_t, PGM_P message, ...); + static inline void set_alert_status_P(PGM_P const) {} + static inline void reset_alert_level() {} + #endif + + #if HAS_DISPLAY + + static void init(); + static void update(); + static void abort_print(); static void pause_print(); static void resume_print(); @@ -481,25 +495,12 @@ class MarlinUI { static bool get_blink(); static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component); static void draw_kill_screen(); - static void set_status(const char* const message, const bool persist=false); - static void set_status_P(PGM_P const message, const int8_t level=0); - static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); - static void reset_status(const bool no_welcome=false); #else // No LCD - // Send status to host as a notification - static void set_status(const char* message, const bool=false); - static void set_status_P(PGM_P message, const int8_t=0); - static void status_printf_P(const uint8_t, PGM_P message, ...); - static inline void init() {} static inline void update() {} static inline void return_to_status() {} - static inline void set_alert_status_P(PGM_P const) {} - static inline void reset_status(const bool=false) {} - static inline void reset_alert_level() {} - static constexpr bool has_status() { return false; } #endif @@ -702,7 +703,7 @@ class MarlinUI { private: - #if HAS_DISPLAY + #if HAS_STATUS_MESSAGE static void finish_status(const bool persist); #endif From 58eaad703a5e369ab3bf6a1d325b8775d89ede0d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 22 Nov 2020 16:47:52 -0800 Subject: [PATCH 225/443] Fix dummy thermistors for Bed, Chamber, Probe (#20247) --- Marlin/src/inc/Conditionals_post.h | 15 +++++++++++---- Marlin/src/module/temperature.cpp | 18 +++++++++--------- Marlin/src/module/temperature.h | 6 +++--- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 4f4787855cbf..35fd92e10b76 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1774,12 +1774,19 @@ #define HAS_TEMP_ADC_CHAMBER 1 #endif -#if HAS_HOTEND && ANY(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675, HEATER_0_DUMMY_THERMISTOR) +#define HAS_TEMP(N) ANY(HAS_TEMP_ADC_##N, HEATER_##N##_USES_MAX6675, HEATER_##N##_DUMMY_THERMISTOR) +#if HAS_HOTEND && HAS_TEMP(0) #define HAS_TEMP_HOTEND 1 #endif -#define HAS_TEMP_BED HAS_TEMP_ADC_BED -#define HAS_TEMP_PROBE HAS_TEMP_ADC_PROBE -#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER +#if HAS_TEMP(BED) + #define HAS_TEMP_BED 1 +#endif +#if HAS_TEMP(PROBE) + #define HAS_TEMP_PROBE 1 +#endif +#if HAS_TEMP(CHAMBER) + #define HAS_TEMP_CHAMBER 1 +#endif #if ENABLED(JOYSTICK) #if PIN_EXISTS(JOY_X) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d9ce6e151e62..d704ebc85bfd 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1839,13 +1839,13 @@ void Temperature::init() { #if HAS_JOY_ADC_EN SET_INPUT_PULLUP(JOY_EN_PIN); #endif - #if HAS_HEATED_BED + #if HAS_TEMP_ADC_BED HAL_ANALOG_SELECT(TEMP_BED_PIN); #endif - #if HAS_TEMP_CHAMBER + #if HAS_TEMP_ADC_CHAMBER HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); #endif - #if HAS_TEMP_PROBE + #if HAS_TEMP_ADC_PROBE HAL_ANALOG_SELECT(TEMP_PROBE_PIN); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -2355,9 +2355,9 @@ void Temperature::update_raw_temperatures() { TERN_(HAS_TEMP_ADC_5, temp_hotend[5].update()); TERN_(HAS_TEMP_ADC_6, temp_hotend[6].update()); TERN_(HAS_TEMP_ADC_7, temp_hotend[7].update()); - TERN_(HAS_HEATED_BED, temp_bed.update()); - TERN_(HAS_TEMP_CHAMBER, temp_chamber.update()); - TERN_(HAS_TEMP_PROBE, temp_probe.update()); + TERN_(HAS_TEMP_ADC_BED, temp_bed.update()); + TERN_(HAS_TEMP_ADC_CHAMBER, temp_chamber.update()); + TERN_(HAS_TEMP_ADC_PROBE, temp_probe.update()); TERN_(HAS_JOY_ADC_X, joystick.x.update()); TERN_(HAS_JOY_ADC_Y, joystick.y.update()); @@ -2822,17 +2822,17 @@ void Temperature::tick() { case MeasureTemp_0: ACCUMULATE_ADC(temp_hotend[0]); break; #endif - #if HAS_HEATED_BED + #if HAS_TEMP_ADC_BED case PrepareTemp_BED: HAL_START_ADC(TEMP_BED_PIN); break; case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break; #endif - #if HAS_TEMP_CHAMBER + #if HAS_TEMP_ADC_CHAMBER case PrepareTemp_CHAMBER: HAL_START_ADC(TEMP_CHAMBER_PIN); break; case MeasureTemp_CHAMBER: ACCUMULATE_ADC(temp_chamber); break; #endif - #if HAS_TEMP_PROBE + #if HAS_TEMP_ADC_PROBE case PrepareTemp_PROBE: HAL_START_ADC(TEMP_PROBE_PIN); break; case MeasureTemp_PROBE: ACCUMULATE_ADC(temp_probe); break; #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index edaa1c53843a..33f38c303608 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -89,13 +89,13 @@ enum ADCSensorState : char { #if HAS_TEMP_ADC_0 PrepareTemp_0, MeasureTemp_0, #endif - #if HAS_HEATED_BED + #if HAS_TEMP_ADC_BED PrepareTemp_BED, MeasureTemp_BED, #endif - #if HAS_TEMP_CHAMBER + #if HAS_TEMP_ADC_CHAMBER PrepareTemp_CHAMBER, MeasureTemp_CHAMBER, #endif - #if HAS_TEMP_PROBE + #if HAS_TEMP_ADC_PROBE PrepareTemp_PROBE, MeasureTemp_PROBE, #endif #if HAS_TEMP_ADC_1 From a4e1132048ae980185c87b9bcee58fa87ad8fd36 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 23 Nov 2020 03:07:43 -0800 Subject: [PATCH 226/443] Fix Z4 in ENABLE/DISABLE_AXIS_Z (#20256) This was accidentally broken in PR #20218 --- Marlin/src/module/stepper/indirection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 04cebc216fec..d14bfc7329c8 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -859,8 +859,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define DISABLE_AXIS_X() if (SHOULD_DISABLE(x)) { DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); AFTER_CHANGE(x, false); FORGET_AXIS(X_AXIS); } #define ENABLE_AXIS_Y() if (SHOULD_ENABLE(y)) { ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); AFTER_CHANGE(y, true); } #define DISABLE_AXIS_Y() if (SHOULD_DISABLE(y)) { DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); AFTER_CHANGE(y, false); FORGET_AXIS(Y_AXIS); } -#define ENABLE_AXIS_Z() if (SHOULD_ENABLE(z)) { ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); AFTER_CHANGE(z, true); } -#define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); AFTER_CHANGE(z, false); FORGET_AXIS(Z_AXIS); Z_RESET(); } +#define ENABLE_AXIS_Z() if (SHOULD_ENABLE(z)) { ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); ENABLE_STEPPER_Z4(); AFTER_CHANGE(z, true); } +#define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); AFTER_CHANGE(z, false); FORGET_AXIS(Z_AXIS); Z_RESET(); } #define FORGET_AXIS(A) TERN(HOME_AFTER_DEACTIVATE, set_axis_never_homed(A), CBI(axis_known_position, A)) From 94fea59e9d37c4117a844538b9a618e686b13dd1 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 24 Nov 2020 00:11:40 +0000 Subject: [PATCH 227/443] [cron] Bump distribution date (2020-11-24) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 73897eed0e17..b8f5b8678ba4 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-23" + #define STRING_DISTRIBUTION_DATE "2020-11-24" #endif /** From 62680bb356b4449661145ecbd6978d286c639a23 Mon Sep 17 00:00:00 2001 From: rdhoggattjr <64983896+rdhoggattjr@users.noreply.github.com> Date: Mon, 23 Nov 2020 23:02:54 -0600 Subject: [PATCH 228/443] LCD position in current units (#20145) --- Marlin/src/gcode/host/M114.cpp | 7 +-- Marlin/src/gcode/parser.h | 4 ++ Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 35 ++++++++++---- Marlin/src/lcd/language/language_en.h | 3 ++ Marlin/src/lcd/menu/menu_motion.cpp | 55 +++++++++++++--------- 5 files changed, 69 insertions(+), 35 deletions(-) diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 85a38f6462a8..75356ff66fee 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -55,7 +55,6 @@ } void report_current_position_detail() { - // Position as sent by G-code SERIAL_ECHOPGM("\nLogical:"); report_xyz(current_position.asLogical()); @@ -81,11 +80,7 @@ #if IS_KINEMATIC // Kinematics applied to the leveled position - #if IS_SCARA - SERIAL_ECHOPGM("ScaraK: "); - #else - SERIAL_ECHOPGM("DeltaK: "); - #endif + SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: ")); inverse_kinematics(leveled); // writes delta[] report_xyz(delta); #endif diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 69bbdaf02d39..8633d2b1e9db 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -329,6 +329,10 @@ class GCodeParser { #endif + static inline 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) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 9fef6258268c..882b2fef506a 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -38,10 +38,11 @@ #include "../../module/motion.h" #include "../../module/temperature.h" +#include "../../gcode/parser.h" // for units (and volumetric) + #if ENABLED(FILAMENT_LCD_DISPLAY) #include "../../feature/filwidth.h" #include "../../module/planner.h" - #include "../../gcode/parser.h" #endif #if HAS_CUTTER @@ -67,6 +68,11 @@ #define X_LABEL_POS 3 #define X_VALUE_POS 11 #define XYZ_SPACING 37 + +#define X_LABEL_POS_IN (X_LABEL_POS - 2) +#define X_VALUE_POS_IN (X_VALUE_POS - 5) +#define XYZ_SPACING_IN (XYZ_SPACING + 9) + #define XYZ_BASELINE (30 + INFO_FONT_ASCENT) #define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT) #define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) @@ -370,10 +376,12 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons // Homed and known, display constantly. // FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { + const bool is_inch = parser.using_inch_units(); const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis); - const uint8_t offs = (XYZ_SPACING) * a; - lcd_put_wchar(X_LABEL_POS + offs, XYZ_BASELINE, axis_codes[axis]); - lcd_moveto(X_VALUE_POS + offs, XYZ_BASELINE); + const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING); + lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]); + lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE); + if (blink) lcd_put_u8str(value); else { @@ -390,9 +398,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } } +/** + * Draw the Status Screen for a 128x64 DOGM (U8glib) display. + * + * Called as needed to update the current display stripe. + * Use the PAGE_CONTAINS macros to avoid pointless draw calls. + */ void MarlinUI::draw_status_screen() { + constexpr int xystorage = TERN(INCH_MODE_SUPPORT, 8, 5); + static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, xystorage)], ystring[xystorage], zstring[8]; - static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, 5)], ystring[5], zstring[8]; #if ENABLED(FILAMENT_LCD_DISPLAY) static char wstring[5], mstring[4]; #endif @@ -439,7 +454,8 @@ void MarlinUI::draw_status_screen() { #endif const xyz_pos_t lpos = current_position.asLogical(); - strcpy(zstring, ftostr52sp(lpos.z)); + const bool is_inch = parser.using_inch_units(); + strcpy(zstring, is_inch ? ftostr42_52(LINEAR_UNIT(lpos.z)) : ftostr52sp(lpos.z)); if (show_e_total) { #if ENABLED(LCD_SHOW_E_TOTAL) @@ -448,8 +464,8 @@ void MarlinUI::draw_status_screen() { #endif } else { - strcpy(xstring, ftostr4sign(lpos.x)); - strcpy(ystring, ftostr4sign(lpos.y)); + strcpy(xstring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.x)) : ftostr4sign(lpos.x)); + strcpy(ystring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.y)) : ftostr4sign(lpos.y)); } #if ENABLED(FILAMENT_LCD_DISPLAY) @@ -854,6 +870,9 @@ void MarlinUI::draw_status_screen() { } } +/** + * Draw the Status Message area + */ void MarlinUI::draw_status_message(const bool blink) { // Get the UTF8 character count of the string diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 0355f2f51249..04487fa13f27 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -258,6 +258,9 @@ namespace Language_en { PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm"); + PROGMEM Language_Str MSG_MOVE_0001IN = _UxGT("Move 0.001in"); + PROGMEM Language_Str MSG_MOVE_001IN = _UxGT("Move 0.01in"); + PROGMEM Language_Str MSG_MOVE_01IN = _UxGT("Move 0.1in"); PROGMEM Language_Str MSG_SPEED = _UxGT("Speed"); PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index c681842e903d..468af3273c18 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -32,6 +32,7 @@ #include "menu_addon.h" #include "../../module/motion.h" +#include "../../gcode/parser.h" // for inch support #if ENABLED(DELTA) #include "../../module/delta.h" @@ -95,7 +96,12 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { ui.manual_move.processing ? destination[axis] : current_position[axis] + TERN0(IS_KINEMATIC, ui.manual_move.offset), axis ); - MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr63(pos)); + if (parser.using_inch_units()) { + const float imp_pos = LINEAR_UNIT(pos); + MenuEditItemBase::draw_edit_screen(name, ftostr63(imp_pos)); + } + else + MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr63(pos)); } } void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } @@ -165,26 +171,33 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int } BACK_ITEM(MSG_MOVE_AXIS); - SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); - SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); - SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); - if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { - // Determine digits needed right of decimal - constexpr uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; - PGM_P const label = GET_TEXT(MSG_MOVE_Z_DIST); - char tmp[strlen_P(label) + 10 + 1], numstr[10]; - sprintf_P(tmp, label, dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); - - #if DISABLED(HAS_GRAPHICAL_TFT) - extern const char NUL_STR[]; - SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_P(tmp, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); - #endif + if (parser.using_inch_units()) { + SUBMENU(MSG_MOVE_01IN, []{ _goto_manual_move(IN_TO_MM(0.100f)); }); + SUBMENU(MSG_MOVE_001IN, []{ _goto_manual_move(IN_TO_MM(0.010f)); }); + SUBMENU(MSG_MOVE_0001IN, []{ _goto_manual_move(IN_TO_MM(0.001f)); }); + } + else { + SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); + SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); + SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); + if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { + // Determine digits needed right of decimal + constexpr uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : + !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; + PGM_P const label = GET_TEXT(MSG_MOVE_Z_DIST); + char tmp[strlen_P(label) + 10 + 1], numstr[10]; + sprintf_P(tmp, label, dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + + #if DISABLED(HAS_GRAPHICAL_TFT) + extern const char NUL_STR[]; + SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); + lcd_put_u8str(tmp); + MENU_ITEM_ADDON_END(); + #else + SUBMENU_P(tmp, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + #endif + } } END_MENU(); } From ef12425befc39fbb6ecedfc1b2db278ca43f86c9 Mon Sep 17 00:00:00 2001 From: ellensp Date: Wed, 25 Nov 2020 11:14:22 +1300 Subject: [PATCH 229/443] Set "lcd_move_e" index to fix the label (#20263) --- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 468af3273c18..478608e9b313 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -205,7 +205,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int #if E_MANUAL inline void _goto_menu_move_distance_e() { - ui.goto_screen([]{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); }); + ui.goto_screen([]{ _menu_move_distance(E_AXIS, []{ lcd_move_e(TERN_(MULTI_MANUAL, active_extruder)); }, -1); }); } inline void _menu_move_distance_e_maybe() { From 4258ff1a689705e1c002d354a17a6fc2f6b2564f Mon Sep 17 00:00:00 2001 From: pseudex Date: Tue, 24 Nov 2020 23:20:06 +0100 Subject: [PATCH 230/443] Allow cold Filament Load/Unload with M302 P1 (#20262) Co-authored-by: Scott Lahteine --- Marlin/src/feature/pause.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 024338f2422e..1593b0cc572e 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -142,10 +142,10 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P #endif UNUSED(mode); - if (wait) - return thermalManager.wait_for_hotend(active_extruder); + if (wait) return thermalManager.wait_for_hotend(active_extruder); - wait_for_heatup = true; // Allow interruption by Emergency Parser M108 + // Allow interruption by Emergency Parser M108 + wait_for_heatup = TERN1(PREVENT_COLD_EXTRUSION, !thermalManager.allow_cold_extrude); while (wait_for_heatup && ABS(thermalManager.degHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > TEMP_WINDOW) idle(); wait_for_heatup = false; From e9431b5445e23ebef657a90a25fce2b424511c17 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 24 Nov 2020 14:27:59 -0800 Subject: [PATCH 231/443] No Z_MULTI_ENDSTOPS when HOMING_Z_WITH_PROBE (#20254) --- Marlin/src/inc/SanityCheck.h | 2 ++ buildroot/tests/DUE-tests | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 072bb26bfe7a..0dfa3058411c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2006,6 +2006,8 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "Enable USE_ZMIN_PLUG when homing Z to MIN." #elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING) #error "Z_HOME_DIR must be -1 when homing Z with the probe." +#elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS) + #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING." #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG) #error "Enable USE_ZMAX_PLUG when homing Z to MAX." #endif diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index ccb49bf4828b..009688ce210f 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -41,14 +41,9 @@ exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options restore_configs opt_set MOTHERBOARD BOARD_RADDS opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ - Z_MULTI_ENDSTOPS Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS \ - Z_SAFE_HOMING + Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS Z_SAFE_HOMING #TOUCH_UI_FTDI_EVE LCD_ALEPHOBJECTS_CLCD_UI OTHER_PIN_LAYOUT opt_set NUM_Z_STEPPER_DRIVERS 3 -opt_add Z2_MAX_ENDSTOP_INVERTING false -opt_add Z3_MAX_ENDSTOP_INVERTING false -opt_add Z2_MAX_PIN 2 -opt_add Z3_MAX_PIN 3 pins_set ramps/RAMPS X_MAX_PIN -1 pins_set ramps/RAMPS Y_MAX_PIN -1 exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN" "$3" From 296a2ad7e45d88a10db4b3305ea183e5c0c177a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Nov 2020 17:38:13 -0600 Subject: [PATCH 232/443] Consistent Probe XY offset type --- Marlin/src/gcode/calibrate/G76_M192_M871.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/probe.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp index 38f17869fb45..8ffada5c0310 100644 --- a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp @@ -144,7 +144,7 @@ void GcodeSuite::G76() { const xyz_pos_t parkpos = temp_comp.park_point, probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }), - noz_pos_xyz = probe_pos_xyz - xy_pos_t(probe.offset_xy); // Nozzle position based on probe position + noz_pos_xyz = probe_pos_xyz - probe.offset_xy; // Nozzle position based on probe position if (do_bed_cal || do_probe_cal) { // Ensure park position is reachable diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index ff80063d658d..f02b90915063 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -89,7 +89,7 @@ Probe probe; xyz_pos_t Probe::offset; // Initialized by settings.load() #if HAS_PROBE_XY_OFFSET - const xyz_pos_t &Probe::offset_xy = Probe::offset; + const xy_pos_t &Probe::offset_xy = xy_pos_t(Probe::offset); #endif #if ENABLED(Z_PROBE_SLED) diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 63229242b5da..cac106fed681 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -112,9 +112,9 @@ class Probe { FORCE_INLINE static bool good_bounds(const xy_pos_t &lf, const xy_pos_t &rb) { return ( #if IS_KINEMATIC - can_reach(lf.x, 0) && can_reach(rb.x, 0) && can_reach(0, lf.y) && can_reach(0, rb.y) + can_reach(lf.x, 0) && can_reach(rb.x, 0) && can_reach(0, lf.y) && can_reach(0, rb.y) #else - can_reach(lf) && can_reach(rb) + can_reach(lf) && can_reach(rb) #endif ); } @@ -122,7 +122,7 @@ class Probe { // Use offset_xy for read only access // More optimal the XY offset is known to always be zero. #if HAS_PROBE_XY_OFFSET - static const xyz_pos_t &offset_xy; + static const xy_pos_t &offset_xy; #else static constexpr xy_pos_t offset_xy = xy_pos_t({ 0, 0 }); // See #16767 #endif From b28b2ca26674219d6654cd287bb9da30c91b2231 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Nov 2020 17:53:26 -0600 Subject: [PATCH 233/443] Cosmetic G29 ABL tweak --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index f387dd9bd814..9999d92e223b 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -656,8 +656,9 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - z_values[meshCount.x][meshCount.y] = measured_z + zoffset; - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y])); + const float z = measured_z + zoffset; + z_values[meshCount.x][meshCount.y] = z; + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(meshCount, z)); #endif From 0eae28a6637ad5f3b960a5b7c6fdd4bed3b1e6d3 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 25 Nov 2020 00:11:42 +0000 Subject: [PATCH 234/443] [cron] Bump distribution date (2020-11-25) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b8f5b8678ba4..4007c237e306 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-24" + #define STRING_DISTRIBUTION_DATE "2020-11-25" #endif /** From e38abef720c419262b89b21467857565aa10ebdf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Nov 2020 18:29:11 -0600 Subject: [PATCH 235/443] Update TOUCH_UI_LULZBOT_BIO wrappers --- .../screens/advanced_settings_menu.cpp | 5 +-- .../screens/bio_advanced_settings.cpp | 4 +-- .../screens/bio_confirm_home_e.cpp | 5 +-- .../screens/bio_confirm_home_xyz.cpp | 5 +-- .../screens/bio_main_menu.cpp | 4 +-- .../screens/bio_printing_dialog_box.cpp | 10 ++---- .../screens/bio_tune_menu.cpp | 4 +-- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 32 ++++--------------- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 2 +- 9 files changed, 25 insertions(+), 46 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 1b7d04331459..3ffc88c385fb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) +#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -152,4 +152,5 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { } return true; } -#endif // TOUCH_UI_FTDI_EVE + +#endif // TOUCH_UI_FTDI_EVE && !TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp index b2611be2509e..196f26fe22b2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -134,4 +134,4 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // TOUCH_UI_FTDI_EVE +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp index 85885fb38837..3f6b4116f189 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -53,4 +53,5 @@ bool BioConfirmHomeE::onTouchEnd(uint8_t tag) { } return true; } -#endif // TOUCH_UI_FTDI_EVE + +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp index 102631f18ed3..f712fdfff9ab 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -52,4 +52,5 @@ bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) { } return true; } -#endif // TOUCH_UI_FTDI_EVE + +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp index 5ddc2d02aea1..dacbaf686642 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -85,4 +85,4 @@ bool MainMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // TOUCH_UI_FTDI_EVE +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp index fc6dc5ee57bd..38426377034e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -78,11 +78,7 @@ void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) { .font(font_medium) .colors(isPrinting() ? action_btn : normal_btn) .tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu")) - #if ENABLED(SDSUPPORT) - .enabled(isPrinting() ? isPrintingFromMedia() : 1) - #else - .enabled(isPrinting() ? 0 : 1) - #endif + .enabled(isPrinting() ? TERN0(SDSUPPORT, isPrintingFromMedia()) : 1) .tag(3) .colors(isPrinting() ? normal_btn : action_btn) .button( BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); @@ -152,4 +148,4 @@ void BioPrintingDialogBox::show() { GOTO_SCREEN(BioPrintingDialogBox); } -#endif // TOUCH_UI_FTDI_EVE +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp index 9723abba0998..ceea3742b0d6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -76,4 +76,4 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // TOUCH_UI_FTDI_EVE +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 17e15afc5ccd..85006566bb18 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -23,7 +23,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) +#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) #include "screens.h" @@ -75,34 +75,14 @@ void MainMenu::onRedraw(draw_mode_t what) { 1 #endif ) - .tag(3).button( CLEAN_NOZZLE_POS, GET_TEXT_F( - #if ENABLED(TOUCH_UI_COCOA_PRESS) - MSG_PREHEAT_1 - #else - MSG_CLEAN_NOZZLE - #endif - )) + .tag(3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_PREHEAT_1, MSG_CLEAN_NOZZLE))) .tag(4).button( MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) .tag(5).button( DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) .tag(6).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) - .enabled( - #if DISABLED(TOUCH_UI_LULZBOT_BIO) - 1 - #endif - ) - .tag(7).button( FILAMENTCHANGE_POS, GET_TEXT_F( - #if ENABLED(TOUCH_UI_COCOA_PRESS) - MSG_CASE_LIGHT - #else - MSG_FILAMENTCHANGE - #endif - )) + .enabled(IF_DISABLED(TOUCH_UI_LULZBOT_BIO, 1)) + .tag(7).button( FILAMENTCHANGE_POS, GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_CASE_LIGHT, MSG_FILAMENTCHANGE)) .tag(8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .enabled( - #ifdef HAS_LEVELING - 1 - #endif - ) + .enabled(TERN_(HAS_LEVELING, 1)) .tag(9).button( LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) @@ -140,4 +120,4 @@ bool MainMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // TOUCH_UI_FTDI_EVE +#endif // TOUCH_UI_FTDI_EVE && !TOUCH_UI_LULZBOT_BIO diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 894b238ae01e..10cbb8af5333 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) +#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) #include "screens.h" From 2693e35caead85de734735c852de52bebbdc818b Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 25 Nov 2020 01:08:35 -0300 Subject: [PATCH 236/443] add missing header to use HAS_SD_HOST_DRIVE (#20270) --- Marlin/src/HAL/STM32F1/msc_sd.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/HAL/STM32F1/msc_sd.cpp b/Marlin/src/HAL/STM32F1/msc_sd.cpp index 44242358eeb8..ba722b8aebfe 100644 --- a/Marlin/src/HAL/STM32F1/msc_sd.cpp +++ b/Marlin/src/HAL/STM32F1/msc_sd.cpp @@ -13,6 +13,8 @@ * along with this program. If not, see . * */ +#include "../../inc/MarlinConfigPre.h" + #if defined(__STM32F1__) && HAS_SD_HOST_DRIVE #include "msc_sd.h" From 04c4c6004e752582235357b14aebdd5ff579f477 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 25 Nov 2020 02:39:49 -0300 Subject: [PATCH 237/443] Fix COLOR_UI without TOUCH_SCREEN_CALIBRATION (#20269) --- Marlin/src/lcd/tft_io/tft_io.h | 8 ++++++++ Marlin/src/lcd/tft_io/touch_calibration.h | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 63d6936ac0b8..50b0ce446383 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -71,6 +71,14 @@ // #define TFT_COLOR TFT_COLOR_RGB // #endif +#define TOUCH_ORIENTATION_NONE 0 +#define TOUCH_LANDSCAPE 1 +#define TOUCH_PORTRAIT 2 + +#ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE +#endif + #define SSD1963 0x5761 #define ST7735 0x89F0 #define ST7789 0x8552 diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h index 5bebafffd250..93ed9aa6099a 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.h +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -19,6 +19,7 @@ #pragma once #include "../../inc/MarlinConfigPre.h" +#include "tft_io.h" #ifndef TOUCH_SCREEN_CALIBRATION_PRECISION #define TOUCH_SCREEN_CALIBRATION_PRECISION 80 @@ -28,14 +29,6 @@ #define TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS 2500 #endif -#define TOUCH_ORIENTATION_NONE 0 -#define TOUCH_LANDSCAPE 1 -#define TOUCH_PORTRAIT 2 - -#ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE -#endif - typedef struct __attribute__((__packed__)) { int32_t x, y; int16_t offset_x, offset_y; From afe5027a399b10d9acbc469c5af87e0717f0a90c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 26 Nov 2020 00:11:33 +0000 Subject: [PATCH 238/443] [cron] Bump distribution date (2020-11-26) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4007c237e306..5fb065dc35d8 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-25" + #define STRING_DISTRIBUTION_DATE "2020-11-26" #endif /** From 649965ae32eca5140ea66d1265a69576e2a2c669 Mon Sep 17 00:00:00 2001 From: swissnorp <67485708+swissnorp@users.noreply.github.com> Date: Thu, 26 Nov 2020 04:38:00 +0100 Subject: [PATCH 239/443] Probe Offset Wizard improvements (#20239) --- Marlin/Configuration_adv.h | 10 +- Marlin/src/gcode/calibrate/G28.cpp | 4 +- Marlin/src/inc/SanityCheck.h | 33 ++++--- Marlin/src/lcd/language/language_en.h | 2 + Marlin/src/lcd/marlinui.h | 2 +- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 114 ++++++++++++++-------- 8 files changed, 109 insertions(+), 60 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index baa0433f19b9..7c8f2da948c6 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1084,8 +1084,14 @@ #if HAS_BED_PROBE //#define PROBE_OFFSET_WIZARD #if ENABLED(PROBE_OFFSET_WIZARD) - #define PROBE_OFFSET_START -4.0 // Estimated nozzle-to-probe Z offset, plus a little extra - //#define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER // Set a convenient position to do the measurement + // + // Enable to init the Probe Z-Offset when starting the Wizard. + // Use the estimated nozzle-to-probe Z offset, plus a little more. + // + //#define PROBE_OFFSET_WIZARD_START_Z -4.0 + + // Set a convenient position to do the calibration (probing point and nozzle/bed-distance) + //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER } #endif #endif diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index c0bc179869e2..c4effe7d58b8 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -324,7 +324,7 @@ void GcodeSuite::G28() { ? 0 : (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT); - if (z_homing_height && (doX || doY || (ENABLED(Z_SAFE_HOMING) && doZ))) { + if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) { // Raise Z before homing any other axes and z is not already high enough (never lower z) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height); do_z_clearance(z_homing_height, true, DISABLED(UNKNOWN_Z_NO_RAISE)); @@ -337,7 +337,7 @@ void GcodeSuite::G28() { #endif // Home Y (before X) - if (ENABLED(HOME_Y_BEFORE_X) && (doY || (ENABLED(CODEPENDENT_XY_HOMING) && doX))) + if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX))) homeaxis(Y_AXIS); // Home X diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0dfa3058411c..9f4c10dd53e1 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -525,6 +525,8 @@ #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT." #elif defined(GRAPHICAL_TFT_ROTATE_180) #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180." +#elif defined(PROBE_OFFSET_START) + #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z." #elif defined(POWER_LOSS_PULL) #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)." #elif defined(FIL_RUNOUT_INVERTING) @@ -1345,25 +1347,32 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled." #endif + /** + * Check for improper NOZZLE_TO_PROBE_OFFSET + */ + constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; #if ENABLED(NOZZLE_AS_PROBE) - constexpr float sanity_nozzle_to_probe_offset[] = NOZZLE_TO_PROBE_OFFSET; - static_assert(sanity_nozzle_to_probe_offset[0] == 0.0 && sanity_nozzle_to_probe_offset[1] == 0.0, - "NOZZLE_AS_PROBE requires the X,Y offsets in NOZZLE_TO_PROBE_OFFSET to be 0,0."); - #endif - - #if DISABLED(NOZZLE_AS_PROBE) - static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); - static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); + static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, + "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); + #else + static_assert(sanity_nozzle_to_probe_offset.z <= 0.25, + "Are you sure your Probe triggers above the nozzle? Set a negative Z value in the NOZZLE_TO_PROBE_OFFSET."); + #ifdef PROBE_OFFSET_WIZARD_START_Z + static_assert(PROBE_OFFSET_WIZARD_START_Z <= 0.25, + "Are you sure your Probe triggers above the nozzle? Set a negative value for PROBE_OFFSET_WIZARD_START_Z."); + #endif + static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); + static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); - static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0."); + static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0."); static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0."); #endif #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))) - static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large."); - static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large."); + static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large."); + static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large."); static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large."); - static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large."); + static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large."); static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large."); #undef _MARGIN diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 04487fa13f27..af0903b91612 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -673,6 +673,8 @@ namespace Language_en { PROGMEM Language_Str MSG_REHEATING = _UxGT("Reheating..."); PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z Probe Wizard"); + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Probing Z Reference"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Moving to Probing Pos"); PROGMEM Language_Str MSG_SOUND = _UxGT("Sound"); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index ccf995bd7131..8e968abda0af 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -624,7 +624,7 @@ class MarlinUI { // // Special handling if a move is underway // - #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) || (ENABLED(PROBE_OFFSET_WIZARD) && defined(PROBE_OFFSET_WIZARD_XY_POS)) + #if ANY(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION, PROBE_OFFSET_WIZARD) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) #define LCD_HAS_WAIT_FOR_MOVE 1 static bool wait_for_move; #else diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 5782d2070a15..cf2f6b163379 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -220,7 +220,7 @@ void _lcd_draw_homing(); #endif #if ENABLED(PROBE_OFFSET_WIZARD) - void home_and_goto_probe_offset_wizard(); + void goto_probe_offset_wizard(); #endif #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 268573beb028..3f2a6da11b50 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -488,7 +488,7 @@ void menu_backlash(); EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #if ENABLED(PROBE_OFFSET_WIZARD) - SUBMENU(MSG_PROBE_WIZARD, home_and_goto_probe_offset_wizard); + SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 9f215500982d..f2b08afd79aa 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -28,12 +28,6 @@ #if ENABLED(PROBE_OFFSET_WIZARD) -#ifndef PROBE_OFFSET_START - #error "PROBE_OFFSET_WIZARD requires a PROBE_OFFSET_START with a negative value." -#else - static_assert(PROBE_OFFSET_START < 0, "PROBE_OFFSET_START must be < 0. Please update your configuration."); -#endif - #include "menu_item.h" #include "menu_addon.h" #include "../../gcode/queue.h" @@ -46,21 +40,20 @@ #endif // Global storage -float z_offset_backup, calculated_z_offset; +float z_offset_backup, calculated_z_offset, z_offset_ref; TERN_(HAS_LEVELING, bool leveling_was_active); -void prepare_for_calibration() { - z_offset_backup = probe.offset.z; - - // Disable soft endstops for free Z movement - SET_SOFT_ENDSTOP_LOOSE(true); - - // Disable leveling for raw planner motion - #if HAS_LEVELING - leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif +inline void z_clearance_move() { + do_z_clearance( + #ifdef Z_AFTER_HOMING + Z_AFTER_HOMING + #elif defined(Z_HOMING_HEIGHT) + Z_HOMING_HEIGHT + #else + 10 + #endif + ); } void set_offset_and_go_back(const float &z) { @@ -77,7 +70,7 @@ void _goto_manual_move_z(const float scale) { void probe_offset_wizard_menu() { START_MENU(); - calculated_z_offset = probe.offset.z + current_position.z; + calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref; if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); @@ -92,7 +85,7 @@ void probe_offset_wizard_menu() { char tmp[20], numstr[10]; // Determine digits needed right of decimal const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; + !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) extern const char NUL_STR[]; @@ -107,47 +100,86 @@ void probe_offset_wizard_menu() { ACTION_ITEM(MSG_BUTTON_DONE, []{ set_offset_and_go_back(calculated_z_offset); - do_z_clearance(20.0 - #ifdef Z_AFTER_HOMING - - 20.0 + Z_AFTER_HOMING - #endif - ); + current_position.z = z_offset_ref; // Set Z to z_offset_ref, as we can expect it is at probe height + sync_plan_position(); + z_clearance_move(); // Raise Z as if it was homed }); ACTION_ITEM(MSG_BUTTON_CANCEL, []{ set_offset_and_go_back(z_offset_backup); + // If wizard-homing was done by probe with with PROBE_OFFSET_WIZARD_START_Z + #if EITHER(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) && defined(PROBE_OFFSET_WIZARD_START_Z) + set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction + queue.inject_P(PSTR("G28Z")); + #else // Otherwise do a Z clearance move like after Homing + z_clearance_move(); + #endif }); END_MENU(); } -#ifdef PROBE_OFFSET_WIZARD_XY_POS +void prepare_for_probe_offset_wizard() { + if (ui.wait_for_move) return; - #define HAS_PROBE_OFFSET_WIZARD_XY_POS 1 + #if defined(PROBE_OFFSET_WIZARD_XY_POS) || NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) + if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); - inline void goto_probe_offset_wizard() { - if (ui.wait_for_move) return; + #ifndef PROBE_OFFSET_WIZARD_XY_POS + #define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER + #endif + // Get X and Y from configuration, or use center constexpr xy_pos_t wizard_pos = PROBE_OFFSET_WIZARD_XY_POS; - current_position = wizard_pos; + + // Probe for Z reference ui.wait_for_move = true; - line_to_current_position(MMM_TO_MMS(HOMING_FEEDRATE_XY)); // Could invoke idle() + z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true); ui.wait_for_move = false; - ui.synchronize(); - prepare_for_calibration(); - probe.offset.z = PROBE_OFFSET_START; - ui.goto_screen(probe_offset_wizard_menu); - ui.defer_status_screen(); - } -#endif + #endif + + // Move Nozzle to Probing/Homing Position + ui.wait_for_move = true; + current_position += probe.offset_xy; + line_to_current_position(MMM_TO_MMS(HOMING_FEEDRATE_XY)); + ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING)); + ui.wait_for_move = false; + + // Go to Calibration Menu + ui.goto_screen(probe_offset_wizard_menu); + ui.defer_status_screen(); +} + +void goto_probe_offset_wizard() { + ui.defer_status_screen(); + set_all_unhomed(); + + // Store probe.offset.z for Case: Cancel + z_offset_backup = probe.offset.z; + + #ifdef PROBE_OFFSET_WIZARD_START_Z + probe.offset.z = PROBE_OFFSET_WIZARD_START_Z; + #endif + + // Store Bed-Leveling-State and disable + #if HAS_LEVELING + leveling_was_active = planner.leveling_active; + set_bed_leveling_enabled(false); + #endif -void home_and_goto_probe_offset_wizard() { + // Home all axes queue.inject_P(G28_STR); + ui.goto_screen([]{ _lcd_draw_homing(); - if (all_axes_homed()) - ui.goto_screen(TERN(HAS_PROBE_OFFSET_WIZARD_XY_POS, goto_probe_offset_wizard, probe_offset_wizard_menu)); + if (all_axes_homed()) { + SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement + z_offset_ref = 0; // Set Z Value for Wizard Position to 0 + ui.goto_screen(prepare_for_probe_offset_wizard); + ui.defer_status_screen(); + } }); + } #endif // PROBE_OFFSET_WIZARD From 18853defdd2189ee595c6f8c2e4d8a16e41f9ce1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Nov 2020 21:40:56 -0600 Subject: [PATCH 240/443] Reduce warnings, extern "C" cleanup (#20279) --- Marlin/src/HAL/AVR/HAL.h | 16 ++++++++++------ Marlin/src/HAL/DUE/HAL.h | 12 +++++++++--- Marlin/src/HAL/ESP32/HAL.h | 12 +++++++++--- Marlin/src/HAL/ESP32/timers.h | 8 +++++--- Marlin/src/HAL/HAL.h | 4 ++++ Marlin/src/HAL/LINUX/HAL.cpp | 17 ++++++----------- Marlin/src/HAL/LINUX/HAL.h | 12 +++++++++--- Marlin/src/HAL/LINUX/include/Arduino.h | 11 ++++++----- Marlin/src/HAL/LPC1768/HAL.cpp | 17 ++++++----------- Marlin/src/HAL/LPC1768/HAL.h | 12 +++++++++--- Marlin/src/HAL/LPC1768/MarlinSerial.cpp | 19 ++++--------------- Marlin/src/HAL/LPC1768/main.cpp | 12 ++++++------ Marlin/src/HAL/SAMD51/HAL.h | 12 +++++++++--- Marlin/src/HAL/STM32/HAL.h | 10 +++++++--- Marlin/src/HAL/STM32F1/HAL.h | 10 +++++++--- Marlin/src/HAL/STM32F1/timers.h | 6 ++++-- Marlin/src/HAL/STM32_F4_F7/HAL.h | 10 +++++++--- Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp | 8 +++----- Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp | 8 +++----- Marlin/src/HAL/TEENSY31_32/HAL.h | 16 ++++++++++------ Marlin/src/HAL/TEENSY31_32/timers.h | 4 ++-- Marlin/src/HAL/TEENSY35_36/HAL.h | 16 ++++++++++------ Marlin/src/HAL/TEENSY35_36/timers.h | 4 ++-- Marlin/src/HAL/TEENSY40_41/HAL.h | 16 ++++++++++------ Marlin/src/HAL/TEENSY40_41/timers.h | 10 ++++++---- Marlin/src/libs/duration_t.h | 10 +++++++--- 26 files changed, 170 insertions(+), 122 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index ce15ed29fb3a..aa6a32132032 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -122,12 +122,16 @@ inline uint8_t HAL_get_reset_source() { return MCUSR; } inline void HAL_reboot() {} // reboot the board or restart the bootloader -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -extern "C" { - int freeMemory(); -} -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +extern "C" int freeMemory(); + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // ADC #ifdef DIDR2 diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 88ace5957535..395ca4ccc971 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -153,10 +153,16 @@ void HAL_init(); // void _delay_ms(const int delay); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + int freeMemory(); -#pragma GCC diagnostic pop + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif #ifdef __cplusplus extern "C" { diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index ebc16c9525e7..5ef13e0c21d4 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -100,10 +100,16 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader void _delay_ms(int delay); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + int freeMemory(); -#pragma GCC diagnostic pop + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif void analogWrite(pin_t pin, int value); diff --git a/Marlin/src/HAL/ESP32/timers.h b/Marlin/src/HAL/ESP32/timers.h index 7d35186b1cda..98386e3980b9 100644 --- a/Marlin/src/HAL/ESP32/timers.h +++ b/Marlin/src/HAL/ESP32/timers.h @@ -91,9 +91,11 @@ typedef uint64_t hal_timer_t; #define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() #endif -extern "C" void tempTC_Handler(); -extern "C" void stepTC_Handler(); -extern "C" void pwmTC_Handler(); +extern "C" { + void tempTC_Handler(); + void stepTC_Handler(); + void pwmTC_Handler(); +} // ------------------------ // Types diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 5eca2f7eacfe..9eefda8fb1e2 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -23,6 +23,10 @@ #include "platforms.h" +#ifndef GCC_VERSION + #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif + #include HAL_PATH(.,HAL.h) #ifdef SERIAL_PORT_2 diff --git a/Marlin/src/HAL/LINUX/HAL.cpp b/Marlin/src/HAL/LINUX/HAL.cpp index d7d7c2d2b4f0..ee9e31e140e8 100644 --- a/Marlin/src/HAL/LINUX/HAL.cpp +++ b/Marlin/src/HAL/LINUX/HAL.cpp @@ -27,18 +27,13 @@ HalSerial usb_serial; // U8glib required functions -extern "C" void u8g_xMicroDelay(uint16_t val) { - DELAY_US(val); -} -extern "C" void u8g_MicroDelay() { - u8g_xMicroDelay(1); -} -extern "C" void u8g_10MicroDelay() { - u8g_xMicroDelay(10); -} -extern "C" void u8g_Delay(uint16_t val) { - delay(val); +extern "C" { + void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } + void u8g_MicroDelay() { u8g_xMicroDelay(1); } + void u8g_10MicroDelay() { u8g_xMicroDelay(10); } + void u8g_Delay(uint16_t val) { delay(val); } } + //************************// // return free heap space diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 1c8dbfd4dcfe..729f6c856e19 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -79,10 +79,16 @@ extern HalSerial usb_serial; inline void HAL_init() {} // Utility functions -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + int freeMemory(); -#pragma GCC diagnostic pop + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // ADC #define HAL_ADC_VREF 5.0 diff --git a/Marlin/src/HAL/LINUX/include/Arduino.h b/Marlin/src/HAL/LINUX/include/Arduino.h index e28b474ede96..6aeb0db58335 100644 --- a/Marlin/src/HAL/LINUX/include/Arduino.h +++ b/Marlin/src/HAL/LINUX/include/Arduino.h @@ -67,8 +67,11 @@ void cli(); // Disable void sei(); // Enable void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode); void detachInterrupt(uint32_t pin); -extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); -extern "C" void GpioDisableInt(uint32_t port, uint32_t pin); + +extern "C" { + void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); + void GpioDisableInt(uint32_t port, uint32_t pin); +} // Program Memory #define pgm_read_ptr(addr) (*((void**)(addr))) @@ -92,9 +95,7 @@ using std::memcpy; #define strlen_P strlen // Time functions -extern "C" { - void delay(const int milis); -} +extern "C" void delay(const int milis); void _delay_ms(const int delay); void delayMicroseconds(unsigned long); uint32_t millis(); diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp index 939f1e8a9408..3614e953851c 100644 --- a/Marlin/src/HAL/LPC1768/HAL.cpp +++ b/Marlin/src/HAL/LPC1768/HAL.cpp @@ -32,18 +32,13 @@ uint32_t HAL_adc_reading = 0; // U8glib required functions -extern "C" void u8g_xMicroDelay(uint16_t val) { - DELAY_US(val); -} -extern "C" void u8g_MicroDelay() { - u8g_xMicroDelay(1); -} -extern "C" void u8g_10MicroDelay() { - u8g_xMicroDelay(10); -} -extern "C" void u8g_Delay(uint16_t val) { - delay(val); +extern "C" { + void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } + void u8g_MicroDelay() { u8g_xMicroDelay(1); } + void u8g_10MicroDelay() { u8g_xMicroDelay(10); } + void u8g_Delay(uint16_t val) { delay(val); } } + //************************// // return free heap space diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index cb637e715dda..51a13389b1e6 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -107,10 +107,16 @@ extern "C" volatile uint32_t _millis; // // Utility functions // -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + int freeMemory(); -#pragma GCC diagnostic pop + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // // ADC API diff --git a/Marlin/src/HAL/LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/LPC1768/MarlinSerial.cpp index 5374e005d3da..baad3f8f26b7 100644 --- a/Marlin/src/HAL/LPC1768/MarlinSerial.cpp +++ b/Marlin/src/HAL/LPC1768/MarlinSerial.cpp @@ -26,30 +26,19 @@ #if USING_SERIAL_0 MarlinSerial MSerial(LPC_UART0); - extern "C" void UART0_IRQHandler() { - MSerial.IRQHandler(); - } + extern "C" void UART0_IRQHandler() { MSerial.IRQHandler(); } #endif - #if USING_SERIAL_1 MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1); - extern "C" void UART1_IRQHandler() { - MSerial1.IRQHandler(); - } + extern "C" void UART1_IRQHandler() { MSerial1.IRQHandler(); } #endif - #if USING_SERIAL_2 MarlinSerial MSerial2(LPC_UART2); - extern "C" void UART2_IRQHandler() { - MSerial2.IRQHandler(); - } + extern "C" void UART2_IRQHandler() { MSerial2.IRQHandler(); } #endif - #if USING_SERIAL_3 MarlinSerial MSerial3(LPC_UART3); - extern "C" void UART3_IRQHandler() { - MSerial3.IRQHandler(); - } + extern "C" void UART3_IRQHandler() { MSerial3.IRQHandler(); } #endif #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index 085b8ce04bcf..96faf54d7fd2 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -31,18 +31,18 @@ #include #include -extern "C" { - #include -} - #include "../../inc/MarlinConfig.h" #include "../../core/millis_t.h" #include "../../sd/cardreader.h" extern uint32_t MSC_SD_Init(uint8_t pdrv); -extern "C" int isLPC1769(); -extern "C" void disk_timerproc(); + +extern "C" { + #include + extern "C" int isLPC1769(); + extern "C" void disk_timerproc(); +} void SysTick_Callback() { disk_timerproc(); } diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index 7cb3635bd7c9..ff9310114641 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -135,10 +135,16 @@ void HAL_idletask(); // FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + int freeMemory(); -#pragma GCC diagnostic pop + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif #ifdef __cplusplus extern "C" { diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index c92c8890ea96..16dc7a453994 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -140,15 +140,19 @@ void _delay_ms(const int delay); extern "C" char* _sbrk(int incr); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // // ADC diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 2880865dbbcc..06f75662cffa 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -189,8 +189,10 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader void _delay_ms(const int delay); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif /* extern "C" { @@ -213,7 +215,9 @@ static int freeMemory() { return &top - reinterpret_cast(_sbrk(0)); } -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // // ADC diff --git a/Marlin/src/HAL/STM32F1/timers.h b/Marlin/src/HAL/STM32F1/timers.h index 6f360f6bfc39..3e2e7775f1e3 100644 --- a/Marlin/src/HAL/STM32F1/timers.h +++ b/Marlin/src/HAL/STM32F1/timers.h @@ -129,8 +129,10 @@ timer_dev* get_timer_dev(int number); #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() #endif -extern "C" void tempTC_Handler(); -extern "C" void stepTC_Handler(); +extern "C" { + void tempTC_Handler(); + void stepTC_Handler(); +} // ------------------------ // Public Variables diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL.h b/Marlin/src/HAL/STM32_F4_F7/HAL.h index 00a65de7926f..85fbf098ff85 100644 --- a/Marlin/src/HAL/STM32_F4_F7/HAL.h +++ b/Marlin/src/HAL/STM32_F4_F7/HAL.h @@ -162,15 +162,19 @@ int freeMemory() { } */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // // ADC diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp index dc41f891318d..8b753f72902e 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp @@ -79,11 +79,9 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { HAL_TIM_Base_Start_IT(&TimerHandle[timer_num].handle); } -extern "C" void TIM5_IRQHandler() { - ((void(*)())TimerHandle[0].callback)(); -} -extern "C" void TIM7_IRQHandler() { - ((void(*)())TimerHandle[1].callback)(); +extern "C" { + void TIM5_IRQHandler() { ((void(*)())TimerHandle[0].callback)(); } + void TIM7_IRQHandler() { ((void(*)())TimerHandle[1].callback)(); } } void HAL_timer_enable_interrupt(const uint8_t timer_num) { diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp index f7ded7454dd9..bc8f76af0987 100644 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp +++ b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp @@ -83,11 +83,9 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { } //forward the interrupt -extern "C" void TIM5_IRQHandler() { - ((void(*)())timerConfig[0].callback)(); -} -extern "C" void TIM7_IRQHandler() { - ((void(*)())timerConfig[1].callback)(); +extern "C" { + void TIM5_IRQHandler() { ((void(*)())timerConfig[0].callback)(); } + void TIM7_IRQHandler() { ((void(*)())timerConfig[1].callback)(); } } void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 8ab358e9e1e5..9156aadb4de0 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -97,12 +97,16 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -extern "C" { - int freeMemory(); -} -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +extern "C" int freeMemory(); + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // ADC diff --git a/Marlin/src/HAL/TEENSY31_32/timers.h b/Marlin/src/HAL/TEENSY31_32/timers.h index 135b32883084..61b86735967e 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.h +++ b/Marlin/src/HAL/TEENSY31_32/timers.h @@ -74,10 +74,10 @@ typedef uint32_t hal_timer_t; #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) #ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() + #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() #endif #ifndef HAL_TEMP_TIMER_ISR - #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() + #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() #endif void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 2b735d6224f4..04151e837861 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -103,12 +103,16 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -extern "C" { - int freeMemory(); -} -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +extern "C" int freeMemory(); + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // ADC diff --git a/Marlin/src/HAL/TEENSY35_36/timers.h b/Marlin/src/HAL/TEENSY35_36/timers.h index 5c623cd80192..99269ac6571f 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.h +++ b/Marlin/src/HAL/TEENSY35_36/timers.h @@ -73,10 +73,10 @@ typedef uint32_t hal_timer_t; #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) #ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() + #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() #endif #ifndef HAL_TEMP_TIMER_ISR - #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() + #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() #endif void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 1e0043342dd6..28f511631eea 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -120,12 +120,16 @@ uint8_t HAL_get_reset_source(); FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -extern "C" { - uint32_t freeMemory(); -} -#pragma GCC diagnostic pop +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +extern "C" uint32_t freeMemory(); + +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop +#endif // ADC diff --git a/Marlin/src/HAL/TEENSY40_41/timers.h b/Marlin/src/HAL/TEENSY40_41/timers.h index 7e4cd080cb88..556333d7f408 100644 --- a/Marlin/src/HAL/TEENSY40_41/timers.h +++ b/Marlin/src/HAL/TEENSY40_41/timers.h @@ -72,14 +72,16 @@ typedef uint32_t hal_timer_t; #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) #ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() // GPT1_Handler() + #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() // GPT1_Handler() #endif #ifndef HAL_TEMP_TIMER_ISR - #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() // GPT2_Handler() + #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() // GPT2_Handler() #endif -extern "C" void stepTC_Handler(); -extern "C" void tempTC_Handler(); +extern "C" { + void stepTC_Handler(); + void tempTC_Handler(); +} void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index 9c1d72dfaff3..bd654b7bad1e 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -106,8 +106,10 @@ struct duration_t { return this->value; } - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wformat-overflow" + #if GCC_VERSION <= 50000 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-overflow" + #endif /** * @brief Formats the duration as a string @@ -167,5 +169,7 @@ struct duration_t { } } - #pragma GCC diagnostic pop + #if GCC_VERSION <= 50000 + #pragma GCC diagnostic pop + #endif }; From 3a396a25dc9e33be2c18a1bdc23600295e42c82e Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 25 Nov 2020 22:37:18 -0800 Subject: [PATCH 241/443] Retire HAL for STM32F4 / F7 (#20153) --- .github/workflows/test-builds.yml | 21 +- Marlin/src/HAL/STM32/pinsDebug.h | 258 ++++- Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h | 125 --- Marlin/src/HAL/STM32/pinsDebug_STM32duino.h | 273 ------ Marlin/src/HAL/STM32F1/pinsDebug.h | 104 +- Marlin/src/HAL/STM32_F4_F7/HAL.cpp | 95 -- Marlin/src/HAL/STM32_F4_F7/HAL.h | 203 ---- Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp | 164 ---- Marlin/src/HAL/STM32_F4_F7/README.md | 6 - Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md | 12 - Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp | 113 --- Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h | 134 --- Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md | 27 - .../src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp | 898 ------------------ Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h | 593 ------------ Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp | 127 --- Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h | 107 --- Marlin/src/HAL/STM32_F4_F7/Servo.cpp | 51 - Marlin/src/HAL/STM32_F4_F7/Servo.h | 41 - Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp | 535 ----------- Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h | 114 --- Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp | 111 --- Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp | 77 -- .../src/HAL/STM32_F4_F7/endstop_interrupts.h | 49 - Marlin/src/HAL/STM32_F4_F7/fastio.h | 310 ------ .../HAL/STM32_F4_F7/inc/Conditionals_LCD.h | 26 - .../HAL/STM32_F4_F7/inc/Conditionals_adv.h | 22 - .../HAL/STM32_F4_F7/inc/Conditionals_post.h | 29 - Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h | 41 - Marlin/src/HAL/STM32_F4_F7/pinsDebug.h | 27 - Marlin/src/HAL/STM32_F4_F7/spi_pins.h | 35 - Marlin/src/HAL/STM32_F4_F7/timers.h | 28 - Marlin/src/HAL/STM32_F4_F7/watchdog.cpp | 57 -- Marlin/src/HAL/STM32_F4_F7/watchdog.h | 27 - Marlin/src/HAL/platforms.h | 2 - .../src/HAL/shared/backtrace/unwmemaccess.cpp | 11 - Marlin/src/HAL/shared/servo.h | 2 - Marlin/src/core/boards.h | 50 +- Marlin/src/core/macros.h | 6 +- Marlin/src/module/stepper/TMC26X.h | 6 +- Marlin/src/pins/pins.h | 18 +- .../pins/{stm32f4 => stm32f1}/pins_BEAST.h | 4 +- .../src/pins/stm32f4/pins_GENERIC_STM32F4.h | 197 ---- Marlin/src/pins/stm32f7/pins_THE_BORG.h | 183 ---- buildroot/tests/BIGTREE_SKR_PRO-tests | 2 +- .../tests/{STM32F7-tests => REMRAM_V1-tests} | 2 +- buildroot/tests/STM32F103RC_btt-tests | 1 + buildroot/tests/STM32F4-tests | 16 - platformio.ini | 17 +- 49 files changed, 399 insertions(+), 4958 deletions(-) delete mode 100644 Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h delete mode 100644 Marlin/src/HAL/STM32/pinsDebug_STM32duino.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/HAL.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/HAL.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/README.md delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/Servo.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/Servo.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/fastio.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/pinsDebug.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/spi_pins.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/timers.h delete mode 100644 Marlin/src/HAL/STM32_F4_F7/watchdog.cpp delete mode 100644 Marlin/src/HAL/STM32_F4_F7/watchdog.h rename Marlin/src/pins/{stm32f4 => stm32f1}/pins_BEAST.h (98%) delete mode 100644 Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h delete mode 100644 Marlin/src/pins/stm32f7/pins_THE_BORG.h rename buildroot/tests/{STM32F7-tests => REMRAM_V1-tests} (89%) delete mode 100644 buildroot/tests/STM32F4-tests diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index d87d10569d57..53ffbe0c08b1 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -54,7 +54,7 @@ jobs: - sanguino1284p - sanguino644p - # Extended STM32 Environments + # STM32F1 (Maple) Environments - STM32F103RC_btt - STM32F103RC_btt_USB @@ -64,38 +64,37 @@ jobs: - STM32F103RC_meeb - jgaurora_a5s_a1 - STM32F103VE_longer + - mks_robin + - mks_robin_lite + - mks_robin_pro + - STM32F103RET6_creality + - mks_robin_nano35 + + # STM32 (ST) Environments + - STM32F407VE_black - STM32F401VE_STEVAL - BIGTREE_BTT002 - BIGTREE_SKR_PRO - BIGTREE_GTR_V1_0 - - mks_robin - mks_robin_stm32 - ARMED - FYSETC_S6 - STM32F070CB_malyan - STM32F070RB_malyan - malyan_M300 - - mks_robin_lite - FLYF407ZG - rumba32 - - mks_robin_pro - - STM32F103RET6_creality - LERDGEX - - mks_robin_nano35 - mks_robin_nano35_stm32 - NUCLEO_F767ZI + - REMRAM_V1 # Put lengthy tests last - LPC1768 - LPC1769 - # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working. - - #- STM32F4 - #- STM32F7 - # Non-working environment tests #- at90usb1286_cdc #- STM32F103CB_malyan diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index ec08e3fd753f..77c93ee41e36 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -18,17 +18,257 @@ */ #pragma once -#if !(defined(NUM_DIGITAL_PINS) || defined(BOARD_NR_GPIO_PINS)) - #error "M43 not supported for this board" +#include + +#ifndef NUM_DIGITAL_PINS + // Only in ST's Arduino core (STM32duino, STM32Core) + #error "Expected NUM_DIGITAL_PINS not found" #endif -// Strange - STM32F4 comes to HAL_STM32 rather than HAL_STM32F4 for these files -#ifdef STM32F4 - #ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "pinsDebug_STM32duino.h" - #elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "pinsDebug_STM32GENERIC.h" +/** + * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order) + * because the variants in this platform do not always define all the I/O port/pins + * that a CPU has. + * + * VARIABLES: + * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and + * digitalWrite commands and by M42. + * - does not contain port/pin info + * - is not in port/pin order + * - typically a variant will only assign Ard_num to port/pins that are actually used + * Index - M43 counter - only used to get Ard_num + * x - a parameter/argument used to search the pin_array to try to find a signal name + * associated with a Ard_num + * Port_pin - port number and pin number for use with CPU registers and printing reports + * + * Since M43 uses digitalRead and digitalWrite commands, only the Port_pins with an Ard_num + * are accessed and/or displayed. + * + * Three arrays are used. + * + * digitalPin[] is provided by the platform. It consists of the Port_pin numbers in + * Arduino pin number order. + * + * pin_array is a structure generated by the pins/pinsDebug.h header file. It is generated by + * the preprocessor. Only the signals associated with enabled options are in this table. + * It contains: + * - name of the signal + * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. + * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the + * argument to digitalPinToPinName(IO) to get the Port_pin number + * - if it is a digital or analog signal. PWMs are considered digital here. + * + * pin_xref is a structure generated by this header file. It is generated by the + * preprocessor. It is in port/pin order. It contains just the port/pin numbers defined by the + * platform for this variant. + * - Ard_num + * - printable version of Port_pin + * + * Routines with an "x" as a parameter/argument are used to search the pin_array to try to + * find a signal name associated with a port/pin. + * + * NOTE - the Arduino pin number is what is used by the M42 command, NOT the port/pin for that + * signal. The Arduino pin number is listed by the M43 I command. + */ + +//////////////////////////////////////////////////////// +// +// make a list of the Arduino pin numbers in the Port/Pin order +// + +#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM }, +#define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM }, +#define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME) + +typedef struct { + char Port_pin_alpha[5]; + pin_t Ard_num; +} XrefInfo; + +const XrefInfo pin_xref[] PROGMEM = { + #include "pins_Xref.h" +}; + +//////////////////////////////////////////////////////////// + +#define MODE_PIN_INPUT 0 // Input mode (reset state) +#define MODE_PIN_OUTPUT 1 // General purpose output mode +#define MODE_PIN_ALT 2 // Alternate function mode +#define MODE_PIN_ANALOG 3 // Analog mode + +#define PIN_NUM(P) (P & 0x000F) +#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1') +#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 ) +#define PORT_NUM(P) ((P >> 4) & 0x0007) +#define PORT_ALPHA(P) ('A' + (P >> 4)) + +/** + * Translation of routines & variables used by pinsDebug.h + */ +#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS +#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL) +#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads +#define PRINT_PIN(Q) +#define PRINT_PORT(ANUM) port_print(ANUM) +#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine +#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num + +// x is a variable used to search pin_array +#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital) +#define GET_ARRAY_PIN(x) ((pin_t) pin_array[x].pin) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin + +#ifndef M43_NEVER_TOUCH + #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP) + #ifdef KILL_PIN + #define M43_NEVER_TOUCH(Index) m43_never_touch(Index) + + bool m43_never_touch(const pin_t Index) { + static pin_t M43_kill_index = -1; + if (M43_kill_index < 0) + for (M43_kill_index = 0; M43_kill_index < NUMBER_PINS_TOTAL; M43_kill_index++) + if (KILL_PIN == GET_PIN_MAP_PIN_M43(M43_kill_index)) break; + return _M43_NEVER_TOUCH(Index) || Index == M43_kill_index; // KILL_PIN and SERIAL/USB + } #else - #error "M43 not supported for this board" + #define M43_NEVER_TOUCH(Index) _M43_NEVER_TOUCH(Index) #endif #endif + +uint8_t get_pin_mode(const pin_t Ard_num) { + uint32_t mode_all = 0; + const PinName dp = digitalPinToPinName(Ard_num); + switch (PORT_ALPHA(dp)) { + case 'A' : mode_all = GPIOA->MODER; break; + case 'B' : mode_all = GPIOB->MODER; break; + case 'C' : mode_all = GPIOC->MODER; break; + case 'D' : mode_all = GPIOD->MODER; break; + #ifdef PE_0 + case 'E' : mode_all = GPIOE->MODER; break; + #elif defined(PF_0) + case 'F' : mode_all = GPIOF->MODER; break; + #elif defined(PG_0) + case 'G' : mode_all = GPIOG->MODER; break; + #elif defined(PH_0) + case 'H' : mode_all = GPIOH->MODER; break; + #elif defined(PI_0) + case 'I' : mode_all = GPIOI->MODER; break; + #elif defined(PJ_0) + case 'J' : mode_all = GPIOJ->MODER; break; + #elif defined(PK_0) + case 'K' : mode_all = GPIOK->MODER; break; + #elif defined(PL_0) + case 'L' : mode_all = GPIOL->MODER; break; + #endif + } + return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03; +} + +bool GET_PINMODE(const pin_t Ard_num) { + const uint8_t pin_mode = get_pin_mode(Ard_num); + return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM +} + +int8_t digital_pin_to_analog_pin(pin_t Ard_num) { + Ard_num -= NUM_ANALOG_FIRST; + return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; +} + +bool IS_ANALOG(const pin_t Ard_num) { + return get_pin_mode(Ard_num) == MODE_PIN_ANALOG; +} + +bool is_digital(const pin_t x) { + const uint8_t pin_mode = get_pin_mode(pin_array[x].pin); + return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; +} + +void port_print(const pin_t Ard_num) { + char buffer[16]; + pin_t Index; + for (Index = 0; Index < NUMBER_PINS_TOTAL; Index++) + if (Ard_num == GET_PIN_MAP_PIN_M43(Index)) break; + + const char * ppa = pin_xref[Index].Port_pin_alpha; + sprintf_P(buffer, PSTR("%s"), ppa); + SERIAL_ECHO(buffer); + if (ppa[3] == '\0') SERIAL_CHAR(' '); + + // print analog pin number + const int8_t Port_pin = digital_pin_to_analog_pin(Ard_num); + if (Port_pin >= 0) { + sprintf_P(buffer, PSTR(" (A%d) "), Port_pin); + SERIAL_ECHO(buffer); + if (Port_pin < 10) SERIAL_CHAR(' '); + } + else + SERIAL_ECHO_SP(7); + + // Print number to be used with M42 + sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num); + SERIAL_ECHO(buffer); + if (Ard_num < 10) SERIAL_CHAR(' '); + if (Ard_num < 100) SERIAL_CHAR(' '); +} + +bool pwm_status(const pin_t Ard_num) { + return get_pin_mode(Ard_num) == MODE_PIN_ALT; +} + +void pwm_details(const pin_t Ard_num) { + if (pwm_status(Ard_num)) { + uint32_t alt_all = 0; + const PinName dp = digitalPinToPinName(Ard_num); + pin_t pin_number = uint8_t(PIN_NUM(dp)); + const bool over_7 = pin_number >= 8; + const uint8_t ind = over_7 ? 1 : 0; + switch (PORT_ALPHA(dp)) { // get alt function + case 'A' : alt_all = GPIOA->AFR[ind]; break; + case 'B' : alt_all = GPIOB->AFR[ind]; break; + case 'C' : alt_all = GPIOC->AFR[ind]; break; + case 'D' : alt_all = GPIOD->AFR[ind]; break; + #ifdef PE_0 + case 'E' : alt_all = GPIOE->AFR[ind]; break; + #elif defined (PF_0) + case 'F' : alt_all = GPIOF->AFR[ind]; break; + #elif defined (PG_0) + case 'G' : alt_all = GPIOG->AFR[ind]; break; + #elif defined (PH_0) + case 'H' : alt_all = GPIOH->AFR[ind]; break; + #elif defined (PI_0) + case 'I' : alt_all = GPIOI->AFR[ind]; break; + #elif defined (PJ_0) + case 'J' : alt_all = GPIOJ->AFR[ind]; break; + #elif defined (PK_0) + case 'K' : alt_all = GPIOK->AFR[ind]; break; + #elif defined (PL_0) + case 'L' : alt_all = GPIOL->AFR[ind]; break; + #endif + } + if (over_7) pin_number -= 8; + + uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; + SERIAL_ECHOPAIR("Alt Function: ", alt_func); + if (alt_func < 10) SERIAL_CHAR(' '); + SERIAL_ECHOPGM(" - "); + switch (alt_func) { + case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; + case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; + case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; + case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; + case 4 : SERIAL_ECHOPGM("I2C1..3"); break; + case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; + case 6 : SERIAL_ECHOPGM("SPI3"); break; + case 7 : SERIAL_ECHOPGM("USART1..3"); break; + case 8 : SERIAL_ECHOPGM("USART4..6"); break; + case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; + case 10 : SERIAL_ECHOPGM("OTG"); break; + case 11 : SERIAL_ECHOPGM("ETH"); break; + case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; + case 13 : SERIAL_ECHOPGM("DCMI"); break; + case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; + case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; + } + } +} // pwm_details diff --git a/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h b/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h deleted file mode 100644 index 9069d9f7bd8a..000000000000 --- a/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 - -/** - * Support routines for STM32GENERIC (Maple) - */ - -/** - * Translation of routines & variables used by pinsDebug.h - */ - -#ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple) - -#ifdef __STM32F1__ - #include "../STM32F1/fastio.h" -#elif defined(STM32F4) || defined(STM32F7) - #include "../STM32_F4_F7/fastio.h" -#else - #include "fastio.h" -#endif - -extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; - -#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS -#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS -#define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS) -#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin) -#define pwm_status(pin) PWM_PIN(pin) -#define digitalRead_mod(p) extDigitalRead(p) -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PORT(p) print_port(p) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin - -// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -#ifndef M43_NEVER_TOUCH - #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) { - return VALID_PIN(pin) ? _GET_MODE(pin) : -1; -} - -static inline 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 - if (adc_channel >= NUM_ANALOG_INPUTS) adc_channel = ADCx; - #endif - return pin_t(adc_channel); -} - -static inline bool IS_ANALOG(pin_t pin) { - if (!VALID_PIN(pin)) return false; - if (PIN_MAP[pin].adc_channel != ADCx) { - #ifdef NUM_ANALOG_INPUTS - if (PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) return false; - #endif - return _GET_MODE(pin) == GPIO_INPUT_ANALOG && !M43_NEVER_TOUCH(pin); - } - return false; -} - -static inline 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) { - const pin_t pin = GET_ARRAY_PIN(array_pin); - return (!IS_ANALOG(pin) - #ifdef NUM_ANALOG_INPUTS - || PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS - #endif - ); -} - -#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density - -static inline 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; - const char num = ( - #if EITHER(STM32_HIGH_DENSITY, STM32_XL_DENSITY) - tdev == &timer8 ? '8' : - tdev == &timer5 ? '5' : - #endif - tdev == &timer4 ? '4' : - tdev == &timer3 ? '3' : - tdev == &timer2 ? '2' : - tdev == &timer1 ? '1' : '?' - ); - char buffer[10]; - sprintf_P(buffer, PSTR(" TIM%c CH%c"), num, ('0' + channel)); - SERIAL_ECHO(buffer); - } -} - -static inline 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]; - sprintf_P(buffer, PSTR("P%c%hd "), port, gbit); - if (gbit < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(buffer); -} - -#endif // BOARD_NR_GPIO_PINS diff --git a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h b/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h deleted file mode 100644 index 71480153a717..000000000000 --- a/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - -/** - * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order) - * because the variants in this platform do not always define all the I/O port/pins - * that a CPU has. - * - * VARIABLES: - * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and - * digitalWrite commands and by M42. - * - does not contain port/pin info - * - is not in port/pin order - * - typically a variant will only assign Ard_num to port/pins that are actually used - * Index - M43 counter - only used to get Ard_num - * x - a parameter/argument used to search the pin_array to try to find a signal name - * associated with a Ard_num - * Port_pin - port number and pin number for use with CPU registers and printing reports - * - * Since M43 uses digitalRead and digitalWrite commands, only the Port_pins with an Ard_num - * are accessed and/or displayed. - * - * Three arrays are used. - * - * digitalPin[] is provided by the platform. It consists of the Port_pin numbers in - * Arduino pin number order. - * - * pin_array is a structure generated by the pins/pinsDebug.h header file. It is generated by - * the preprocessor. Only the signals associated with enabled options are in this table. - * It contains: - * - name of the signal - * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. - * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the - * argument to digitalPinToPinName(IO) to get the Port_pin number - * - if it is a digital or analog signal. PWMs are considered digital here. - * - * pin_xref is a structure generated by this header file. It is generated by the - * preprocessor. It is in port/pin order. It contains just the port/pin numbers defined by the - * platform for this variant. - * - Ard_num - * - printable version of Port_pin - * - * Routines with an "x" as a parameter/argument are used to search the pin_array to try to - * find a signal name associated with a port/pin. - * - * NOTE - the Arduino pin number is what is used by the M42 command, NOT the port/pin for that - * signal. The Arduino pin number is listed by the M43 I command. - */ - -//////////////////////////////////////////////////////// -// -// make a list of the Arduino pin numbers in the Port/Pin order -// - -#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM }, -#define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM }, -#define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME) - -typedef struct { - char Port_pin_alpha[5]; - pin_t Ard_num; -} XrefInfo; - -const XrefInfo pin_xref[] PROGMEM = { - #include "pins_Xref.h" -}; - -//////////////////////////////////////////////////////////// - -#define MODE_PIN_INPUT 0 // Input mode (reset state) -#define MODE_PIN_OUTPUT 1 // General purpose output mode -#define MODE_PIN_ALT 2 // Alternate function mode -#define MODE_PIN_ANALOG 3 // Analog mode - -#define PIN_NUM(P) (P & 0x000F) -#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1') -#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 ) -#define PORT_NUM(P) ((P >> 4) & 0x0007) -#define PORT_ALPHA(P) ('A' + (P >> 4)) - -/** - * Translation of routines & variables used by pinsDebug.h - */ -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS -#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL) -#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads -#define PRINT_PIN(Q) -#define PRINT_PORT(ANUM) port_print(ANUM) -#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine -#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num - -// x is a variable used to search pin_array -#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital) -#define GET_ARRAY_PIN(x) ((pin_t) pin_array[x].pin) -#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) -#define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin - -#ifndef M43_NEVER_TOUCH - #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP) - #ifdef KILL_PIN - #define M43_NEVER_TOUCH(Index) m43_never_touch(Index) - - bool m43_never_touch(const pin_t Index) { - static pin_t M43_kill_index = -1; - if (M43_kill_index < 0) - for (M43_kill_index = 0; M43_kill_index < NUMBER_PINS_TOTAL; M43_kill_index++) - if (KILL_PIN == GET_PIN_MAP_PIN_M43(M43_kill_index)) break; - return _M43_NEVER_TOUCH(Index) || Index == M43_kill_index; // KILL_PIN and SERIAL/USB - } - #else - #define M43_NEVER_TOUCH(Index) _M43_NEVER_TOUCH(Index) - #endif -#endif - -uint8_t get_pin_mode(const pin_t Ard_num) { - uint32_t mode_all = 0; - const PinName dp = digitalPinToPinName(Ard_num); - switch (PORT_ALPHA(dp)) { - case 'A' : mode_all = GPIOA->MODER; break; - case 'B' : mode_all = GPIOB->MODER; break; - case 'C' : mode_all = GPIOC->MODER; break; - case 'D' : mode_all = GPIOD->MODER; break; - #ifdef PE_0 - case 'E' : mode_all = GPIOE->MODER; break; - #elif defined(PF_0) - case 'F' : mode_all = GPIOF->MODER; break; - #elif defined(PG_0) - case 'G' : mode_all = GPIOG->MODER; break; - #elif defined(PH_0) - case 'H' : mode_all = GPIOH->MODER; break; - #elif defined(PI_0) - case 'I' : mode_all = GPIOI->MODER; break; - #elif defined(PJ_0) - case 'J' : mode_all = GPIOJ->MODER; break; - #elif defined(PK_0) - case 'K' : mode_all = GPIOK->MODER; break; - #elif defined(PL_0) - case 'L' : mode_all = GPIOL->MODER; break; - #endif - } - return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03; -} - -bool GET_PINMODE(const pin_t Ard_num) { - const uint8_t pin_mode = get_pin_mode(Ard_num); - return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM -} - -int8_t digital_pin_to_analog_pin(pin_t Ard_num) { - Ard_num -= NUM_ANALOG_FIRST; - return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; -} - -bool IS_ANALOG(const pin_t Ard_num) { - return get_pin_mode(Ard_num) == MODE_PIN_ANALOG; -} - -bool is_digital(const pin_t x) { - const uint8_t pin_mode = get_pin_mode(pin_array[x].pin); - return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; -} - -void port_print(const pin_t Ard_num) { - char buffer[16]; - pin_t Index; - for (Index = 0; Index < NUMBER_PINS_TOTAL; Index++) - if (Ard_num == GET_PIN_MAP_PIN_M43(Index)) break; - - const char * ppa = pin_xref[Index].Port_pin_alpha; - sprintf_P(buffer, PSTR("%s"), ppa); - SERIAL_ECHO(buffer); - if (ppa[3] == '\0') SERIAL_CHAR(' '); - - // print analog pin number - const int8_t Port_pin = digital_pin_to_analog_pin(Ard_num); - if (Port_pin >= 0) { - sprintf_P(buffer, PSTR(" (A%d) "), Port_pin); - SERIAL_ECHO(buffer); - if (Port_pin < 10) SERIAL_CHAR(' '); - } - else - SERIAL_ECHO_SP(7); - - // Print number to be used with M42 - sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num); - SERIAL_ECHO(buffer); - if (Ard_num < 10) SERIAL_CHAR(' '); - if (Ard_num < 100) SERIAL_CHAR(' '); -} - -bool pwm_status(const pin_t Ard_num) { - return get_pin_mode(Ard_num) == MODE_PIN_ALT; -} - -void pwm_details(const pin_t Ard_num) { - if (pwm_status(Ard_num)) { - uint32_t alt_all = 0; - const PinName dp = digitalPinToPinName(Ard_num); - pin_t pin_number = uint8_t(PIN_NUM(dp)); - const bool over_7 = pin_number >= 8; - const uint8_t ind = over_7 ? 1 : 0; - switch (PORT_ALPHA(dp)) { // get alt function - case 'A' : alt_all = GPIOA->AFR[ind]; break; - case 'B' : alt_all = GPIOB->AFR[ind]; break; - case 'C' : alt_all = GPIOC->AFR[ind]; break; - case 'D' : alt_all = GPIOD->AFR[ind]; break; - #ifdef PE_0 - case 'E' : alt_all = GPIOE->AFR[ind]; break; - #elif defined (PF_0) - case 'F' : alt_all = GPIOF->AFR[ind]; break; - #elif defined (PG_0) - case 'G' : alt_all = GPIOG->AFR[ind]; break; - #elif defined (PH_0) - case 'H' : alt_all = GPIOH->AFR[ind]; break; - #elif defined (PI_0) - case 'I' : alt_all = GPIOI->AFR[ind]; break; - #elif defined (PJ_0) - case 'J' : alt_all = GPIOJ->AFR[ind]; break; - #elif defined (PK_0) - case 'K' : alt_all = GPIOK->AFR[ind]; break; - #elif defined (PL_0) - case 'L' : alt_all = GPIOL->AFR[ind]; break; - #endif - } - if (over_7) pin_number -= 8; - - uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; - SERIAL_ECHOPAIR("Alt Function: ", alt_func); - if (alt_func < 10) SERIAL_CHAR(' '); - SERIAL_ECHOPGM(" - "); - switch (alt_func) { - case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; - case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; - case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; - case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; - case 4 : SERIAL_ECHOPGM("I2C1..3"); break; - case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; - case 6 : SERIAL_ECHOPGM("SPI3"); break; - case 7 : SERIAL_ECHOPGM("USART1..3"); break; - case 8 : SERIAL_ECHOPGM("USART4..6"); break; - case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; - case 10 : SERIAL_ECHOPGM("OTG"); break; - case 11 : SERIAL_ECHOPGM("ETH"); break; - case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; - case 13 : SERIAL_ECHOPGM("DCMI"); break; - case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; - case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; - } - } -} // pwm_details - -#endif // NUM_DIGITAL_PINS diff --git a/Marlin/src/HAL/STM32F1/pinsDebug.h b/Marlin/src/HAL/STM32F1/pinsDebug.h index 2d63ebd770f0..8e7a3d8135fd 100644 --- a/Marlin/src/HAL/STM32F1/pinsDebug.h +++ b/Marlin/src/HAL/STM32F1/pinsDebug.h @@ -18,10 +18,102 @@ */ #pragma once -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "../STM32/pinsDebug_STM32duino.h" -#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "../STM32/pinsDebug_STM32GENERIC.h" -#else - #error "M43 not supported for this board" +/** + * Support routines for STM32GENERIC (Maple) + */ + +/** + * Translation of routines & variables used by pinsDebug.h + */ + +#ifndef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple) + #error "Expected BOARD_NR_GPIO_PINS not found" #endif + +#include "fastio.h" + +extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; + +#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS +#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS +#define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS) +#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin) +#define pwm_status(pin) PWM_PIN(pin) +#define digitalRead_mod(p) extDigitalRead(p) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PORT(p) print_port(p) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin + +// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities +#ifndef M43_NEVER_TOUCH + #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) { + return VALID_PIN(pin) ? _GET_MODE(pin) : -1; +} + +static inline 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 + if (adc_channel >= NUM_ANALOG_INPUTS) adc_channel = ADCx; + #endif + return pin_t(adc_channel); +} + +static inline bool IS_ANALOG(pin_t pin) { + if (!VALID_PIN(pin)) return false; + if (PIN_MAP[pin].adc_channel != ADCx) { + #ifdef NUM_ANALOG_INPUTS + if (PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) return false; + #endif + return _GET_MODE(pin) == GPIO_INPUT_ANALOG && !M43_NEVER_TOUCH(pin); + } + return false; +} + +static inline 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) { + const pin_t pin = GET_ARRAY_PIN(array_pin); + return (!IS_ANALOG(pin) + #ifdef NUM_ANALOG_INPUTS + || PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS + #endif + ); +} + +#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density + +static inline 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; + const char num = ( + #if EITHER(STM32_HIGH_DENSITY, STM32_XL_DENSITY) + tdev == &timer8 ? '8' : + tdev == &timer5 ? '5' : + #endif + tdev == &timer4 ? '4' : + tdev == &timer3 ? '3' : + tdev == &timer2 ? '2' : + tdev == &timer1 ? '1' : '?' + ); + char buffer[10]; + sprintf_P(buffer, PSTR(" TIM%c CH%c"), num, ('0' + channel)); + SERIAL_ECHO(buffer); + } +} + +static inline 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]; + sprintf_P(buffer, PSTR("P%c%hd "), port, gbit); + if (gbit < 10) SERIAL_CHAR(' '); + SERIAL_ECHO(buffer); +} diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL.cpp b/Marlin/src/HAL/STM32_F4_F7/HAL.cpp deleted file mode 100644 index b4629d2afd12..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/HAL.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "HAL.h" - -//#include - -// ------------------------ -// Public Variables -// ------------------------ - -uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -/* VGPV Done with defines -// disable interrupts -void cli() { noInterrupts(); } - -// enable interrupts -void sei() { interrupts(); } -*/ - -void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } - -uint8_t HAL_get_reset_source() { - if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON; - return 0; -} - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// return free memory between end of heap (or end bss) and whatever is current - -/* -#include -//extern caddr_t _sbrk(int incr); -#ifndef CONFIG_HEAP_END -extern char _lm_heap_end; -#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) -#endif - -extern "C" { - static int freeMemory() { - char top = 't'; - return &top - reinterpret_cast(sbrk(0)); - } - int freeMemory() { - int free_memory; - int heap_end = (int)_sbrk(0); - free_memory = ((int)&free_memory) - ((int)heap_end); - return free_memory; - } -} -*/ - -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } - -uint16_t HAL_adc_get_result() { return HAL_adc_result; } - -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL.h b/Marlin/src/HAL/STM32_F4_F7/HAL.h deleted file mode 100644 index 85fbf098ff85..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/HAL.h +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2017 Victor Perez - * - * 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 CPU_32_BIT - -#include "../../inc/MarlinConfigPre.h" - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" - -#include "fastio.h" -#include "watchdog.h" - -#include - -#if defined(STM32F4) && USBCON - #include -#endif - -// ------------------------ -// Defines -// ------------------------ - -// Serial override -//extern HalSerial usb_serial; - -#define _MSERIAL(X) SerialUART##X -#define MSERIAL(X) _MSERIAL(X) -#define SerialUART0 Serial1 - -#if defined(STM32F4) && SERIAL_PORT == 0 - #error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration." -#elif SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif WITHIN(SERIAL_PORT, 0, 6) - #define MYSERIAL0 MSERIAL(SERIAL_PORT) -#else - #error "SERIAL_PORT must be from -1 to 6. Please update your configuration." -#endif - -#ifdef SERIAL_PORT_2 - #if defined(STM32F4) && SERIAL_PORT_2 == 0 - #error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration." - #elif SERIAL_PORT_2 == -1 - #define MYSERIAL1 SerialUSB - #elif WITHIN(SERIAL_PORT_2, 0, 6) - #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) - #else - #error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration." - #endif -#endif - -#ifdef LCD_SERIAL_PORT - #if defined(STM32F4) && LCD_SERIAL_PORT == 0 - #error "LCD_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration." - #elif LCD_SERIAL_PORT == -1 - #define LCD_SERIAL SerialUSB - #elif WITHIN(LCD_SERIAL_PORT, 0, 6) - #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT) - #else - #error "LCD_SERIAL_PORT must be from -1 to 6. Please update your configuration." - #endif -#endif - -/** - * TODO: review this to return 1 for pins that are not analog input - */ -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) (p) -#endif - -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() -#define cli() __disable_irq() -#define sei() __enable_irq() - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -// ------------------------ -// Types -// ------------------------ - -typedef int8_t pin_t; - -#ifdef STM32F4 - #define HAL_SERVO_LIB libServo -#endif - -// ------------------------ -// Public Variables -// ------------------------ - -// Result of last ADC conversion -extern uint16_t HAL_adc_result; - -// ------------------------ -// Public functions -// ------------------------ - -// Memory related -#define __bss_end __bss_end__ - -inline void HAL_init() {} - -// Clear reset reason -void HAL_clear_reset_source(); - -// Reset reason -uint8_t HAL_get_reset_source(); - -inline void HAL_reboot() {} // reboot the board or restart the bootloader - -void _delay_ms(const int delay); - -/* -extern "C" { - int freeMemory(); -} -*/ - -extern "C" char* _sbrk(int incr); - -/* -int freeMemory() { - volatile int top; - top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); - return top; -} -*/ - -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wunused-function" -#endif - -static inline int freeMemory() { - volatile char top; - return &top - reinterpret_cast(_sbrk(0)); -} - -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic pop -#endif - -// -// ADC -// - -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) - -inline void HAL_adc_init() {} - -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true - -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(); - -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -#ifdef STM32F4 - #define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) - #define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp b/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp deleted file mode 100644 index ebd0b4cee7d0..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * Adapted to the Marlin STM32F4/7 HAL - */ - -#include "../../inc/MarlinConfig.h" - -#include -#include -#include "../shared/HAL_SPI.h" -#include "spi_pins.h" - -// ------------------------ -// Public Variables -// ------------------------ - -static SPISettings spiConfig; - -// ------------------------ -// Public functions -// ------------------------ - -#if ENABLED(SOFTWARE_SPI) - // ------------------------ - // Software SPI - // ------------------------ - #error "Software SPI not supported for STM32F4/7. Use Hardware SPI." -#else - -// ------------------------ -// Hardware SPI -// ------------------------ - -/** - * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz - */ - -/** - * @brief Begin SPI port setup - * - * @return Nothing - * - * @details Only configures SS pin since libmaple creates and initialize the SPI object - */ -void spiBegin() { - #if !defined(SS_PIN) || SS_PIN < 0 - #error "SS_PIN not defined!" - #endif - - OUT_WRITE(SS_PIN, HIGH); -} - -/** Configure SPI for specified SPI speed */ -void spiInit(uint8_t spiRate) { - // Use datarates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 300000; break; - default: clock = 4000000; // Default from the SPI libarary - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -/** - * @brief Receives a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ -uint8_t spiRec() { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; -} - -/** - * @brief Receives a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - * - * @details Uses DMA - */ -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - #ifndef STM32GENERIC - SPI.dmaTransfer(0, const_cast(buf), nbyte); - #else - SPI.transfer((uint8_t*)buf, nbyte); - #endif - SPI.endTransaction(); -} - -/** - * @brief Sends a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); -} - -/** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Use DMA - */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPI.transfer(token); - #ifndef STM32GENERIC - SPI.dmaSend(const_cast(buf), 512); - #else - SPI.transfer((uint8_t*)buf, nullptr, 512); - #endif - SPI.endTransaction(); -} - -#endif // SOFTWARE_SPI -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/README.md b/Marlin/src/HAL/STM32_F4_F7/README.md deleted file mode 100644 index 3b5a9ab02e21..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# This HAL is for... - - - STM32F407 MCU with STM32Generic Arduino core by danieleff. - - STM32F765 board "The Borg" with STM32Generic. - -See the `README.md` files in HAL_STM32F4 and HAL_STM32F7 for the specifics of those hals. diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md b/Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md deleted file mode 100644 index 10396e875b88..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# This HAL is for the STM32F407 MCU used with STM32Generic Arduino core by danieleff. - -# Arduino core is located at: - -https://github.com/danieleff/STM32GENERIC - -Unzip it into [Arduino]/hardware folder - -# This HAL is in development. - -This HAL is a modified version of Chris Barr's Picoprint STM32F4 HAL. - diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp deleted file mode 100644 index 8b753f72902e..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ -#if defined(STM32GENERIC) && defined(STM32F4) - -#include "../../../inc/MarlinConfig.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 2 -#define STEP_TIMER_IRQ_ID TIM5_IRQn -#define TEMP_TIMER_IRQ_ID TIM7_IRQn - -// ------------------------ -// Private Variables -// ------------------------ - -stm32_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; - -// ------------------------ -// Public functions -// ------------------------ - -bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - constexpr uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1, - temp_prescaler = TEMP_TIMER_PRESCALE - 1; - switch (timer_num) { - case STEP_TIMER_NUM: - // STEPPER TIMER TIM5 - use a 32bit timer - __HAL_RCC_TIM5_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM5; - TimerHandle[timer_num].handle.Init.Prescaler = step_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC5_Handler; - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 1, 0); - break; - - case TEMP_TIMER_NUM: - // TEMP TIMER TIM7 - any available 16bit Timer (1 already used for PWM) - __HAL_RCC_TIM7_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM7; - TimerHandle[timer_num].handle.Init.Prescaler = temp_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC7_Handler; - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_ID, 2, 0); - break; - } - timers_initialized[timer_num] = true; - } - - TimerHandle[timer_num].handle.Init.Period = (((HAL_TIMER_RATE) / TimerHandle[timer_num].handle.Init.Prescaler) / frequency) - 1; - if (HAL_TIM_Base_Init(&TimerHandle[timer_num].handle) == HAL_OK) - HAL_TIM_Base_Start_IT(&TimerHandle[timer_num].handle); -} - -extern "C" { - void TIM5_IRQHandler() { ((void(*)())TimerHandle[0].callback)(); } - void TIM7_IRQHandler() { ((void(*)())TimerHandle[1].callback)(); } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_EnableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_EnableIRQ(TEMP_TIMER_IRQ_ID); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_DisableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_DisableIRQ(TEMP_TIMER_IRQ_ID); break; - } - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)STEP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)STEP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - case TEMP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - } - return false; -} - -#endif // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h b/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h deleted file mode 100644 index a4a7ad82cca9..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2017 Victor Perez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -#define hal_timer_t uint32_t // TODO: One is 16-bit, one 32-bit - does this need to be checked? -#define HAL_TIMER_TYPE_MAX 0xFFFF - -#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals - -#ifndef STEP_TIMER_NUM - #define STEP_TIMER_NUM 0 // Timer Index for Stepper -#endif -#ifndef PULSE_TIMER_NUM - #define PULSE_TIMER_NUM STEP_TIMER_NUM -#endif -#ifndef TEMP_TIMER_NUM - #define TEMP_TIMER_NUM 1 // Timer Index for Temperature -#endif - -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency - -#define STEPPER_TIMER_PRESCALE 54 // was 40,prescaler for setting stepper timer, 2Mhz -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -// TODO change this - -#ifdef STM32GENERIC - #define TC_TIMER_ARGS -#else - #define TC_TIMER_ARGS stimer_t *htim -#endif - -extern void TC5_Handler(TC_TIMER_ARGS); -extern void TC7_Handler(TC_TIMER_ARGS); -#ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() void TC5_Handler(TC_TIMER_ARGS) -#endif -#ifndef HAL_TEMP_TIMER_ISR - #define HAL_TEMP_TIMER_ISR() void TC7_Handler(TC_TIMER_ARGS) -#endif - -// ------------------------ -// Types -// ------------------------ - -#ifdef STM32GENERIC - typedef struct { - TIM_HandleTypeDef handle; - uint32_t callback; - } tTimerConfig; - typedef tTimerConfig stm32_timer_t; -#else - typedef stimer_t stm32_timer_t; -#endif - -// ------------------------ -// Public Variables -// ------------------------ - -extern stm32_timer_t TimerHandle[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -FORCE_INLINE static uint32_t HAL_timer_get_count(const uint8_t timer_num) { - return __HAL_TIM_GET_COUNTER(&TimerHandle[timer_num].handle); -} - -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { - __HAL_TIM_SET_AUTORELOAD(&TimerHandle[timer_num].handle, compare); - if (HAL_timer_get_count(timer_num) >= compare) - TimerHandle[timer_num].handle.Instance->EGR |= TIM_EGR_UG; // Generate an immediate update interrupt -} - -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return __HAL_TIM_GET_AUTORELOAD(&TimerHandle[timer_num].handle); -} - -#ifdef STM32GENERIC - FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { - if (__HAL_TIM_GET_FLAG(&TimerHandle[timer_num].handle, TIM_FLAG_UPDATE) == SET) - __HAL_TIM_CLEAR_FLAG(&TimerHandle[timer_num].handle, TIM_FLAG_UPDATE); - } -#else - #define HAL_timer_isr_prologue(TIMER_NUM) -#endif - -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md b/Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md deleted file mode 100644 index 23155b425e31..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# This HAL is for the STM32F765 board "The Borg" used with STM32Generic Arduino core by danieleff. - -# Original core is located at: - -https://github.com/danieleff/STM32GENERIC - -but I haven't committed the changes needed for the Borg there yet, so please use: - -https://github.com/Spawn32/STM32GENERIC - -Unzip it into [Arduino]/hardware folder - - -Download the latest GNU ARM Embedded Toolchain: - -https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads - -(The one in Arduino doesn't support STM32F7). - -Change compiler.path in platform.txt to point to the one you downloaded. - -# This HAL is in development. -# Currently only tested on "The Borg". - -You will also need the latest Arduino 1.9.0-beta or newer. - -This HAL is a modified version of Chris Barr's Picoprint STM32F4 HAL, so shouldn't be to hard to get it to work on a F4. diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp deleted file mode 100644 index e67808c3c458..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp +++ /dev/null @@ -1,898 +0,0 @@ -/** - * TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino - * - * based on the stepper library by Tom Igoe, et. al. - * - * Copyright (c) 2011, Interactive Matter, Marcus Nowotny - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#if defined(STM32GENERIC) && defined(STM32F7) - -#include "../../../inc/MarlinConfigPre.h" - -#if HAS_DRIVER(TMC2660) - -#include -#include -#include "TMC2660.h" - -#include "../../../inc/MarlinConfig.h" -#include "../../../MarlinCore.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/printcounter.h" -#include "../../../libs/duration_t.h" -#include "../../../libs/hex_print.h" - -//some default values used in initialization -#define DEFAULT_MICROSTEPPING_VALUE 32 - -//TMC26X register definitions -#define DRIVER_CONTROL_REGISTER 0x0UL -#define CHOPPER_CONFIG_REGISTER 0x80000UL -#define COOL_STEP_REGISTER 0xA0000ul -#define STALL_GUARD2_LOAD_MEASURE_REGISTER 0xC0000ul -#define DRIVER_CONFIG_REGISTER 0xE0000ul - -#define REGISTER_BIT_PATTERN 0xFFFFFul - -//definitions for the driver control register -#define MICROSTEPPING_PATTERN 0xFul -#define STEP_INTERPOLATION 0x200UL -#define DOUBLE_EDGE_STEP 0x100UL -#define VSENSE 0x40UL -#define READ_MICROSTEP_POSTION 0x0UL -#define READ_STALL_GUARD_READING 0x10UL -#define READ_STALL_GUARD_AND_COOL_STEP 0x20UL -#define READ_SELECTION_PATTERN 0x30UL - -//definitions for the chopper config register -#define CHOPPER_MODE_STANDARD 0x0UL -#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000UL -#define T_OFF_PATTERN 0xFul -#define RANDOM_TOFF_TIME 0x2000UL -#define BLANK_TIMING_PATTERN 0x18000UL -#define BLANK_TIMING_SHIFT 15 -#define HYSTERESIS_DECREMENT_PATTERN 0x1800UL -#define HYSTERESIS_DECREMENT_SHIFT 11 -#define HYSTERESIS_LOW_VALUE_PATTERN 0x780UL -#define HYSTERESIS_LOW_SHIFT 7 -#define HYSTERESIS_START_VALUE_PATTERN 0x78UL -#define HYSTERESIS_START_VALUE_SHIFT 4 -#define T_OFF_TIMING_PATERN 0xFul - -//definitions for cool step register -#define MINIMUM_CURRENT_FOURTH 0x8000UL -#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000UL -#define SE_MAX_PATTERN 0xF00ul -#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60UL -#define SE_MIN_PATTERN 0xFul - -//definitions for StallGuard2 current register -#define STALL_GUARD_FILTER_ENABLED 0x10000UL -#define STALL_GUARD_TRESHHOLD_VALUE_PATTERN 0x17F00ul -#define CURRENT_SCALING_PATTERN 0x1Ful -#define STALL_GUARD_CONFIG_PATTERN 0x17F00ul -#define STALL_GUARD_VALUE_PATTERN 0x7F00ul - -//definitions for the input from the TMC2660 -#define STATUS_STALL_GUARD_STATUS 0x1UL -#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2UL -#define STATUS_OVER_TEMPERATURE_WARNING 0x4UL -#define STATUS_SHORT_TO_GROUND_A 0x8UL -#define STATUS_SHORT_TO_GROUND_B 0x10UL -#define STATUS_OPEN_LOAD_A 0x20UL -#define STATUS_OPEN_LOAD_B 0x40UL -#define STATUS_STAND_STILL 0x80UL -#define READOUT_VALUE_PATTERN 0xFFC00ul - -#define CPU_32_BIT - -//default values -#define INITIAL_MICROSTEPPING 0x3UL //32th microstepping - -SPIClass SPI_6(SPI6, SPI6_MOSI_PIN, SPI6_MISO_PIN, SPI6_SCK_PIN); - -#define STEPPER_SPI SPI_6 - -//debuging output - -//#define TMC_DEBUG1 - -uint8_t current_scaling = 0; - -/** - * Constructor - * number_of_steps - the steps per rotation - * cs_pin - the SPI client select pin - * dir_pin - the pin where the direction pin is connected - * step_pin - the pin where the step pin is connected - */ -TMC26XStepper::TMC26XStepper(const int16_t in_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t current, uint16_t resistor) { - // We are not started yet - started = false; - - // By default cool step is not enabled - cool_step_enabled = false; - - // Save the pins for later use - this->cs_pin = cs_pin; - this->dir_pin = dir_pin; - this->step_pin = step_pin; - - // Store the current sense resistor value for later use - this->resistor = resistor; - - // Initizalize our status values - this->steps_left = 0; - this->direction = 0; - - // Initialize register values - driver_control_register_value = DRIVER_CONTROL_REGISTER | INITIAL_MICROSTEPPING; - chopper_config_register = CHOPPER_CONFIG_REGISTER; - - // Setting the default register values - driver_control_register_value = DRIVER_CONTROL_REGISTER|INITIAL_MICROSTEPPING; - microsteps = _BV(INITIAL_MICROSTEPPING); - chopper_config_register = CHOPPER_CONFIG_REGISTER; - cool_step_register_value = COOL_STEP_REGISTER; - stallguard2_current_register_value = STALL_GUARD2_LOAD_MEASURE_REGISTER; - driver_configuration_register_value = DRIVER_CONFIG_REGISTER | READ_STALL_GUARD_READING; - - // Set the current - setCurrent(current); - // Set to a conservative start value - setConstantOffTimeChopper(7, 54, 13,12,1); - // Set a nice microstepping value - setMicrosteps(DEFAULT_MICROSTEPPING_VALUE); - // Save the number of steps - number_of_steps = in_steps; -} - - -/** - * start & configure the stepper driver - * just must be called. - */ -void TMC26XStepper::start() { - - #ifdef TMC_DEBUG1 - SERIAL_ECHOLNPGM("\n TMC26X stepper library"); - SERIAL_ECHOPAIR("\n CS pin: ", cs_pin); - SERIAL_ECHOPAIR("\n DIR pin: ", dir_pin); - SERIAL_ECHOPAIR("\n STEP pin: ", step_pin); - SERIAL_PRINTF("\n current scaling: %d", current_scaling); - SERIAL_PRINTF("\n Resistor: %d", resistor); - //SERIAL_PRINTF("\n current: %d", current); - SERIAL_ECHOPAIR("\n Microstepping: ", microsteps); - #endif - - //set the pins as output & its initial value - pinMode(step_pin, OUTPUT); - pinMode(dir_pin, OUTPUT); - pinMode(cs_pin, OUTPUT); - extDigitalWrite(step_pin, LOW); - extDigitalWrite(dir_pin, LOW); - extDigitalWrite(cs_pin, HIGH); - - STEPPER_SPI.begin(); - STEPPER_SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE3)); - - //set the initial values - send262(driver_control_register_value); - send262(chopper_config_register); - send262(cool_step_register_value); - send262(stallguard2_current_register_value); - send262(driver_configuration_register_value); - - //save that we are in running mode - started = true; -} - -/** - * Mark the driver as unstarted to be able to start it again - */ -void TMC26XStepper::un_start() { started = false; } - - -/** - * Sets the speed in revs per minute - */ -void TMC26XStepper::setSpeed(uint16_t whatSpeed) { - this->speed = whatSpeed; - this->step_delay = 60UL * sq(1000UL) / ((uint32_t)this->number_of_steps * (uint32_t)whatSpeed * (uint32_t)this->microsteps); - #ifdef TMC_DEBUG0 // crashes - SERIAL_ECHOPAIR("\nStep delay in micros: ", this->step_delay); - #endif - // Update the next step time - this->next_step_time = this->last_step_time + this->step_delay; -} - -uint16_t TMC26XStepper::getSpeed() { return this->speed; } - -/** - * Moves the motor steps_to_move steps. - * Negative indicates the reverse direction. - */ -char TMC26XStepper::step(int16_t steps_to_move) { - if (this->steps_left == 0) { - this->steps_left = ABS(steps_to_move); // how many steps to take - - // determine direction based on whether steps_to_move is + or -: - if (steps_to_move > 0) - this->direction = 1; - else if (steps_to_move < 0) - this->direction = 0; - return 0; - } - return -1; -} - -char TMC26XStepper::move() { - // decrement the number of steps, moving one step each time: - if (this->steps_left > 0) { - uint32_t time = micros(); - // move only if the appropriate delay has passed: - - // rem if (time >= this->next_step_time) { - - if (ABS(time - this->last_step_time) > this->step_delay) { - // increment or decrement the step number, - // depending on direction: - if (this->direction == 1) - extDigitalWrite(step_pin, HIGH); - else { - extDigitalWrite(dir_pin, HIGH); - extDigitalWrite(step_pin, HIGH); - } - // get the timeStamp of when you stepped: - this->last_step_time = time; - this->next_step_time = time + this->step_delay; - // decrement the steps left: - steps_left--; - //disable the step & dir pins - extDigitalWrite(step_pin, LOW); - extDigitalWrite(dir_pin, LOW); - } - return -1; - } - return 0; -} - -char TMC26XStepper::isMoving() { return this->steps_left > 0; } - -uint16_t TMC26XStepper::getStepsLeft() { return this->steps_left; } - -char TMC26XStepper::stop() { - //note to self if the motor is currently moving - char state = isMoving(); - //stop the motor - this->steps_left = 0; - this->direction = 0; - //return if it was moving - return state; -} - -void TMC26XStepper::setCurrent(uint16_t current) { - uint8_t current_scaling = 0; - //calculate the current scaling from the max current setting (in mA) - float mASetting = (float)current, - resistor_value = (float)this->resistor; - // remove vsense flag - this->driver_configuration_register_value &= ~(VSENSE); - // Derived from I = (cs + 1) / 32 * (Vsense / Rsense) - // leading to cs = 32 * R * I / V (with V = 0,31V oder 0,165V and I = 1000 * current) - // with Rsense = 0,15 - // for vsense = 0,310V (VSENSE not set) - // or vsense = 0,165V (VSENSE set) - current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.31 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5 - - // Check if the current scalingis too low - if (current_scaling < 16) { - // Set the csense bit to get a use half the sense voltage (to support lower motor currents) - this->driver_configuration_register_value |= VSENSE; - // and recalculate the current setting - current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.165 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5 - #ifdef TMC_DEBUG0 // crashes - SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling); - #endif - } - #ifdef TMC_DEBUG0 // crashes - else - SERIAL_ECHOPAIR("\nCS: ", current_scaling); - #endif - - // do some sanity checks - NOMORE(current_scaling, 31); - - // delete the old value - stallguard2_current_register_value &= ~(CURRENT_SCALING_PATTERN); - // set the new current scaling - stallguard2_current_register_value |= current_scaling; - // if started we directly send it to the motor - if (started) { - send262(driver_configuration_register_value); - send262(stallguard2_current_register_value); - } -} - -uint16_t TMC26XStepper::getCurrent() { - // Calculate the current according to the datasheet to be on the safe side. - // This is not the fastest but the most accurate and illustrative way. - float result = (float)(stallguard2_current_register_value & CURRENT_SCALING_PATTERN), - resistor_value = (float)this->resistor, - voltage = (driver_configuration_register_value & VSENSE) ? 0.165 : 0.31; - result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); - return (uint16_t)result; -} - -void TMC26XStepper::setStallGuardThreshold(char stallguard_threshold, char stallguard_filter_enabled) { - // We just have 5 bits - LIMIT(stallguard_threshold, -64, 63); - - // Add trim down to 7 bits - stallguard_threshold &= 0x7F; - // Delete old StallGuard settings - stallguard2_current_register_value &= ~(STALL_GUARD_CONFIG_PATTERN); - if (stallguard_filter_enabled) - stallguard2_current_register_value |= STALL_GUARD_FILTER_ENABLED; - - // Set the new StallGuard threshold - stallguard2_current_register_value |= (((uint32_t)stallguard_threshold << 8) & STALL_GUARD_CONFIG_PATTERN); - // If started we directly send it to the motor - if (started) send262(stallguard2_current_register_value); -} - -char TMC26XStepper::getStallGuardThreshold() { - uint32_t stallguard_threshold = stallguard2_current_register_value & STALL_GUARD_VALUE_PATTERN; - //shift it down to bit 0 - stallguard_threshold >>= 8; - //convert the value to an int16_t to correctly handle the negative numbers - char result = stallguard_threshold; - //check if it is negative and fill it up with leading 1 for proper negative number representation - //rem if (result & _BV(6)) { - - if (TEST(result, 6)) result |= 0xC0; - return result; -} - -char TMC26XStepper::getStallGuardFilter() { - if (stallguard2_current_register_value & STALL_GUARD_FILTER_ENABLED) - return -1; - return 0; -} - -/** - * Set the number of microsteps per step. - * 0,2,4,8,16,32,64,128,256 is supported - * any value in between will be mapped to the next smaller value - * 0 and 1 set the motor in full step mode - */ -void TMC26XStepper::setMicrosteps(const int16_t in_steps) { - uint16_t setting_pattern; - - if (in_steps >= 256) setting_pattern = 0; - else if (in_steps >= 128) setting_pattern = 1; - else if (in_steps >= 64) setting_pattern = 2; - else if (in_steps >= 32) setting_pattern = 3; - else if (in_steps >= 16) setting_pattern = 4; - else if (in_steps >= 8) setting_pattern = 5; - else if (in_steps >= 4) setting_pattern = 6; - else if (in_steps >= 2) setting_pattern = 7; - else if (in_steps <= 1) setting_pattern = 8; // 1 and 0 lead to full step - - microsteps = _BV(8 - setting_pattern); - - #ifdef TMC_DEBUG0 // crashes - SERIAL_ECHOPAIR("\n Microstepping: ", microsteps); - #endif - - // Delete the old value - this->driver_control_register_value &= 0x000FFFF0UL; - - // Set the new value - this->driver_control_register_value |= setting_pattern; - - // If started we directly send it to the motor - if (started) send262(driver_control_register_value); - - // Recalculate the stepping delay by simply setting the speed again - this->setSpeed(this->speed); -} - -/** - * returns the effective number of microsteps at the moment - */ -int16_t TMC26XStepper::getMicrosteps() { return microsteps; } - -/** - * constant_off_time: The off time setting controls the minimum chopper frequency. - * For most applications an off time within the range of 5μs to 20μs will fit. - * 2...15: off time setting - * - * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the - * duration of the ringing on the sense resistor. For - * 0: min. setting 3: max. setting - * - * fast_decay_time_setting: Fast decay time setting. With CHM=1, these bits control the portion of fast decay for each chopper cycle. - * 0: slow decay only - * 1...15: duration of fast decay phase - * - * sine_wave_offset: Sine wave offset. With CHM=1, these bits control the sine wave offset. - * A positive offset corrects for zero crossing error. - * -3..-1: negative offset 0: no offset 1...12: positive offset - * - * use_current_comparator: Selects usage of the current comparator for termination of the fast decay cycle. - * If current comparator is enabled, it terminates the fast decay cycle in case the current - * reaches a higher negative value than the actual positive value. - * 1: enable comparator termination of fast decay cycle - * 0: end by time only - */ -void TMC26XStepper::setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, uint8_t use_current_comparator) { - // Perform some sanity checks - LIMIT(constant_off_time, 2, 15); - - // Save the constant off time - this->constant_off_time = constant_off_time; - - // Calculate the value acc to the clock cycles - const char blank_value = blank_time >= 54 ? 3 : - blank_time >= 36 ? 2 : - blank_time >= 24 ? 1 : 0; - - LIMIT(fast_decay_time_setting, 0, 15); - LIMIT(sine_wave_offset, -3, 12); - - // Shift the sine_wave_offset - sine_wave_offset += 3; - - // Calculate the register setting - // First of all delete all the values for this - chopper_config_register &= ~(_BV(12) | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN); - // Set the constant off pattern - chopper_config_register |= CHOPPER_MODE_T_OFF_FAST_DECAY; - // Set the blank timing value - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - // Setting the constant off time - chopper_config_register |= constant_off_time; - // Set the fast decay time - // Set msb - chopper_config_register |= (((uint32_t)(fast_decay_time_setting & 0x8)) << HYSTERESIS_DECREMENT_SHIFT); - // Other bits - chopper_config_register |= (((uint32_t)(fast_decay_time_setting & 0x7)) << HYSTERESIS_START_VALUE_SHIFT); - // Set the sine wave offset - chopper_config_register |= (uint32_t)sine_wave_offset << HYSTERESIS_LOW_SHIFT; - // Using the current comparator? - if (!use_current_comparator) - chopper_config_register |= _BV(12); - - // If started we directly send it to the motor - if (started) { - // rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -/** - * constant_off_time: The off time setting controls the minimum chopper frequency. - * For most applications an off time within the range of 5μs to 20μs will fit. - * 2...15: off time setting - * - * blank_time: Selects the comparator blank time. This time needs to safely cover the switching event and the - * duration of the ringing on the sense resistor. For - * 0: min. setting 3: max. setting - * - * hysteresis_start: Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value HEND. - * 1...8 - * - * hysteresis_end: Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by HDEC. - * The sum HSTRT+HEND must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. - * -3..-1: negative HEND 0: zero HEND 1...12: positive HEND - * - * hysteresis_decrement: Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. - * 0: fast decrement 3: very slow decrement - */ - -void TMC26XStepper::setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement) { - // Perform some sanity checks - LIMIT(constant_off_time, 2, 15); - - // Save the constant off time - this->constant_off_time = constant_off_time; - - // Calculate the value acc to the clock cycles - const char blank_value = blank_time >= 54 ? 3 : - blank_time >= 36 ? 2 : - blank_time >= 24 ? 1 : 0; - - LIMIT(hysteresis_start, 1, 8); - hysteresis_start--; - - LIMIT(hysteresis_start, -3, 12); - - // Shift the hysteresis_end - hysteresis_end += 3; - - LIMIT(hysteresis_decrement, 0, 3); - - //first of all delete all the values for this - chopper_config_register &= ~(CHOPPER_MODE_T_OFF_FAST_DECAY | BLANK_TIMING_PATTERN | HYSTERESIS_DECREMENT_PATTERN | HYSTERESIS_LOW_VALUE_PATTERN | HYSTERESIS_START_VALUE_PATTERN | T_OFF_TIMING_PATERN); - - //set the blank timing value - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - //setting the constant off time - chopper_config_register |= constant_off_time; - //set the hysteresis_start - chopper_config_register |= ((uint32_t)hysteresis_start) << HYSTERESIS_START_VALUE_SHIFT; - //set the hysteresis end - chopper_config_register |= ((uint32_t)hysteresis_end) << HYSTERESIS_LOW_SHIFT; - //set the hystereis decrement - chopper_config_register |= ((uint32_t)blank_value) << BLANK_TIMING_SHIFT; - //if started we directly send it to the motor - if (started) { - //rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -/** - * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. - * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. - * With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a - * few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. - * Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. - * Hint: A common factor, which can cause motor noise, is a bad PCB layout causing coupling of both sense resistor voltages - * (please refer to sense resistor layout hint in chapter 8.1). - * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. - * It modulates the slow decay time setting when switched on by the RNDTF bit. The RNDTF feature further spreads the chopper spectrum, - * reducing electromagnetic emission on single frequencies. - */ -void TMC26XStepper::setRandomOffTime(char value) { - if (value) - chopper_config_register |= RANDOM_TOFF_TIME; - else - chopper_config_register &= ~(RANDOM_TOFF_TIME); - //if started we directly send it to the motor - if (started) { - //rem send262(driver_control_register_value); - send262(chopper_config_register); - } -} - -void TMC26XStepper::setCoolStepConfiguration( - uint16_t lower_SG_threshold, - uint16_t SG_hysteresis, - uint8_t current_decrement_step_size, - uint8_t current_increment_step_size, - uint8_t lower_current_limit -) { - // Sanitize the input values - NOMORE(lower_SG_threshold, 480); - // Divide by 32 - lower_SG_threshold >>= 5; - NOMORE(SG_hysteresis, 480); - // Divide by 32 - SG_hysteresis >>= 5; - NOMORE(current_decrement_step_size, 3); - NOMORE(current_increment_step_size, 3); - NOMORE(lower_current_limit, 1); - - // Store the lower level in order to enable/disable the cool step - this->cool_step_lower_threshold=lower_SG_threshold; - // If cool step is not enabled we delete the lower value to keep it disabled - if (!this->cool_step_enabled) lower_SG_threshold = 0; - // The good news is that we can start with a complete new cool step register value - // And simply set the values in the register - cool_step_register_value = ((uint32_t)lower_SG_threshold) - | (((uint32_t)SG_hysteresis) << 8) - | (((uint32_t)current_decrement_step_size) << 5) - | (((uint32_t)current_increment_step_size) << 13) - | (((uint32_t)lower_current_limit) << 15) - | COOL_STEP_REGISTER; // Register signature - - if (started) send262(cool_step_register_value); -} - -void TMC26XStepper::setCoolStepEnabled(boolean enabled) { - // Simply delete the lower limit to disable the cool step - cool_step_register_value &= ~SE_MIN_PATTERN; - // And set it to the proper value if cool step is to be enabled - if (enabled) - cool_step_register_value |= this->cool_step_lower_threshold; - // And save the enabled status - this->cool_step_enabled = enabled; - // Save the register value - if (started) send262(cool_step_register_value); -} - -boolean TMC26XStepper::isCoolStepEnabled() { return this->cool_step_enabled; } - -uint16_t TMC26XStepper::getCoolStepLowerSgThreshold() { - // We return our internally stored value - in order to provide the correct setting even if cool step is not enabled - return this->cool_step_lower_threshold<<5; -} - -uint16_t TMC26XStepper::getCoolStepUpperSgThreshold() { - return uint8_t((cool_step_register_value & SE_MAX_PATTERN) >> 8) << 5; -} - -uint8_t TMC26XStepper::getCoolStepCurrentIncrementSize() { - return uint8_t((cool_step_register_value & CURRENT_DOWN_STEP_SPEED_PATTERN) >> 13); -} - -uint8_t TMC26XStepper::getCoolStepNumberOfSGReadings() { - return uint8_t((cool_step_register_value & SE_CURRENT_STEP_WIDTH_PATTERN) >> 5); -} - -uint8_t TMC26XStepper::getCoolStepLowerCurrentLimit() { - return uint8_t((cool_step_register_value & MINIMUM_CURRENT_FOURTH) >> 15); -} - -void TMC26XStepper::setEnabled(boolean enabled) { - //delete the t_off in the chopper config to get sure - chopper_config_register &= ~(T_OFF_PATTERN); - if (enabled) { - //and set the t_off time - chopper_config_register |= this->constant_off_time; - } - //if not enabled we don't have to do anything since we already delete t_off from the register - if (started) send262(chopper_config_register); -} - -boolean TMC26XStepper::isEnabled() { return !!(chopper_config_register & T_OFF_PATTERN); } - -/** - * reads a value from the TMC26X status register. The value is not obtained directly but can then - * be read by the various status routines. - */ -void TMC26XStepper::readStatus(char read_value) { - uint32_t old_driver_configuration_register_value = driver_configuration_register_value; - //reset the readout configuration - driver_configuration_register_value &= ~(READ_SELECTION_PATTERN); - //this now equals TMC26X_READOUT_POSITION - so we just have to check the other two options - if (read_value == TMC26X_READOUT_STALLGUARD) - driver_configuration_register_value |= READ_STALL_GUARD_READING; - else if (read_value == TMC26X_READOUT_CURRENT) - driver_configuration_register_value |= READ_STALL_GUARD_AND_COOL_STEP; - - //all other cases are ignored to prevent funny values - //check if the readout is configured for the value we are interested in - if (driver_configuration_register_value != old_driver_configuration_register_value) { - //because then we need to write the value twice - one time for configuring, second time to get the value, see below - send262(driver_configuration_register_value); - } - //write the configuration to get the last status - send262(driver_configuration_register_value); -} - -int16_t TMC26XStepper::getMotorPosition() { - //we read it out even if we are not started yet - perhaps it is useful information for somebody - readStatus(TMC26X_READOUT_POSITION); - return getReadoutValue(); -} - -//reads the StallGuard setting from last status -//returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getCurrentStallGuardReading() { - //if we don't yet started there cannot be a StallGuard value - if (!started) return -1; - //not time optimal, but solution optiomal: - //first read out the StallGuard value - readStatus(TMC26X_READOUT_STALLGUARD); - return getReadoutValue(); -} - -uint8_t TMC26XStepper::getCurrentCSReading() { - //if we don't yet started there cannot be a StallGuard value - if (!started) return 0; - //not time optimal, but solution optiomal: - //first read out the StallGuard value - readStatus(TMC26X_READOUT_CURRENT); - return (getReadoutValue() & 0x1F); -} - -uint16_t TMC26XStepper::getCurrentCurrent() { - float result = (float)getCurrentCSReading(), - resistor_value = (float)this->resistor, - voltage = (driver_configuration_register_value & VSENSE)? 0.165 : 0.31; - result = (result + 1.0) / 32.0 * voltage / resistor_value * sq(1000.0); - return (uint16_t)result; -} - -/** - * Return true if the StallGuard threshold has been reached - */ -boolean TMC26XStepper::isStallGuardOverThreshold() { - if (!this->started) return false; - return (driver_status_result & STATUS_STALL_GUARD_STATUS); -} - -/** - * returns if there is any over temperature condition: - * OVER_TEMPERATURE_PREWARING if pre warning level has been reached - * OVER_TEMPERATURE_SHUTDOWN if the temperature is so hot that the driver is shut down - * Any of those levels are not too good. - */ -char TMC26XStepper::getOverTemperature() { - if (!this->started) return 0; - - if (driver_status_result & STATUS_OVER_TEMPERATURE_SHUTDOWN) - return TMC26X_OVERTEMPERATURE_SHUTDOWN; - - if (driver_status_result & STATUS_OVER_TEMPERATURE_WARNING) - return TMC26X_OVERTEMPERATURE_PREWARING; - - return 0; -} - -// Is motor channel A shorted to ground -boolean TMC26XStepper::isShortToGroundA() { - if (!this->started) return false; - return (driver_status_result & STATUS_SHORT_TO_GROUND_A); -} - -// Is motor channel B shorted to ground -boolean TMC26XStepper::isShortToGroundB() { - if (!this->started) return false; - return (driver_status_result & STATUS_SHORT_TO_GROUND_B); -} - -// Is motor channel A connected -boolean TMC26XStepper::isOpenLoadA() { - if (!this->started) return false; - return (driver_status_result & STATUS_OPEN_LOAD_A); -} - -// Is motor channel B connected -boolean TMC26XStepper::isOpenLoadB() { - if (!this->started) return false; - return (driver_status_result & STATUS_OPEN_LOAD_B); -} - -// Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStandStill() { - if (!this->started) return false; - return (driver_status_result & STATUS_STAND_STILL); -} - -//is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStallGuardReached() { - if (!this->started) return false; - return (driver_status_result & STATUS_STALL_GUARD_STATUS); -} - -//reads the StallGuard setting from last status -//returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getReadoutValue() { - return (int)(driver_status_result >> 10); -} - -int16_t TMC26XStepper::getResistor() { return this->resistor; } - -boolean TMC26XStepper::isCurrentScalingHalfed() { - return !!(this->driver_configuration_register_value & VSENSE); -} -/** - * version() returns the version of the library: - */ -int16_t TMC26XStepper::version() { return 1; } - -void TMC26XStepper::debugLastStatus() { - #ifdef TMC_DEBUG1 - if (this->started) { - if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_PREWARING) - SERIAL_ECHOLNPGM("\n WARNING: Overtemperature Prewarning!"); - else if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_SHUTDOWN) - SERIAL_ECHOLNPGM("\n ERROR: Overtemperature Shutdown!"); - - if (this->isShortToGroundA()) - SERIAL_ECHOLNPGM("\n ERROR: SHORT to ground on channel A!"); - - if (this->isShortToGroundB()) - SERIAL_ECHOLNPGM("\n ERROR: SHORT to ground on channel B!"); - - if (this->isOpenLoadA()) - SERIAL_ECHOLNPGM("\n ERROR: Channel A seems to be unconnected!"); - - if (this->isOpenLoadB()) - SERIAL_ECHOLNPGM("\n ERROR: Channel B seems to be unconnected!"); - - if (this->isStallGuardReached()) - SERIAL_ECHOLNPGM("\n INFO: Stall Guard level reached!"); - - if (this->isStandStill()) - SERIAL_ECHOLNPGM("\n INFO: Motor is standing still."); - - uint32_t readout_config = driver_configuration_register_value & READ_SELECTION_PATTERN; - const int16_t value = getReadoutValue(); - if (readout_config == READ_MICROSTEP_POSTION) { - SERIAL_ECHOPAIR("\n Microstep position phase A: ", value); - } - else if (readout_config == READ_STALL_GUARD_READING) { - SERIAL_ECHOPAIR("\n Stall Guard value:", value); - } - else if (readout_config == READ_STALL_GUARD_AND_COOL_STEP) { - SERIAL_ECHOPAIR("\n Approx Stall Guard: ", value & 0xF); - SERIAL_ECHOPAIR("\n Current level", value & 0x1F0); - } - } - #endif -} - -/** - * send register settings to the stepper driver via SPI - * returns the current status - */ -inline void TMC26XStepper::send262(uint32_t datagram) { - uint32_t i_datagram; - - //preserver the previous spi mode - //uint8_t oldMode = SPCR & SPI_MODE_MASK; - - //if the mode is not correct set it to mode 3 - //if (oldMode != SPI_MODE3) { - // SPI.setDataMode(SPI_MODE3); - //} - - //select the TMC driver - extDigitalWrite(cs_pin, LOW); - - //ensure that only valid bist are set (0-19) - //datagram &=REGISTER_BIT_PATTERN; - - #ifdef TMC_DEBUG1 - //SERIAL_PRINTF("Sending "); - //SERIAL_PRINTF("Sending ", datagram,HEX); - //SERIAL_ECHOPAIR("\n\nSending \n", print_hex_long(datagram)); - SERIAL_PRINTF("\n\nSending %x", datagram); - #endif - - //write/read the values - i_datagram = STEPPER_SPI.transfer((datagram >> 16) & 0xFF); - i_datagram <<= 8; - i_datagram |= STEPPER_SPI.transfer((datagram >> 8) & 0xFF); - i_datagram <<= 8; - i_datagram |= STEPPER_SPI.transfer((datagram) & 0xFF); - i_datagram >>= 4; - - #ifdef TMC_DEBUG1 - //SERIAL_PRINTF("Received "); - //SERIAL_PRINTF("Received ", i_datagram,HEX); - //SERIAL_ECHOPAIR("\n\nReceived \n", i_datagram); - SERIAL_PRINTF("\n\nReceived %x", i_datagram); - debugLastStatus(); - #endif - - //deselect the TMC chip - extDigitalWrite(cs_pin, HIGH); - - //restore the previous SPI mode if neccessary - //if the mode is not correct set it to mode 3 - //if (oldMode != SPI_MODE3) { - // SPI.setDataMode(oldMode); - //} - - //store the datagram as status result - driver_status_result = i_datagram; -} - -#endif // HAS_DRIVER(TMC2660) - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h b/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h deleted file mode 100644 index 208c3bc7e062..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h +++ /dev/null @@ -1,593 +0,0 @@ -/** - * TMC26XStepper.h - - TMC26X Stepper library for Wiring/Arduino - * - * based on the stepper library by Tom Igoe, et. al. - * - * Copyright (c) 2011, Interactive Matter, Marcus Nowotny - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#pragma once - -#include - -//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TMC chip -/*! - * This warning indicates that the TMC chip is too warm. - * It is still working but some parameters may be inferior. - * You should do something against it. - */ -#define TMC26X_OVERTEMPERATURE_PREWARING 1 -//! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC chip -/*! - * This warning indicates that the TMC chip is too warm to operate and has shut down to prevent damage. - * It will stop working until it cools down again. - * If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout - * and/or heat management. - */ -#define TMC26X_OVERTEMPERATURE_SHUTDOWN 2 - -//which values can be read out -/*! - * Selects to readout the microstep position from the motor. - *\sa readStatus() - */ -#define TMC26X_READOUT_POSITION 0 -/*! - * Selects to read out the StallGuard value of the motor. - *\sa readStatus() - */ -#define TMC26X_READOUT_STALLGUARD 1 -/*! - * Selects to read out the current current setting (acc. to CoolStep) and the upper bits of the StallGuard value from the motor. - *\sa readStatus(), setCurrent() - */ -#define TMC26X_READOUT_CURRENT 3 - -/*! - * Define to set the minimum current for CoolStep operation to 1/2 of the selected CS minium. - *\sa setCoolStepConfiguration() - */ -#define COOL_STEP_HALF_CS_LIMIT 0 -/*! - * Define to set the minimum current for CoolStep operation to 1/4 of the selected CS minium. - *\sa setCoolStepConfiguration() - */ -#define COOL_STEP_QUARTDER_CS_LIMIT 1 - -/*! - * \class TMC26XStepper - * \brief Class representing a TMC26X stepper driver - * - * To use one of these drivers in your code create an object of its class: - * \code - * TMC26XStepper tmc_stepper = TMC26XStepper(200,1,2,3,500); - * \endcode - * see TMC26XStepper(int16_t number_of_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t rms_current) - * - * Keep in mind that you need to start the driver with start() in order to configure the TMC26X. - * - * The most important function is move(). It checks if the motor requires a step. It's important to call move() as - * often as possible in loop(). I suggest using a very fast loop routine and always call move() at the beginning or end. - * - * To move you must set a movement speed with setSpeed(). The speed is a positive value, setting the RPM. - * - * To really move the motor you have to call step() to tell the driver to move the motor the given number - * of steps in the given direction. Positive values move the motor in one direction, negative values in the other. - * - * You can check with isMoving() if the motor is still moving or stop it abruptly with stop(). - */ -class TMC26XStepper { - public: - /*! - * \brief Create a new representation of a stepper motor connected to a TMC26X stepper driver - * - * Main constructor. If in doubt use this. All parameters must be provided as described below. - * - * \param number_of_steps Number of steps the motor has per rotation. - * \param cs_pin Arduino pin connected to the Client Select Pin (!CS) of the TMC26X for SPI. - * \param dir_pin Arduino pin connected to the DIR input of the TMC26X. - * \param step_pin Arduino pin connected to the STEP pin of the TMC26X. - * \param rms_current Maximum current to provide to the motor in mA (!). A value of 200 will send up to 200mA to the motor. - * \param resistor Current sense resistor in milli-Ohm, defaults to 0.15 Ohm (or 150 milli-Ohm) as in the TMC260 Arduino Shield. - * - * You must also call TMC26XStepper.start() to configure the stepper driver for use. - * - * By default the Constant Off Time chopper is used. See TMC26XStepper.setConstantOffTimeChopper() for details. - * This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper. See setSpreadCycleChopper(). - * - * By default a microstepping of 1/32 is used to provide a smooth motor run while still giving a good progression per step. - * Change stepping by sending setMicrosteps() a different value. - * \sa start(), setMicrosteps() - */ - TMC26XStepper(const int16_t in_steps, int16_t cs_pin, int16_t dir_pin, int16_t step_pin, uint16_t current, uint16_t resistor=100); //resistor=150 - - /*! - * \brief Configure and start the TMC26X stepper driver. Before this is called the stepper driver is nonfunctional. - * - * Configure the TMC26X stepper driver for the given values via SPI. - * Most member functions are non-functional if the driver has not been started, - * therefore it is best to call this in setup(). - */ - void start(); - - /*! - * \brief Reset the stepper in unconfigured mode. - * - * Allows start to be called again. It doesn't change the internal stepper - * configuration or the desired configuration. It just marks the stepper as - * not-yet-started. The stepper doesn't need to be reconfigured before - * starting again, and is not reset to any factory settings. - * It must be reset intentionally. - * (Hint: Normally you do not need this function) - */ - void un_start(); - - /*! - * \brief Set the rotation speed in RPM. - * \param whatSpeed the desired speed in RPM. - */ - void setSpeed(uint16_t whatSpeed); - - /*! - * \brief Report the currently selected speed in RPM. - * \sa setSpeed() - */ - uint16_t getSpeed(); - - /*! - * \brief Set the number of microsteps in 2^i values (rounded) up to 256 - * - * This method sets the number of microsteps per step in 2^i interval. - * It accepts 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps. - * Other values will be rounded down to the next smaller value (e.g., 3 gives a microstepping of 2). - * You can always check the current microstepping with getMicrosteps(). - */ - void setMicrosteps(const int16_t in_steps); - - /*! - * \brief Return the effective current number of microsteps selected. - * - * Always returns the effective number of microsteps. - * This may be different from the micro-steps set in setMicrosteps() since it is rounded to 2^i. - * - * \sa setMicrosteps() - */ - int16_t getMicrosteps(); - - /*! - * \brief Initiate a movement with the given number of steps. Positive values move in one direction, negative in the other. - * - * \param number_of_steps The number of steps to move the motor. - * \return 0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set. - * - * If the previous movement is incomplete the function returns -1 and doesn't change the steps to move the motor. - * If the motor does not move it returns 0. - * - * The movement direction is determined by the sign of the steps parameter. The motor direction in machine space - * cannot be determined, as it depends on the construction of the motor and how it functions in the drive system. - * - * For safety, verify with isMoving() or even use stop() to stop the motor before giving it new step directions. - * \sa isMoving(), getStepsLeft(), stop() - */ - char step(int16_t number_of_steps); - - /*! - * \brief Central movement method. Must be called as often as possible in the loop function and is very fast. - * - * Check if the motor still has to move and whether the wait-to-step interval has expired, and manages the - * number of steps remaining to fulfill the current move command. - * - * This function is implemented to be as fast as possible, so call it as often as possible in your loop. - * It should be invoked with as frequently and with as much regularity as possible. - * - * This can be called even when the motor is known not to be moving. It will simply return. - * - * The frequency with which this function is called determines the top stepping speed of the motor. - * It is recommended to call this using a hardware timer to ensure regular invocation. - * \sa step() - */ - char move(); - - /*! - * \brief Check whether the last movement command is done. - * \return 0 if the motor stops, -1 if the motor is moving. - * - * Used to determine if the motor is ready for new movements. - *\sa step(), move() - */ - char isMoving(); - - /*! - * \brief Get the number of steps left in the current movement. - * \return The number of steps left in the movement. Always positive. - */ - uint16_t getStepsLeft(); - - /*! - * \brief Stop the motor immediately. - * \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all. - * - * This method directly and abruptly stops the motor and may be used as an emergency stop. - */ - char stop(); - - /*! - * \brief Set and configure the classical Constant Off Timer Chopper - * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) - * \param blank_time Comparator blank time. This duration needs to safely cover the duration of the switching event and the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting - * \param fast_decay_time_setting Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 1…15: duration of fast decay phase - * \param sine_wave_offset Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset - * \param use_curreent_comparator Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable). - * - * The classic constant off time chopper uses a fixed portion of fast decay following each on phase. - * While the duration of the on time is determined by the chopper comparator, the fast decay time needs - * to be set by the user in a way, that the current decay is enough for the driver to be able to follow - * the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize - * motor current ripple and power dissipation. This best can be tuned using an oscilloscope or - * trying out motor smoothness at different velocities. A good starting value is a fast decay time setting - * similar to the slow decay time setting. - * After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. - * This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower - * than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short - * moment during current zero crossing, if it is set too high, it makes a larger microstep. - * Typically, a positive offset setting is required for optimum operation. - * - * \sa setSpreadCycleChoper() for other alternatives. - * \sa setRandomOffTime() for spreading the noise over a wider spectrum - */ - void setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, uint8_t use_current_comparator); - - /*! - * \brief Sets and configures with spread cycle chopper. - * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) - * \param blank_time Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting - * \param hysteresis_start Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 … 8 - * \param hysteresis_end Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. - * \param hysteresis_decrement Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement). - * - * The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines - * the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver - * to the motor. - * Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase. - * The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. - * The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of - * current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. - * The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is - * disabled during this time. - * - * \sa setRandomOffTime() for spreading the noise over a wider spectrum - */ - void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement); - - /*! - * \brief Use random off time for noise reduction (0 for off, -1 for on). - * \param value 0 for off, -1 for on - * - * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. - * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, - * thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper - * frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within - * each quarter wave. - * This effect normally is not audible when compared to mechanical noise generated by ball bearings, - * etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. - * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. - * It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum, - * reducing electromagnetic emission on single frequencies. - */ - void setRandomOffTime(char value); - - /*! - * \brief set the maximum motor current in mA (1000 is 1 Amp) - * Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller - * by employing CoolStep. - * \param current the maximum motor current in mA - * \sa getCurrent(), getCurrentCurrent() - */ - void setCurrent(uint16_t current); - - /*! - * \brief readout the motor maximum current in mA (1000 is an Amp) - * This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent() - * \return the maximum motor current in milli amps - * \sa getCurrentCurrent() - */ - uint16_t getCurrent(); - - /*! - * \brief set the StallGuard threshold in order to get sensible StallGuard readings. - * \param stallguard_threshold -64 … 63 the StallGuard threshold - * \param stallguard_filter_enabled 0 if the filter is disabled, -1 if it is enabled - * - * The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at - * the maximum allowable load on the otor (but not before). = is a good starting point (and the default) - * If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value. - * If you get readings of 1023 even with load decrease the setting. - * - * If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the - * reading. - * - * \sa getCurrentStallGuardReading() to read out the current value. - */ - void setStallGuardThreshold(char stallguard_threshold, char stallguard_filter_enabled); - - /*! - * \brief reads out the StallGuard threshold - * \return a number between -64 and 63. - */ - char getStallGuardThreshold(); - - /*! - * \brief returns the current setting of the StallGuard filter - * \return 0 if not set, -1 if set - */ - char getStallGuardFilter(); - - /*! - * \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. - * \param lower_SG_threshold Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480 - * \param SG_hysteresis Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480 - * \param current_decrement_step_size Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32 - * \param current_increment_step_size Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8 - * \param lower_current_limit Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - * The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load, - * read out by the StallGuard in order to provide the optimum torque with the minimal current consumption. - * You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the - * limit the current gets increased, below the limit the current gets decreased. - * You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of - * StallGuard readings neccessary above or below the limit to get a more stable current adjustement. - * The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current - * (1/2 or 1/4th otf the configured current). - * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - */ - void setCoolStepConfiguration(uint16_t lower_SG_threshold, uint16_t SG_hysteresis, uint8_t current_decrement_step_size, - uint8_t current_increment_step_size, uint8_t lower_current_limit); - - /*! - * \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. - * \param enabled true if CoolStep should be enabled, false if not. - * \sa setCoolStepConfiguration() - */ - void setCoolStepEnabled(boolean enabled); - - - /*! - * \brief check if the CoolStep feature is enabled - * \sa setCoolStepEnabled() - */ - boolean isCoolStepEnabled(); - - /*! - * \brief returns the lower StallGuard threshold for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint16_t getCoolStepLowerSgThreshold(); - - /*! - * \brief returns the upper StallGuard threshold for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint16_t getCoolStepUpperSgThreshold(); - - /*! - * \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current. - * \sa setCoolStepConfiguration() - */ - uint8_t getCoolStepNumberOfSGReadings(); - - /*! - * \brief returns the increment steps for the current for the CoolStep operation - * \sa setCoolStepConfiguration() - */ - uint8_t getCoolStepCurrentIncrementSize(); - - /*! - * \brief returns the absolut minium current for the CoolStep operation - * \sa setCoolStepConfiguration() - * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT - */ - uint8_t getCoolStepLowerCurrentLimit(); - - /*! - * \brief Get the current microstep position for phase A - * \return The current microstep position for phase A 0…255 - * - * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. - */ - int16_t getMotorPosition(); - - /*! - * \brief Reads the current StallGuard value. - * \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected. - * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. - * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. - */ - int16_t getCurrentStallGuardReading(); - - /*! - * \brief Reads the current current setting value as fraction of the maximum current - * Returns values between 0 and 31, representing 1/32 to 32/32 (=1) - * \sa setCoolStepConfiguration() - */ - uint8_t getCurrentCSReading(); - - - /*! - *\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. - *\return false if 0.13V is the reference voltage, true if 0.165V is used. - */ - boolean isCurrentScalingHalfed(); - - /*! - * \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). - * This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs - * the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it - * may not be the fastest. - * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent() - */ - uint16_t getCurrentCurrent(); - - /*! - * \brief checks if there is a StallGuard warning in the last status - * \return 0 if there was no warning, -1 if there was some warning. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - * - * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. - */ - boolean isStallGuardOverThreshold(); - - /*! - * \brief Return over temperature status of the last status readout - * return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - char getOverTemperature(); - - /*! - * \brief Is motor channel A shorted to ground detected in the last status readout. - * \return true is yes, false if not. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - - boolean isShortToGroundA(); - - /*! - * \brief Is motor channel B shorted to ground detected in the last status readout. - * \return true is yes, false if not. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - boolean isShortToGroundB(); - /*! - * \brief iIs motor channel A connected according to the last statu readout. - * \return true is yes, false if not. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - boolean isOpenLoadA(); - - /*! - * \brief iIs motor channel A connected according to the last statu readout. - * \return true is yes, false if not. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - boolean isOpenLoadB(); - - /*! - * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s - * \return true is yes, false if not. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - */ - boolean isStandStill(); - - /*! - * \brief checks if there is a StallGuard warning in the last status - * \return 0 if there was no warning, -1 if there was some warning. - * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. - * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. - * - * \sa isStallGuardOverThreshold() - * TODO why? - * - * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. - */ - boolean isStallGuardReached(); - - /*! - *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. - *\param enabled a boolean value true if the motor should be enabled, false otherwise. - */ - void setEnabled(boolean enabled); - - /*! - *\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely - *\return true if the bridges and by that the motor driver are enabled, false if not. - *\sa setEnabled() - */ - boolean isEnabled(); - - /*! - * \brief Manually read out the status register - * This function sends a byte to the motor driver in order to get the current readout. The parameter read_value - * seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method - * automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method - * may take time to send and read one or two bits - depending on the previous readout. - * \param read_value selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT - * \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT - */ - void readStatus(char read_value); - - /*! - * \brief Returns the current sense resistor value in milliohm. - * The default value of ,15 Ohm will return 150. - */ - int16_t getResistor(); - - /*! - * \brief Prints out all the information that can be found in the last status read out - it does not force a status readout. - * The result is printed via Serial - */ - void debugLastStatus(); - - /*! - * \brief library version - * \return the version number as int. - */ - int16_t version(); - - private: - uint16_t steps_left; // The steps the motor has to do to complete the movement - int16_t direction; // Direction of rotation - uint32_t step_delay; // Delay between steps, in ms, based on speed - int16_t number_of_steps; // Total number of steps this motor can take - uint16_t speed; // Store the current speed in order to change the speed after changing microstepping - uint16_t resistor; // Current sense resitor value in milliohm - - uint32_t last_step_time, // Timestamp (ms) of the last step - next_step_time; // Timestamp (ms) of the next step - - // Driver control register copies to easily set & modify the registers - uint32_t driver_control_register_value, - chopper_config_register, - cool_step_register_value, - stallguard2_current_register_value, - driver_configuration_register_value, - driver_status_result; // The driver status result - - // Helper routione to get the top 10 bit of the readout - inline int16_t getReadoutValue(); - - // The pins for the stepper driver - uint8_t cs_pin, step_pin, dir_pin; - - // Status values - boolean started; // If the stepper has been started yet - int16_t microsteps; // The current number of micro steps - char constant_off_time; // We need to remember this value in order to enable and disable the motor - uint8_t cool_step_lower_threshold; // we need to remember the threshold to enable and disable the CoolStep feature - boolean cool_step_enabled; // We need to remember this to configure the coolstep if it si enabled - - // SPI sender - inline void send262(uint32_t datagram); -}; diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp deleted file mode 100644 index bc8f76af0987..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ -#if defined(STM32GENERIC) && defined(STM32F7) - -#include "../../../inc/MarlinConfig.h" - -// ------------------------ -// Local defines -// ------------------------ - -#define NUM_HARDWARE_TIMERS 2 - -//#define PRESCALER 1 - -// ------------------------ -// Private Variables -// ------------------------ - -tTimerConfig timerConfig[NUM_HARDWARE_TIMERS]; - -// ------------------------ -// Public functions -// ------------------------ - -bool timers_initialized[NUM_HARDWARE_TIMERS] = { false }; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - switch (timer_num) { - case STEP_TIMER_NUM: - //STEPPER TIMER TIM5 //use a 32bit timer - __HAL_RCC_TIM5_CLK_ENABLE(); - timerConfig[0].timerdef.Instance = TIM5; - timerConfig[0].timerdef.Init.Prescaler = (STEPPER_TIMER_PRESCALE); - timerConfig[0].timerdef.Init.CounterMode = TIM_COUNTERMODE_UP; - timerConfig[0].timerdef.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - timerConfig[0].IRQ_Id = TIM5_IRQn; - timerConfig[0].callback = (uint32_t)TC5_Handler; - HAL_NVIC_SetPriority(timerConfig[0].IRQ_Id, 1, 0); - #if PIN_EXISTS(STEPPER_ENABLE) - OUT_WRITE(STEPPER_ENABLE_PIN, HIGH); - #endif - break; - case TEMP_TIMER_NUM: - //TEMP TIMER TIM7 // any available 16bit Timer (1 already used for PWM) - __HAL_RCC_TIM7_CLK_ENABLE(); - timerConfig[1].timerdef.Instance = TIM7; - timerConfig[1].timerdef.Init.Prescaler = (TEMP_TIMER_PRESCALE); - timerConfig[1].timerdef.Init.CounterMode = TIM_COUNTERMODE_UP; - timerConfig[1].timerdef.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - timerConfig[1].IRQ_Id = TIM7_IRQn; - timerConfig[1].callback = (uint32_t)TC7_Handler; - HAL_NVIC_SetPriority(timerConfig[1].IRQ_Id, 2, 0); - break; - } - timers_initialized[timer_num] = true; - } - - timerConfig[timer_num].timerdef.Init.Period = (((HAL_TIMER_RATE) / timerConfig[timer_num].timerdef.Init.Prescaler) / frequency) - 1; - - if (HAL_TIM_Base_Init(&timerConfig[timer_num].timerdef) == HAL_OK) - HAL_TIM_Base_Start_IT(&timerConfig[timer_num].timerdef); -} - -//forward the interrupt -extern "C" { - void TIM5_IRQHandler() { ((void(*)())timerConfig[0].callback)(); } - void TIM7_IRQHandler() { ((void(*)())timerConfig[1].callback)(); } -} - -void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { - __HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, compare); -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - HAL_NVIC_EnableIRQ(timerConfig[timer_num].IRQ_Id); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - HAL_NVIC_DisableIRQ(timerConfig[timer_num].IRQ_Id); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return __HAL_TIM_GetAutoreload(&timerConfig[timer_num].timerdef); -} - -uint32_t HAL_timer_get_count(const uint8_t timer_num) { - return __HAL_TIM_GetCounter(&timerConfig[timer_num].timerdef); -} - -void HAL_timer_isr_prologue(const uint8_t timer_num) { - if (__HAL_TIM_GET_FLAG(&timerConfig[timer_num].timerdef, TIM_FLAG_UPDATE) == SET) { - __HAL_TIM_CLEAR_FLAG(&timerConfig[timer_num].timerdef, TIM_FLAG_UPDATE); - } -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - const uint32_t IRQ_Id = uint32_t(timerConfig[timer_num].IRQ_Id); - return NVIC->ISER[IRQ_Id >> 5] & _BV32(IRQ_Id & 0x1F); -} - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h b/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h deleted file mode 100644 index d2f78259d68d..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2017 Victor Perez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -// ------------------------ -// Defines -// ------------------------ - -#define FORCE_INLINE __attribute__((always_inline)) inline - -#define hal_timer_t uint32_t // TODO: One is 16-bit, one 32-bit - does this need to be checked? -#define HAL_TIMER_TYPE_MAX 0xFFFF - -#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals - -#ifndef STEP_TIMER_NUM - #define STEP_TIMER_NUM 0 // Timer Index for Stepper -#endif -#ifndef PULSE_TIMER_NUM - #define PULSE_TIMER_NUM STEP_TIMER_NUM -#endif -#ifndef TEMP_TIMER_NUM - #define TEMP_TIMER_NUM 1 // Timer Index for Temperature -#endif - -#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency -#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz - -#define STEPPER_TIMER_PRESCALE 54 // was 40,prescaler for setting stepper timer, 2Mhz -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer -#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs - -#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US - -#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) -#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) - -#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) -#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) - -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) -#define TEMP_ISR_ENABLED() HAL_timer_interrupt_enabled(TEMP_TIMER_NUM) - -// TODO change this - -extern void TC5_Handler(); -extern void TC7_Handler(); -#ifndef HAL_STEP_TIMER_ISR - #define HAL_STEP_TIMER_ISR() void TC5_Handler() -#endif -#ifndef HAL_TEMP_TIMER_ISR - #define HAL_TEMP_TIMER_ISR() void TC7_Handler() -#endif - -// ------------------------ -// Types -// ------------------------ - -typedef struct { - TIM_HandleTypeDef timerdef; - IRQn_Type IRQ_Id; - uint32_t callback; -} tTimerConfig; - -// ------------------------ -// Public Variables -// ------------------------ - -//extern const tTimerConfig timerConfig[]; - -// ------------------------ -// Public functions -// ------------------------ - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); -void HAL_timer_enable_interrupt(const uint8_t timer_num); -void HAL_timer_disable_interrupt(const uint8_t timer_num); -bool HAL_timer_interrupt_enabled(const uint8_t timer_num); - -void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare); -hal_timer_t HAL_timer_get_compare(const uint8_t timer_num); -uint32_t HAL_timer_get_count(const uint8_t timer_num); -void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin/src/HAL/STM32_F4_F7/Servo.cpp b/Marlin/src/HAL/STM32_F4_F7/Servo.cpp deleted file mode 100644 index 7185468f50a8..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/Servo.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "Servo.h" - -int8_t libServo::attach(const int pin) { - if (servoIndex >= MAX_SERVOS) return -1; - return super::attach(pin); -} - -int8_t libServo::attach(const int pin, const int min, const int max) { - return super::attach(pin, min, max); -} - -void libServo::move(const int value) { - constexpr uint16_t servo_delay[] = SERVO_DELAY; - static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (attach(0) >= 0) { - write(value); - safe_delay(servo_delay[servoIndex]); - TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach()); - } -} - -#endif // HAS_SERVOS -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/Servo.h b/Marlin/src/HAL/STM32_F4_F7/Servo.h deleted file mode 100644 index e42cc6084091..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/Servo.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 - -//#ifdef STM32F7 -// #include <../../libraries/Servo/src/Servo.h> -//#else - #include -//#endif - -// Inherit and expand on the official library -class libServo : public Servo { - public: - int8_t attach(const int pin); - int8_t attach(const int pin, const int min, const int max); - void move(const int value); - private: - typedef Servo super; - uint16_t min_ticks, max_ticks; - uint8_t servoIndex; // index into the channel data for this servo -}; diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp deleted file mode 100644 index e0726c7cd592..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp +++ /dev/null @@ -1,535 +0,0 @@ -/** - ****************************************************************************** - * @file eeprom_emul.cpp - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file provides all the EEPROM emulation firmware functions. - ****************************************************************************** - * @attention - * - * Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution 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 other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS 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. - * - ****************************************************************************** - */ -/** @addtogroup EEPROM_Emulation - * @{ - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(FLASH_EEPROM_EMULATION) - -/* Includes ------------------------------------------------------------------*/ -#include "eeprom_emul.h" - -/* Private variables ---------------------------------------------------------*/ - -/* Global variable used to store variable value in read sequence */ -uint16_t DataVar = 0; - -/* Virtual address defined by the user: 0xFFFF value is prohibited */ -uint16_t VirtAddVarTab[NB_OF_VAR]; - -/* Private function prototypes -----------------------------------------------*/ - -static HAL_StatusTypeDef EE_Format(); -static uint16_t EE_FindValidPage(uint8_t Operation); -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_VerifyPageFullyErased(uint32_t Address); - - /** - * @brief Restore the pages to a known good state in case of page's status - * corruption after a power loss. - * @param None. - * @retval - Flash error code: on write Flash error - * - FLASH_COMPLETE: on success - */ - -/* Private functions ---------------------------------------------------------*/ - -uint16_t EE_Initialize() { - /* Get Page0 and Page1 status */ - uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - HAL_StatusTypeDef FlashStatus; // = HAL_OK - - /* Check for invalid header states and repair if necessary */ - uint32_t SectorError; - switch (PageStatus0) { - case ERASED: - if (PageStatus1 == VALID_PAGE) { /* Page0 erased, Page1 valid */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - else if (PageStatus1 == RECEIVE_DATA) { /* Page0 erased, Page1 receive */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (fStat != HAL_OK) return fStat; - } - /* Mark Page1 as valid */ - /* As the last operation, simply return the result */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - } - else { /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) { /* Page0 receive, Page1 valid */ - /* Transfer data from Page1 to Page0 */ - int16_t x = -1; - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - if (VarIdx != x) { - /* Read the last variables' updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page0 */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page0 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - else if (PageStatus1 == ERASED) { /* Page0 receive, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (fStat != HAL_OK) return fStat; - } - /* Mark Page0 as valid */ - /* As the last operation, simply return the result */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - } - else { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - break; - - case VALID_PAGE: - if (PageStatus1 == VALID_PAGE) { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - else if (PageStatus1 == ERASED) { /* Page0 valid, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - else { /* Page0 valid, Page1 receive */ - /* Transfer data from Page0 to Page1 */ - int16_t x = -1; - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - - if (VarIdx != x) { - /* Read the last variables' updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page1 */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page1 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - /* As the last operation, simply return the result */ - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - } - break; - - default: /* Any other state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - /* As the last operation, simply return the result */ - return EE_Format(); - } - - return HAL_OK; -} - -/** - * @brief Verify if specified page is fully erased. - * @param Address: page address - * This parameter can be one of the following values: - * @arg PAGE0_BASE_ADDRESS: Page0 base address - * @arg PAGE1_BASE_ADDRESS: Page1 base address - * @retval page fully erased status: - * - 0: if Page not erased - * - 1: if Page erased - */ -uint16_t EE_VerifyPageFullyErased(uint32_t Address) { - uint32_t ReadStatus = 1; - /* Check each active page address starting from end */ - while (Address <= PAGE0_END_ADDRESS) { - /* Get the current location content to be compared with virtual address */ - uint16_t AddressValue = (*(__IO uint16_t*)Address); - /* Compare the read address with the virtual address */ - if (AddressValue != ERASED) { - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - /* Next address location */ - Address += 4; - } - /* Return ReadStatus value: (0: Page not erased, 1: Sector erased) */ - return ReadStatus; -} - -/** - * @brief Returns the last stored variable data, if found, which correspond to - * the passed virtual address - * @param VirtAddress: Variable virtual address - * @param Data: Global variable contains the read variable value - * @retval Success or error status: - * - 0: if variable was found - * - 1: if the variable was not found - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) { - uint16_t ReadStatus = 1; - - /* Get active Page for read operation */ - uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start and end Addresses */ - uint32_t PageStartAddress = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), - Address = PageStartAddress + PAGE_SIZE - 2; - - /* Check each active page address starting from end */ - while (Address > PageStartAddress + 2) { - /* Get the current location content to be compared with virtual address */ - uint16_t AddressValue = (*(__IO uint16_t*)Address); - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) { - /* Get content of Address-2 which is variable value */ - *Data = (*(__IO uint16_t*)(Address - 2)); - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - else /* Next address location */ - Address -= 4; - } - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { - /* Write the variable virtual address and value in the EEPROM */ - uint16_t Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - - /* In case the EEPROM active page is full */ - if (Status == PAGE_FULL) /* Perform Page transfer */ - Status = EE_PageTransfer(VirtAddress, Data); - - /* Return last operation status */ - return Status; -} - -/** - * @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE - * @param None - * @retval Status of the last operation (Flash write or erase) done during - * EEPROM formatting - */ -static HAL_StatusTypeDef EE_Format() { - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - HAL_StatusTypeDef FlashStatus; // = HAL_OK - - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - uint32_t SectorError; - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - pEraseInit.Sector = PAGE1_ID; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - /* As the last operation, just return the result code */ - uint32_t SectorError; - return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - } - - return HAL_OK; -} - -/** - * @brief Find valid Page for write or read operation - * @param Operation: operation to achieve on the valid page. - * This parameter can be one of the following values: - * @arg READ_FROM_VALID_PAGE: read operation from valid page - * @arg WRITE_IN_VALID_PAGE: write operation from valid page - * @retval Valid page number (PAGE or PAGE1) or NO_VALID_PAGE in case - * of no valid page was found - */ -static uint16_t EE_FindValidPage(uint8_t Operation) { - /* Get Page0 and Page1 actual status */ - uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Write or read operation */ - switch (Operation) { - case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ - if (PageStatus1 == VALID_PAGE) { - /* Page0 receiving data */ - return (PageStatus0 == RECEIVE_DATA) ? PAGE0 : PAGE1; - } - else if (PageStatus0 == VALID_PAGE) { - /* Page1 receiving data */ - return (PageStatus1 == RECEIVE_DATA) ? PAGE1 : PAGE0; - } - else - return NO_VALID_PAGE; /* No valid Page */ - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - return PAGE0; /* Page0 valid */ - else if (PageStatus1 == VALID_PAGE) - return PAGE1; /* Page1 valid */ - else - return NO_VALID_PAGE; /* No valid Page */ - - default: - return PAGE0; /* Page0 valid */ - } -} - -/** - * @brief Verify if active page is full and Writes variable in EEPROM. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) { - /* Get valid Page for write operation */ - uint16_t ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start and end Addresses */ - uint32_t Address = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), - PageEndAddress = Address + PAGE_SIZE - 1; - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) { - /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ - if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) { - /* Set variable data */ - HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address, Data); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - /* Set variable virtual address, return status */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address + 2, VirtAddress); - } - else /* Next address location */ - Address += 4; - } - - /* Return PAGE_FULL in case the valid page is full */ - return PAGE_FULL; -} - -/** - * @brief Transfers last updated variables data from the full Page to - * an empty one. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { - /* Get active Page for read operation */ - uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - uint32_t NewPageAddress = EEPROM_START_ADDRESS; - uint16_t OldPageId = 0; - - if (ValidPage == PAGE1) { /* Page1 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE0_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE1_ID; - } - else if (ValidPage == PAGE0) { /* Page0 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE1_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE0_ID; - } - else - return NO_VALID_PAGE; /* No valid Page */ - - /* Set the new Page status to RECEIVE_DATA status */ - HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, RECEIVE_DATA); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Write the variable passed as parameter in the new active page */ - uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - - /* Transfer process: transfer variables from old to the new active page */ - for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (VirtAddVarTab[VarIdx] != VirtAddress) { /* Check each variable except the one passed as parameter */ - /* Read the other last variable updates */ - uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - - FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = OldPageId; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - /* Erase the old Page: Set old Page status to ERASED status */ - uint32_t SectorError; - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Set new Page status to VALID_PAGE status */ - /* As the last operation, just return the result code */ - return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); -} - -#endif // FLASH_EEPROM_EMULATION -#endif // STM32GENERIC && (STM32F4 || STM32F7) - -/** - * @} - */ - -/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h b/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h deleted file mode 100644 index 84c4c6e3d253..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** - * @file eeprom_emul.h - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file contains all the functions prototypes for the EEPROM - * emulation firmware library. - ****************************************************************************** - * @attention - * - * Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution 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 other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS 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. - * - ******************************************************************************/ -#pragma once - -// ------------------------ -// Includes -// ------------------------ - -#include "../../inc/MarlinConfig.h" - -/* Exported constants --------------------------------------------------------*/ -/* EEPROM emulation firmware error codes */ -#define EE_OK uint32_t(HAL_OK) -#define EE_ERROR uint32_t(HAL_ERROR) -#define EE_BUSY uint32_t(HAL_BUSY) -#define EE_TIMEOUT uint32_t(HAL_TIMEOUT) - -/* Define the size of the sectors to be used */ -#define PAGE_SIZE uint32_t(0x4000) /* Page size = 16KByte */ - -/* Device voltage range supposed to be [2.7V to 3.6V], the operation will - be done by word */ -#define VOLTAGE_RANGE uint8_t(VOLTAGE_RANGE_3) - -/* EEPROM start address in Flash */ -#ifdef STM32F7 - #define EEPROM_START_ADDRESS uint32_t(0x08100000) /* EEPROM emulation start address: - from sector2 : after 16KByte of used - Flash memory */ -#else - #define EEPROM_START_ADDRESS uint32_t(0x08078000) /* EEPROM emulation start address: - after 480KByte of used Flash memory */ -#endif - -/* Pages 0 and 1 base and end addresses */ -#define PAGE0_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x0000) -#define PAGE0_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + PAGE_SIZE - 1) -#define PAGE0_ID FLASH_SECTOR_1 - -#define PAGE1_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x4000) -#define PAGE1_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + 2 * (PAGE_SIZE) - 1) -#define PAGE1_ID FLASH_SECTOR_2 - -/* Used Flash pages for EEPROM emulation */ -#define PAGE0 uint16_t(0x0000) -#define PAGE1 uint16_t(0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ - -/* No valid page define */ -#define NO_VALID_PAGE uint16_t(0x00AB) - -/* Page status definitions */ -#define ERASED uint16_t(0xFFFF) /* Page is empty */ -#define RECEIVE_DATA uint16_t(0xEEEE) /* Page is marked to receive data */ -#define VALID_PAGE uint16_t(0x0000) /* Page containing valid data */ - -/* Valid pages in read and write defines */ -#define READ_FROM_VALID_PAGE uint8_t(0x00) -#define WRITE_IN_VALID_PAGE uint8_t(0x01) - -/* Page full define */ -#define PAGE_FULL uint8_t(0x80) - -/* Variables' number */ -#define NB_OF_VAR uint16_t(4096) - -/* Exported functions ------------------------------------------------------- */ -uint16_t EE_Initialize(); -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp deleted file mode 100644 index 8c5795b6853b..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(FLASH_EEPROM_EMULATION) - -#include "../shared/eeprom_api.h" -#include "eeprom_emul.h" - -// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to -// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4/7 - -#ifdef STM32F7 - #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR -#else - //#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR -#endif - -void ee_write_byte(uint8_t *pos, unsigned char value) { - HAL_FLASH_Unlock(); - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - const unsigned eeprom_address = (unsigned)pos; - if (EE_WriteVariable(eeprom_address, uint16_t(value)) != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); -} - -uint8_t ee_read_byte(uint8_t *pos) { - uint16_t data = 0xFF; - const unsigned eeprom_address = (unsigned)pos; - (void)EE_ReadVariable(eeprom_address, &data); // Data unchanged on error - return uint8_t(data); -} - -#ifndef MARLIN_EEPROM_SIZE - #error "MARLIN_EEPROM_SIZE is required for Flash-based EEPROM." -#endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } - -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::access_start() { - static bool ee_initialized = false; - if (!ee_initialized) { - HAL_FLASH_Unlock(); - - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - /* EEPROM Init */ - if (EE_Initialize() != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); - ee_initialized = true; - } - return true; -} - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != ee_read_byte(p)) { - ee_write_byte(p, v); - if (ee_read_byte(p) != v) { - SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - } - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = ee_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -#endif // FLASH_EEPROM_EMULATION -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp b/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp deleted file mode 100644 index 2bf386bec505..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if USE_WIRED_EEPROM - -/** - * PersistentStore for Arduino-style EEPROM interface - * with simple implementations supplied by Marlin. - */ - -#include "../shared/eeprom_if.h" -#include "../shared/eeprom_api.h" - -#ifndef MARLIN_EEPROM_SIZE - #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." -#endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } - -bool PersistentStore::access_start() { eeprom_init(); return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - } - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -#endif // USE_WIRED_EEPROM -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h b/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h deleted file mode 100644 index fdff8cc644cd..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR() { endstops.update(); } - -void setup_endstop_interrupts() { - #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE) - TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN)); - TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN)); - TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN)); - TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN)); - TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN)); - TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN)); - TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN)); - TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN)); - TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN)); - TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN)); - TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN)); - TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN)); - TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN)); - TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN)); - TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN)); - TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN)); - TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN)); -} diff --git a/Marlin/src/HAL/STM32_F4_F7/fastio.h b/Marlin/src/HAL/STM32_F4_F7/fastio.h deleted file mode 100644 index f42be5835433..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/fastio.h +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 - -/** - * Fast I/O interfaces for STM32F4/7 - * These use GPIO functions instead of Direct Port Manipulation, as on AVR. - */ - -#ifndef PWM - #define PWM OUTPUT -#endif - -#define READ(IO) digitalRead(IO) -#define WRITE(IO,V) digitalWrite(IO,V) - -#define _GET_MODE(IO) -#define _SET_MODE(IO,M) pinMode(IO, M) -#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ - -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ -#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ -#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */ -#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) -#define SET_PWM(IO) _SET_MODE(IO, PWM) - -#define TOGGLE(IO) OUT_WRITE(IO, !READ(IO)) - -#define IS_INPUT(IO) -#define IS_OUTPUT(IO) - -#define PWM_PIN(P) true - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -// -// Pins Definitions -// -#define PORTA 0 -#define PORTB 1 -#define PORTC 2 -#define PORTD 3 -#define PORTE 4 -#define PORTF 5 -#define PORTG 6 - -#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) - -#undef PA0 -#define PA0 _STM32_PIN(A, 0) -#undef PA1 -#define PA1 _STM32_PIN(A, 1) -#undef PA2 -#define PA2 _STM32_PIN(A, 2) -#undef PA3 -#define PA3 _STM32_PIN(A, 3) -#undef PA4 -#define PA4 _STM32_PIN(A, 4) -#undef PA5 -#define PA5 _STM32_PIN(A, 5) -#undef PA6 -#define PA6 _STM32_PIN(A, 6) -#undef PA7 -#define PA7 _STM32_PIN(A, 7) -#undef PA8 -#define PA8 _STM32_PIN(A, 8) -#undef PA9 -#define PA9 _STM32_PIN(A, 9) -#undef PA10 -#define PA10 _STM32_PIN(A, 10) -#undef PA11 -#define PA11 _STM32_PIN(A, 11) -#undef PA12 -#define PA12 _STM32_PIN(A, 12) -#undef PA13 -#define PA13 _STM32_PIN(A, 13) -#undef PA14 -#define PA14 _STM32_PIN(A, 14) -#undef PA15 -#define PA15 _STM32_PIN(A, 15) - -#undef PB0 -#define PB0 _STM32_PIN(B, 0) -#undef PB1 -#define PB1 _STM32_PIN(B, 1) -#undef PB2 -#define PB2 _STM32_PIN(B, 2) -#undef PB3 -#define PB3 _STM32_PIN(B, 3) -#undef PB4 -#define PB4 _STM32_PIN(B, 4) -#undef PB5 -#define PB5 _STM32_PIN(B, 5) -#undef PB6 -#define PB6 _STM32_PIN(B, 6) -#undef PB7 -#define PB7 _STM32_PIN(B, 7) -#undef PB8 -#define PB8 _STM32_PIN(B, 8) -#undef PB9 -#define PB9 _STM32_PIN(B, 9) -#undef PB10 -#define PB10 _STM32_PIN(B, 10) -#undef PB11 -#define PB11 _STM32_PIN(B, 11) -#undef PB12 -#define PB12 _STM32_PIN(B, 12) -#undef PB13 -#define PB13 _STM32_PIN(B, 13) -#undef PB14 -#define PB14 _STM32_PIN(B, 14) -#undef PB15 -#define PB15 _STM32_PIN(B, 15) - -#undef PC0 -#define PC0 _STM32_PIN(C, 0) -#undef PC1 -#define PC1 _STM32_PIN(C, 1) -#undef PC2 -#define PC2 _STM32_PIN(C, 2) -#undef PC3 -#define PC3 _STM32_PIN(C, 3) -#undef PC4 -#define PC4 _STM32_PIN(C, 4) -#undef PC5 -#define PC5 _STM32_PIN(C, 5) -#undef PC6 -#define PC6 _STM32_PIN(C, 6) -#undef PC7 -#define PC7 _STM32_PIN(C, 7) -#undef PC8 -#define PC8 _STM32_PIN(C, 8) -#undef PC9 -#define PC9 _STM32_PIN(C, 9) -#undef PC10 -#define PC10 _STM32_PIN(C, 10) -#undef PC11 -#define PC11 _STM32_PIN(C, 11) -#undef PC12 -#define PC12 _STM32_PIN(C, 12) -#undef PC13 -#define PC13 _STM32_PIN(C, 13) -#undef PC14 -#define PC14 _STM32_PIN(C, 14) -#undef PC15 -#define PC15 _STM32_PIN(C, 15) - -#undef PD0 -#define PD0 _STM32_PIN(D, 0) -#undef PD1 -#define PD1 _STM32_PIN(D, 1) -#undef PD2 -#define PD2 _STM32_PIN(D, 2) -#undef PD3 -#define PD3 _STM32_PIN(D, 3) -#undef PD4 -#define PD4 _STM32_PIN(D, 4) -#undef PD5 -#define PD5 _STM32_PIN(D, 5) -#undef PD6 -#define PD6 _STM32_PIN(D, 6) -#undef PD7 -#define PD7 _STM32_PIN(D, 7) -#undef PD8 -#define PD8 _STM32_PIN(D, 8) -#undef PD9 -#define PD9 _STM32_PIN(D, 9) -#undef PD10 -#define PD10 _STM32_PIN(D, 10) -#undef PD11 -#define PD11 _STM32_PIN(D, 11) -#undef PD12 -#define PD12 _STM32_PIN(D, 12) -#undef PD13 -#define PD13 _STM32_PIN(D, 13) -#undef PD14 -#define PD14 _STM32_PIN(D, 14) -#undef PD15 -#define PD15 _STM32_PIN(D, 15) - -#undef PE0 -#define PE0 _STM32_PIN(E, 0) -#undef PE1 -#define PE1 _STM32_PIN(E, 1) -#undef PE2 -#define PE2 _STM32_PIN(E, 2) -#undef PE3 -#define PE3 _STM32_PIN(E, 3) -#undef PE4 -#define PE4 _STM32_PIN(E, 4) -#undef PE5 -#define PE5 _STM32_PIN(E, 5) -#undef PE6 -#define PE6 _STM32_PIN(E, 6) -#undef PE7 -#define PE7 _STM32_PIN(E, 7) -#undef PE8 -#define PE8 _STM32_PIN(E, 8) -#undef PE9 -#define PE9 _STM32_PIN(E, 9) -#undef PE10 -#define PE10 _STM32_PIN(E, 10) -#undef PE11 -#define PE11 _STM32_PIN(E, 11) -#undef PE12 -#define PE12 _STM32_PIN(E, 12) -#undef PE13 -#define PE13 _STM32_PIN(E, 13) -#undef PE14 -#define PE14 _STM32_PIN(E, 14) -#undef PE15 -#define PE15 _STM32_PIN(E, 15) - -#ifdef STM32F7 - - #undef PORTF - #define PORTF 5 - #undef PF0 - #define PF0 _STM32_PIN(F, 0) - #undef PF1 - #define PF1 _STM32_PIN(F, 1) - #undef PF2 - #define PF2 _STM32_PIN(F, 2) - #undef PF3 - #define PF3 _STM32_PIN(F, 3) - #undef PF4 - #define PF4 _STM32_PIN(F, 4) - #undef PF5 - #define PF5 _STM32_PIN(F, 5) - #undef PF6 - #define PF6 _STM32_PIN(F, 6) - #undef PF7 - #define PF7 _STM32_PIN(F, 7) - #undef PF8 - #define PF8 _STM32_PIN(F, 8) - #undef PF9 - #define PF9 _STM32_PIN(F, 9) - #undef PF10 - #define PF10 _STM32_PIN(F, 10) - #undef PF11 - #define PF11 _STM32_PIN(F, 11) - #undef PF12 - #define PF12 _STM32_PIN(F, 12) - #undef PF13 - #define PF13 _STM32_PIN(F, 13) - #undef PF14 - #define PF14 _STM32_PIN(F, 14) - #undef PF15 - #define PF15 _STM32_PIN(F, 15) - - #undef PORTG - #define PORTG 6 - #undef PG0 - #define PG0 _STM32_PIN(G, 0) - #undef PG1 - #define PG1 _STM32_PIN(G, 1) - #undef PG2 - #define PG2 _STM32_PIN(G, 2) - #undef PG3 - #define PG3 _STM32_PIN(G, 3) - #undef PG4 - #define PG4 _STM32_PIN(G, 4) - #undef PG5 - #define PG5 _STM32_PIN(G, 5) - #undef PG6 - #define PG6 _STM32_PIN(G, 6) - #undef PG7 - #define PG7 _STM32_PIN(G, 7) - #undef PG8 - #define PG8 _STM32_PIN(G, 8) - #undef PG9 - #define PG9 _STM32_PIN(G, 9) - #undef PG10 - #define PG10 _STM32_PIN(G, 10) - #undef PG11 - #define PG11 _STM32_PIN(G, 11) - #undef PG12 - #define PG12 _STM32_PIN(G, 12) - #undef PG13 - #define PG13 _STM32_PIN(G, 13) - #undef PG14 - #define PG14 _STM32_PIN(G, 14) - #undef PG15 - #define PG15 _STM32_PIN(G, 15) - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h deleted file mode 100644 index a9f1b5822215..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#if HAS_SPI_TFT || HAS_FSMC_TFT - #error "Sorry! TFT displays are not available for HAL/STM32F4_F7." -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h deleted file mode 100644 index 5f1c4b16019d..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h b/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h deleted file mode 100644 index b5d808e21acc..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#if ENABLED(EEPROM_SETTINGS) && defined(STM32F7) - #undef USE_WIRED_EEPROM - #undef SRAM_EEPROM_EMULATION - #undef SDCARD_EEPROM_EMULATION - #define FLASH_EEPROM_EMULATION -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h b/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h deleted file mode 100644 index 9bb36f3bbbca..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * Test STM32F4/7-specific configuration values for errors at compile-time. - */ -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif - -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32F4/7. Disable EMERGENCY_PARSER to continue." -#endif - -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY - #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F4/F7." -#endif - -#if HAS_TMC_SW_SERIAL - #error "TMC220x Software Serial is not supported on this platform." -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h b/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h deleted file mode 100644 index 973abb1b0185..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 - -#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) - #include "../STM32/pinsDebug_STM32duino.h" -#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) - #include "../STM32/pinsDebug_STM32GENERIC.h" -#else - #error "M43 Pins Debugging not supported for this board." -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/spi_pins.h b/Marlin/src/HAL/STM32_F4_F7/spi_pins.h deleted file mode 100644 index 75a6a2b250f6..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/spi_pins.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 SPI Pins: SCK, MISO, MOSI, SS - */ -#ifndef SCK_PIN - #define SCK_PIN PA5 -#endif -#ifndef MISO_PIN - #define MISO_PIN PA6 -#endif -#ifndef MOSI_PIN - #define MOSI_PIN PA7 -#endif -#ifndef SS_PIN - #define SS_PIN PA8 -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/timers.h b/Marlin/src/HAL/STM32_F4_F7/timers.h deleted file mode 100644 index 4e8c81783e59..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/timers.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2017 Victor Perez - * - * 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 - -#ifdef STM32F4 - #include "STM32F4/timers.h" -#else - #include "STM32F7/timers.h" -#endif diff --git a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp b/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp deleted file mode 100644 index c0afd0cd58fb..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT_COUNT TERN(WATCHDOG_DURATION_8S, 8192, 4096) // 4 or 8 second timeout - -IWDG_HandleTypeDef hiwdg; - -void watchdog_init() { - hiwdg.Instance = IWDG; - hiwdg.Init.Prescaler = IWDG_PRESCALER_32; // 32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock - hiwdg.Init.Reload = WDT_TIMEOUT_COUNT - 1; - if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { - //Error_Handler(); - } - else { - #if PIN_EXISTS(LED) && DISABLED(PINS_DEBUGGING) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } -} - -void HAL_watchdog_refresh() { - /* Refresh IWDG: reload counter */ - if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { - /* Refresh Error */ - //Error_Handler(); - } -} - -#endif // USE_WATCHDOG -#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/STM32_F4_F7/watchdog.h b/Marlin/src/HAL/STM32_F4_F7/watchdog.h deleted file mode 100644 index 3dbc2d08c139..000000000000 --- a/Marlin/src/HAL/STM32_F4_F7/watchdog.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -extern IWDG_HandleTypeDef hiwdg; - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/platforms.h b/Marlin/src/HAL/platforms.h index ef17d19170cc..e0617bdf7fa5 100644 --- a/Marlin/src/HAL/platforms.h +++ b/Marlin/src/HAL/platforms.h @@ -37,8 +37,6 @@ #define HAL_PATH(PATH, NAME) XSTR(PATH/LPC1768/NAME) #elif defined(__STM32F1__) || defined(TARGET_STM32F1) #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32F1/NAME) -#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32_F4_F7/NAME) #elif defined(ARDUINO_ARCH_STM32) #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32/NAME) #elif defined(ARDUINO_ARCH_ESP32) diff --git a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp index e74953064592..5ca46f98865b 100644 --- a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp @@ -74,17 +74,6 @@ #define START_FLASH_ADDR 0x08000000 #define END_FLASH_ADDR 0x08080000 -#elif MB(THE_BORG) - - // For STM32F765 in BORG - // SRAM (0x20000000 - 0x20080000) (512kb) - // FLASH (0x08000000 - 0x08100000) (1024kb) - // - #define START_SRAM_ADDR 0x20000000 - #define END_SRAM_ADDR 0x20080000 - #define START_FLASH_ADDR 0x08000000 - #define END_FLASH_ADDR 0x08100000 - #elif MB(REMRAM_V1, NUCLEO_F767ZI) // For STM32F765VI in RemRam v1 diff --git a/Marlin/src/HAL/shared/servo.h b/Marlin/src/HAL/shared/servo.h index 6d850da851d2..c2560a853832 100644 --- a/Marlin/src/HAL/shared/servo.h +++ b/Marlin/src/HAL/shared/servo.h @@ -76,8 +76,6 @@ #include "../LPC1768/Servo.h" #elif defined(__STM32F1__) || defined(TARGET_STM32F1) #include "../STM32F1/Servo.h" -#elif defined(STM32GENERIC) && defined(STM32F4) - #include "../STM32_F4_F7/Servo.h" #elif defined(ARDUINO_ARCH_STM32) #include "../STM32/Servo.h" #elif defined(ARDUINO_ARCH_ESP32) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e68ba196ee81..1d1f3972d9d7 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -329,6 +329,7 @@ #define BOARD_TRIGORILLA_PRO 4037 // Trigorilla Pro (STM32F103ZET6) #define BOARD_FLY_MINI 4038 // FLY MINI (STM32F103RCT6) #define BOARD_FLSUN_HISPEED 4039 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4040 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F @@ -341,37 +342,34 @@ // STM32 ARM Cortex-M4F // -#define BOARD_BEAST 4200 // STM32F4xxVxT6 Libmaple-based STM32F4 controller -#define BOARD_GENERIC_STM32F4 4201 // STM32 STM32GENERIC-based STM32F4 controller -#define BOARD_ARMED 4202 // Arm'ed STM32F4-based controller -#define BOARD_RUMBA32_V1_0 4203 // RUMBA32 STM32F446VET6 based controller from Aus3D -#define BOARD_RUMBA32_V1_1 4204 // RUMBA32 STM32F446VET6 based controller from Aus3D -#define BOARD_RUMBA32_MKS 4205 // RUMBA32 STM32F446VET6 based controller from Makerbase -#define BOARD_BLACK_STM32F407VE 4206 // BLACK_STM32F407VE -#define BOARD_BLACK_STM32F407ZE 4207 // BLACK_STM32F407ZE -#define BOARD_STEVAL_3DP001V1 4208 // STEVAL-3DP001V1 3D PRINTER BOARD -#define BOARD_BTT_SKR_PRO_V1_1 4209 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) -#define BOARD_BTT_SKR_PRO_V1_2 4210 // BigTreeTech SKR Pro v1.2 (STM32F407ZG) -#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG) -#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT) -#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG) -#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE) -#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE) -#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6) -#define BOARD_FYSETC_S6 4217 // FYSETC S6 board -#define BOARD_FYSETC_S6_V2_0 4218 // FYSETC S6 v2.0 board -#define BOARD_FLYF407ZG 4219 // FLYF407ZG board (STM32F407ZG) -#define BOARD_MKS_ROBIN2 4220 // MKS_ROBIN2 (STM32F407ZE) +#define BOARD_ARMED 4200 // Arm'ed STM32F4-based controller +#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VET6 based controller from Aus3D +#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VET6 based controller from Aus3D +#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VET6 based controller from Makerbase +#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE +#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE +#define BOARD_STEVAL_3DP001V1 4206 // STEVAL-3DP001V1 3D PRINTER BOARD +#define BOARD_BTT_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) +#define BOARD_BTT_SKR_PRO_V1_2 4208 // BigTreeTech SKR Pro v1.2 (STM32F407ZG) +#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VG) +#define BOARD_BTT_GTR_V1_0 4210 // BigTreeTech GTR v1.0 (STM32F407IGT) +#define BOARD_LERDGE_K 4211 // Lerdge K (STM32F407ZG) +#define BOARD_LERDGE_S 4212 // Lerdge S (STM32F407VE) +#define BOARD_LERDGE_X 4213 // Lerdge X (STM32F407VE) +#define BOARD_VAKE403D 4214 // VAkE 403D (STM32F446VET6) +#define BOARD_FYSETC_S6 4215 // FYSETC S6 board +#define BOARD_FYSETC_S6_V2_0 4216 // FYSETC S6 v2.0 board +#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG) +#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE) // // ARM Cortex M7 // -#define BOARD_THE_BORG 5000 // THE-BORG (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_REMRAM_V1 5001 // RemRam v1 -#define BOARD_TEENSY41 5002 // Teensy 4.1 -#define BOARD_T41U5XBB 5003 // T41U5XBB Teensy 4.1 breakout board -#define BOARD_NUCLEO_F767ZI 5004 // ST NUCLEO-F767ZI Dev Board +#define BOARD_REMRAM_V1 5000 // RemRam v1 +#define BOARD_TEENSY41 5001 // Teensy 4.1 +#define BOARD_T41U5XBB 5002 // T41U5XBB Teensy 4.1 breakout board +#define BOARD_NUCLEO_F767ZI 5003 // ST NUCLEO-F767ZI Dev Board // // Espressif ESP32 WiFi diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 7985706173fe..2e38fad30ef6 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -61,11 +61,7 @@ #define _O3 __attribute__((optimize("O3"))) #ifndef UNUSED - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - #define UNUSED(X) (void)X - #else - #define UNUSED(x) ((void)(x)) - #endif + #define UNUSED(x) ((void)(x)) #endif // Clock speed factors diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h index 8977266b47bf..547eb6521f19 100644 --- a/Marlin/src/module/stepper/TMC26X.h +++ b/Marlin/src/module/stepper/TMC26X.h @@ -31,11 +31,7 @@ // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI #include -#if defined(STM32GENERIC) && defined(STM32F7) - #include "../../HAL/STM32_F4_F7/STM32F7/TMC2660.h" -#else - #include -#endif +#include void tmc26x_init_to_defaults(); diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index af3b72475660..1660d16dd2da 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -594,6 +594,8 @@ #include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI #elif MB(FLSUN_HISPEED) #include "stm32f1/pins_FLSUN_HISPEED.h" // STM32F1 env:flsun_hispeed +#elif MB(BEAST) + #include "stm32f1/pins_BEAST.h" // STM32F1 env:STM32F103RE // // ARM Cortex-M4F @@ -608,10 +610,6 @@ // STM32 ARM Cortex-M4F // -#elif MB(BEAST) - #include "stm32f4/pins_BEAST.h" // STM32F4 env:STM32F4 -#elif MB(GENERIC_STM32F4) - #include "stm32f4/pins_GENERIC_STM32F4.h" // STM32F4 env:STM32F4 #elif MB(ARMED) #include "stm32f4/pins_ARMED.h" // STM32F4 env:ARMED #elif MB(RUMBA32_V1_0) @@ -633,13 +631,13 @@ #elif MB(BTT_BTT002_V1_0) #include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 #elif MB(LERDGE_K) - #include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:STM32F4 + #include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:LERDGEK #elif MB(LERDGE_S) - #include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGE_S + #include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGES #elif MB(LERDGE_X) - #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGE_X + #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGEX #elif MB(VAKE403D) - #include "stm32f4/pins_VAKE403D.h" // STM32F4 env:STM32F4 + #include "stm32f4/pins_VAKE403D.h" // STM32F4 #elif MB(FYSETC_S6) #include "stm32f4/pins_FYSETC_S6.h" // STM32F4 env:FYSETC_S6 #elif MB(FLYF407ZG) @@ -653,10 +651,8 @@ // ARM Cortex M7 // -#elif MB(THE_BORG) - #include "stm32f7/pins_THE_BORG.h" // STM32F7 env:STM32F7 #elif MB(REMRAM_V1) - #include "stm32f7/pins_REMRAM_V1.h" // STM32F7 env:STM32F7 + #include "stm32f7/pins_REMRAM_V1.h" // STM32F7 env:REMRAM_V1 #elif MB(NUCLEO_F767ZI) #include "stm32f7/pins_NUCLEO_F767ZI.h" // STM32F7 env:NUCLEO_F767ZI #elif MB(TEENSY41) diff --git a/Marlin/src/pins/stm32f4/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h similarity index 98% rename from Marlin/src/pins/stm32f4/pins_BEAST.h rename to Marlin/src/pins/stm32f1/pins_BEAST.h index 279d0b9ec70d..ccb8a31ab727 100644 --- a/Marlin/src/pins/stm32f4/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -21,8 +21,8 @@ */ #pragma once -#if NOT_TARGET(__STM32F1__, __STM32F4__) - #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'" +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif /** diff --git a/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h b/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h deleted file mode 100644 index 4acfd743b756..000000000000 --- a/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * To build with Arduino IDE use "Discovery F407VG" - * To build with PlatformIO use environment "STM32F4" - */ -#if NOT_TARGET(STM32F4, STM32F4xx) - #error "Oops! Select an STM32F4 board in 'Tools > Board.'" -#elif HOTENDS > 2 || E_STEPPERS > 2 - #error "STM32F4 supports up to 2 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "Misc. STM32F4" -#define DEFAULT_MACHINE_NAME "STM32F407VET6" - -//#define I2C_EEPROM - -#ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB -#endif - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_MIN_PIN PE0 -#define X_MAX_PIN -1 -#define Y_MIN_PIN PE1 -#define Y_MAX_PIN -1 -#define Z_MIN_PIN PE14 -#define Z_MAX_PIN -1 - -// -// Z Probe (when not Z_MIN_PIN) -// - -//#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PA4 -//#endif - -// -// Steppers -// - -#define X_STEP_PIN PD3 -#define X_DIR_PIN PD2 -#define X_ENABLE_PIN PD0 -//#ifndef X_CS_PIN -// #define X_CS_PIN PD1 -//#endif - -#define Y_STEP_PIN PE11 -#define Y_DIR_PIN PE10 -#define Y_ENABLE_PIN PE13 -//#ifndef Y_CS_PIN -// #define Y_CS_PIN PE12 -//#endif - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD7 -#define Z_ENABLE_PIN PD4 -//#ifndef Z_CS_PIN -// #define Z_CS_PIN PD5 -//#endif - -#define E0_STEP_PIN PB5 -#define E0_DIR_PIN PB6 -#define E0_ENABLE_PIN PB3 -//#ifndef E0_CS_PIN -// #define E0_CS_PIN PB4 -//#endif - -#define E1_STEP_PIN PE4 -#define E1_DIR_PIN PE2 -#define E1_ENABLE_PIN PE3 -//#ifndef E1_CS_PIN -// #define E1_CS_PIN PE5 -//#endif - -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -// -// Temperature Sensors -// - -#define TEMP_0_PIN PC0 // Analog Input -#define TEMP_1_PIN PC1 // Analog Input -#define TEMP_BED_PIN PC2 // Analog Input - -// -// Heaters / Fans -// - -#define HEATER_0_PIN PA1 -#define HEATER_1_PIN PA2 -#define HEATER_BED_PIN PA0 - -#ifndef FAN_PIN - #define FAN_PIN PC6 -#endif -#define FAN1_PIN PC7 -#define FAN2_PIN PC8 - -#ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN PC7 -#endif - -// -// Misc. Functions -// - -//#define CASE_LIGHT_PIN_CI PF13 -//#define CASE_LIGHT_PIN_DO PF14 -//#define NEOPIXEL_PIN PF13 - -// -// Průša i3 MK2 Multi Material Multiplexer Support -// - -//#define E_MUX0_PIN PG3 -//#define E_MUX1_PIN PG4 - -// -// Servos -// - -//#define SERVO0_PIN PE13 -//#define SERVO1_PIN PE14 - -#define SDSS PE7 -#define SS_PIN PE7 -#define LED_PIN PB7 //Alive -#define PS_ON_PIN PA10 -#define KILL_PIN PA8 -#define PWR_LOSS PA4 //Power loss / nAC_FAULT - -// -// LCD / Controller -// - -#define SD_DETECT_PIN PA15 -#define BEEPER_PIN PC9 -#define LCD_PINS_RS PE9 -#define LCD_PINS_ENABLE PE8 -#define LCD_PINS_D4 PB12 -#define LCD_PINS_D5 PB13 -#define LCD_PINS_D6 PB14 -#define LCD_PINS_D7 PB15 -#define BTN_EN1 PC4 -#define BTN_EN2 PC5 -#define BTN_ENC PC3 - -// -// Filament runout -// - -#define FIL_RUNOUT_PIN PA3 - -// -// ST7920 Delays -// -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif -#endif diff --git a/Marlin/src/pins/stm32f7/pins_THE_BORG.h b/Marlin/src/pins/stm32f7/pins_THE_BORG.h deleted file mode 100644 index c050824a83da..000000000000 --- a/Marlin/src/pins/stm32f7/pins_THE_BORG.h +++ /dev/null @@ -1,183 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#if NOT_TARGET(STM32F7) - #error "Oops! Select an STM32F7 board in 'Tools > Board.'" -#elif HOTENDS > 3 || E_STEPPERS > 3 - #error "The-Borg supports up to 3 hotends / E-steppers." -#endif - -#define BOARD_INFO_NAME "The-Borge" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -#ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x1000 -#endif - -// Ignore temp readings during development. -//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 - -// -// Limit Switches -// -#define X_MIN_PIN PE9 -#define X_MAX_PIN PE10 -#define Y_MIN_PIN PE7 -#define Y_MAX_PIN PE8 -#define Z_MIN_PIN PF15 -#define Z_MAX_PIN PG0 -#define E_MIN_PIN PE2 -#define E_MAX_PIN PE3 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PA4 -#endif - -// -// Steppers -// -#define STEPPER_ENABLE_PIN PE0 - -#define X_STEP_PIN PC6 // 96, 39 in Arduino -#define X_DIR_PIN PC7 -#define X_ENABLE_PIN PC8 - -#define Y_STEP_PIN PD9 -#define Y_DIR_PIN PD10 -#define Y_ENABLE_PIN PD11 - -#define Z_STEP_PIN PE15 -#define Z_DIR_PIN PG1 -#define Z_ENABLE_PIN PD8 - -#define E0_STEP_PIN PB1 -#define E0_DIR_PIN PB2 -#define E0_ENABLE_PIN PE11 - -#define E1_STEP_PIN PC4 -#define E1_DIR_PIN PC5 -#define E1_ENABLE_PIN PB0 - -#define E2_STEP_PIN PC13 -#define E2_DIR_PIN PC14 -#define E2_ENABLE_PIN PC15 - -#define Z2_STEP_PIN PC13 -#define Z2_DIR_PIN PC14 -#define Z2_ENABLE_PIN PC15 - -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 - -#define SPI1_SCK_PIN PA5 -#define SPI1_MISO_PIN PA6 -#define SPI1_MOSI_PIN PA7 - -#define SPI6_SCK_PIN PG13 -#define SPI6_MISO_PIN PG12 -#define SPI6_MOSI_PIN PG14 - -// -// Temperature Sensors -// - -#define TEMP_0_PIN PC3 // Analog Input -#define TEMP_1_PIN PC2 // Analog Input -#define TEMP_2_PIN PC1 // Analog Input -#define TEMP_3_PIN PC0 // Analog Input - -#define TEMP_BED_PIN PF10 // Analog Input - -#define TEMP_5_PIN PE12 // Analog Input, Probe temp - -// -// Heaters / Fans -// -#define HEATER_0_PIN PD15 -#define HEATER_1_PIN PD14 -#define HEATER_BED_PIN PF6 - -#ifndef FAN_PIN - #define FAN_PIN PD13 -#endif -#define FAN1_PIN PA0 -#define FAN2_PIN PA1 - -#ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN PA1 -#endif - -// -// Misc. Functions -// - -//#define CASE_LIGHT_PIN_CI PF13 -//#define CASE_LIGHT_PIN_DO PF14 -//#define NEOPIXEL_PIN PF13 - -// -// Průša i3 MK2 Multi Material Multiplexer Support -// - -#define E_MUX0_PIN PG3 -#define E_MUX1_PIN PG4 - -// -// Servos -// - -#define SERVO0_PIN PE13 -#define SERVO1_PIN PE14 - -#define SDSS PA8 -#define SS_PIN PA8 -#define LED_PIN PA2 // Alive -#define PS_ON_PIN PA3 -#define KILL_PIN -1 //PD5 // EXP2-10 -#define PWR_LOSS PG5 // Power loss / nAC_FAULT - -// -// MAX7219_DEBUG -// -#define MAX7219_CLK_PIN PG10 // EXP1-1 -#define MAX7219_DIN_PIN PD7 // EXP1-3 -#define MAX7219_LOAD_PIN PD1 // EXP1-5 - -// -// LCD / Controller -// -//#define SD_DETECT_PIN -1 //PB6) // EXP2-4 -#define BEEPER_PIN PG10 // EXP1-1 -#define LCD_PINS_RS PG9 // EXP1-4 -#define LCD_PINS_ENABLE PD7 // EXP1-3 -#define LCD_PINS_D4 PD1 // EXP1-5 -#define LCD_PINS_D5 PF0 // EXP1-6 -#define LCD_PINS_D6 PD3 // EXP1-7 -#define LCD_PINS_D7 PD4 // EXP1-8 -#define BTN_EN1 PD6 // EXP2-5 -#define BTN_EN2 PD0 // EXP2-3 -#define BTN_ENC PG11 // EXP1-2 diff --git a/buildroot/tests/BIGTREE_SKR_PRO-tests b/buildroot/tests/BIGTREE_SKR_PRO-tests index 3d0000ccc4f7..ff4a8d734e73 100644 --- a/buildroot/tests/BIGTREE_SKR_PRO-tests +++ b/buildroot/tests/BIGTREE_SKR_PRO-tests @@ -25,7 +25,7 @@ opt_set E1_AUTO_FAN_PIN PC11 opt_set E2_AUTO_FAN_PIN PC12 opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 -opt_enable BLTOUCH EEPROM_SETTINGS AUTO_BED_LEVELING_3POINT Z_SAFE_HOMING +opt_enable BLTOUCH EEPROM_SETTINGS AUTO_BED_LEVELING_3POINT Z_SAFE_HOMING PINS_DEBUGGING exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders, Auto-Fan, BLTOUCH, mixed TMC drivers" "$3" # clean up diff --git a/buildroot/tests/STM32F7-tests b/buildroot/tests/REMRAM_V1-tests similarity index 89% rename from buildroot/tests/STM32F7-tests rename to buildroot/tests/REMRAM_V1-tests index b23a16467edc..f5944ff5af84 100644 --- a/buildroot/tests/STM32F7-tests +++ b/buildroot/tests/REMRAM_V1-tests @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build tests for STM32F7 +# Build tests for REMRAM_V1 # # exit on first failure diff --git a/buildroot/tests/STM32F103RC_btt-tests b/buildroot/tests/STM32F103RC_btt-tests index 77044dcb364e..5d695c9296b1 100644 --- a/buildroot/tests/STM32F103RC_btt-tests +++ b/buildroot/tests/STM32F103RC_btt-tests @@ -21,6 +21,7 @@ opt_set X_SLAVE_ADDRESS 0 opt_set Y_SLAVE_ADDRESS 1 opt_set Z_SLAVE_ADDRESS 2 opt_set E0_SLAVE_ADDRESS 3 +opt_enable PINS_DEBUGGING exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" diff --git a/buildroot/tests/STM32F4-tests b/buildroot/tests/STM32F4-tests deleted file mode 100644 index 89281860f65f..000000000000 --- a/buildroot/tests/STM32F4-tests +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for STM32F4 disco_f407vg -# - -# exit on first failure -set -e - -# -# Build with the default configurations -# -use_example_configs STM32/STM32F4 -exec_test $1 $2 "STM32F4 Default Configuration" "$3" - -# clean up -restore_configs diff --git a/platformio.ini b/platformio.ini index 9fb49040209a..062514c882e5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -863,22 +863,13 @@ lib_deps = ${common_stm32f1.lib_deps} USBComposite for STM32F1@0.91 # -# STM32F4 with STM32GENERIC +# REMRAM_V1 # -[env:STM32F4] -platform = ${common_stm32.platform} -board = disco_f407vg -build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED -src_filter = ${common.default_src_filter} + - - -# -# STM32F7 with STM32GENERIC -# -[env:STM32F7] +[env:REMRAM_V1] platform = ${common_stm32.platform} +extends = common_stm32 board = remram_v1 -build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F7 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED -src_filter = ${common.default_src_filter} + - +build_flags = ${common_stm32.build_flags} # # ST NUCLEO-F767ZI Development Board From 4f4843a84578dfb27176fbea855faa407453e706 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 01:08:12 -0600 Subject: [PATCH 242/443] Tweak some pin errors --- Marlin/src/pins/esp32/pins_E4D.h | 2 +- Marlin/src/pins/esp32/pins_FYSETC_E4.h | 2 +- Marlin/src/pins/esp32/pins_MRR_ESPA.h | 2 +- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 6 +++--- Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 2 +- Marlin/src/pins/stm32f7/pins_REMRAM_V1.h | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 2a1f070ddaaf..6009ea6cdb72 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -32,7 +32,7 @@ #elif EXTRUDERS > 1 || E_STEPPERS > 1 #error "E4d@box only supports one E Stepper. Comment out this line to continue." #elif HOTENDS > 1 - #error "E4d@box currently supports only one hotend. Comment out this line to continue." + #error "E4d@box only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "E4D@BOX" diff --git a/Marlin/src/pins/esp32/pins_FYSETC_E4.h b/Marlin/src/pins/esp32/pins_FYSETC_E4.h index af179256e136..5b6251868954 100644 --- a/Marlin/src/pins/esp32/pins_FYSETC_E4.h +++ b/Marlin/src/pins/esp32/pins_FYSETC_E4.h @@ -32,7 +32,7 @@ #elif EXTRUDERS > 1 || E_STEPPERS > 1 #error "FYSETC E4 only supports one E Stepper. Comment out this line to continue." #elif HOTENDS > 1 - #error "FYSETC E4 currently supports only one hotend. Comment out this line to continue." + #error "FYSETC E4 only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "FYSETC_E4" diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index 52837df741c2..02cdd0a0094e 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h @@ -32,7 +32,7 @@ #elif EXTRUDERS > 1 || E_STEPPERS > 1 #error "MRR ESPA only supports one E Stepper. Comment out this line to continue." #elif HOTENDS > 1 - #error "MRR ESPA currently supports only one hotend. Comment out this line to continue." + #error "MRR ESPA only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "MRR ESPA" diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 0c489dd7b473..0c9ab43fd3ac 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -33,7 +33,7 @@ #elif EXTRUDERS > 2 || E_STEPPERS > 2 #error "MRR ESPE only supports two E Steppers. Comment out this line to continue." #elif HOTENDS > 1 - #error "MRR ESPE currently supports only one hotend. Comment out this line to continue." + #error "MRR ESPE only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "MRR ESPE" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index c6f2dd8b8081..f0c1611cb861 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -27,7 +27,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "CREALITY supports up to 1 hotends / E-steppers. Comment out this line to continue." + #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h index 2028cd9dd4d0..89ace3493fc2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin E3 supports up to 1 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin E3 only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h index d1f6dece5c15..a629bce9f38d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h @@ -26,7 +26,7 @@ */ #if HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin E3D supports up to 1 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin E3D only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index b9283a060f86..93890e9aa777 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -28,12 +28,12 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin e3p supports up to 1 hotends / E-steppers. Comment out this line to continue." + #error "MKS Robin E3P only supports one hotend / E-stepper. Comment out this line to continue." #elif HAS_FSMC_TFT - #error "MKS Robin e3p doesn't support FSMC-based TFT displays." + #error "MKS Robin E3P doesn't support FSMC-based TFT displays." #endif -#define BOARD_INFO_NAME "MKS Robin e3p" +#define BOARD_INFO_NAME "MKS Robin E3P" #define BOARD_NO_NATIVE_USB 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 19ff2a34e222..660ba29e97d1 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -24,7 +24,7 @@ #if NOT_TARGET(STM32F4) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "BIGTREE BTT002 V1.0 supports up to 1 hotends / E-steppers." + #error "BIGTREE BTT002 V1.0 only supports one hotend / E-stepper." #endif #define BOARD_INFO_NAME "BTT BTT002 V1.0" diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index bed51ca660cf..075aec6e9bf8 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -21,7 +21,7 @@ #if NOT_TARGET(STM32F4, STM32F4xx) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "LERDGE X supports only one hotend / E-steppers" + #error "LERDGE X only supports one hotend / E-steppers" #endif #define BOARD_INFO_NAME "Lerdge X" diff --git a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index c3dc004728d8..f07cf824d22c 100644 --- a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h @@ -33,7 +33,7 @@ #endif #if HOTENDS > 1 || E_STEPPERS > 1 - #error "RemRam supports only one hotend / E-stepper." + #error "RemRam only supports one hotend / E-stepper." #endif // From 8c59212ca46a3a9f721b2216bb538c0b42a3992f Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Thu, 26 Nov 2020 16:36:29 +0800 Subject: [PATCH 243/443] MKS Robin E3 / E3D v1.1 (#20216) --- Marlin/src/core/boards.h | 54 ++++++++------- Marlin/src/pins/pins.h | 4 ++ .../pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 67 +++++++++++++++++++ .../src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h | 36 ++++++++++ .../stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h | 39 +++++++++++ .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 10 ++- 6 files changed, 181 insertions(+), 29 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h create mode 100644 Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h create mode 100644 Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 1d1f3972d9d7..a6fc1b4dfdd0 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -289,11 +289,11 @@ // STM32 ARM Cortex-M3 // -#define BOARD_MALYAN_M200_V2 4000 // STM32F070CB STM32F0 controller +#define BOARD_MALYAN_M200_V2 4000 // STM32F070CB controller #define BOARD_MALYAN_M300 4001 // STM32F070-based delta #define BOARD_STM32F103RE 4002 // STM32F103RE Libmaple-based STM32F1 controller -#define BOARD_MALYAN_M200 4003 // STM32C8T6 Libmaple-based STM32F1 controller -#define BOARD_STM3R_MINI 4004 // STM32F103RE Libmaple-based STM32F1 controller +#define BOARD_MALYAN_M200 4003 // STM32C8T6 Libmaple-based STM32F1 controller +#define BOARD_STM3R_MINI 4004 // STM32F103RE Libmaple-based STM32F1 controller #define BOARD_GTM32_PRO_VB 4005 // STM32F103VET6 controller #define BOARD_GTM32_MINI 4006 // STM32F103VET6 controller #define BOARD_GTM32_MINI_A30 4007 // STM32F103VET6 controller @@ -307,29 +307,31 @@ #define BOARD_MKS_ROBIN_LITE 4015 // MKS Robin Lite/Lite2 (STM32F103RCT6) #define BOARD_MKS_ROBIN_LITE3 4016 // MKS Robin Lite3 (STM32F103RCT6) #define BOARD_MKS_ROBIN_PRO 4017 // MKS Robin Pro (STM32F103ZET6) -#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3D 4019 // MKS Robin E3D (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3P 4020 // MKS Robin E3p (STM32F103VET6) -#define BOARD_BTT_SKR_MINI_V1_1 4021 // BigTreeTech SKR Mini v1.1 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_0 4022 // BigTreeTech SKR Mini E3 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V1_2 4023 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_E3_V2_0 4024 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC) -#define BOARD_BTT_SKR_MINI_MZ_V1_0 4025 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC) -#define BOARD_BTT_SKR_E3_DIP 4026 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) -#define BOARD_JGAURORA_A5S_A1 4027 // JGAurora A5S A1 (STM32F103ZET6) -#define BOARD_FYSETC_AIO_II 4028 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4029 // FYSETC Cheetah -#define BOARD_FYSETC_CHEETAH_V12 4030 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4031 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 -#define BOARD_CCROBOT_MEEB_3DP 4032 // ccrobot-online.com MEEB_3DP (STM32F103RC) -#define BOARD_CHITU3D_V5 4033 // Chitu3D TronXY X5SA V5 Board -#define BOARD_CHITU3D_V6 4034 // Chitu3D TronXY X5SA V5 Board -#define BOARD_CREALITY_V4 4035 // Creality v4.x (STM32F103RE) -#define BOARD_CREALITY_V427 4036 // Creality v4.2.7 (STM32F103RE) -#define BOARD_TRIGORILLA_PRO 4037 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4038 // FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4039 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4040 // STM32F103RET6 Libmaple-based controller +#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3_V1_1 4019 // MKS Robin E3 V1.1 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3D 4020 // MKS Robin E3D (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3D_V1_1 4021 // MKS Robin E3D V1.1 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3P 4022 // MKS Robin E3p (STM32F103VET6) +#define BOARD_BTT_SKR_MINI_V1_1 4023 // BigTreeTech SKR Mini v1.1 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_0 4024 // BigTreeTech SKR Mini E3 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_2 4025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V2_0 4026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_MZ_V1_0 4027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC) +#define BOARD_BTT_SKR_E3_DIP 4028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) +#define BOARD_JGAURORA_A5S_A1 4029 // JGAurora A5S A1 (STM32F103ZET6) +#define BOARD_FYSETC_AIO_II 4030 // FYSETC AIO_II +#define BOARD_FYSETC_CHEETAH 4031 // FYSETC Cheetah +#define BOARD_FYSETC_CHEETAH_V12 4032 // FYSETC Cheetah V1.2 +#define BOARD_LONGER3D_LK 4033 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 +#define BOARD_CCROBOT_MEEB_3DP 4034 // ccrobot-online.com MEEB_3DP (STM32F103RC) +#define BOARD_CHITU3D_V5 4035 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CHITU3D_V6 4036 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CREALITY_V4 4037 // Creality v4.x (STM32F103RE) +#define BOARD_CREALITY_V427 4038 // Creality v4.2.7 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4039 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4040 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4041 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4042 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 1660d16dd2da..676e1133102a 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -552,8 +552,12 @@ #include "stm32f1/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro #elif MB(MKS_ROBIN_E3) #include "stm32f1/pins_MKS_ROBIN_E3.h" // STM32F1 env:mks_robin_e3 +#elif MB(MKS_ROBIN_E3_V1_1) + #include "stm32f1/pins_MKS_ROBIN_E3_V1_1.h" // STM32F1 env:mks_robin_e3 #elif MB(MKS_ROBIN_E3D) #include "stm32f1/pins_MKS_ROBIN_E3D.h" // STM32F1 env:mks_robin_e3 +#elif MB(MKS_ROBIN_E3D_V1_1) + #include "stm32f1/pins_MKS_ROBIN_E3D_V1_1.h" // STM32F1 env:mks_robin_e3 #elif MB(MKS_ROBIN_E3P) #include "stm32f1/pins_MKS_ROBIN_E3P.h" // STM32F1 env:mks_robin_e3p #elif MB(BTT_SKR_MINI_V1_1) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h new file mode 100644 index 000000000000..0d927cf7cb6a --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h @@ -0,0 +1,67 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * MKS Robin E3D v1.1 (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3D v1.1 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin E3D V1.1" +#endif + +// +// Steppers +// +#ifndef X_CS_PIN + #define X_CS_PIN PC7 +#endif +#ifndef Y_CS_PIN + #define Y_CS_PIN PD2 +#endif +#ifndef Z_CS_PIN + #define Z_CS_PIN PC12 +#endif +#ifndef E0_CS_PIN + #define E0_CS_PIN PC11 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB14 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB13 + #endif +#endif + +#include "pins_MKS_ROBIN_E3_V1_1_common.h" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h new file mode 100644 index 000000000000..002c35fe54c1 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * MKS Robin E3 v1.1 (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3 v1.1 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin E3 V1.1" +#endif + +#include "pins_MKS_ROBIN_E3_V1_1_common.h" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h new file mode 100644 index 000000000000..4eaf2e946939 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// EEPROM +// +// Onboard I2C EEPROM +#if NO_EEPROM_SELECTED + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x1000// 4KB + #undef NO_EEPROM_SELECTED +#endif + +#define Z_STEP_PIN PC14 +#define Z_DIR_PIN PC15 + +#define BTN_ENC_EN -1 + +#include "pins_MKS_ROBIN_E3_common.h" 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 c2b7e52067c1..1362d2208619 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -70,8 +70,12 @@ #define Y_DIR_PIN PB9 #define Y_ENABLE_PIN PB12 -#define Z_STEP_PIN PB7 -#define Z_DIR_PIN PB6 +#ifndef Z_STEP_PIN + #define Z_STEP_PIN PB7 +#endif +#ifndef Z_DIR_PIN + #define Z_DIR_PIN PB6 +#endif #define Z_ENABLE_PIN PB8 #define E0_STEP_PIN PB4 @@ -161,7 +165,7 @@ #define LCD_PINS_D6 PC4 #define LCD_PINS_D7 PC5 - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #if !defined(BTN_ENC_EN) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif From aa2ced96e05de394abf34cb5b75046f823aa4954 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 03:47:07 -0600 Subject: [PATCH 244/443] Finish HAL/STM32 cpp wrappers --- Marlin/src/HAL/STM32/MarlinSPI.cpp | 1 - Marlin/src/HAL/STM32/MarlinSerial.cpp | 1 - Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp | 4 +++- Marlin/src/HAL/STM32/eeprom_sdcard.cpp | 5 ++--- Marlin/src/HAL/STM32/fast_pwm.cpp | 2 ++ Marlin/src/HAL/STM32/tft/tft_fsmc.cpp | 2 ++ Marlin/src/HAL/STM32/tft/tft_spi.cpp | 2 ++ Marlin/src/HAL/STM32/tft/xpt2046.cpp | 2 ++ Marlin/src/HAL/STM32/usb_serial.cpp | 3 +-- Marlin/src/HAL/STM32/watchdog.cpp | 1 - 10 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index da11b88a60b1..399430f5eb94 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "MarlinSPI.h" diff --git a/Marlin/src/HAL/STM32/MarlinSerial.cpp b/Marlin/src/HAL/STM32/MarlinSerial.cpp index a146664366df..50765ee9958e 100644 --- a/Marlin/src/HAL/STM32/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32/MarlinSerial.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp index 9c2666ed26f4..a7b1e8006f2d 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp @@ -19,10 +19,11 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfig.h" -#if ENABLED(SDIO_SUPPORT) && !defined(STM32GENERIC) +#if ENABLED(SDIO_SUPPORT) #include #include @@ -319,3 +320,4 @@ #endif // !USBD_USE_CDC_COMPOSITE #endif // SDIO_SUPPORT +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index c9180bf09b22..f811468fb484 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -19,13 +19,12 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) /** * Implementation of EEPROM settings in SD Card */ -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - #include "../../inc/MarlinConfig.h" #if ENABLED(SDCARD_EEPROM_EMULATION) @@ -89,4 +88,4 @@ bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uin } #endif // SDCARD_EEPROM_EMULATION -#endif // STM32 && !STM32GENERIC +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp index 99101c6e81fe..42eecb5e1a96 100644 --- a/Marlin/src/HAL/STM32/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfigPre.h" @@ -55,3 +56,4 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } #endif // NEEDS_HARDWARE_PWM +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp index 3a080d5e271e..b6bc7fcd8426 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../../inc/MarlinConfig.h" @@ -178,3 +179,4 @@ void TFT_FSMC::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Cou } #endif // HAS_FSMC_TFT +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index d3eb4ba8db6a..aed15ad66df5 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../../inc/MarlinConfig.h" @@ -210,3 +211,4 @@ void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Coun } #endif // HAS_SPI_TFT +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index f95bb8ca4da4..7e2dbfd15adb 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../../inc/MarlinConfig.h" @@ -186,3 +187,4 @@ uint16_t XPT2046::SoftwareIO(uint16_t data) { } #endif // HAS_TFT_XPT2046 +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/usb_serial.cpp b/Marlin/src/HAL/STM32/usb_serial.cpp index 25c47d694fbd..705d649ff58c 100644 --- a/Marlin/src/HAL/STM32/usb_serial.cpp +++ b/Marlin/src/HAL/STM32/usb_serial.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . * */ - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../inc/MarlinConfigPre.h" @@ -51,5 +50,5 @@ void USB_Hook_init() { USBD_CDC_fops.Receive = USBD_CDC_Receive_hook; } -#endif // EMERGENCY_PARSER +#endif // EMERGENCY_PARSER && USBD_USE_CDC #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/watchdog.cpp b/Marlin/src/HAL/STM32/watchdog.cpp index 3d8340831118..aad0a79a0cb2 100644 --- a/Marlin/src/HAL/STM32/watchdog.cpp +++ b/Marlin/src/HAL/STM32/watchdog.cpp @@ -46,5 +46,4 @@ void HAL_watchdog_refresh() { } #endif // USE_WATCHDOG - #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC From 7ce675e60497f1f68ab1f3753e3d114c9418dd66 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Nov 2020 23:36:22 -0600 Subject: [PATCH 245/443] No auto debug for EEPROM_CHITCHAT --- Marlin/src/module/settings.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 6614aec35b8a..c49c643b60e3 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -559,13 +559,11 @@ void MarlinSettings::postprocess() { #endif // SD_FIRMWARE_UPDATE #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE - static_assert( - EEPROM_OFFSET + sizeof(SettingsData) < ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE, - "ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE is insufficient to capture all EEPROM data." - ); + static_assert(EEPROM_OFFSET + sizeof(SettingsData) < ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE, + "ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE is insufficient to capture all EEPROM data."); #endif -#define DEBUG_OUT ENABLED(EEPROM_CHITCHAT) +//#define DEBUG_OUT 1 #include "../core/debug_out.h" #if ENABLED(EEPROM_SETTINGS) From 3ba374a29eff40535e72267f4d5cf89ca07a3ce6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Nov 2020 22:28:42 -0600 Subject: [PATCH 246/443] Optimize emergency parser check --- Marlin/src/gcode/queue.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 12dfce5111ff..ba2cdf35b11c 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -538,12 +538,11 @@ void GCodeQueue::get_serial_commands() { #if DISABLED(EMERGENCY_PARSER) // Process critical commands early - if (strcmp_P(command, PSTR("M108")) == 0) { - wait_for_heatup = false; - TERN_(HAS_LCD_MENU, wait_for_user = false); + if (command[0] == 'M') switch (command[3]) { + case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_LCD_MENU, wait_for_user = false); } break; + case '2': if (command[2] == '1' && command[1] == '1') kill(M112_KILL_STR, nullptr, true); break; + case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break; } - if (strcmp_P(command, PSTR("M112")) == 0) kill(M112_KILL_STR, nullptr, true); - if (strcmp_P(command, PSTR("M410")) == 0) quickstop_stepper(); #endif #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 From 58ac815822b4c04f29b66ddf076156e6b4994749 Mon Sep 17 00:00:00 2001 From: wmariz <11435639+wmariz@users.noreply.github.com> Date: Thu, 26 Nov 2020 10:58:19 -0300 Subject: [PATCH 247/443] Level Corners with Probe option (#20241) --- Marlin/Configuration.h | 6 + Marlin/src/feature/backlash.cpp | 10 +- Marlin/src/feature/bltouch.cpp | 11 +- Marlin/src/gcode/calibrate/G425.cpp | 8 +- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/lcd/language/language_en.h | 3 + Marlin/src/lcd/menu/menu_bed_corners.cpp | 205 +++++++++++++++++++---- Marlin/src/module/endstops.cpp | 6 +- Marlin/src/module/probe.cpp | 20 +-- Marlin/src/module/probe.h | 6 + buildroot/tests/LPC1769-tests | 1 + 11 files changed, 211 insertions(+), 69 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c64569d2bf91..3320e18abc3d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1392,6 +1392,12 @@ #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points //#define LEVEL_CENTER_TOO // Move to the center after the last corner + //#define LEVEL_CORNERS_USE_PROBE + #if ENABLED(LEVEL_CORNERS_USE_PROBE) + #define LEVEL_CORNERS_PROBE_TOLERANCE 0.1 + #define LEVEL_CORNERS_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify + //#define LEVEL_CORNERS_AUDIO_FEEDBACK + #endif #endif /** diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index 867e9cdd217c..b848214f0c46 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -123,24 +123,22 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - #if HAS_CUSTOM_PROBE_PIN - #define TEST_PROBE_PIN (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define TEST_PROBE_PIN (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif + + #include "../module/probe.h" // Measure Z backlash by raising nozzle in increments until probe deactivates void Backlash::measure_with_probe() { if (measured_count.z == 255) return; const float start_height = current_position.z; - while (current_position.z < (start_height + BACKLASH_MEASUREMENT_LIMIT) && TEST_PROBE_PIN) + while (current_position.z < (start_height + BACKLASH_MEASUREMENT_LIMIT) && PROBE_TRIGGERED()) do_blocking_move_to_z(current_position.z + BACKLASH_MEASUREMENT_RESOLUTION, MMM_TO_MMS(BACKLASH_MEASUREMENT_FEEDRATE)); // The backlash from all probe points is averaged, so count the number of measurements measured_mm.z += current_position.z - start_height; measured_count.z++; } + #endif #endif // BACKLASH_COMPENSATION diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index d6b1f99c16b9..48eaf9efc400 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -31,6 +31,7 @@ BLTouch bltouch; bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain #include "../module/servo.h" +#include "../module/probe.h" void stop(); @@ -90,15 +91,7 @@ void BLTouch::clear() { _stow(); // STOW to be ready for meaningful work. Could fail, don't care } -bool BLTouch::triggered() { - return ( - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING - #else - READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING - #endif - ); -} +bool BLTouch::triggered() { return PROBE_TRIGGERED(); } bool BLTouch::deploy_proc() { // Do a DEPLOY diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 6517e6b4bdc4..9510da7740ef 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -143,14 +143,16 @@ inline void park_above_object(measurements_t &m, const float uncertainty) { #endif +#if !PIN_EXISTS(CALIBRATION) + #include "../../module/probe.h" +#endif + inline bool read_calibration_pin() { return ( #if PIN_EXISTS(CALIBRATION) READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING - #elif HAS_CUSTOM_PROBE_PIN - READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING #else - READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING + PROBE_TRIGGERED() #endif ); } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9f4c10dd53e1..eec9ff084464 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -357,6 +357,8 @@ #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB." #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB) #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values." +#elif BOTH(LEVEL_CORNERS_USE_PROBE, SENSORLESS_PROBING) + #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING." #elif defined(BEZIER_JERK_CONTROL) #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION." #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR) @@ -1603,7 +1605,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Allen Key * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) +#if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && (Z_HOME_DIR < 0) #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY." #endif diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index af0903b91612..2892f79df8ab 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -125,6 +125,8 @@ namespace Language_en { PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bed Leveling"); PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Level Bed"); PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Level Corners"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Raise Bed Until Probe Triggered"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("All Corners Within Tolerance. Level Bed"); PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Next Corner"); PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Mesh Editor"); PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Edit Mesh"); @@ -379,6 +381,7 @@ namespace Language_en { PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Done"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Back"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceed"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Skip"); PROGMEM Language_Str MSG_PAUSING = _UxGT("Pausing..."); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause Print"); PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resume Print"); diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 16f9992c1852..52d2d0ec3db6 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -44,53 +44,187 @@ #define LEVEL_CORNERS_HEIGHT 0.0 #endif +#if ENABLED(LEVEL_CORNERS_USE_PROBE) + #include "../../module/probe.h" + #include "../../module/endstops.h" + #if ENABLED(BLTOUCH) + #include "../../feature/bltouch.h" + #endif + #ifndef LEVEL_CORNERS_PROBE_TOLERANCE + #define LEVEL_CORNERS_PROBE_TOLERANCE 0.1 + #endif + #if ENABLED(LEVEL_CORNERS_AUDIO_FEEDBACK) + #include "../../libs/buzzer.h" + #define PROBE_BUZZ() BUZZ(200, 600) + #else + #define PROBE_BUZZ() NOOP + #endif + static float last_z; + static bool corner_probing_done; + static bool verify_corner; + static int good_points; +#endif + static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); +extern const char G28_STR[]; + #if HAS_LEVELING static bool leveling_was_active = false; #endif +static int8_t bed_corner; + /** * Level corners, starting in the front-left corner. */ -static int8_t bed_corner; -static inline void _lcd_goto_next_corner() { - constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; - constexpr xy_pos_t lf { (X_MIN_BED) + lfrb[0], (Y_MIN_BED) + lfrb[1] }, - rb { (X_MAX_BED) - lfrb[2], (Y_MAX_BED) - lfrb[3] }; - line_to_z(LEVEL_CORNERS_Z_HOP); - switch (bed_corner) { - case 0: current_position = lf; break; // copy xy - case 1: current_position.x = rb.x; break; - case 2: current_position.y = rb.y; break; - case 3: current_position.x = lf.x; break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: current_position.set(X_CENTER, Y_CENTER); break; +#if ENABLED(LEVEL_CORNERS_USE_PROBE) + + static inline void _lcd_level_bed_corners_probing() { + ui.goto_screen([]{ MenuItem_static::draw((LCD_HEIGHT - 1) / 2, GET_TEXT(MSG_PROBING_MESH)); }); + + float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; + xy_pos_t lf { (X_MIN_BED) + lfrb[0] - probe.offset_xy.x , (Y_MIN_BED) + lfrb[1] - probe.offset_xy.y }, + rb { (X_MAX_BED) - lfrb[2] - probe.offset_xy.x , (Y_MAX_BED) - lfrb[3] - probe.offset_xy.y }; + + do_blocking_move_to_z(LEVEL_CORNERS_Z_HOP - probe.offset.z); + + switch (bed_corner) { + case 0: current_position = lf; break; // copy xy + case 1: current_position.x = rb.x; break; + case 2: current_position.y = rb.y; break; + case 3: current_position.x = lf.x; break; + #if ENABLED(LEVEL_CENTER_TOO) + case 4: current_position.set(X_CENTER - probe.offset_xy.x, Y_CENTER - probe.offset_xy.y); good_points--; break; + #endif + } + + do_blocking_move_to_xy(current_position); + + #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) + bltouch.deploy(); // DEPLOY in LOW SPEED MODE on every probe action #endif + TERN_(QUIET_PROBING, probe.set_probing_paused(true)); + + // Move down until the probe is triggered + do_blocking_move_to_z(last_z - (LEVEL_CORNERS_PROBE_TOLERANCE), manual_feedrate_mm_s.z); + + // Check to see if the probe was triggered + bool probe_triggered = TEST(endstops.trigger_state(), TERN(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_MIN, Z_MIN_PROBE)); + if (!probe_triggered) { + + static bool wait_for_probe; + + ui.goto_screen([]{ + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP) + , []{ corner_probing_done = true; + wait_for_probe = false; + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + ui.goto_previous_screen_no_defer(); + } + , []{ wait_for_probe = false; } + , GET_TEXT(MSG_LEVEL_CORNERS_RAISE) + , (const char*)nullptr, PSTR("") + ); + }); + ui.set_selection(true); + + wait_for_probe = true; + while (wait_for_probe && !probe_triggered) { + probe_triggered = PROBE_TRIGGERED(); + if (probe_triggered) PROBE_BUZZ(); + idle(); + } + wait_for_probe = false; + + TERN_(LEVEL_CORNERS_VERIFY_RAISED, verify_corner = true); + } + + TERN_(QUIET_PROBING, probe.set_probing_paused(false)); + + #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) + bltouch.stow(); + #endif + + if (probe_triggered) { + endstops.hit_on_purpose(); + if (!WITHIN(current_position.z, last_z - (LEVEL_CORNERS_PROBE_TOLERANCE), last_z + (LEVEL_CORNERS_PROBE_TOLERANCE))) { + last_z = current_position.z; + good_points = 0; + } + if (!verify_corner) good_points++; + } + + if (!corner_probing_done) { + if (!verify_corner) bed_corner++; + if (bed_corner > 3) bed_corner = 0; + verify_corner = false; + if (good_points < 4) + _lcd_level_bed_corners_probing(); + else { + ui.goto_screen([]{ + MenuItem_confirm::confirm_screen( + []{ ui.goto_previous_screen_no_defer(); + queue.inject_P(TERN(HAS_LEVELING, PSTR("G28\nG29"), G28_STR)); + } + , []{ ui.goto_previous_screen_no_defer(); } + , GET_TEXT(MSG_LEVEL_CORNERS_IN_RANGE) + , (const char*)nullptr, PSTR("?") + ); + }); + ui.set_selection(true); + } + } } - line_to_current_position(manual_feedrate_mm_s.x); - line_to_z(LEVEL_CORNERS_HEIGHT); - if (++bed_corner > 3 + ENABLED(LEVEL_CENTER_TOO)) bed_corner = 0; -} + +#else + + static inline void _lcd_goto_next_corner() { + constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; + constexpr xy_pos_t lf { (X_MIN_BED) + lfrb[0], (Y_MIN_BED) + lfrb[1] }, + rb { (X_MAX_BED) - lfrb[2], (Y_MAX_BED) - lfrb[3] }; + line_to_z(LEVEL_CORNERS_Z_HOP); + switch (bed_corner) { + case 0: current_position = lf; break; // copy xy + case 1: current_position.x = rb.x; break; + case 2: current_position.y = rb.y; break; + case 3: current_position.x = lf.x; break; + #if ENABLED(LEVEL_CENTER_TOO) + case 4: current_position.set(X_CENTER, Y_CENTER); break; + #endif + } + line_to_current_position(manual_feedrate_mm_s.x); + line_to_z(LEVEL_CORNERS_HEIGHT); + if (++bed_corner > 3 + ENABLED(LEVEL_CENTER_TOO)) bed_corner = 0; + } + +#endif static inline void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (all_axes_homed()) { - bed_corner = 0; - ui.goto_screen([]{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) - , _lcd_goto_next_corner - , []{ - TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); - ui.goto_previous_screen_no_defer(); - } - , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) - , (const char*)nullptr, PSTR("?") - ); - }); - ui.set_selection(true); - _lcd_goto_next_corner(); + #if ENABLED(LEVEL_CORNERS_USE_PROBE) + TERN_(LEVEL_CENTER_TOO, bed_corner = 4); + endstops.enable_z_probe(true); + ui.goto_screen(_lcd_level_bed_corners_probing); + #else + bed_corner = 0; + ui.goto_screen([]{ + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) + , _lcd_goto_next_corner + , []{ + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + ui.goto_previous_screen_no_defer(); + } + , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , (const char*)nullptr, PSTR("?") + ); + }); + ui.set_selection(true); + _lcd_goto_next_corner(); + #endif } } @@ -107,6 +241,13 @@ void _lcd_level_bed_corners() { set_bed_leveling_enabled(false); #endif + #if ENABLED(LEVEL_CORNERS_USE_PROBE) + last_z = LEVEL_CORNERS_HEIGHT; + corner_probing_done = false; + verify_corner = false; + good_points = 0; + #endif + ui.goto_screen(_lcd_level_bed_corners_homing); } diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 697ced783379..ef0b92a7ee05 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -48,6 +48,10 @@ #include "../feature/joystick.h" #endif +#if HAS_BED_PROBE + #include "probe.h" +#endif + Endstops endstops; // private: @@ -455,7 +459,7 @@ void _O2 Endstops::report_states() { ES_REPORT(Z4_MAX); #endif #if HAS_CUSTOM_PROBE_PIN - print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(STR_Z_PROBE)); + print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE)); #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index f02b90915063..47c6f569b7a9 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -270,13 +270,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) do { #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED) - if (deploy == ( - #if HAS_CUSTOM_PROBE_PIN - READ(Z_MIN_PROBE_PIN) == Z_MIN_PROBE_ENDSTOP_INVERTING - #else - READ(Z_MIN_PIN) == Z_MIN_ENDSTOP_INVERTING - #endif - )) break; + if (deploy == PROBE_TRIGGERED()) break; #endif BUZZ(100, 659); @@ -375,23 +369,15 @@ bool Probe::set_deployed(const bool deploy) { const xy_pos_t old_xy = current_position; #if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) - #if HAS_CUSTOM_PROBE_PIN - #define PROBE_STOWED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define PROBE_STOWED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - #endif - - #ifdef PROBE_STOWED // Only deploy/stow if needed - if (PROBE_STOWED() == deploy) { + if (PROBE_TRIGGERED() == deploy) { if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early // otherwise an Allen-Key probe can't be stowed. probe_specific_action(deploy); } - if (PROBE_STOWED() == deploy) { // Unchanged after deploy/stow action? + if (PROBE_TRIGGERED() == deploy) { // Unchanged after deploy/stow action? if (IsRunning()) { SERIAL_ERROR_MSG("Z-Probe failed"); LCD_ALERTMESSAGEPGM_P(PSTR("Err: ZPROBE")); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index cac106fed681..e5ad892e379f 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -38,6 +38,12 @@ }; #endif +#if HAS_CUSTOM_PROBE_PIN + #define PROBE_TRIGGERED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) +#else + #define PROBE_TRIGGERED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) +#endif + class Probe { public: diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index 702f8035ecb3..f661babc40f0 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -19,6 +19,7 @@ opt_set TEMP_SENSOR_1 -1 opt_set TEMP_SENSOR_BED 5 opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + LEVEL_BED_CORNERS LEVEL_CORNERS_USE_PROBE LEVEL_CORNERS_VERIFY_RAISED \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ From 5cae4e9f55a851d27efce52b7d67bc9b231a0654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Daleck=C3=BD?= <36531759+daleckystepan@users.noreply.github.com> Date: Thu, 26 Nov 2020 22:21:48 +0100 Subject: [PATCH 248/443] [WIP] Fix Probe::offset_xy (#20290) Co-authored-by: Jason Smith --- Marlin/src/module/probe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 47c6f569b7a9..11447d71297e 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -89,7 +89,7 @@ Probe probe; xyz_pos_t Probe::offset; // Initialized by settings.load() #if HAS_PROBE_XY_OFFSET - const xy_pos_t &Probe::offset_xy = xy_pos_t(Probe::offset); + const xy_pos_t &Probe::offset_xy = Probe::offset; #endif #if ENABLED(Z_PROBE_SLED) From c61a311c0da25f2738e05c649cd8c2acb790cf8f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 27 Nov 2020 00:12:12 +0000 Subject: [PATCH 249/443] [cron] Bump distribution date (2020-11-27) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 5fb065dc35d8..83345a9fd7f2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-26" + #define STRING_DISTRIBUTION_DATE "2020-11-27" #endif /** From b6a32500c401877e3ee1300fa613e81086bb31d3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 21:18:40 -0600 Subject: [PATCH 250/443] M808 Repeat Markers (#20084) --- Marlin/Configuration_adv.h | 2 + Marlin/src/MarlinCore.cpp | 5 ++ Marlin/src/feature/powerloss.cpp | 3 + Marlin/src/feature/powerloss.h | 6 ++ Marlin/src/feature/repeat.cpp | 81 +++++++++++++++++++++++++++ Marlin/src/feature/repeat.h | 49 ++++++++++++++++ Marlin/src/gcode/gcode.cpp | 4 ++ Marlin/src/gcode/gcode.h | 3 + Marlin/src/gcode/host/M115.cpp | 3 + Marlin/src/gcode/queue.cpp | 23 +++++--- Marlin/src/gcode/sd/M808.cpp | 51 +++++++++++++++++ Marlin/src/sd/cardreader.cpp | 3 +- Marlin/src/sd/cardreader.h | 7 ++- buildroot/test-gcode/M808-loops.gcode | 16 ++++++ buildroot/tests/mega2560-tests | 2 +- platformio.ini | 5 +- 16 files changed, 248 insertions(+), 15 deletions(-) create mode 100644 Marlin/src/feature/repeat.cpp create mode 100644 Marlin/src/feature/repeat.h create mode 100644 Marlin/src/gcode/sd/M808.cpp create mode 100644 buildroot/test-gcode/M808-loops.gcode diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7c8f2da948c6..e6b76a4133c1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1186,6 +1186,8 @@ //#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up //#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash) + //#define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping + #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 5769da05d0f2..b6282cb09835 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -173,6 +173,10 @@ #include "feature/pause.h" #endif +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "feature/repeat.h" +#endif + #if ENABLED(POWER_LOSS_RECOVERY) #include "feature/powerloss.h" #endif @@ -435,6 +439,7 @@ bool printingIsPaused() { void startOrResumeJob() { if (!printingIsPaused()) { + TERN_(GCODE_REPEAT_MARKERS, repeat.reset()); TERN_(CANCEL_OBJECTS, cancelable.reset()); TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0); #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index c4e0ef694abe..c55b278a724a 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -182,6 +182,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/ info.current_position = current_position; info.feedrate = uint16_t(feedrate_mm_s * 60.0f); info.zraise = zraise; + + TERN_(GCODE_REPEAT_MARKERS, info.stored_repeat = repeat); TERN_(HAS_HOME_OFFSET, info.home_offset = home_offset); TERN_(HAS_POSITION_SHIFT, info.position_shift = position_shift); @@ -507,6 +509,7 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("G92.9 E%s"), dtostrf(info.current_position.e, 1, 3, str_1)); gcode.process_subcommands_now(cmd); + TERN_(GCODE_REPEAT_MARKERS, repeat = info.stored_repeat); TERN_(HAS_HOME_OFFSET, home_offset = info.home_offset); TERN_(HAS_POSITION_SHIFT, position_shift = info.position_shift); #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 73cd0b70faf4..f964f122941f 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -30,6 +30,10 @@ #include "../inc/MarlinConfig.h" +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "../feature/repeat.h" +#endif + #if ENABLED(MIXING_EXTRUDER) #include "../feature/mixing.h" #endif @@ -50,6 +54,8 @@ typedef struct { uint16_t feedrate; float zraise; + // Repeat information + TERN_(GCODE_REPEAT_MARKERS, Repeat stored_repeat); TERN_(HAS_HOME_OFFSET, xyz_pos_t home_offset); TERN_(HAS_POSITION_SHIFT, xyz_pos_t position_shift); diff --git a/Marlin/src/feature/repeat.cpp b/Marlin/src/feature/repeat.cpp new file mode 100644 index 000000000000..d48157a84d41 --- /dev/null +++ b/Marlin/src/feature/repeat.cpp @@ -0,0 +1,81 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../inc/MarlinConfig.h" + +#if ENABLED(GCODE_REPEAT_MARKERS) + +//#define DEBUG_GCODE_REPEAT_MARKERS + +#include "repeat.h" + +#include "../gcode/gcode.h" +#include "../sd/cardreader.h" + +#define DEBUG_OUT ENABLED(DEBUG_GCODE_REPEAT_MARKERS) +#include "../core/debug_out.h" + +repeat_marker_t Repeat::marker[MAX_REPEAT_NESTING]; +uint8_t Repeat::index; + +void Repeat::add_marker(const uint32_t sdpos, const uint16_t count) { + if (index >= MAX_REPEAT_NESTING) + SERIAL_ECHO_MSG("!Too many markers."); + else { + marker[index].sdpos = sdpos; + marker[index].counter = count ?: -1; + index++; + DEBUG_ECHOLNPAIR("Add Marker ", int(index), " at ", sdpos, " (", count, ")"); + } +} + +void Repeat::loop() { + if (!index) // No marker? + SERIAL_ECHO_MSG("!No marker set."); // Inform the user. + else { + const uint8_t ind = index - 1; // Active marker's index + if (!marker[ind].counter) { // Did its counter run out? + DEBUG_ECHOLNPAIR("Pass Marker ", int(index)); + index--; // Carry on. Previous marker on the next 'M808'. + } + else { + card.setIndex(marker[ind].sdpos); // Loop back to the marker. + if (marker[ind].counter > 0) // Ignore a negative (or zero) counter. + --marker[ind].counter; // Decrement the counter. If zero this 'M808' will be skipped next time. + DEBUG_ECHOLNPAIR("Goto Marker ", int(index), " at ", marker[ind].sdpos, " (", marker[ind].counter, ")"); + } + } +} + +void Repeat::cancel() { LOOP_L_N(i, index) marker[i].counter = 0; } + +void Repeat::early_parse_M808(char * const cmd) { + if (is_command_M808(cmd)) { + DEBUG_ECHOLNPAIR("Parsing \"", cmd, "\""); + parser.parse(cmd); + if (parser.seen('L')) + add_marker(card.getIndex(), parser.value_ushort()); + else + Repeat::loop(); + } +} + +#endif // GCODE_REPEAT_MARKERS diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h new file mode 100644 index 000000000000..e293b2bbacb4 --- /dev/null +++ b/Marlin/src/feature/repeat.h @@ -0,0 +1,49 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../inc/MarlinConfigPre.h" +#include "../gcode/parser.h" + +#include + +#define MAX_REPEAT_NESTING 10 + +typedef struct { + uint32_t sdpos; // The repeat file position + int16_t counter; // The counter for looping +} repeat_marker_t; + +class Repeat { +private: + static repeat_marker_t marker[MAX_REPEAT_NESTING]; + static uint8_t index; +public: + static inline void reset() { index = 0; } + static bool is_command_M808(char * const cmd) { return cmd[0] == 'M' && cmd[1] == '8' && cmd[2] == '0' && cmd[3] == '8' && !NUMERIC(cmd[4]); } + static void early_parse_M808(char * const cmd); + static void add_marker(const uint32_t sdpos, const uint16_t count); + static void loop(); + static void cancel(); +}; + +extern Repeat repeat; diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 3bce34c1f323..8e2ef62204e8 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -882,6 +882,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 800: parser.debug(); break; // M800: GCode Parser Test for M #endif + #if ENABLED(GCODE_REPEAT_MARKERS) + case 808: M808(); break; // M808: Set / Goto repeat markers + #endif + #if ENABLED(I2C_POSITION_ENCODERS) case 860: M860(); break; // M860: Report encoder module position case 861: M861(); break; // M861: Report encoder module status diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 1d74ac371960..735456a533b3 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -242,6 +242,7 @@ * M672 - Set/Reset Duet Smart Effector's sensitivity. (Requires DUET_SMART_EFFECTOR and SMART_EFFECTOR_MOD_PIN) * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) + * M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS) * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS) * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below) * M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ) @@ -807,6 +808,8 @@ class GcodeSuite { static void M702(); #endif + TERN_(GCODE_REPEAT_MARKERS, static void M808()); + TERN_(GCODE_MACROS, static void M810_819()); TERN_(HAS_BED_PROBE, static void M851()); diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 529b1dd6d012..63511b606d16 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -117,6 +117,9 @@ void GcodeSuite::M115() { // SDCARD (M20, M23, M24, etc.) cap_line(PSTR("SDCARD"), ENABLED(SDSUPPORT)); + // REPEAT (M808) + cap_line(PSTR("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS)); + // AUTOREPORT_SD_STATUS (M27 extension) cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS)); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index ba2cdf35b11c..d23e9ee07fc3 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -51,6 +51,10 @@ GCodeQueue queue; #include "../feature/powerloss.h" #endif +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "../feature/repeat.h" +#endif + /** * GCode line number handling. Hosts may opt to include line numbers when * sending commands to Marlin, and lines will be checked for sequentiality. @@ -577,10 +581,9 @@ void GCodeQueue::get_serial_commands() { if (!IS_SD_PRINTING()) return; int sd_count = 0; - bool card_eof = card.eof(); - while (length < BUFSIZE && !card_eof) { + while (length < BUFSIZE && !card.eof()) { const int16_t n = card.get(); - card_eof = card.eof(); + const bool card_eof = card.eof(); if (n < 0 && !card_eof) { SERIAL_ERROR_MSG(STR_SD_ERR_READ); continue; } const char sd_char = (char)n; @@ -590,17 +593,21 @@ void GCodeQueue::get_serial_commands() { // Reset stream state, terminate the buffer, and commit a non-empty command if (!is_eol && sd_count) ++sd_count; // End of file with no newline if (!process_line_done(sd_input_state, command_buffer[index_w], sd_count)) { + + // M808 S saves the sdpos of the next line. M808 loops to a new sdpos. + TERN_(GCODE_REPEAT_MARKERS, repeat.early_parse_M808(command_buffer[index_w])); + + // Put the new command into the buffer (no "ok" sent) _commit_command(false); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.cmd_sdpos = card.getIndex(); // Prime for the NEXT _commit_command - #endif + + // Prime Power-Loss Recovery for the NEXT _commit_command + TERN_(POWER_LOSS_RECOVERY, recovery.cmd_sdpos = card.getIndex()); } - if (card_eof) card.fileHasFinished(); // Handle end of file reached + if (card.eof()) card.fileHasFinished(); // Handle end of file reached } else process_stream_char(sd_char, sd_input_state, command_buffer[index_w], sd_count); - } } diff --git a/Marlin/src/gcode/sd/M808.cpp b/Marlin/src/gcode/sd/M808.cpp new file mode 100644 index 000000000000..0d11b16f8ae2 --- /dev/null +++ b/Marlin/src/gcode/sd/M808.cpp @@ -0,0 +1,51 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(GCODE_REPEAT_MARKERS) + +#include "../gcode.h" +#include "../../feature/repeat.h" + +/** + * M808: Set / Goto a repeat marker + * + * L - Set a repeat marker with 'count' repetitions. If omitted, infinity. + * + * Examples: + * + * M808 L ; Set a loop marker with a count of infinity + * M808 L2 ; Set a loop marker with a count of 2 + * M808 ; Decrement and loop if not zero. + */ +void GcodeSuite::M808() { + + // Handled early and ignored here in the queue. + // Allowed to go into the queue for logging purposes. + + // M808 K sent from the host to cancel all loops + if (parser.seen('K')) repeat.cancel(); + +} + +#endif // GCODE_REPEAT_MARKERS diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 4416f4e90792..bce84bbd3921 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -699,8 +699,7 @@ void CardReader::removeFile(const char * const name) { void CardReader::report_status() { if (isPrinting()) { - SERIAL_ECHOPGM(STR_SD_PRINTING_BYTE); - SERIAL_ECHO(sdpos); + SERIAL_ECHOPAIR(STR_SD_PRINTING_BYTE, sdpos); SERIAL_CHAR('/'); SERIAL_ECHOLN(filesize); } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index c6fe37400c2d..dabbf719f92b 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -159,9 +159,9 @@ class CardReader { static inline uint32_t getIndex() { return sdpos; } static inline uint32_t getFileSize() { return filesize; } static inline bool eof() { return sdpos >= filesize; } - static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } + static inline void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); } static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } + 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; } @@ -244,7 +244,8 @@ class CardReader { static SdVolume volume; static SdFile file; - static uint32_t filesize, sdpos; + static uint32_t filesize, // Total size of the current file, in bytes + sdpos; // Index most recently read (one behind file.getPos) // // Procedure calls to other files diff --git a/buildroot/test-gcode/M808-loops.gcode b/buildroot/test-gcode/M808-loops.gcode new file mode 100644 index 000000000000..6248c9cc3146 --- /dev/null +++ b/buildroot/test-gcode/M808-loops.gcode @@ -0,0 +1,16 @@ +; +; M808 Repeat Marker Test +; + +M808 L3 ; Marker at 54 + +M118 Outer Loop +M300 S220 P100 + +M808 L5 ; Marker at 111 + +M118 Inner Loop +M300 S110 P100 + +M808 +M808 diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index a968a5d21316..da3a79f58cb4 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -107,7 +107,7 @@ restore_configs opt_set MOTHERBOARD BOARD_MEGACONTROLLER opt_set LCD_LANGUAGE de opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ - MINIPANEL SDSUPPORT PCA9632 LCD_INFO_MENU SOUND_MENU_ITEM \ + MINIPANEL SDSUPPORT PCA9632 LCD_INFO_MENU SOUND_MENU_ITEM GCODE_REPEAT_MARKERS \ AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS M100_FREE_MEMORY_WATCHER \ diff --git a/platformio.ini b/platformio.ini index 062514c882e5..52310e6b8198 100644 --- a/platformio.ini +++ b/platformio.ini @@ -101,6 +101,7 @@ default_src_filter = + - - + - - - - - + - - - - - - - @@ -182,6 +183,7 @@ default_src_filter = + - - + - - - + - - - - @@ -374,6 +376,7 @@ G38_PROBE_TARGET = src_filter=+ MAGNETIC_PARKING_EXTRUDER = src_filter=+ SDSUPPORT = src_filter=+ HAS_MEDIA_SUBCALLS = src_filter=+ +GCODE_REPEAT_MARKERS = src_filter=+ + HAS_EXTRUDERS = src_filter=+ + AUTO_REPORT_TEMPERATURES = src_filter=+ INCH_MODE_SUPPORT = src_filter=+ @@ -402,7 +405,7 @@ framework = arduino extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} -monitor_speed = 250000 +monitor_speed = 115200 monitor_flags = --quiet --echo From 819ec462b8440172c32f009adf44ad54c266c1e5 Mon Sep 17 00:00:00 2001 From: BsCmOD <64871957+BsCmOD@users.noreply.github.com> Date: Fri, 27 Nov 2020 04:25:18 +0100 Subject: [PATCH 251/443] FIX TMC menu message (#20294) --- Marlin/src/lcd/menu/menu_tmc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 402ee41a1b45..69193701eb1f 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -247,7 +247,7 @@ void menu_tmc_current() { void menu_tmc() { START_MENU(); - BACK_ITEM(MSG_CONTROL); + BACK_ITEM(MSG_ADVANCED_SETTINGS); SUBMENU(MSG_TMC_CURRENT, menu_tmc_current); #if ENABLED(HYBRID_THRESHOLD) SUBMENU(MSG_TMC_HYBRID_THRS, menu_tmc_hybrid_thrs); From 109f68f7dff0b0539d6d522ac3b849b516394ae9 Mon Sep 17 00:00:00 2001 From: ellensp Date: Fri, 27 Nov 2020 17:50:21 +1300 Subject: [PATCH 252/443] Fix BTT GTR 1.0 endstop/DIAG pins (#20296) --- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 51 ++++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) 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 6c475faeb558..bfa4007658db 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -46,15 +46,54 @@ #define PS_ON_PIN PH6 +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PF2 // X- +#define Y_DIAG_PIN PC13 // Y- +#define Z_DIAG_PIN PE0 // Z- +#define E0_DIAG_PIN PG14 // X+ +#define E1_DIAG_PIN PG9 // Y+ +#define E2_DIAG_PIN PD3 // Z+ + // // Limit Switches // -#define X_MIN_PIN PF2 -#define X_MAX_PIN PG14 -#define Y_MIN_PIN PC13 -#define Y_MAX_PIN PG9 -#define Z_MIN_PIN PE0 -#define Z_MAX_PIN PD3 +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN E0_DIAG_PIN // X+ + #else + #define X_MIN_PIN E0_DIAG_PIN // X+ + #endif +#else + #define X_MIN_PIN X_DIAG_PIN // X- + #define X_MAX_PIN E0_DIAG_PIN // X+ +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN E1_DIAG_PIN // Y+ + #else + #define Y_MIN_PIN E1_DIAG_PIN // Y+ + #endif +#else + #define Y_MIN_PIN Y_DIAG_PIN // Y- + #define Y_MAX_PIN E1_DIAG_PIN // Y+ +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN E2_DIAG_PIN // Z+ + #else + #define Z_MIN_PIN E2_DIAG_PIN // Z+ + #endif +#else + #define Z_MIN_PIN Z_DIAG_PIN // Z- + #define Z_MAX_PIN E2_DIAG_PIN // Z+ +#endif // // Pins on the extender From bab660ca7d4f2f22586375e44d97678d9f7846c1 Mon Sep 17 00:00:00 2001 From: yysh12 Date: Thu, 26 Nov 2020 23:29:07 -0600 Subject: [PATCH 253/443] =?UTF-8?q?Fix=20G2/G3=20arcs=20>=20180=C2=B0=20(#?= =?UTF-8?q?20292)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/motion/G2_G3.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index c713877a0e6a..b920e2307336 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -77,16 +77,21 @@ void plan_arc( rt_Y = cart[q_axis] - center_Q, start_L = current_position[l_axis]; - // CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required. + // Angle of rotation between position and target from the circle center. float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); - if (angular_travel < 0) angular_travel += RADIANS(360); + + // Make sure angular travel over 180 degrees goes the other way around. + switch (((angular_travel < 0) << 1) + clockwise) { + case 1: angular_travel -= RADIANS(360); break; // Positive but CW? Reverse direction. + case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction. + } + #ifdef MIN_ARC_SEGMENTS - uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * (angular_travel / RADIANS(360))); + uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * ABS(angular_travel) / RADIANS(360)); NOLESS(min_segments, 1U); #else constexpr uint16_t min_segments = 1; #endif - if (clockwise) angular_travel -= RADIANS(360); // Make a circle if the angular rotation is 0 and the target is current position if (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { From 0acd751e2d99e3ba53dae69651ad25282ba6a058 Mon Sep 17 00:00:00 2001 From: Sergey1560 <53866542+Sergey1560@users.noreply.github.com> Date: Fri, 27 Nov 2020 09:00:25 +0300 Subject: [PATCH 254/443] Group related homing options (#20283) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 4 ++-- Marlin/Configuration_adv.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3320e18abc3d..0e529b3462be 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1099,8 +1099,8 @@ // @section homing -//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed - +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety. +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety. //#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. //#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e6b76a4133c1..03c9ba55eb35 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -854,8 +854,6 @@ // If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here. //#define Z_AFTER_DEACTIVATE Z_HOME_POS -//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated - // Default Minimum Feedrates for printing and travel moves #define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S. #define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T. From 1c7f53bbb27aae47a2529f907e8bf26f7590de7f Mon Sep 17 00:00:00 2001 From: Thomas Niccolo Reyes Date: Sat, 28 Nov 2020 05:26:19 +0800 Subject: [PATCH 255/443] Fix M73 LCD code typo (#20300) --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 00968f4ba0e9..fabd403c6b73 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -714,7 +714,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && (printingIsActive() || marlin_state == MF_SD_COMPLETE); if (show_remain) { #if ENABLED(USE_M73_REMAINING_TIME) - duration_t remaining = get_remaining_time(); + duration_t remaining = ui.get_remaining_time(); #else uint8_t progress = ui.get_progress_percent(); uint32_t elapsed = print_job_timer.duration(); From d466ac12ea1452525456b0ea3f2e257f954abce2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 28 Nov 2020 00:12:13 +0000 Subject: [PATCH 256/443] [cron] Bump distribution date (2020-11-28) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 83345a9fd7f2..9360f4112a0d 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-27" + #define STRING_DISTRIBUTION_DATE "2020-11-28" #endif /** From e7e1dcf19049448328ad9fb25bbdba9e59ade3a9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 29 Nov 2020 00:12:56 +0000 Subject: [PATCH 257/443] [cron] Bump distribution date (2020-11-29) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9360f4112a0d..2ca9145bcbde 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-28" + #define STRING_DISTRIBUTION_DATE "2020-11-29" #endif /** From dcb101224f3c0e2ceb12f81a91c13ce16468445d Mon Sep 17 00:00:00 2001 From: yysh12 Date: Sun, 29 Nov 2020 14:50:54 -0600 Subject: [PATCH 258/443] Arc Direction followup for circles (#20314) --- Marlin/src/gcode/motion/G2_G3.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index b920e2307336..469d726df91b 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -80,24 +80,26 @@ void plan_arc( // Angle of rotation between position and target from the circle center. float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); - // Make sure angular travel over 180 degrees goes the other way around. - switch (((angular_travel < 0) << 1) + clockwise) { - case 1: angular_travel -= RADIANS(360); break; // Positive but CW? Reverse direction. - case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction. - } - #ifdef MIN_ARC_SEGMENTS - uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * ABS(angular_travel) / RADIANS(360)); - NOLESS(min_segments, 1U); + uint16_t min_segments = MIN_ARC_SEGMENTS; #else constexpr uint16_t min_segments = 1; #endif - // Make a circle if the angular rotation is 0 and the target is current position - if (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { - angular_travel = RADIANS(360); + // Do a full circle if angular rotation is near 0 and the target is current position + if ((!angular_travel || NEAR_ZERO(angular_travel)) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { + // Preserve direction for circles + angular_travel = clockwise ? -RADIANS(360) : RADIANS(360); + } + else { + // Make sure angular travel over 180 degrees goes the other way around. + switch (((angular_travel < 0) << 1) | clockwise) { + case 1: angular_travel -= RADIANS(360); break; // Positive but CW? Reverse direction. + case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction. + } #ifdef MIN_ARC_SEGMENTS - min_segments = MIN_ARC_SEGMENTS; + min_segments = CEIL(min_segments * ABS(angular_travel) / RADIANS(360)); + NOLESS(min_segments, 1U); #endif } From 39abda874391695cfa227acb4521fe88e7ac00aa Mon Sep 17 00:00:00 2001 From: "Alexander D. Kanevskiy" Date: Sun, 29 Nov 2020 22:55:18 +0200 Subject: [PATCH 259/443] SKR E3 Turbo Controller Fan (#20320) --- Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 4 ++++ 1 file changed, 4 insertions(+) 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 6d6d7557f57d..097a41347c22 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -173,6 +173,10 @@ #define FAN_PIN P2_01 #define FAN1_PIN P2_02 +#ifndef CONTROLLER_FAN_PIN + #define CONTROLLER_FAN_PIN FAN1_PIN +#endif + /** * _____ * 5V | 1 2 | GND From f2b9be6e70e1709010977f2675308d21bffe6977 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 29 Nov 2020 12:57:05 -0800 Subject: [PATCH 260/443] Fix STM32F1 'freeMemory()' warnings (#20319) --- Marlin/src/HAL/STM32F1/HAL.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 06f75662cffa..226c8ca9b266 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -202,17 +202,9 @@ extern "C" { extern "C" char* _sbrk(int incr); -/* -static int freeMemory() { - volatile int top; - top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); - return top; -} -*/ - -static int freeMemory() { +static inline int freeMemory() { volatile char top; - return &top - reinterpret_cast(_sbrk(0)); + return &top - _sbrk(0); } #if GCC_VERSION <= 50000 From df0a0c9490346f57e1b8224cb0fe7a1ad46d76bb Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 29 Nov 2020 13:00:08 -0800 Subject: [PATCH 261/443] Leveling Fade Height default setting (#20316) --- Marlin/Configuration.h | 3 +++ Marlin/src/inc/Conditionals_post.h | 4 ++++ Marlin/src/module/settings.cpp | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0e529b3462be..ebc3311d9eda 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1291,6 +1291,9 @@ // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + #define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height. + #endif // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 35fd92e10b76..dfecd57749b0 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2448,6 +2448,10 @@ #endif #endif +#ifndef DEFAULT_LEVELING_FADE_HEIGHT + #define DEFAULT_LEVELING_FADE_HEIGHT 0.0 +#endif + #if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) #define LEVELED_SEGMENT_LENGTH 5 #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index c49c643b60e3..c6eee271a08f 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -696,7 +696,7 @@ void MarlinSettings::postprocess() { // Global Leveling // { - const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, 10.0f); + const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, (DEFAULT_LEVELING_FADE_HEIGHT)); EEPROM_WRITE(zfh); } @@ -2588,7 +2588,7 @@ void MarlinSettings::reset() { // // Global Leveling // - TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = 0.0); + TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); TERN_(HAS_LEVELING, reset_bed_level()); #if HAS_BED_PROBE From 0f9ac3026de3a95bfa62aaba348efba803fbc1a7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 30 Nov 2020 00:12:42 +0000 Subject: [PATCH 262/443] [cron] Bump distribution date (2020-11-30) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2ca9145bcbde..dc3638439599 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-29" + #define STRING_DISTRIBUTION_DATE "2020-11-30" #endif /** From 8fd8772a6fffe63d99d0b88aec7a77d283df8584 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Nov 2020 19:06:40 -0600 Subject: [PATCH 263/443] Adjust axis homed / trusted methods (#20323) --- Marlin/src/gcode/calibrate/G28.cpp | 9 ++--- Marlin/src/gcode/calibrate/G34.cpp | 2 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 2 +- Marlin/src/gcode/feature/pause/M600.cpp | 2 +- Marlin/src/gcode/feature/pause/M701_M702.cpp | 12 ++---- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 18 +++------ Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 18 +++------ Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 18 +++------ .../lcd/dogm/status_screen_lite_ST7920.cpp | 11 +++-- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 3 +- Marlin/src/lcd/extui/ui_api.cpp | 12 +++--- Marlin/src/lcd/menu/menu.cpp | 3 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 2 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- Marlin/src/lcd/tft/ui_320x240.cpp | 31 ++++++-------- Marlin/src/lcd/tft/ui_480x320.cpp | 31 ++++++-------- Marlin/src/module/motion.cpp | 35 ++++++++-------- Marlin/src/module/motion.h | 40 +++++++++++-------- Marlin/src/module/probe.cpp | 4 +- Marlin/src/module/stepper/indirection.h | 8 ++-- 22 files changed, 118 insertions(+), 149 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index c4effe7d58b8..c17d6dcc8b94 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -319,15 +319,14 @@ void GcodeSuite::G28() { #endif - const float z_homing_height = - ENABLED(UNKNOWN_Z_NO_RAISE) && !TEST(axis_known_position, Z_AXIS) - ? 0 - : (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT); + const float z_homing_height = TERN1(UNKNOWN_Z_NO_RAISE, axis_is_trusted(Z_AXIS)) + ? (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT) + : 0; if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) { // Raise Z before homing any other axes and z is not already high enough (never lower z) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height); - do_z_clearance(z_homing_height, true, DISABLED(UNKNOWN_Z_NO_RAISE)); + do_z_clearance(z_homing_height, axis_is_trusted(Z_AXIS), DISABLED(UNKNOWN_Z_NO_RAISE)); } #if ENABLED(QUICK_HOME) diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index 315b2d7333dd..85e843c2c8f1 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -39,7 +39,7 @@ void GcodeSuite::G34() { // Home before the alignment procedure - if (!all_axes_known()) home_all_axes(); + if (!all_axes_trusted()) home_all_axes(); SET_SOFT_ENDSTOP_LOOSE(true); TEMPORARY_BED_LEVELING_STATE(false); diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 8d3dd0d06b23..840d04f29e98 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -167,7 +167,7 @@ void GcodeSuite::G34() { ); // Home before the alignment procedure - if (!all_axes_known()) home_all_axes(); + if (!all_axes_trusted()) home_all_axes(); // Move the Z coordinate realm towards the positive - dirty trick current_position.z += z_probe * 0.5f; diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index e676ed38a4a0..bdaec7c7f9b5 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -102,7 +102,7 @@ void GcodeSuite::M600() { #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) // If needed, home before parking for filament change - if (!all_axes_known()) home_all_axes(); + if (!all_axes_trusted()) home_all_axes(); #endif #if HAS_MULTI_EXTRUDER diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index a100d462da7e..a889da8aeaa7 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -59,10 +59,8 @@ void GcodeSuite::M701() { xyz_pos_t park_point = NOZZLE_PARK_POINT; - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Don't raise Z if the machine isn't homed - if (axes_should_home()) park_point.z = 0; - #endif + // Don't raise Z if the machine isn't homed + 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(); @@ -147,10 +145,8 @@ void GcodeSuite::M701() { void GcodeSuite::M702() { xyz_pos_t park_point = NOZZLE_PARK_POINT; - #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Don't raise Z if the machine isn't homed - if (axes_should_home()) park_point.z = 0; - #endif + // Don't raise Z if the machine isn't homed + if (TERN0(NO_MOTION_BEFORE_HOMING, axes_should_home())) park_point.z = 0; #if ENABLED(MIXING_EXTRUDER) const uint8_t old_mixing_tool = mixer.get_current_vtool(); diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index fabd403c6b73..84c477fbde5d 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -506,18 +506,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const lcd_put_wchar('X' + uint8_t(axis)); if (blink) lcd_put_u8str(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); - else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_put_u8str(value); - } - } + else if (axis_should_home(axis)) + while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); + else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) + lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); + else + lcd_put_u8str(value); } FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) { diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 74be828c727e..cadd693f6f9e 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -422,18 +422,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const lcd.write('X' + uint8_t(axis)); if (blink) lcd.print(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd.write(c <= '.' ? c : '?'); - else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_put_u8str(value); - } - } + else if (axis_should_home(axis)) + while (const char c = *value++) lcd.write(c <= '.' ? c : '?'); + else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) + lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); + else + lcd_put_u8str(value); } FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char *prefix, const bool blink) { diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 882b2fef506a..29acb869413f 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -384,18 +384,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (blink) lcd_put_u8str(value); - else { - if (!TEST(axis_homed, axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); - else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_known_position, axis)) - lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); - else - #endif - lcd_put_u8str(value); - } - } + else if (axis_should_home(axis)) + while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); + else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) + lcd_put_u8str_P(axis == Z_AXIS ? PSTR(" ") : PSTR(" ")); + else + lcd_put_u8str(value); } /** diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index c06080f601bb..a538121d2cf6 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -659,13 +659,13 @@ void ST7920_Lite_Status_Screen::draw_status_message() { #endif } -void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool position_known) { +void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool position_trusted) { char str[7]; set_ddram_address(DDRAM_LINE_4); begin_data(); // If position is unknown, flash the labels. - const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); + const unsigned char alt_label = position_trusted ? 0 : (ui.get_blink() ? ' ' : 0); if (TERN1(LCD_SHOW_E_TOTAL, !printingIsActive())) { write_byte(alt_label ? alt_label : 'X'); @@ -831,9 +831,8 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { } } - if (countdown == 0 && (forceUpdate || position_changed() - || TERN(DISABLE_REDUCED_ACCURACY_WARNING, 0, blink_changed()) - )) draw_position(current_position, TERN(DISABLE_REDUCED_ACCURACY_WARNING, 1, all_axes_known())); + if (countdown == 0 && (forceUpdate || position_changed() || TERN(DISABLE_REDUCED_ACCURACY_WARNING, 0, blink_changed()))) + draw_position(current_position, TERN(DISABLE_REDUCED_ACCURACY_WARNING, 1, all_axes_trusted())); #endif } @@ -855,7 +854,7 @@ void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { UNUSED(forceUpdate); - #endif // LCD_SET_PROGRESS_MANUALLY || SDSUPPORT + #endif } void ST7920_Lite_Status_Screen::update(const bool forceUpdate) { diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index fe2397fa6b42..e9e6ef69e510 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -1281,8 +1281,7 @@ void HMI_Move_Z() { last_zoffset = dwin_zoffset; dwin_zoffset = HMI_ValueStruct.offset_value / 100.0f; #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - if ( (ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_known()) && (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy()) ) - babystep.add_mm(Z_AXIS, dwin_zoffset - last_zoffset); + if (BABYSTEP_ALLOWED()) babystep.add_mm(Z_AXIS, dwin_zoffset - last_zoffset); #endif DWIN_Draw_Signed_Float(font8x16, Select_Color, 2, 2, 202, MBASE(zoff_line), HMI_ValueStruct.offset_value); DWIN_UpdateLCD(); diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 1583db41e90b..1877914bfb5d 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -356,9 +356,9 @@ namespace ExtUI { bool canMove(const axis_t axis) { switch (axis) { #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - case X: return TEST(axis_homed, X_AXIS); - case Y: return TEST(axis_homed, Y_AXIS); - case Z: return TEST(axis_homed, Z_AXIS); + case X: return axis_should_home(X_AXIS); + case Y: return axis_should_home(Y_AXIS); + case Z: return axis_should_home(Z_AXIS); #else case X: case Y: case Z: return true; #endif @@ -889,9 +889,9 @@ namespace ExtUI { bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); } - bool isAxisPositionKnown(const axis_t axis) { return TEST(axis_known_position, axis); } - bool isAxisPositionKnown(const extruder_t) { return TEST(axis_known_position, E_AXIS); } - bool isPositionKnown() { return all_axes_known(); } + bool isAxisPositionKnown(const axis_t axis) { return axis_is_trusted((AxisEnum)axis); } + bool isAxisPositionKnown(const extruder_t) { return axis_is_trusted(E_AXIS); } + bool isPositionKnown() { return all_axes_trusted(); } bool isMachineHomed() { return all_axes_homed(); } PGM_P getFirmwareName_str() { diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 1497940ffe55..add306b6e322 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -188,8 +188,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; } else if (screen == status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) { - if ( (ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_known()) - && (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy()) ) + if (BABYSTEP_ALLOWED()) screen = TERN(BABYSTEP_ZPROBE_OFFSET, lcd_babystep_zoffset, lcd_babystep_z); else { #if ENABLED(MOVE_Z_WHEN_IDLE) diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 52d2d0ec3db6..ad91c404aa7a 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -230,7 +230,7 @@ static inline void _lcd_level_bed_corners_homing() { void _lcd_level_bed_corners() { ui.defer_status_screen(); - if (!all_axes_known()) { + if (!all_axes_trusted()) { set_all_unhomed(); queue.inject_P(G28_STR); } diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index d089b2125ac7..64dca3b04fd2 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -237,7 +237,7 @@ * Save Settings (Req: EEPROM_SETTINGS) */ void menu_bed_leveling() { - const bool is_homed = all_axes_known(), + const bool is_homed = all_axes_trusted(), is_valid = leveling_is_valid(); START_MENU(); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 2c3af1e5ee2d..7b95f435baa0 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -164,7 +164,7 @@ void menu_advanced_settings(); void menu_tool_offsets() { auto _recalc_offsets = []{ - if (active_extruder && all_axes_known()) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. + if (active_extruder && all_axes_trusted()) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. queue.inject_P(G28_STR); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. active_extruder = 0; } diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 5dce47eec294..eb19e96626c0 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -524,7 +524,7 @@ void _ubl_map_screen_homing() { */ void _ubl_goto_map_screen() { if (planner.movesplanned()) return; // The ACTION_ITEM will do nothing - if (!all_axes_known()) { + if (!all_axes_trusted()) { set_all_unhomed(); queue.inject_P(G28_STR); } diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 45a91cd5e5c2..51f65c59b563 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -257,42 +257,37 @@ void MarlinUI::draw_status_screen() { tft.set_background(COLOR_BACKGROUND); tft.add_rectangle(0, 0, 312, 24, COLOR_AXIS_HOMED); - uint16_t color; - uint16_t offset; - bool is_homed; - tft.add_text( 10, 3, COLOR_AXIS_HOMED , "X"); tft.add_text(127, 3, COLOR_AXIS_HOMED , "Y"); tft.add_text(219, 3, COLOR_AXIS_HOMED , "Z"); - is_homed = TEST(axis_homed, X_AXIS); - tft_string.set(blink & !is_homed ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); - tft.add_text( 68 - tft_string.width(), 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + bool not_homed = axis_should_home(X_AXIS); + tft_string.set(blink && not_homed ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); + tft.add_text( 68 - tft_string.width(), 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - is_homed = TEST(axis_homed, Y_AXIS); - tft_string.set(blink & !is_homed ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); - tft.add_text(185 - tft_string.width(), 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + not_homed = axis_should_home(Y_AXIS); + tft_string.set(blink && not_homed ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); + tft.add_text(185 - tft_string.width(), 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - is_homed = TEST(axis_homed, Z_AXIS); - if (blink & !is_homed) { + not_homed = axis_should_home(Z_AXIS); + uint16_t offset = 25; + if (blink && not_homed) tft_string.set("?"); - offset = 25; // ".00" - } else { const float z = LOGICAL_Z_POSITION(current_position.z); tft_string.set(ftostr52sp((int16_t)z)); tft_string.rtrim(); - offset = tft_string.width(); + offset += tft_string.width(); tft_string.set(ftostr52sp(z)); - offset += 25 - tft_string.width(); + offset -= tft_string.width(); } - tft.add_text(301 - tft_string.width() - offset, 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + tft.add_text(301 - tft_string.width() - offset, 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); // feed rate tft.canvas(70, 136, 80, 32); tft.set_background(COLOR_BACKGROUND); - color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; + uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFeedRate, color); tft_string.set(i16tostr3rj(feedrate_percentage)); tft_string.add('%'); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index d152acdf7726..343d187d26ba 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -262,43 +262,38 @@ void MarlinUI::draw_status_screen() { tft.set_background(COLOR_BACKGROUND); tft.add_rectangle(0, 0, TFT_WIDTH - 8, 34, COLOR_AXIS_HOMED); - uint16_t color; - uint16_t offset; - bool is_homed; - tft.add_text( 16, 3, COLOR_AXIS_HOMED , "X"); tft.add_text(192, 3, COLOR_AXIS_HOMED , "Y"); tft.add_text(330, 3, COLOR_AXIS_HOMED , "Z"); - is_homed = TEST(axis_homed, X_AXIS); - tft_string.set(blink & !is_homed ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); - tft.add_text(102 - tft_string.width(), 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + bool not_homed = axis_should_home(X_AXIS); + tft_string.set(blink && not_homed ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); + tft.add_text(102 - tft_string.width(), 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - is_homed = TEST(axis_homed, Y_AXIS); - tft_string.set(blink & !is_homed ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); - tft.add_text(280 - tft_string.width(), 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + not_homed = axis_should_home(Y_AXIS); + tft_string.set(blink && not_homed ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); + tft.add_text(280 - tft_string.width(), 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - is_homed = TEST(axis_homed, Z_AXIS); - if (blink & !is_homed) { + uint16_t offset = 32; + not_homed = axis_should_home(Z_AXIS); + if (blink && not_homed) tft_string.set("?"); - offset = 32; // ".00" - } else { const float z = LOGICAL_Z_POSITION(current_position.z); tft_string.set(ftostr52sp((int16_t)z)); tft_string.rtrim(); - offset = tft_string.width(); + offset += tft_string.width(); tft_string.set(ftostr52sp(z)); - offset += 32 - tft_string.width(); + offset -= tft_string.width(); } - tft.add_text(455 - tft_string.width() - offset, 3, is_homed ? COLOR_AXIS_HOMED : COLOR_AXIS_NOT_HOMED, tft_string); + tft.add_text(455 - tft_string.width() - offset, 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 4, 132, TFT_WIDTH - 8, 34)); // feed rate tft.canvas(96, 180, 100, 32); tft.set_background(COLOR_BACKGROUND); - color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; + uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFeedRate, color); tft_string.set(i16tostr3rj(feedrate_percentage)); tft_string.add('%'); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 03c8ddc46296..3a01cda5c120 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -79,11 +79,11 @@ * Flags that each linear axis was homed. * XYZ on cartesian, ABC on delta, ABZ on SCARA. * - * axis_known_position - * Flags that the position is known in each linear axis. Set when homed. + * axis_trusted + * Flags that the position is trusted in each linear axis. Set when homed. * Cleared whenever a stepper powers off, potentially losing its position. */ -uint8_t axis_homed, axis_known_position; // = 0 +uint8_t axis_homed, axis_trusted; // = 0 // Relative Mode. Enable with G91, disable with G90. bool relative_mode; // = false; @@ -506,8 +506,8 @@ void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRat do_blocking_move_to(raw.x, raw.y, z, fr_mm_s); } -void do_z_clearance(const float &zclear, const bool z_known/*=true*/, const bool raise_on_unknown/*=true*/, const bool lower_allowed/*=false*/) { - const bool rel = raise_on_unknown && !z_known; +void do_z_clearance(const float &zclear, const bool z_trusted/*=true*/, const bool raise_on_untrusted/*=true*/, const bool lower_allowed/*=false*/) { + const bool rel = raise_on_untrusted && !z_trusted; float zdest = zclear + (rel ? current_position.z : 0.0f); if (!lower_allowed) NOLESS(zdest, current_position.z); do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), MMM_TO_MMS(TERN(HAS_BED_PROBE, Z_PROBE_SPEED_FAST, HOMING_FEEDRATE_Z))); @@ -649,7 +649,7 @@ void restore_feedrate_and_scaling() { constexpr xy_pos_t offs{0}; #endif - if (TERN1(IS_SCARA, TEST(axis_homed, X_AXIS) && TEST(axis_homed, Y_AXIS))) { + if (TERN1(IS_SCARA, axis_was_homed(X_AXIS) && axis_was_homed(Y_AXIS))) { const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y); if (dist_2 > delta_max_radius_2) target *= float(delta_max_radius / SQRT(dist_2)); // 200 / 300 = 0.66 @@ -657,7 +657,7 @@ void restore_feedrate_and_scaling() { #else - if (TEST(axis_homed, X_AXIS)) { + if (axis_was_homed(X_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_X) NOLESS(target.x, soft_endstop.min.x); #endif @@ -666,7 +666,7 @@ void restore_feedrate_and_scaling() { #endif } - if (TEST(axis_homed, Y_AXIS)) { + if (axis_was_homed(Y_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Y) NOLESS(target.y, soft_endstop.min.y); #endif @@ -677,7 +677,7 @@ void restore_feedrate_and_scaling() { #endif - if (TEST(axis_homed, Z_AXIS)) { + if (axis_was_homed(Z_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Z) NOLESS(target.z, soft_endstop.min.z); #endif @@ -1124,10 +1124,11 @@ void prepare_line_to_destination() { } uint8_t axes_should_home(uint8_t axis_bits/*=0x07*/) { + #define SHOULD_HOME(A) TERN(HOME_AFTER_DEACTIVATE, axis_is_trusted, axis_was_homed)(A) // Clear test bits that are trusted - if (TEST(axis_bits, X_AXIS) && TEST(axis_homed, X_AXIS)) CBI(axis_bits, X_AXIS); - if (TEST(axis_bits, Y_AXIS) && TEST(axis_homed, Y_AXIS)) CBI(axis_bits, Y_AXIS); - if (TEST(axis_bits, Z_AXIS) && TEST(axis_homed, Z_AXIS)) CBI(axis_bits, Z_AXIS); + if (TEST(axis_bits, X_AXIS) && SHOULD_HOME(X_AXIS)) CBI(axis_bits, X_AXIS); + if (TEST(axis_bits, Y_AXIS) && SHOULD_HOME(Y_AXIS)) CBI(axis_bits, Y_AXIS); + if (TEST(axis_bits, Z_AXIS) && SHOULD_HOME(Z_AXIS)) CBI(axis_bits, Z_AXIS); return axis_bits; } @@ -1388,7 +1389,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t * * DELTA should wait until all homing is done before setting the XYZ * current_position to home, because homing is a single operation. - * In the case where the axis positions are already known and previously + * In the case where the axis positions are trusted and previously * homed, DELTA could home to X or Y individually by moving either one * to the center. However, homing Z always homes XY and Z. * @@ -1401,8 +1402,8 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t void set_axis_is_at_home(const AxisEnum axis) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> set_axis_is_at_home(", axis_codes[axis], ")"); - SBI(axis_known_position, axis); - SBI(axis_homed, axis); + set_axis_trusted(axis); + set_axis_homed(axis); #if ENABLED(DUAL_X_CARRIAGE) if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { @@ -1462,8 +1463,8 @@ void set_axis_is_at_home(const AxisEnum axis) { void set_axis_never_homed(const AxisEnum axis) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> set_axis_never_homed(", axis_codes[axis], ")"); - CBI(axis_known_position, axis); - CBI(axis_homed, axis); + set_axis_untrusted(axis); + set_axis_unhomed(axis); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("<<< set_axis_never_homed(", axis_codes[axis], ")"); diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index abc59f92b886..efbfd7de4dda 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -34,19 +34,6 @@ #include "scara.h" #endif -// Axis homed and known-position states -extern uint8_t axis_homed, axis_known_position; -constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); -FORCE_INLINE bool no_axes_homed() { return !axis_homed; } -FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; } -FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; } -FORCE_INLINE void set_all_homed() { axis_homed = axis_known_position = xyz_bits; } -FORCE_INLINE void set_all_unhomed() { axis_homed = axis_known_position = 0; } - -FORCE_INLINE bool homing_needed() { - return !TERN(HOME_AFTER_DEACTIVATE, all_axes_known, all_axes_homed)(); -} - // Error margin to work around float imprecision constexpr float fslop = 0.0001; @@ -269,23 +256,42 @@ void remember_feedrate_and_scaling(); void remember_feedrate_scaling_off(); void restore_feedrate_and_scaling(); -void do_z_clearance(const float &zclear, const bool z_known=true, const bool raise_on_unknown=true, const bool lower_allowed=false); +void do_z_clearance(const float &zclear, const bool z_trusted=true, const bool raise_on_untrusted=true, const bool lower_allowed=false); + +/** + * Homing and Trusted Axes + */ +constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS); +extern uint8_t axis_homed, axis_trusted; -// -// Homing -// void homeaxis(const AxisEnum axis); void set_axis_is_at_home(const AxisEnum axis); void set_axis_never_homed(const AxisEnum axis); uint8_t axes_should_home(uint8_t axis_bits=0x07); bool homing_needed_error(uint8_t axis_bits=0x07); +FORCE_INLINE bool axis_was_homed(const AxisEnum axis) { return TEST(axis_homed, axis); } +FORCE_INLINE bool axis_is_trusted(const AxisEnum axis) { return TEST(axis_trusted, axis); } +FORCE_INLINE bool axis_should_home(const AxisEnum axis) { return (axes_should_home() & _BV(axis)) != 0; } +FORCE_INLINE bool no_axes_homed() { return !axis_homed; } +FORCE_INLINE bool all_axes_homed() { return xyz_bits == (axis_homed & xyz_bits); } +FORCE_INLINE bool homing_needed() { return !all_axes_homed(); } +FORCE_INLINE bool all_axes_trusted() { return xyz_bits == (axis_trusted & xyz_bits); } +FORCE_INLINE void set_axis_homed(const AxisEnum axis) { SBI(axis_homed, axis); } +FORCE_INLINE void set_axis_unhomed(const AxisEnum axis) { CBI(axis_homed, axis); } +FORCE_INLINE void set_axis_trusted(const AxisEnum axis) { SBI(axis_trusted, axis); } +FORCE_INLINE void set_axis_untrusted(const AxisEnum axis) { CBI(axis_trusted, axis); } +FORCE_INLINE void set_all_homed() { axis_homed = axis_trusted = xyz_bits; } +FORCE_INLINE void set_all_unhomed() { axis_homed = axis_trusted = 0; } + #if ENABLED(NO_MOTION_BEFORE_HOMING) #define MOTION_CONDITIONS (IsRunning() && !homing_needed_error()) #else #define MOTION_CONDITIONS IsRunning() #endif +#define BABYSTEP_ALLOWED() ((ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_trusted()) && (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy())) + /** * Workspace offsets */ diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 11447d71297e..400206f83ae1 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -350,7 +350,7 @@ bool Probe::set_deployed(const bool deploy) { // For beds that fall when Z is powered off only raise for trusted Z #if ENABLED(UNKNOWN_Z_NO_RAISE) - const bool unknown_condition = TEST(axis_known_position, Z_AXIS); + const bool unknown_condition = axis_is_trusted(Z_AXIS); #else constexpr float unknown_condition = true; #endif @@ -510,7 +510,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { // Stop the probe before it goes too low to prevent damage. // If Z isn't known then probe to -10mm. - const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -offset.z + Z_PROBE_LOW_POINT : -10.0; + const float z_probe_low_point = axis_is_trusted(Z_AXIS) ? -offset.z + Z_PROBE_LOW_POINT : -10.0; // Double-probing does a fast probe followed by a slow probe #if TOTAL_PROBING == 2 diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index d14bfc7329c8..4346e9d6cccf 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -856,13 +856,11 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif #define ENABLE_AXIS_X() if (SHOULD_ENABLE(x)) { ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); AFTER_CHANGE(x, true); } -#define DISABLE_AXIS_X() if (SHOULD_DISABLE(x)) { DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); AFTER_CHANGE(x, false); FORGET_AXIS(X_AXIS); } +#define DISABLE_AXIS_X() if (SHOULD_DISABLE(x)) { DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); AFTER_CHANGE(x, false); set_axis_untrusted(X_AXIS); } #define ENABLE_AXIS_Y() if (SHOULD_ENABLE(y)) { ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); AFTER_CHANGE(y, true); } -#define DISABLE_AXIS_Y() if (SHOULD_DISABLE(y)) { DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); AFTER_CHANGE(y, false); FORGET_AXIS(Y_AXIS); } +#define DISABLE_AXIS_Y() if (SHOULD_DISABLE(y)) { DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); AFTER_CHANGE(y, false); set_axis_untrusted(Y_AXIS); } #define ENABLE_AXIS_Z() if (SHOULD_ENABLE(z)) { ENABLE_STEPPER_Z(); ENABLE_STEPPER_Z2(); ENABLE_STEPPER_Z3(); ENABLE_STEPPER_Z4(); AFTER_CHANGE(z, true); } -#define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); AFTER_CHANGE(z, false); FORGET_AXIS(Z_AXIS); Z_RESET(); } - -#define FORGET_AXIS(A) TERN(HOME_AFTER_DEACTIVATE, set_axis_never_homed(A), CBI(axis_known_position, A)) +#define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); AFTER_CHANGE(z, false); set_axis_untrusted(Z_AXIS); Z_RESET(); } #ifdef Z_AFTER_DEACTIVATE #define Z_RESET() do{ current_position.z = Z_AFTER_DEACTIVATE; sync_plan_position(); }while(0) From fd35d1b8a6e08a72255a0b2cf9ddc1cf577fe12b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 29 Nov 2020 20:49:42 -0600 Subject: [PATCH 264/443] General cleanup --- Marlin/src/feature/bedlevel/abl/abl.cpp | 2 +- Marlin/src/feature/power_monitor.cpp | 4 ++-- Marlin/src/feature/power_monitor.h | 4 ++-- Marlin/src/gcode/feature/controllerfan/M710.cpp | 4 ++-- Marlin/src/gcode/feature/power_monitor/M430.cpp | 4 ++-- Marlin/src/lcd/menu/menu_power_monitor.cpp | 4 ++-- Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 2 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index 44e4fc38a1bd..3fb0cfc3583e 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -168,7 +168,7 @@ void print_bilinear_leveling_grid() { // cancelled out in bed_level_virt_cmr and does not impact the result. Return 0.0 rather than // making this function more complex by extrapolating two points. return 0.0; - } + } if (!x || x == ABL_TEMP_POINTS_X - 1) { if (x) { ep = GRID_MAX_POINTS_X - 1; diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp index e1e7324fb6c6..97c4a933637e 100644 --- a/Marlin/src/feature/power_monitor.cpp +++ b/Marlin/src/feature/power_monitor.cpp @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/feature/power_monitor.h b/Marlin/src/feature/power_monitor.h index a0eaf353f4c7..f378ee2a107c 100644 --- a/Marlin/src/feature/power_monitor.h +++ b/Marlin/src/feature/power_monitor.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/gcode/feature/controllerfan/M710.cpp b/Marlin/src/gcode/feature/controllerfan/M710.cpp index 67d4ad8abf54..cc450732baed 100644 --- a/Marlin/src/gcode/feature/controllerfan/M710.cpp +++ b/Marlin/src/gcode/feature/controllerfan/M710.cpp @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/gcode/feature/power_monitor/M430.cpp b/Marlin/src/gcode/feature/power_monitor/M430.cpp index 7639ea962d9b..9559404456f5 100644 --- a/Marlin/src/gcode/feature/power_monitor/M430.cpp +++ b/Marlin/src/gcode/feature/power_monitor/M430.cpp @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/lcd/menu/menu_power_monitor.cpp b/Marlin/src/lcd/menu/menu_power_monitor.cpp index e88bdb28d8c8..d31ebd36b27f 100644 --- a/Marlin/src/lcd/menu/menu_power_monitor.cpp +++ b/Marlin/src/lcd/menu/menu_power_monitor.cpp @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h index 42b665ce8659..1bcf310bc17c 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h @@ -263,7 +263,7 @@ #ifndef SD_DETECT_PIN #define SD_DETECT_PIN 38 #endif - + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 05b8b19a8a54..7541f8272941 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -243,7 +243,7 @@ #endif // Use the on-board card socket labeled SD_Extender -#if SD_CONNECTION_IS(CUSTOM_CABLE) +#if SD_CONNECTION_IS(CUSTOM_CABLE) #define SCK_PIN PC12 #define MISO_PIN PC8 #define MOSI_PIN PD2 @@ -300,7 +300,7 @@ #define FSMC_DMA_CHANNEL DMA_CH5 #define TFT_BUFFER_SIZE 14400 - #if ENABLED(TFT_CLASSIC_UI) + #if ENABLED(TFT_CLASSIC_UI) #define TFT_MARLINBG_COLOR 0x3186 // White #define TFT_MARLINUI_COLOR 0xC7B6 // green #define TFT_BTARROWS_COLOR 0xDEE6 // Yellow From 87ede6fa1b2ffb81d921264958b665f17b7326ab Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 30 Nov 2020 04:44:34 -0800 Subject: [PATCH 265/443] Increase E3V2 DWIN steps/mm range to 999.9 (#20324) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index e9e6ef69e510..7e2259e17fd5 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -186,7 +186,6 @@ bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION; constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; -constexpr float default_axis_steps_per_unit[] = DEFAULT_AXIS_STEPS_PER_UNIT; uint8_t Percentrecord = 0; uint16_t remain_time = 0; @@ -1522,7 +1521,7 @@ void HMI_StepXYZE() { } // Step limit if (WITHIN(HMI_flag.step_axis, X_AXIS, E_AXIS)) - NOMORE(HMI_ValueStruct.Max_Step, default_axis_steps_per_unit[HMI_flag.step_axis] * 2 * MINUNITMULT); + NOMORE(HMI_ValueStruct.Max_Step, 999.9 * MINUNITMULT); NOLESS(HMI_ValueStruct.Max_Step, MIN_STEP); // Step value DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Select_Color, 3, 1, 210, MBASE(select_step.now), HMI_ValueStruct.Max_Step); From db8fb9a03a1a8e13e55f82b537468883065a251a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 1 Dec 2020 00:13:08 +0000 Subject: [PATCH 266/443] [cron] Bump distribution date (2020-12-01) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index dc3638439599..e20e4525bd4a 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-30" + #define STRING_DISTRIBUTION_DATE "2020-12-01" #endif /** From 6f4381df53235b4f97815d07ce560d704ad550ab Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 30 Nov 2020 22:25:44 -0800 Subject: [PATCH 267/443] Prevent Watchdog reset writing Creality 4.x EEPROM (#20328) --- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 94b5e099bd58..09fe8f910370 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -48,6 +48,8 @@ bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { + size_t written = 0; + while (size--) { uint8_t v = *value; uint8_t * const p = (uint8_t * const)pos; @@ -55,7 +57,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui // so only write bytes that have changed! if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); - delay(2); + if (++written % 128 == 0) + safe_delay(2); // Avoid triggering watchdog during long EEPROM writes + else + delay(2); if (eeprom_read_byte(p) != v) { SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; From 0d080cea83b2666c105613678de212d7c828cbb1 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 1 Dec 2020 00:29:21 -0800 Subject: [PATCH 268/443] Fix E3V2 Control Menu when returning from Info (#20338) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 7e2259e17fd5..a96b1dcb73f4 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -726,14 +726,14 @@ inline void Draw_Control_Menu() { else { #ifdef USE_STRING_HEADINGS Draw_Title(GET_TEXT_F(MSG_CONTROL)); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_TEMP), GET_TEXT_F(MSG_TEMPERATURE)); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_MOVE), GET_TEXT_F(MSG_MOTION)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_TEMP), GET_TEXT_F(MSG_TEMPERATURE)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_MOVE), GET_TEXT_F(MSG_MOTION)); #if ENABLED(EEPROM_SETTINGS) - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_SAVE), GET_TEXT_F(MSG_STORE_EEPROM)); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_LOAD), GET_TEXT_F(MSG_LOAD_EEPROM)); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_RESET), GET_TEXT_F(MSG_RESTORE_DEFAULTS)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_SAVE), GET_TEXT_F(MSG_STORE_EEPROM)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_LOAD), GET_TEXT_F(MSG_LOAD_EEPROM)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_RESET), GET_TEXT_F(MSG_RESTORE_DEFAULTS)); #endif - if (CVISI(CONTROL_CASE_INFO)) DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(CONTROL_CASE_INFO), F("Info")); + if (CVISI(CONTROL_CASE_INFO)) DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, CLINE(CONTROL_CASE_INFO), F("Info")); #else DWIN_Frame_TitleCopy(1, 128, 2, 176, 12); // "Control" DWIN_Frame_AreaCopy(1, 1, 89, 83, 101, LBLX, CLINE(CONTROL_CASE_TEMP)); // Temperature > From 2e010909ac06bb7e91cbf79a9622db8ee39fc7b6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 1 Dec 2020 16:14:30 -0600 Subject: [PATCH 269/443] Tweak to EEPROM safe delay --- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 09fe8f910370..9a7e4d799d49 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -48,8 +48,6 @@ bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - size_t written = 0; - while (size--) { uint8_t v = *value; uint8_t * const p = (uint8_t * const)pos; @@ -57,10 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui // so only write bytes that have changed! if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); - if (++written % 128 == 0) - safe_delay(2); // Avoid triggering watchdog during long EEPROM writes - else - delay(2); + if (size & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes if (eeprom_read_byte(p) != v) { SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; From 7226f6834e9aef295ea3a7c2599e6c5a0ebb3c10 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 2 Dec 2020 00:12:48 +0000 Subject: [PATCH 270/443] [cron] Bump distribution date (2020-12-02) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e20e4525bd4a..d180e995ceb8 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-01" + #define STRING_DISTRIBUTION_DATE "2020-12-02" #endif /** From c353eab8989878d8c47603d1f87e6179129877d0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 1 Dec 2020 21:53:23 -0600 Subject: [PATCH 271/443] Level Bed Corners is a sub-menu --- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 478608e9b313..42fdbfceda07 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -400,7 +400,7 @@ void menu_motion() { #endif #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - ACTION_ITEM(MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + SUBMENU(MSG_LEVEL_CORNERS, _lcd_level_bed_corners); #endif #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) From 753cf994b6d529da9c8dd710a24a96b0388425ee Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Wed, 2 Dec 2020 06:51:04 +0100 Subject: [PATCH 272/443] Update to STM32 v10, optimize build (#20325) --- platformio.ini | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/platformio.ini b/platformio.ini index 52310e6b8198..b26ece402619 100644 --- a/platformio.ini +++ b/platformio.ini @@ -722,7 +722,7 @@ board = nxp_lpc1769 # HAL/STM32 Base Environment values # [common_stm32] -platform = ststm32@~8.0 +platform = ststm32@~10.0 build_flags = ${common.build_flags} -std=gnu++14 -DUSBCON -DUSBD_USE_CDC @@ -734,14 +734,17 @@ src_filter = ${common.default_src_filter} + + -lib_ignore = SPI -lib_deps = ${common.lib_deps} + -DARDUINO_ARCH_STM32 +build_unflags = -std=gnu11 -std=gnu++11 +src_filter = ${common.default_src_filter} + +lib_ignore = SPI, FreeRTOS701, FreeRTOS821 +lib_deps = ${common.lib_deps} SoftwareSerialM +platform_packages = tool-stm32duino # # STM32F103RC @@ -750,7 +753,6 @@ lib_deps = ${common.lib_deps} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC -platform_packages = tool-stm32duino monitor_speed = 115200 # @@ -760,7 +762,6 @@ monitor_speed = 115200 platform = ${common_stm32f1.platform} extends = common_stm32f1 board = MEEB_3DP -platform_packages = tool-stm32duino build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 @@ -842,7 +843,6 @@ lib_deps = ${env:STM32F103RC_btt_512K.lib_deps} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RE -platform_packages = tool-stm32duino monitor_speed = 115200 # @@ -922,7 +922,6 @@ build_flags = ${common_stm32f1.build_flags} -DMCU_STM32F103VE -DSTM32F1xx -USERIAL_USB -DU20 -DTS_V12 build_unflags = ${common_stm32f1.build_unflags} -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 -lib_ignore = ${common_stm32f1.lib_ignore} # # MKS Robin Mini (STM32F103VET6) @@ -943,7 +942,6 @@ build_flags = ${common_stm32f1.build_flags} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE -platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_nano35.py build_flags = ${common_stm32f1.build_flags} @@ -1024,7 +1022,6 @@ build_flags = ${common_stm32f1.build_flags} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE -platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_e3p.py build_flags = ${common_stm32f1.build_flags} @@ -1153,7 +1150,6 @@ upload_protocol = jlink platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE -platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_mini.py buildroot/share/PlatformIO/scripts/add_nanolib.py @@ -1195,7 +1191,6 @@ extra_scripts = ${common.extra_scripts} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC -platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/fly_mini.py build_flags = ${common_stm32f1.build_flags} From 257dc6d1734d616f8d4d9628433f0d00bc9cc58c Mon Sep 17 00:00:00 2001 From: Luu Lac <45380455+shitcreek@users.noreply.github.com> Date: Tue, 1 Dec 2020 23:52:09 -0600 Subject: [PATCH 273/443] Help hosts when password-locked (#20348) --- Marlin/src/gcode/gcode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 8e2ef62204e8..89bc0dc7af60 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -252,6 +252,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #if ENABLED(PASSWORD_FEATURE) if (password.is_locked && !parser.is_command('M', 511)) { SERIAL_ECHO_MSG(STR_PRINTER_LOCKED); + if (!no_ok) queue.ok_to_send(); return; } #endif From a4618309ce9746a731d92a69ccb49183dfc0828d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 2 Dec 2020 01:31:06 -0800 Subject: [PATCH 274/443] Fix E3V2 DWIN Jerk Menu (#20352) * Fix E3V2 DWIN build without CLASSIC_JERK * Fix jerk edits applying to wrong index --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 143 ++++++++++--------- buildroot/tests/STM32F103RET6_creality-tests | 4 + 2 files changed, 80 insertions(+), 67 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index a96b1dcb73f4..89ab77ba3c58 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -185,7 +185,10 @@ bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION; -constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; + +#if HAS_CLASSIC_JERK + constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; +#endif uint8_t Percentrecord = 0; uint16_t remain_time = 0; @@ -1492,8 +1495,8 @@ void HMI_MaxAccelerationXYZE() { if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Max_Jerk)) { checkkey = MaxJerk; EncoderRate.enabled = false; - if (WITHIN(HMI_flag.step_axis, X_AXIS, E_AXIS)) - planner.set_max_jerk(HMI_flag.step_axis, HMI_ValueStruct.Max_Jerk / 10); + if (WITHIN(HMI_flag.jerk_axis, X_AXIS, E_AXIS)) + planner.set_max_jerk(HMI_flag.jerk_axis, HMI_ValueStruct.Max_Jerk / 10); DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(select_jerk.now), HMI_ValueStruct.Max_Jerk); return; } @@ -2955,75 +2958,77 @@ inline void Draw_Max_Accel_Menu() { #endif } -inline void Draw_Max_Jerk_Menu() { - Clear_Main_Window(); +#if HAS_CLASSIC_JERK + inline void Draw_Max_Jerk_Menu() { + Clear_Main_Window(); - if (HMI_IsChinese()) { - DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Jerk" - - DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(1)); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(1) + 1); - DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(1)); - DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 83, MBASE(1)); // Max Jerk speed X - DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(2)); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(2) + 1); - DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(2)); - DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 83, MBASE(2) + 3); // Max Jerk speed Y - DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(3)); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(3) + 1); - DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(3)); - DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 83, MBASE(3) + 3); // Max Jerk speed Z - #if HAS_HOTEND - DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(4)); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(4) + 1); - DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(4)); - DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 83, MBASE(4) + 3); // Max Jerk speed E - #endif - } - else { - #ifdef USE_STRING_HEADINGS - Draw_Title(GET_TEXT_F(MSG_JERK)); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(1), F("Max Jerk X")); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(2), F("Max Jerk Y")); - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(3), F("Max Jerk Z")); + if (HMI_IsChinese()) { + DWIN_Frame_TitleCopy(1, 1, 16, 28, 28); // "Jerk" + + DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(1)); + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(1) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(1)); + DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 83, MBASE(1)); // Max Jerk speed X + DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(2)); + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(2) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(2)); + DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 83, MBASE(2) + 3); // Max Jerk speed Y + DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(3)); + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(3) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(3)); + DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 83, MBASE(3) + 3); // Max Jerk speed Z #if HAS_HOTEND - DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(4), F("Max Jerk E")); + DWIN_Frame_AreaCopy(1, 173, 133, 200, 147, LBLX , MBASE(4)); + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(4) + 1); + DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 53, MBASE(4)); + DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 83, MBASE(4) + 3); // Max Jerk speed E #endif - #else - DWIN_Frame_TitleCopy(1, 144, 16, 189, 26); // "Jerk" - draw_max_en(MBASE(1)); // "Max" - draw_jerk_en(MBASE(1)); // "Jerk" - draw_speed_en(72, MBASE(1)); // "Speed" - say_x(115, MBASE(1)); // "X" - - draw_max_en(MBASE(2)); // "Max" - draw_jerk_en(MBASE(2)); // "Jerk" - draw_speed_en(72, MBASE(2)); // "Speed" - say_y(115, MBASE(2)); // "Y" - - draw_max_en(MBASE(3)); // "Max" - draw_jerk_en(MBASE(3)); // "Jerk" - draw_speed_en(72, MBASE(3)); // "Speed" - say_z(115, MBASE(3)); // "Z" + } + else { + #ifdef USE_STRING_HEADINGS + Draw_Title(GET_TEXT_F(MSG_JERK)); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(1), F("Max Jerk X")); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(2), F("Max Jerk Y")); + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(3), F("Max Jerk Z")); + #if HAS_HOTEND + DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(4), F("Max Jerk E")); + #endif + #else + DWIN_Frame_TitleCopy(1, 144, 16, 189, 26); // "Jerk" + draw_max_en(MBASE(1)); // "Max" + draw_jerk_en(MBASE(1)); // "Jerk" + draw_speed_en(72, MBASE(1)); // "Speed" + say_x(115, MBASE(1)); // "X" + + draw_max_en(MBASE(2)); // "Max" + draw_jerk_en(MBASE(2)); // "Jerk" + draw_speed_en(72, MBASE(2)); // "Speed" + say_y(115, MBASE(2)); // "Y" + + draw_max_en(MBASE(3)); // "Max" + draw_jerk_en(MBASE(3)); // "Jerk" + draw_speed_en(72, MBASE(3)); // "Speed" + say_z(115, MBASE(3)); // "Z" - #if HAS_HOTEND - draw_max_en(MBASE(4)); // "Max" - draw_jerk_en(MBASE(4)); // "Jerk" - draw_speed_en(72, MBASE(4)); // "Speed" - say_e(115, MBASE(4)); // "E" + #if HAS_HOTEND + draw_max_en(MBASE(4)); // "Max" + draw_jerk_en(MBASE(4)); // "Jerk" + draw_speed_en(72, MBASE(4)); // "Speed" + say_e(115, MBASE(4)); // "E" + #endif #endif + } + + Draw_Back_First(); + LOOP_L_N(i, 3 + ENABLED(HAS_HOTEND)) Draw_Menu_Line(i + 1, ICON_MaxSpeedJerkX + i); + DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(1), planner.max_jerk[X_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(2), planner.max_jerk[Y_AXIS] * MINUNITMULT); + DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(3), planner.max_jerk[Z_AXIS] * MINUNITMULT); + #if HAS_HOTEND + DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS] * MINUNITMULT); #endif } - - Draw_Back_First(); - LOOP_L_N(i, 3 + ENABLED(HAS_HOTEND)) Draw_Menu_Line(i + 1, ICON_MaxSpeedJerkX + i); - DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(1), planner.max_jerk[X_AXIS] * MINUNITMULT); - DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(2), planner.max_jerk[Y_AXIS] * MINUNITMULT); - DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(3), planner.max_jerk[Z_AXIS] * MINUNITMULT); - #if HAS_HOTEND - DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS] * MINUNITMULT); - #endif -} +#endif inline void Draw_Steps_Menu() { Clear_Main_Window(); @@ -3636,7 +3641,9 @@ void DWIN_HandleScreen() { #endif case MaxSpeed: HMI_MaxSpeed(); break; case MaxAcceleration: HMI_MaxAcceleration(); break; - case MaxJerk: HMI_MaxJerk(); break; + #if HAS_CLASSIC_JERK + case MaxJerk: HMI_MaxJerk(); break; + #endif case Step: HMI_Step(); break; case Move_X: HMI_Move_X(); break; case Move_Y: HMI_Move_Y(); break; @@ -3657,7 +3664,9 @@ void DWIN_HandleScreen() { case PrintSpeed: HMI_PrintSpeed(); break; case MaxSpeed_value: HMI_MaxFeedspeedXYZE(); break; case MaxAcceleration_value: HMI_MaxAccelerationXYZE(); break; - case MaxJerk_value: HMI_MaxJerkXYZE(); break; + #if HAS_CLASSIC_JERK + case MaxJerk_value: HMI_MaxJerkXYZE(); break; + #endif case Step_value: HMI_StepXYZE(); break; default: break; } diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index 954827ddd9ca..f0377c68f7a9 100644 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -13,4 +13,8 @@ use_example_configs "Creality/Ender-3 V2" opt_enable MARLIN_DEV_MODE exec_test $1 $2 "Ender 3 v2" "$3" +use_example_configs "Creality/Ender-3 V2" +opt_disable CLASSIC_JERK +exec_test $1 $2 "Ender 3 v2 w/o CLASSIC_JERK" "$3" + restore_configs From a4d6908d556afd77cf66ef7a8adc7c34fee81674 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 2 Dec 2020 03:23:34 -0800 Subject: [PATCH 275/443] Permit SD EEPROM emulation on E3V2 (#20353) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 4 +-- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 32 ++++++-------------- buildroot/tests/STM32F103RET6_creality-tests | 3 +- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 89ab77ba3c58..5a2100069849 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -216,7 +216,7 @@ void HMI_SetLanguageCache() { } void HMI_SetLanguage() { - #if ENABLED(EEPROM_SETTINGS) + #if BOTH(EEPROM_SETTINGS, IIC_BL24CXX_EEPROM) BL24CXX::read(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif HMI_SetLanguageCache(); @@ -225,7 +225,7 @@ void HMI_SetLanguage() { void HMI_ToggleLanguage() { HMI_flag.language = HMI_IsChinese() ? DWIN_ENGLISH : DWIN_CHINESE; HMI_SetLanguageCache(); - #if ENABLED(EEPROM_SETTINGS) + #if BOTH(EEPROM_SETTINGS, IIC_BL24CXX_EEPROM) BL24CXX::write(DWIN_LANGUAGE_EEPROM_ADDRESS, (uint8_t*)&HMI_flag.language, sizeof(HMI_flag.language)); #endif } diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index f0c1611cb861..28ff16d4e490 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -43,30 +43,16 @@ // EEPROM // #if NO_EEPROM_SELECTED - // FLASH - //#define FLASH_EEPROM_EMULATION - - // I2C - #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings - #if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) - #else - #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb - #endif - - // SPI - //#define SPI_EEPROM // EEPROM on SPI-0 - //#define SPI_CHAN_EEPROM1 ? - //#define SPI_EEPROM1_CS ? - - // 2K EEPROM - //#define SPI_EEPROM2_CS ? + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + //#define SDCARD_EEPROM_EMULATION +#endif - // 32Mb FLASH - //#define SPI_FLASH_CS ? +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb #endif // diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index f0377c68f7a9..4e6c4f988b3f 100644 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -15,6 +15,7 @@ exec_test $1 $2 "Ender 3 v2" "$3" use_example_configs "Creality/Ender-3 V2" opt_disable CLASSIC_JERK -exec_test $1 $2 "Ender 3 v2 w/o CLASSIC_JERK" "$3" +opt_add SDCARD_EEPROM_EMULATION +exec_test $1 $2 "Ender 3 v2, SD EEPROM, w/o CLASSIC_JERK" "$3" restore_configs From 7bf04d1526660c7674994fa9cd8bdb0ea35bdc55 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 3 Dec 2020 00:12:40 +0000 Subject: [PATCH 276/443] [cron] Bump distribution date (2020-12-03) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d180e995ceb8..b95b61ab5525 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-02" + #define STRING_DISTRIBUTION_DATE "2020-12-03" #endif /** From 287887606440df467f7e4dcd0feb541990f254dc Mon Sep 17 00:00:00 2001 From: yysh12 Date: Thu, 3 Dec 2020 04:40:39 -0600 Subject: [PATCH 277/443] Fix circle arc condition (#20322) --- Marlin/src/gcode/motion/G2_G3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 469d726df91b..9c6710a08de4 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -87,7 +87,7 @@ void plan_arc( #endif // Do a full circle if angular rotation is near 0 and the target is current position - if ((!angular_travel || NEAR_ZERO(angular_travel)) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { + if (!angular_travel || (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis]))) { // Preserve direction for circles angular_travel = clockwise ? -RADIANS(360) : RADIANS(360); } From 31352f8a8a4f1019d235b9c48048676828fa5e5a Mon Sep 17 00:00:00 2001 From: ellensp Date: Thu, 3 Dec 2020 23:44:33 +1300 Subject: [PATCH 278/443] Fix up start, monitor baud (#20326) --- Marlin/src/MarlinCore.cpp | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index b6282cb09835..d615f1937078 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -982,7 +982,7 @@ void setup() { serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } #endif - SERIAL_ECHO_MSG("start"); + SERIAL_ECHOLNPGM("start"); #if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE) mks_esp_wifi_init(); diff --git a/platformio.ini b/platformio.ini index b26ece402619..0cff2dac606e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -405,7 +405,7 @@ framework = arduino extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} -monitor_speed = 115200 +monitor_speed = 250000 monitor_flags = --quiet --echo From a1f319d5b66f80f96ab1a7037b685d942b34c5e1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 3 Dec 2020 05:52:39 -0600 Subject: [PATCH 279/443] Consolidate common pin includes --- Marlin/src/pins/pins.h | 84 +++++------------------------------------- 1 file changed, 10 insertions(+), 74 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 676e1133102a..5c603c8475a0 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -71,35 +71,11 @@ #if MB(RAMPS_OLD) #include "ramps/pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_13_EFB) +#elif MB(RAMPS_13_EFB, RAMPS_13_EEB, RAMPS_13_EFF, RAMPS_13_EEF, RAMPS_13_SF) #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_13_EEB) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_13_EFF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_13_EEF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_13_SF) - #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_14_EFB) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_14_EEB) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_14_EFF) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_14_EEF) - #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_14_SF) +#elif MB(RAMPS_14_EFB, RAMPS_14_EEB, RAMPS_14_EFF, RAMPS_14_EEF, RAMPS_14_SF) #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_PLUS_EFB) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_PLUS_EEB) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_PLUS_EFF) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_PLUS_EEF) - #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 -#elif MB(RAMPS_PLUS_SF) +#elif MB(RAMPS_PLUS_EFB, RAMPS_PLUS_EEB, RAMPS_PLUS_EFF, RAMPS_PLUS_EEF, RAMPS_PLUS_SF) #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:mega1280 env:mega2560 // @@ -178,9 +154,7 @@ #include "ramps/pins_MAKEBOARD_MINI.h" // ATmega2560 env:mega2560 #elif MB(TRIGORILLA_13) #include "ramps/pins_TRIGORILLA_13.h" // ATmega2560 env:mega2560 -#elif MB(TRIGORILLA_14) - #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:mega2560 -#elif MB(TRIGORILLA_14_11) +#elif MB(TRIGORILLA_14, TRIGORILLA_14_11) #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:mega2560 #elif MB(RAMPS_ENDER_4) #include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:mega2560 @@ -214,11 +188,7 @@ #include "ramps/pins_TENLOG_D3_HERO.h" // ATmega2560 env:mega2560 #elif MB(MKS_GEN_L_V21) #include "ramps/pins_MKS_GEN_L_V21.h" // ATmega2560 env:mega2560 -#elif MB(RAMPS_S_12_EEFB) - #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 -#elif MB(RAMPS_S_12_EEEB) - #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 -#elif MB(RAMPS_S_12_EFFB) +#elif MB(RAMPS_S_12_EEFB, RAMPS_S_12_EEEB, RAMPS_S_12_EFFB) #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 #elif MB(RAMPS_LONGER3D_LKPRO) #include "ramps/pins_LONGER3D_LK4PRO.h" // ATmega2560 env:mega2560 @@ -383,15 +353,7 @@ // LPC1768 ARM Cortex M3 // -#elif MB(RAMPS_14_RE_ARM_EFB) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EEB) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EFF) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_EEF) - #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 -#elif MB(RAMPS_14_RE_ARM_SF) +#elif MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(MKS_SBASE) #include "lpc1768/pins_MKS_SBASE.h" // LPC1768 env:LPC1768 @@ -461,35 +423,11 @@ #include "sam/pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_FD_V2) #include "sam/pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EFB) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EEB) +#elif MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EFF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_EEF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_SMART_SF) - #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EFB) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EEB) +#elif MB(RAMPS_DUO_EFB, RAMPS_DUO_EEB, RAMPS_DUO_EFF, RAMPS_DUO_EEF, RAMPS_DUO_SF) #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EFF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EEF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_SF) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EFB) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EEB) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EFF) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_EEF) - #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS4DUE_SF) +#elif MB(RAMPS4DUE_EFB, RAMPS4DUE_EEB, RAMPS4DUE_EFF, RAMPS4DUE_EEF, RAMPS4DUE_SF) #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(ULTRATRONICS_PRO) #include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug @@ -616,9 +554,7 @@ #elif MB(ARMED) #include "stm32f4/pins_ARMED.h" // STM32F4 env:ARMED -#elif MB(RUMBA32_V1_0) - #include "stm32f4/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32 -#elif MB(RUMBA32_V1_1) +#elif MB(RUMBA32_V1_0, RUMBA32_V1_1) #include "stm32f4/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32 #elif MB(RUMBA32_MKS) #include "stm32f4/pins_RUMBA32_MKS.h" // STM32F4 env:rumba32 From 3eddbc7286ce2dd5a14ceb848ef26fd1dd7a3c4c Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 3 Dec 2020 14:23:48 -0300 Subject: [PATCH 280/443] Require minimum PlatformIO version (#20361) Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith --- .../PlatformIO/scripts/common-dependencies.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index f3bc2b9b0283..56dc86e63420 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -16,6 +16,30 @@ # PIO >= 4.4 from platformio.package.meta import PackageSpec as PackageManager +PIO_VERSION_MIN = (5, 0, 3) +try: + from platformio import VERSION as PIO_VERSION + weights = (1000, 100, 1) + version_min = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION_MIN)]) + version_cur = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION)]) + if version_cur < version_min: + print() + print("**************************************************") + print("****** An update to PlatformIO is ******") + print("****** required to build Marlin Firmware. ******") + print("****** ******") + print("****** Minimum version: ", PIO_VERSION_MIN, " ******") + print("****** Current Version: ", PIO_VERSION, " ******") + print("****** ******") + print("****** Update PlatformIO and try again. ******") + print("**************************************************") + print() + exit(1) +except SystemExit: + exit(1) +except: + print("Can't detect PlatformIO Version") + Import("env") #print(env.Dump()) From 517bcd2b5d4a1ade507cea78c0961130480739d8 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 4 Dec 2020 00:12:52 +0000 Subject: [PATCH 281/443] [cron] Bump distribution date (2020-12-04) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b95b61ab5525..4cb4e5b07cef 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-03" + #define STRING_DISTRIBUTION_DATE "2020-12-04" #endif /** From d17db477753067982b2cbf277609f4d66b0b57a9 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 3 Dec 2020 19:33:46 -0800 Subject: [PATCH 282/443] Fix MESH_BED_LEVELING w/o SEGMENT_LEVELED_MOVES (#20363) --- Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index 1200c2a1b3b8..ec5b95c108b8 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -71,8 +71,8 @@ // Start and end in the same cell? No split needed. if (scel == ecel) { - line_to_destination(scaled_fr_mm_s); current_position = destination; + line_to_current_position(scaled_fr_mm_s); return; } @@ -104,8 +104,8 @@ else { // Must already have been split on these border(s) // This should be a rare case. - line_to_destination(scaled_fr_mm_s); current_position = destination; + line_to_current_position(scaled_fr_mm_s); return; } From 465840e1fb2dd5ce4c996d78ae8764f0d8ec8ea5 Mon Sep 17 00:00:00 2001 From: Belin Fieldson Date: Fri, 4 Dec 2020 03:49:30 -0700 Subject: [PATCH 283/443] Loosen E on pause for fila-manipulation (#20346) Co-authored-by: Scott Lahteine --- Marlin/src/feature/pause.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 1593b0cc572e..c8265a154fb1 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -295,6 +295,18 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l return true; } +/** + * Disabling E steppers for manual filament change should be fine + * as long as users don't spin the E motor ridiculously fast and + * send current back to their board, potentially frying it. + */ +inline void disable_active_extruder() { + #if HAS_E_STEPPER_ENABLE + disable_e_stepper(active_extruder); + safe_delay(100); + #endif +} + /** * Unload filament from the hotend * @@ -357,11 +369,8 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, planner.settings.retract_acceleration = saved_acceleration; #endif - // Disable E steppers for manual change - #if HAS_E_STEPPER_ENABLE - disable_e_stepper(active_extruder); - safe_delay(100); - #endif + // Disable the Extruder for manual change + disable_active_extruder(); return true; } @@ -447,6 +456,9 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float set_duplication_enabled(saved_ext_dup_mode, saved_ext); #endif + // Disable the Extruder for manual change + disable_active_extruder(); + return true; } From 71db4f0426da68d428febe6b885cf8b5e64d05af Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 5 Dec 2020 00:13:14 +0000 Subject: [PATCH 284/443] [cron] Bump distribution date (2020-12-05) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4cb4e5b07cef..7796c4e06673 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-04" + #define STRING_DISTRIBUTION_DATE "2020-12-05" #endif /** From 0a03ef4b6fb4fe52769f4d84255e7fee10c04b95 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 5 Dec 2020 05:29:55 +0100 Subject: [PATCH 285/443] =?UTF-8?q?Don=E2=80=99t=20use=20near=20keyword=20?= =?UTF-8?q?as=20variable=20name=20(#20374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 94bec99194b7..9ab7861a01e9 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -727,7 +727,7 @@ * Probe all invalidated locations of the mesh that can be reached by the probe. * This attempts to fill in locations closest to the nozzle's start location first. */ - void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { + void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW TERN_(HAS_LCD_MENU, ui.capture()); @@ -758,7 +758,7 @@ best = do_furthest ? find_furthest_invalid_mesh_point() - : find_closest_mesh_point_of_type(INVALID, near, true); + : find_closest_mesh_point_of_type(INVALID, pos, true); if (best.pos.x >= 0) { // mesh point found and is reachable by probe TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::PROBE_START)); @@ -788,8 +788,8 @@ restore_ubl_active_state_and_leave(); do_blocking_move_to_xy( - constrain(near.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), - constrain(near.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) + constrain(pos.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), + constrain(pos.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) ); } @@ -1206,7 +1206,7 @@ found_a_NAN = true; - xy_int8_t near { -1, -1 }; + xy_int8_t near_pos { -1, -1 }; float d1, d2 = 99999.9f; GRID_LOOP(k, l) { if (isnan(z_values[k][l])) continue; @@ -1221,7 +1221,7 @@ if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l) d2 = d1; - near.set(i, j); + near_pos.set(i, j); } } @@ -1229,8 +1229,8 @@ // At this point d2 should have the near defined mesh point to invalid mesh point (i,j) // - if (found_a_real && near.x >= 0 && d2 > farthest.distance) { - farthest.pos = near; // Found an invalid location farther from the defined mesh point + if (found_a_real && near_pos.x >= 0 && d2 > farthest.distance) { + farthest.pos = near_pos; // Found an invalid location farther from the defined mesh point farthest.distance = d2; } } // GRID_LOOP From 5fdd949115ffe92334e3111e1906022fc4a93a3a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Dec 2020 23:56:20 -0600 Subject: [PATCH 286/443] Improved Longer3D LKx Pro board (#20372) Co-authored-by: mrv96 --- Marlin/src/core/boards.h | 3 +- Marlin/src/pins/pins.h | 8 +- Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h | 38 ------ Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 118 ++++++++++++++++++ 4 files changed, 126 insertions(+), 41 deletions(-) delete mode 100644 Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h create mode 100644 Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index a6fc1b4dfdd0..d85cf2c664c0 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -113,7 +113,8 @@ #define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed) #define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) -#define BOARD_RAMPS_LONGER3D_LK4PRO 1160 // Longer LKxxPRO/ Alfawise UxxPro (PRO version) +#define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version) +#define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version) // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5c603c8475a0..3c059769640f 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -190,8 +190,8 @@ #include "ramps/pins_MKS_GEN_L_V21.h" // ATmega2560 env:mega2560 #elif MB(RAMPS_S_12_EEFB, RAMPS_S_12_EEEB, RAMPS_S_12_EFFB) #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 -#elif MB(RAMPS_LONGER3D_LKPRO) - #include "ramps/pins_LONGER3D_LK4PRO.h" // ATmega2560 env:mega2560 +#elif MB(LONGER3D_LK1_PRO, LONGER3D_LKx_PRO) + #include "ramps/pins_LONGER3D_LKx_PRO.h" // ATmega2560 env:mega2560 // // RAMBo and derivatives @@ -663,6 +663,7 @@ #define BOARD_RUMBA32 -1018 #define BOARD_RUMBA32_AUS3D -1019 #define BOARD_RAMPS_DAGOMA -1020 + #define BOARD_RAMPS_LONGER3D_LK4PRO -1021 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." @@ -708,6 +709,8 @@ #error "BOARD_RUMBA32_AUS3D is now BOARD_RUMBA32_V1_0. Please update your configuration." #elif MB(RAMPS_DAGOMA) #error "BOARD_RAMPS_DAGOMA is now BOARD_DAGOMA_F5. Please update your configuration." + #elif MB(RAMPS_LONGER3D_LK4PRO) + #error "BOARD_RAMPS_LONGER3D_LK4PRO is now BOARD_LONGER3D_LKx_PRO. Please update your configuration." #else #error "Unknown MOTHERBOARD value set in Configuration.h" #endif @@ -733,6 +736,7 @@ #undef BOARD_RUMBA32 #undef BOARD_RUMBA32_AUS3D #undef BOARD_RAMPS_DAGOMA + #undef BOARD_RAMPS_LONGER3D_LK4PRO #endif diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h deleted file mode 100644 index 8acf4e2f4f01..000000000000 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -// Longer UI assumptions -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "Longer UI supports only 1 hotend / E-stepper." -#endif - -#define BOARD_INFO_NAME "LGT Kit 1.0" - -#define SD_DETECT_PIN 49 -#define FIL_RUNOUT_PIN 2 -#define Z_MIN_PIN 35 - -// -// Import RAMPS 1.4 pins -// -#include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h new file mode 100644 index 000000000000..3bcaae96a330 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h @@ -0,0 +1,118 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Longer3D LK1/LK4/LK5 Pro board pin assignments + */ + +#if NOT_TARGET(__AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "Longer3D LGT KIT V1.0 board only supports 1 hotend / E-stepper. Comment out this line to continue." +#endif + +#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 + #warning "Serial 1 is originally reserved to DGUS LCD." +#endif +#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 + #warning "Serial 2 has no connector. Hardware changes may be required to use it." +#endif +#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 + #define CHANGE_Y_LIMIT_PINS + #warning "Serial 3 is originally reserved to Y limit switches. Hardware changes are required to use it." +#endif + +// Custom flags and defines for the build +//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__ + +#define BOARD_INFO_NAME "LGT KIT V1.0" + +// +// Servos +// +#if !MB(LONGER3D_LK1_PRO) + #define SERVO0_PIN 7 +#endif +#define SERVO1_PIN -1 +#define SERVO2_PIN -1 +#define SERVO3_PIN -1 + +// +// Limit Switches +// +#define X_STOP_PIN 3 + +#ifdef CHANGE_Y_LIMIT_PINS + #define Y_STOP_PIN 37 +#else + #define Y_MIN_PIN 14 + #define Y_MAX_PIN 15 +#endif + +#if !MB(LONGER3D_LK1_PRO) + #ifdef CHANGE_Y_LIMIT_PINS + #define Z_STOP_PIN 35 + #else + #define Z_MIN_PIN 35 + #define Z_MAX_PIN 37 + #endif +#else + #define Z_MIN_PIN 11 + #define Z_MAX_PIN 37 +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#define Z_MIN_PROBE_PIN -1 + +// +// Misc. Functions +// +#define SD_DETECT_PIN 49 +#define FIL_RUNOUT_PIN 2 + +// +// Other RAMPS 1.3 pins +// +#define IS_RAMPS_EFB // Override autodetection. Bed will be undefined. +#include "pins_RAMPS_13.h" + +// +// Steppers +// +#undef E1_STEP_PIN +#undef E1_DIR_PIN +#undef E1_ENABLE_PIN +#undef E1_CS_PIN + +// +// Temperature Sensors +// +#undef TEMP_1_PIN + +// +// Průša i3 MK2 Multiplexer Support +// +#undef E_MUX2_PIN +#undef CHANGE_Y_LIMIT_PINS From 21ee7b1c862230e58d68bd8a9a81e561fc5df1e2 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 4 Dec 2020 21:58:39 -0800 Subject: [PATCH 287/443] Fix TMC_HOME_PHASE divide by zero (#20368) --- Marlin/src/module/motion.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 3a01cda5c120..7b4c89e759a1 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1490,10 +1490,12 @@ void set_axis_never_homed(const AxisEnum axis) { effectorBackoutDir, // Direction in which the effector mm coordinates move away from endstop. stepperBackoutDir; // Direction in which the TMC µstep count(phase) move away from endstop. + #define PHASE_PER_MICROSTEP(N) (256 / _MAX(1, N##_MICROSTEPS)) + switch (axis) { #ifdef X_MICROSTEPS case X_AXIS: - phasePerUStep = 256 / (X_MICROSTEPS); + phasePerUStep = PHASE_PER_MICROSTEP(X); phaseCurrent = stepperX.get_microstep_counter(); effectorBackoutDir = -X_HOME_DIR; stepperBackoutDir = INVERT_X_DIR ? effectorBackoutDir : -effectorBackoutDir; @@ -1501,7 +1503,7 @@ void set_axis_never_homed(const AxisEnum axis) { #endif #ifdef Y_MICROSTEPS case Y_AXIS: - phasePerUStep = 256 / (Y_MICROSTEPS); + phasePerUStep = PHASE_PER_MICROSTEP(Y); phaseCurrent = stepperY.get_microstep_counter(); effectorBackoutDir = -Y_HOME_DIR; stepperBackoutDir = INVERT_Y_DIR ? effectorBackoutDir : -effectorBackoutDir; @@ -1509,7 +1511,7 @@ void set_axis_never_homed(const AxisEnum axis) { #endif #ifdef Z_MICROSTEPS case Z_AXIS: - phasePerUStep = 256 / (Z_MICROSTEPS); + phasePerUStep = PHASE_PER_MICROSTEP(Z); phaseCurrent = stepperZ.get_microstep_counter(); effectorBackoutDir = -Z_HOME_DIR; stepperBackoutDir = INVERT_Z_DIR ? effectorBackoutDir : -effectorBackoutDir; From 2c8f5662313f35fb3728fb691615977ac360cd3e Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 4 Dec 2020 22:02:58 -0800 Subject: [PATCH 288/443] Suspend Servos for STM32+NeoPixel (#19963) --- Marlin/src/HAL/STM32/HAL.h | 3 +++ Marlin/src/HAL/STM32/eeprom_flash.cpp | 17 ++++------------- Marlin/src/feature/leds/neopixel.h | 3 +++ Marlin/src/inc/Conditionals_post.h | 3 +++ buildroot/tests/BIGTREE_GTR_V1_0-tests | 3 ++- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 16dc7a453994..9842cdaae4b0 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -29,6 +29,7 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" +#include "Servo.h" #include "watchdog.h" #include "MarlinSerial.h" @@ -110,6 +111,8 @@ typedef int16_t pin_t; #define HAL_SERVO_LIB libServo +#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos() +#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos() // ------------------------ // Public Variables diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index 702e42e561f8..8cd62879a5c6 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -28,15 +28,6 @@ #include "../shared/eeprom_api.h" -#if HAS_SERVOS - #include "Servo.h" - #define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos() - #define RESUME_SERVO_OUTPUT() libServo::resume_all_servos() -#else - #define PAUSE_SERVO_OUTPUT() - #define RESUME_SERVO_OUTPUT() -#endif - /** * The STM32 HAL supports chips that deal with "pages" and some with "sectors" and some that * even have multiple "banks" of flash. @@ -172,11 +163,11 @@ bool PersistentStore::access_finish() { current_slot = EEPROM_SLOTS - 1; UNLOCK_FLASH(); - PAUSE_SERVO_OUTPUT(); + TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); DISABLE_ISRS(); status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError); ENABLE_ISRS(); - RESUME_SERVO_OUTPUT(); + TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); if (status != HAL_OK) { DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status); DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError()); @@ -227,11 +218,11 @@ bool PersistentStore::access_finish() { // Interrupts during this time can have unpredictable results, such as killing Servo // output. Servo output still glitches with interrupts disabled, but recovers after the // erase. - PAUSE_SERVO_OUTPUT(); + TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); DISABLE_ISRS(); eeprom_buffer_flush(); ENABLE_ISRS(); - RESUME_SERVO_OUTPUT(); + TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); eeprom_data_written = false; #endif diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index d7354207fc53..acf2e7f54d3b 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -105,6 +105,8 @@ class Marlin_NeoPixel { } static inline 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(); #if PIN_EXISTS(NEOPIXEL2) #if CONJOINED_NEOPIXEL @@ -115,6 +117,7 @@ class Marlin_NeoPixel { adaneo1.setPin(NEOPIXEL_PIN); #endif #endif + TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); } #if 0 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index dfecd57749b0..092dc818b84f 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1997,6 +1997,9 @@ #if NUM_SERVOS > 0 #define HAS_SERVOS 1 #endif +#if HAS_SERVOS && defined(PAUSE_SERVO_OUTPUT) && defined(RESUME_SERVO_OUTPUT) + #define HAS_PAUSE_SERVO_OUTPUT 1 +#endif // Sensors #if PIN_EXISTS(FILWIDTH) diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests index ef245143a818..adc850db03b3 100644 --- a/buildroot/tests/BIGTREE_GTR_V1_0-tests +++ b/buildroot/tests/BIGTREE_GTR_V1_0-tests @@ -23,7 +23,8 @@ opt_set E1_AUTO_FAN_PIN PC11 opt_set E2_AUTO_FAN_PIN PC12 opt_set X_DRIVER_TYPE TMC2208 opt_set Y_DRIVER_TYPE TMC2130 -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +opt_set NEOPIXEL_PIN PF13 +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING opt_enable FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE opt_set FIL_RUNOUT_PIN 3 opt_set FIL_RUNOUT2_PIN 4 From e8ed880e6256704630009e1ae911bf476e09fd1a Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 5 Dec 2020 15:23:58 -0600 Subject: [PATCH 289/443] Add Creality 4.5.2 board (#20378) Co-authored-by: Jason Smith --- Marlin/src/HAL/STM32F1/HAL.h | 2 + Marlin/src/core/boards.h | 9 +- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 +- Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 113 +++++++++++++++++++ 5 files changed, 124 insertions(+), 6 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V452.h diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 226c8ca9b266..d8bba774e917 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -109,6 +109,8 @@ #else #error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #endif + + #define SERIAL_GET_TX_BUFFER_FREE LCD_SERIAL.availableForWrite #endif // Set interrupt grouping for this MCU diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index d85cf2c664c0..643d577d1b13 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -329,10 +329,11 @@ #define BOARD_CHITU3D_V6 4036 // Chitu3D TronXY X5SA V5 Board #define BOARD_CREALITY_V4 4037 // Creality v4.x (STM32F103RE) #define BOARD_CREALITY_V427 4038 // Creality v4.2.7 (STM32F103RE) -#define BOARD_TRIGORILLA_PRO 4039 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4040 // FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4041 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4042 // STM32F103RET6 Libmaple-based controller +#define BOARD_CREALITY_V452 4039 // Creality v4.5.2 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4040 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4041 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4042 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4043 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 3c059769640f..1961d5cf8d3d 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -530,6 +530,8 @@ #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality #elif MB(CREALITY_V427) #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality +#elif MB(CREALITY_V452) + #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro #elif MB(FLY_MINI) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 28ff16d4e490..c66bca8540a4 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -21,13 +21,13 @@ */ /** - * CREALITY (STM32F103) board pin assignments + * Creality 4.2.x (STM32F103RET6) board pin assignments */ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality_V4 only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h new file mode 100644 index 000000000000..348ab28dff2c --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -0,0 +1,113 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Creality v4.5.2 (STM32F103RET6) board pin assignments + */ + +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "CREALITY_V452 supports up to 1 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_NAME "Creality v4.5.2" +#define DEFAULT_MACHINE_NAME "Creality3D" + +#define BOARD_NO_NATIVE_USB + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + //#define SDCARD_EEPROM_EMULATION +#endif + +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb +#endif + +// +// Limit Switches +// +#define X_MIN_PIN PC4 +// #define X_MAX_PIN PA7 +#define Y_MIN_PIN PC5 +#define Z_MIN_PIN PA4 +#define PROBE_TARE_PIN PA5 + +// +// Steppers +// +#define X_ENABLE_PIN PC3 +#define X_STEP_PIN PB8 +#define X_DIR_PIN PB7 + +#define Y_ENABLE_PIN PC3 +#define Y_STEP_PIN PB6 +#define Y_DIR_PIN PB5 + +#define Z_ENABLE_PIN PC3 +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB3 + +#define E0_ENABLE_PIN PC3 +#define E0_STEP_PIN PC2 +#define E0_DIR_PIN PB9 + + +// +// Release PB4 (Z_STEP_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// Temperature Sensors +// +#define TEMP_0_PIN PB1 // TH1 +#define TEMP_BED_PIN PB0 // TB1 + +// +// Heaters / Fans + +#define HEATER_0_PIN PA1 // HEATER1 +#define HEATER_BED_PIN PA2 // HOT BED + +#define FAN_PIN PA0 // FAN +#define FAN_SOFT_PWM + +/* SD card detect */ +#define SD_DETECT_PIN PC7 +#define NO_SD_HOST_DRIVE // SD is only seen by the printer + +#define SDIO_SUPPORT // Extra added by Creality +#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h + +#define CASE_LIGHT_PIN PA6 + +#define FIL_RUNOUT_PIN PA7 +#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe From 2dbd2063f87e8e91d5d1ebd42c027975498b29c9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 6 Dec 2020 00:13:51 +0000 Subject: [PATCH 290/443] [cron] Bump distribution date (2020-12-06) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 7796c4e06673..af6eac73771a 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-05" + #define STRING_DISTRIBUTION_DATE "2020-12-06" #endif /** From 7a6b742d1263d7ed0e4ea4dfb3fbdf14124401dc Mon Sep 17 00:00:00 2001 From: LinFor Date: Sun, 6 Dec 2020 03:19:17 +0300 Subject: [PATCH 291/443] Fix FYSETC S6 I2C EEPROM size (#20340) Both V1.2 and V2.0 boards have a 24LC16, which is a 2kB EEPROM. Co-authored-by: PingWin Co-authored-by: Jason Smith --- Marlin/src/pins/pins.h | 4 ++-- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 3 +-- Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 1961d5cf8d3d..fbae5356ca53 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -582,12 +582,12 @@ #include "stm32f4/pins_VAKE403D.h" // STM32F4 #elif MB(FYSETC_S6) #include "stm32f4/pins_FYSETC_S6.h" // STM32F4 env:FYSETC_S6 +#elif MB(FYSETC_S6_V2_0) + #include "stm32f4/pins_FYSETC_S6_V2_0.h" // STM32F4 env:FYSETC_S6 #elif MB(FLYF407ZG) #include "stm32f4/pins_FLYF407ZG.h" // STM32F4 env:FLYF407ZG #elif MB(MKS_ROBIN2) #include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2 -#elif MB(FYSETC_S6_V2_0) - #include "stm32f4/pins_FYSETC_S6_V2_0.h" // STM32F4 env:FYSETC_S6 // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index a8105c37a244..decf4aeb6bca 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -42,7 +42,6 @@ // #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION - //#define SRAM_EEPROM_EMULATION //#define I2C_EEPROM #endif @@ -51,7 +50,7 @@ // 128 kB sector allocated for EEPROM emulation. #define FLASH_EEPROM_LEVELING #elif ENABLED(I2C_EEPROM) - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x0800 // 2KB #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h index b12c12c848c9..641805d855a6 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h @@ -29,7 +29,6 @@ #if NO_EEPROM_SELECTED #undef NO_EEPROM_SELECTED //#define FLASH_EEPROM_EMULATION - //#define SRAM_EEPROM_EMULATION #define I2C_EEPROM #endif From 9e68c9a214e3eed1eafff46851f446d275475dd0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 18:18:28 -0600 Subject: [PATCH 292/443] Creality 4.5.2 format and fix --- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 93 +++++++++++--------- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index c66bca8540a4..a7c06cb99dae 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -27,7 +27,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "Creality_V4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index 348ab28dff2c..715fd89db813 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -33,81 +33,88 @@ #define BOARD_NAME "Creality v4.5.2" #define DEFAULT_MACHINE_NAME "Creality3D" +// +// Release PB4 (Z_STEP_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + #define BOARD_NO_NATIVE_USB // // EEPROM // #if NO_EEPROM_SELECTED - #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 //#define SDCARD_EEPROM_EMULATION #endif #if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb #endif // // Limit Switches // -#define X_MIN_PIN PC4 -// #define X_MAX_PIN PA7 -#define Y_MIN_PIN PC5 -#define Z_MIN_PIN PA4 -#define PROBE_TARE_PIN PA5 +#define X_STOP_PIN PC4 +#define Y_STOP_PIN PC5 +#define Z_STOP_PIN PA4 + +#define FIL_RUNOUT_PIN PA7 // -// Steppers +// Probe // -#define X_ENABLE_PIN PC3 -#define X_STEP_PIN PB8 -#define X_DIR_PIN PB7 - -#define Y_ENABLE_PIN PC3 -#define Y_STEP_PIN PB6 -#define Y_DIR_PIN PB5 +#define PROBE_TARE_PIN PA5 +#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe -#define Z_ENABLE_PIN PC3 -#define Z_STEP_PIN PB4 -#define Z_DIR_PIN PB3 +// +// Steppers +// +#define X_ENABLE_PIN PC3 +#define X_STEP_PIN PB8 +#define X_DIR_PIN PB7 -#define E0_ENABLE_PIN PC3 -#define E0_STEP_PIN PC2 -#define E0_DIR_PIN PB9 +#define Y_ENABLE_PIN PC3 +#define Y_STEP_PIN PB6 +#define Y_DIR_PIN PB5 +#define Z_ENABLE_PIN PC3 +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB3 -// -// Release PB4 (Z_STEP_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG +#define E0_ENABLE_PIN PC3 +#define E0_STEP_PIN PC2 +#define E0_DIR_PIN PB9 // // Temperature Sensors // -#define TEMP_0_PIN PB1 // TH1 -#define TEMP_BED_PIN PB0 // TB1 +#define TEMP_0_PIN PB1 // TH1 +#define TEMP_BED_PIN PB0 // TB1 // // Heaters / Fans +// +#define HEATER_0_PIN PA1 // HEATER1 +#define HEATER_BED_PIN PA2 // HOT BED -#define HEATER_0_PIN PA1 // HEATER1 -#define HEATER_BED_PIN PA2 // HOT BED - -#define FAN_PIN PA0 // FAN +#define FAN_PIN PA0 // FAN #define FAN_SOFT_PWM -/* SD card detect */ -#define SD_DETECT_PIN PC7 -#define NO_SD_HOST_DRIVE // SD is only seen by the printer - -#define SDIO_SUPPORT // Extra added by Creality -#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h +// +// SD Card +// +#define SD_DETECT_PIN PC7 +#define NO_SD_HOST_DRIVE // SD is only seen by the printer -#define CASE_LIGHT_PIN PA6 +#define SDIO_SUPPORT // Extra added by Creality +#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h -#define FIL_RUNOUT_PIN PA7 -#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe +// +// Misc. Functions +// +#define CASE_LIGHT_PIN PA6 From bf4c08bce1c6bbb5c2e7a44b9bfc253b242022ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 18:21:56 -0600 Subject: [PATCH 293/443] Use 'nearby' for 'near' --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 9ab7861a01e9..11bea18c81a9 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -727,7 +727,7 @@ * Probe all invalidated locations of the mesh that can be reached by the probe. * This attempts to fill in locations closest to the nozzle's start location first. */ - void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { + void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &nearby, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW TERN_(HAS_LCD_MENU, ui.capture()); @@ -758,7 +758,7 @@ best = do_furthest ? find_furthest_invalid_mesh_point() - : find_closest_mesh_point_of_type(INVALID, pos, true); + : find_closest_mesh_point_of_type(INVALID, nearby, true); if (best.pos.x >= 0) { // mesh point found and is reachable by probe TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::PROBE_START)); @@ -788,8 +788,8 @@ restore_ubl_active_state_and_leave(); do_blocking_move_to_xy( - constrain(pos.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), - constrain(pos.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) + constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), + constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) ); } @@ -1206,7 +1206,7 @@ found_a_NAN = true; - xy_int8_t near_pos { -1, -1 }; + xy_int8_t nearby { -1, -1 }; float d1, d2 = 99999.9f; GRID_LOOP(k, l) { if (isnan(z_values[k][l])) continue; @@ -1221,7 +1221,7 @@ if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l) d2 = d1; - near_pos.set(i, j); + nearby.set(i, j); } } @@ -1229,8 +1229,8 @@ // At this point d2 should have the near defined mesh point to invalid mesh point (i,j) // - if (found_a_real && near_pos.x >= 0 && d2 > farthest.distance) { - farthest.pos = near_pos; // Found an invalid location farther from the defined mesh point + if (found_a_real && nearby.x >= 0 && d2 > farthest.distance) { + farthest.pos = nearby; // Found an invalid location farther from the defined mesh point farthest.distance = d2; } } // GRID_LOOP From 889695b6ba54ec56ca7ed7fd50d597c29a854687 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 5 Nov 2020 16:45:22 -0600 Subject: [PATCH 294/443] ExtUI homing / leveling additions --- Marlin/src/MarlinCore.cpp | 8 ++++++++ Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 ++ Marlin/src/gcode/calibrate/G28.cpp | 8 ++++++++ Marlin/src/gcode/sd/M1001.cpp | 2 ++ Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp | 9 +++++++++ Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp | 19 ++++++++++++++++--- Marlin/src/lcd/extui/dgus_lcd.cpp | 10 ++++++++++ Marlin/src/lcd/extui/example.cpp | 16 +++++++++++++--- .../lib/ftdi_eve_touch_ui/marlin_events.cpp | 13 +++++++++++-- Marlin/src/lcd/extui/malyan_lcd.cpp | 13 ++++++++++--- Marlin/src/lcd/extui/ui_api.h | 6 ++++++ 11 files changed, 95 insertions(+), 11 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index d615f1937078..d4d22a6198a2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -77,6 +77,10 @@ #include "lcd/dwin/e3v2/rotary_encoder.h" #endif +#if ENABLED(EXTENSIBLE_UI) + #include "lcd/extui/ui_api.h" +#endif + #if HAS_ETHERNET #include "feature/ethernet.h" #endif @@ -360,6 +364,8 @@ void enable_all_steppers() { ENABLE_AXIS_Y(); ENABLE_AXIS_Z(); enable_e_steppers(); + + TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled()); } void disable_e_steppers() { @@ -379,6 +385,8 @@ void disable_all_steppers() { DISABLE_AXIS_Y(); DISABLE_AXIS_Z(); disable_e_steppers(); + + TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled()); } #if ENABLED(G29_RETRY_AND_RECOVER) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 9999d92e223b..653c632f1a57 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -177,6 +177,8 @@ G29_TYPE GcodeSuite::G29() { if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false); #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); + const bool seenA = TERN0(PROBE_MANUALLY, parser.seen('A')), no_action = seenA || seenQ, faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index c17d6dcc8b94..31fc1e1cf2a2 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -50,6 +50,10 @@ #include "../../lcd/dwin/e3v2/dwin.h" #endif +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" +#endif + #if HAS_L64XX // set L6470 absolute position registers to counts #include "../../libs/L64XX/L64XX_Marlin.h" #endif @@ -209,6 +213,8 @@ void GcodeSuite::G28() { TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true); + TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); + #if ENABLED(DUAL_X_CARRIAGE) bool IDEX_saved_duplication_state = extruder_duplication_enabled; DualXMode IDEX_saved_mode = dual_x_carriage_mode; @@ -462,6 +468,8 @@ void GcodeSuite::G28() { TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); + TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete()); + report_current_position(); if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS))) diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 4a461170bc39..e4b7054bf283 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -96,6 +96,8 @@ void GcodeSuite::M1001() { queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND)); #endif + TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished()); + // Re-select the last printed file in the UI TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); } diff --git a/Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp b/Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp index a7f9a7a0c3e3..06baa4c19d11 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp @@ -62,6 +62,10 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); } void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); } + void onHomingStart() {} + void onHomingComplete() {} + void onPrintFinished() {} + void onFactoryReset() {} void onStoreSettings(char *buff) { @@ -95,6 +99,8 @@ namespace ExtUI { } #if HAS_MESH + void onMeshLevelingStart() {} + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { // Called when any mesh points are updated //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval); @@ -116,6 +122,9 @@ namespace ExtUI { // Called for temperature PID tuning result } #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} } #endif // ANYCUBIC_LCD_CHIRON diff --git a/Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp index 15526d16fc21..e2bd96068ceb 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp @@ -52,6 +52,11 @@ namespace ExtUI { void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); } void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); } void onStatusChanged(const char * const msg) {} + + void onHomingStart() {} + void onHomingComplete() {} + void onPrintFinished() {} + void onFactoryReset() {} void onStoreSettings(char *buff) { @@ -84,9 +89,14 @@ namespace ExtUI { // whether successful or not. } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { - // Called when any mesh points are updated - } + #if HAS_MESH + + void onMeshLevelingStart() {} + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { + // Called when any mesh points are updated + } + #endif #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume() { @@ -99,6 +109,9 @@ namespace ExtUI { // Called for temperature PID tuning result } #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} } #endif // ANYCUBIC_LCD_I3MEGA diff --git a/Marlin/src/lcd/extui/dgus_lcd.cpp b/Marlin/src/lcd/extui/dgus_lcd.cpp index d175b5acac9a..33d8bd4d89e2 100644 --- a/Marlin/src/lcd/extui/dgus_lcd.cpp +++ b/Marlin/src/lcd/extui/dgus_lcd.cpp @@ -76,7 +76,12 @@ namespace ExtUI { void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); } + void onHomingStart() {} + void onHomingComplete() {} + void onPrintFinished() {} + void onFactoryReset() {} + void onStoreSettings(char *buff) { // Called when saving to EEPROM (i.e. M500). If the ExtUI needs // permanent data to be stored, it can write up to eeprom_data_size bytes @@ -108,6 +113,8 @@ namespace ExtUI { } #if HAS_MESH + void onMeshLevelingStart() {} + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { // Called when any mesh points are updated } @@ -146,5 +153,8 @@ namespace ExtUI { } #endif + void onSteppersDisabled() {} + void onSteppersEnabled() {} } + #endif // HAS_DGUS_LCD diff --git a/Marlin/src/lcd/extui/example.cpp b/Marlin/src/lcd/extui/example.cpp index 592d67214d07..dd4b3312eb95 100644 --- a/Marlin/src/lcd/extui/example.cpp +++ b/Marlin/src/lcd/extui/example.cpp @@ -47,9 +47,9 @@ namespace ExtUI { } void onIdle() {} void onPrinterKilled(PGM_P const error, PGM_P const component) {} - void onMediaInserted() {}; - void onMediaError() {}; - void onMediaRemoved() {}; + void onMediaInserted() {} + void onMediaError() {} + void onMediaRemoved() {} void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} @@ -57,6 +57,11 @@ namespace ExtUI { void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const msg) {} void onStatusChanged(const char * const msg) {} + + void onHomingStart() {} + void onHomingComplete() {} + void onPrintFinished() {} + void onFactoryReset() {} void onStoreSettings(char *buff) { @@ -90,6 +95,8 @@ namespace ExtUI { } #if HAS_MESH + void onMeshLevelingStart() {} + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { // Called when any mesh points are updated } @@ -110,6 +117,9 @@ namespace ExtUI { // Called for temperature PID tuning result } #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} } #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp index ed7e653af1a6..fc9b5d0a702a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -87,8 +87,9 @@ namespace ExtUI { InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED); } - void onPrintTimerPaused() { - } + void onPrintTimerPaused() {} + + void onPrintFinished() {} void onFilamentRunout(const extruder_t extruder) { char lcd_msg[30]; @@ -97,6 +98,9 @@ namespace ExtUI { InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, FTDI::PLAY_SYNCHRONOUS); } + void onHomingStart() {} + void onHomingComplete() {} + void onFactoryReset() { InterfaceSettingsScreen::defaultSettings(); } @@ -134,6 +138,8 @@ namespace ExtUI { } #if HAS_LEVELING && HAS_MESH + void onMeshLevelingStart() {} + void onMeshUpdate(const int8_t x, const int8_t y, const float val) { BedMeshScreen::onMeshUpdate(x, y, val); } @@ -170,6 +176,9 @@ namespace ExtUI { GOTO_SCREEN(StatusScreen); } #endif // HAS_PID_HEATING + + void onSteppersDisabled() {} + void onSteppersEnabled() {} } #endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/malyan_lcd.cpp b/Marlin/src/lcd/extui/malyan_lcd.cpp index 5505a0dff7d7..bdbf3802abe8 100644 --- a/Marlin/src/lcd/extui/malyan_lcd.cpp +++ b/Marlin/src/lcd/extui/malyan_lcd.cpp @@ -511,12 +511,15 @@ namespace ExtUI { // Not needed for Malyan LCD void onStatusChanged(const char * const) {} - void onMediaInserted() {}; - void onMediaError() {}; - void onMediaRemoved() {}; + void onMediaInserted() {} + void onMediaError() {} + void onMediaRemoved() {} void onPlayTone(const uint16_t, const uint16_t) {} void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const) {} + void onHomingStart() {} + void onHomingComplete() {} + void onPrintFinished() {} void onFactoryReset() {} void onStoreSettings(char*) {} void onLoadSettings(const char*) {} @@ -524,6 +527,7 @@ namespace ExtUI { void onConfigurationStoreRead(bool) {} #if HAS_MESH + void onMeshLevelingStart() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {} #endif @@ -531,6 +535,9 @@ namespace ExtUI { #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume() {} #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index c429a0aadee9..cdf9b4412aa9 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -140,6 +140,7 @@ namespace ExtUI { bed_mesh_t& getMeshArray(); float getMeshPoint(const xy_uint8_t &pos); void setMeshPoint(const xy_uint8_t &pos, const float zval); + void onMeshLevelingStart(); void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval); inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); } @@ -344,11 +345,16 @@ namespace ExtUI { void onPrintTimerStarted(); void onPrintTimerPaused(); void onPrintTimerStopped(); + void onPrintFinished(); void onFilamentRunout(const extruder_t extruder); void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired_P(PGM_P const pstr); void onStatusChanged(const char * const msg); void onStatusChanged_P(PGM_P const pstr); + void onHomingStart(); + void onHomingComplete(); + void onSteppersDisabled(); + void onSteppersEnabled(); void onFactoryReset(); void onStoreSettings(char *); void onLoadSettings(const char *); From a8dffdebd4afff1f161af492086e95e70bf76928 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 19:57:50 -0600 Subject: [PATCH 295/443] Move G29 3-point startup earlier --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 653c632f1a57..15555d5f8d43 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -394,6 +394,11 @@ G29_TYPE GcodeSuite::G29() { planner.synchronize(); + #if ENABLED(AUTO_BED_LEVELING_3POINT) + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); + points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points + #endif + if (!faux) remember_feedrate_scaling_off(); // Disable auto bed leveling during G29. @@ -411,7 +416,6 @@ G29_TYPE GcodeSuite::G29() { #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (TERN1(PROBE_MANUALLY, !no_action) && (gridSpacing != bilinear_grid_spacing || probe_position_lf != bilinear_start) ) { @@ -425,18 +429,8 @@ G29_TYPE GcodeSuite::G29() { // Can't re-enable (on error) until the new grid is written abl_should_enable = false; } - #endif // AUTO_BED_LEVELING_BILINEAR - #if ENABLED(AUTO_BED_LEVELING_3POINT) - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); - - // Probe at 3 arbitrary points - points[0].z = points[1].z = points[2].z = 0; - - #endif // AUTO_BED_LEVELING_3POINT - } // !g29_in_progress #if ENABLED(PROBE_MANUALLY) From a3f6e48eb6dd45e764d0bb5845ea787e5e4e0c8c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 19:25:34 -0600 Subject: [PATCH 296/443] Fix STM32F1 SERIAL_GET_TX_BUFFER_FREE --- Marlin/src/HAL/STM32F1/HAL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index d8bba774e917..2c852f22e1c3 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -110,7 +110,7 @@ #error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #endif - #define SERIAL_GET_TX_BUFFER_FREE LCD_SERIAL.availableForWrite + #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #endif // Set interrupt grouping for this MCU From 139a33c9fc864b3d2546398e3366a49a0433865b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 19:14:15 -0600 Subject: [PATCH 297/443] G28 tweaks --- Marlin/src/gcode/calibrate/G28.cpp | 17 ++++++----------- Marlin/src/lcd/dwin/e3v2/dwin.h | 2 ++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 31fc1e1cf2a2..e2b0860eef75 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -211,10 +211,6 @@ void GcodeSuite::G28() { TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser - TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true); - - TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); - #if ENABLED(DUAL_X_CARRIAGE) bool IDEX_saved_duplication_state = extruder_duplication_enabled; DualXMode IDEX_saved_mode = dual_x_carriage_mode; @@ -236,17 +232,17 @@ void GcodeSuite::G28() { return; } + TERN_(DWIN_CREALITY_LCD, DWIN_StartHoming()); + TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); + planner.synchronize(); // Wait for planner moves to finish! SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state // Disable the leveling matrix before homing #if HAS_LEVELING - - // Cancel the active G29 session - TERN_(PROBE_MANUALLY, g29_in_progress = false); - TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active); + TERN_(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session set_bed_leveling_enabled(false); #endif @@ -439,8 +435,6 @@ void GcodeSuite::G28() { do_blocking_move_to_z(delta_clip_start_height); #endif - TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active)); - restore_feedrate_and_scaling(); // Restore the active tool after homing @@ -464,10 +458,11 @@ void GcodeSuite::G28() { #endif #endif + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_restore_state)); + ui.refresh(); TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); - TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete()); report_current_position(); diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.h b/Marlin/src/lcd/dwin/e3v2/dwin.h index 5bff2e9f7890..8f17c3060983 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.h +++ b/Marlin/src/lcd/dwin/e3v2/dwin.h @@ -369,5 +369,7 @@ void DWIN_Update(); void EachMomentUpdate(); void DWIN_HandleScreen(); +inline void DWIN_StartHoming() { HMI_flag.home_flag = true; } + void DWIN_CompletedHoming(); void DWIN_CompletedLeveling(); From 6f4589b375e8adba2c110dbd5d1ec5e80a9204ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 23:05:03 -0600 Subject: [PATCH 298/443] G28 followup --- Marlin/src/gcode/calibrate/G28.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index e2b0860eef75..f54b2fb7d467 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -435,6 +435,8 @@ void GcodeSuite::G28() { do_blocking_move_to_z(delta_clip_start_height); #endif + TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active)); + restore_feedrate_and_scaling(); // Restore the active tool after homing @@ -458,8 +460,6 @@ void GcodeSuite::G28() { #endif #endif - TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_restore_state)); - ui.refresh(); TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); From 1a04c8c7bb65a4802bc5fedad442b4d1bfc41a89 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 6 Dec 2020 17:36:36 -0300 Subject: [PATCH 299/443] Avoid invalid memory optimizations (#20389) When building for AVR, merge-all-constants can incorrectly combine constants stored in flash with constants stored in RAM. These have different access requirements, leading to undefined behavior during execution. Co-authored-by: ellensp --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 0cff2dac606e..237634a4546c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -203,7 +203,7 @@ extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-dependencies.py pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py post:buildroot/share/PlatformIO/scripts/common-dependencies-post.py -build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants +build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-constants lib_deps = # From 00143f77d08bac20d1bedf27326f907a4cca8381 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 7 Dec 2020 00:13:45 +0000 Subject: [PATCH 300/443] [cron] Bump distribution date (2020-12-07) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index af6eac73771a..b66f4dadd951 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-06" + #define STRING_DISTRIBUTION_DATE "2020-12-07" #endif /** From ee4c2b36b8f06ac032cfcac84ca252fa114b61b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Dec 2020 04:36:22 -0600 Subject: [PATCH 301/443] Fix fileExists, use openFailed --- Marlin/src/sd/cardreader.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index bce84bbd3921..7ba9f3d3d6b4 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -662,14 +662,24 @@ void CardReader::openFileWrite(char * const path) { // bool CardReader::fileExists(const char * const path) { if (!isMounted()) return false; + + DEBUG_ECHOLNPAIR("fileExists: ", path); + + // Dive to the file's directory and get the base name SdFile *diveDir = nullptr; const char * const fname = diveToFile(false, diveDir, path); - if (fname) { - diveDir->rewind(); - selectByName(*diveDir, fname); - //diveDir->close(); - } - return !!fname; + if (!fname) return false; + + // Get the longname of the checked file + //diveDir->rewind(); + //selectByName(*diveDir, fname); + //diveDir->close(); + + // Try to open the file and return the result + SdFile tmpFile; + const bool success = tmpFile.open(diveDir, fname, O_READ); + if (success) tmpFile.close(); + return success; } // @@ -1231,7 +1241,7 @@ void CardReader::fileHasFinished() { if (!isMounted()) return; if (recovery.file.isOpen()) return; if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) - SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, recovery.filename, "."); + openFailed(recovery.filename); else if (!read) echo_write_to_file(recovery.filename); } From 2ecb4fad72c95e13344b512b38dca720b859c46f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Dec 2020 04:04:38 -0600 Subject: [PATCH 302/443] Watch idle() depth over 5 --- Marlin/src/MarlinCore.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index d4d22a6198a2..84eb7e21d1b0 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -709,6 +709,10 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { * - Handle Joystick jogging */ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { + #if ENABLED(MARLIN_DEV_MODE) + static uint8_t idle_depth = 0; + if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", int(idle_depth)); + #endif // Core Marlin activities manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep)); @@ -720,7 +724,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { TERN_(MAX7219_DEBUG, max7219.idle_tasks()); // Return if setup() isn't completed - if (marlin_state == MF_INITIALIZING) return; + if (marlin_state == MF_INITIALIZING) goto IDLE_DONE; // Handle filament runout sensors TERN_(HAS_FILAMENT_SENSOR, runout.run()); @@ -764,6 +768,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { // Run i2c Position Encoders #if ENABLED(I2C_POSITION_ENCODERS) + { static millis_t i2cpem_next_update_ms; if (planner.has_blocks_queued()) { const millis_t ms = millis(); @@ -772,6 +777,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS; } } + } #endif // Auto-report Temperatures / SD Status @@ -793,6 +799,10 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) { // Update the LVGL interface TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER()); + + IDLE_DONE: + TERN_(MARLIN_DEV_MODE, idle_depth--); + return; } /** From b04914fb720c657e10de2b19c595e9bedb534e79 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Dec 2020 05:06:09 -0600 Subject: [PATCH 303/443] More LPC P-string macros --- Marlin/src/HAL/LPC1768/HAL.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 51a13389b1e6..9a1852d94d38 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -212,3 +212,11 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader #ifndef strcmp_P #define strcmp_P(a, b) strcmp((a), (b)) #endif + +#ifndef strcat_P + #define strcat_P(a, b) strcat((a), (b)) +#endif + +#ifndef strcpy_P + #define strcpy_P(a, b) strcpy((a), (b)) +#endif From 7f20184ebcac95e7e8542a1a24d801af6f594596 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Dec 2020 05:53:15 -0600 Subject: [PATCH 304/443] Fix auto#.g file handling, add NO_SD_AUTOSTART (#20071) --- Marlin/Configuration_adv.h | 1 + Marlin/src/MarlinCore.cpp | 4 +- Marlin/src/feature/powerloss.h | 2 +- Marlin/src/gcode/sd/M1001.cpp | 14 +++-- Marlin/src/inc/Conditionals_adv.h | 4 ++ Marlin/src/lcd/menu/menu_main.cpp | 4 +- Marlin/src/sd/cardreader.cpp | 97 +++++++++++++++++-------------- Marlin/src/sd/cardreader.h | 10 ++-- buildroot/tests/mega2560-tests | 2 +- 9 files changed, 80 insertions(+), 58 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 03c9ba55eb35..92de09eec9d2 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1197,6 +1197,7 @@ #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + //#define NO_SD_AUTOSTART // Remove auto#.g file support completely to save some Flash, SRAM //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files //#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 84eb7e21d1b0..0171690d4e6e 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -460,6 +460,7 @@ void startOrResumeJob() { #if ENABLED(SDSUPPORT) inline void abortSDPrinting() { + IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel()); card.endFilePrint(TERN_(SD_RESORT, true)); queue.clear(); quickstop_stepper(); @@ -585,7 +586,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { if (ELAPSED(ms, next_home_key_ms)) { next_home_key_ms = ms + HOME_DEBOUNCE_DELAY; LCD_MESSAGEPGM(MSG_AUTO_HOME); - queue.enqueue_now_P(G28_STR); + queue.inject_P(G28_STR); } } #endif @@ -1354,7 +1355,6 @@ void loop() { idle(); #if ENABLED(SDSUPPORT) - card.checkautostart(); if (card.flag.abort_sd_printing) abortSDPrinting(); if (marlin_state == MF_SD_COMPLETE) finishSDPrinting(); #endif diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index f964f122941f..25581e17230d 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -152,7 +152,7 @@ class PrintJobRecovery { static void resume(); static void purge(); - static inline void cancel() { purge(); card.autostart_index = 0; } + static inline 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=0); diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index e4b7054bf283..406cd074c3c2 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -27,6 +27,10 @@ #include "../gcode.h" #include "../../module/printcounter.h" +#if DISABLED(NO_SD_AUTOSTART) + #include "../../sd/cardreader.h" +#endif + #ifdef SD_FINISHED_RELEASECOMMAND #include "../queue.h" #endif @@ -60,6 +64,11 @@ * M1001: Execute actions for SD print completion */ void GcodeSuite::M1001() { + // If there's another auto#.g file to run... + if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return; + + // Purge the recovery file... + TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Report total print time const bool long_print = print_job_timer.duration() > 60; @@ -71,9 +80,6 @@ void GcodeSuite::M1001() { // Set the progress bar "done" state TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done()); - // Purge the recovery file - TERN_(POWER_LOSS_RECOVERY, recovery.purge()); - // Announce SD file completion { PORT_REDIRECT(SERIAL_BOTH); @@ -93,7 +99,7 @@ void GcodeSuite::M1001() { // Inject SD_FINISHED_RELEASECOMMAND, if any #ifdef SD_FINISHED_RELEASECOMMAND - queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND)); + gcode.process_subcommands_now_P(PSTR(SD_FINISHED_RELEASECOMMAND)); #endif TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished()); diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 1bd9dc47a417..f99e363d7b64 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -142,6 +142,10 @@ #undef SD_FINISHED_RELEASECOMMAND #endif +#if ENABLED(NO_SD_AUTOSTART) + #undef MENU_ADDAUTOSTART +#endif + #if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) #define HAS_PRINT_PROGRESS 1 #endif diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index cda11bfc57cc..1b87e06cc808 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -136,7 +136,7 @@ void menu_main() { // Run Auto Files // #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart); + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); #endif if (card_detected) { @@ -238,7 +238,7 @@ void menu_main() { // Autostart // #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart); + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); #endif if (card_detected) { diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 7ba9f3d3d6b4..fe8bc4879a78 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -61,7 +61,8 @@ card_flags_t CardReader::flag; char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH]; -int8_t CardReader::autostart_index; + +IF_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0 #if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER) int8_t CardReader::transfer_port_index; @@ -135,17 +136,17 @@ CardReader::CardReader() { //sort_reverse = false; #endif #endif + flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; filesize = sdpos = 0; TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); + IF_DISABLED(NO_SD_AUTOSTART, autofile_cancel()); + workDirDepth = 0; ZERO(workDirParents); - // Disable autostart until card is initialized - autostart_index = -1; - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif @@ -442,12 +443,14 @@ void CardReader::manage_media() { if (stat) { TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); - if (old_stat == 2) // First mount? + if (old_stat == 2) { // First mount? DEBUG_ECHOLNPGM("First mount."); - TERN(POWER_LOSS_RECOVERY, - recovery.check(), // Check for PLR file. (If not there it will beginautostart) - beginautostart() // Look for auto0.g on the next loop - ); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.check(); // Check for PLR file. (If not there then call autofile_begin) + #elif DISABLED(NO_SD_AUTOSTART) + autofile_begin(); // Look for auto0.g on the next loop + #endif + } } } else @@ -477,12 +480,12 @@ void CardReader::release() { * Enqueues M23 and M24 commands to initiate a media print. */ void CardReader::openAndPrintFile(const char *name) { - char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null + char cmd[4 + strlen(name) + 1 + 3 + 1]; // Room for "M23 ", filename, "\n", "M24", and null extern const char M23_STR[]; sprintf_P(cmd, M23_STR, name); for (char *c = &cmd[4]; *c; c++) *c = tolower(*c); - queue.enqueue_one_now(cmd); - queue.enqueue_now_P(M24_STR); + strcat_P(cmd, PSTR("\nM24")); + queue.inject(cmd); } /** @@ -511,7 +514,7 @@ void CardReader::endFilePrint(TERN_(SD_RESORT, const bool re_sort/*=false*/)) { void CardReader::openLogFile(char * const path) { flag.logging = DISABLED(SDCARD_READONLY); - TERN(SDCARD_READONLY,,openFileWrite(path)); + IF_DISABLED(SDCARD_READONLY, openFileWrite(path)); } // @@ -735,42 +738,48 @@ void CardReader::write_command(char * const buf) { if (file.writeError) SERIAL_ERROR_MSG(STR_SD_ERR_WRITE_TO_FILE); } -// -// Run the next autostart file. Called: -// - On boot after successful card init -// - After finishing the previous autostart file -// - From the LCD command to run the autostart file -// - -void CardReader::checkautostart() { - - if (autostart_index < 0 || flag.sdprinting) return; - - if (!isMounted()) mount(); - TERN_(SDCARD_EEPROM_EMULATION, else settings.first_load()); +#if DISABLED(NO_SD_AUTOSTART) + /** + * Run all the auto#.g files. Called: + * - On boot after successful card init. + * - From the LCD command to Run Auto Files + */ + void CardReader::autofile_begin() { + autofile_index = 1; + (void)autofile_check(); + } - // Don't run auto#.g when a PLR file exists - if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) { - char autoname[8]; - sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0'); - dir_t p; - root.rewind(); - while (root.readDir(&p, nullptr) > 0) { - for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); - if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { + /** + * Run the next auto#.g file. Called: + * - On boot after successful card init + * - After finishing the previous auto#.g file + * - From the LCD command to begin the auto#.g files + * + * Return 'true' if there was nothing to do + */ + bool CardReader::autofile_check() { + if (!autofile_index) return true; + + if (!isMounted()) + mount(); + else if (ENABLED(SDCARD_EEPROM_EMULATION)) + settings.first_load(); + + // Don't run auto#.g when a PLR file exists + if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) { + char autoname[10]; + sprintf_P(autoname, PSTR("/auto%c.g"), '0' + autofile_index - 1); + if (fileExists(autoname)) { + cdroot(); openAndPrintFile(autoname); - autostart_index++; - return; + autofile_index++; + return false; } } + autofile_cancel(); + return true; } - autostart_index = -1; -} - -void CardReader::beginautostart() { - autostart_index = 0; - cdroot(); -} +#endif void CardReader::closefile(const bool store_location/*=false*/) { file.sync(); diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index dabbf719f92b..b775d8a8730e 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -90,10 +90,12 @@ class CardReader { static void openLogFile(char * const path); static void write_command(char * const buf); - // Auto-Start files - static int8_t autostart_index; // Index of autoX.g files - static void beginautostart(); - static void checkautostart(); + #if DISABLED(NO_SD_AUTOSTART) // Auto-Start auto#.g file handling + 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; } + #endif // Basic file ops static void openFileRead(char * const path, const uint8_t subcall=0); diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index da3a79f58cb4..0a17cacba1a0 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -49,7 +49,7 @@ opt_set TEMP_SENSOR_4 1000 opt_set TEMP_SENSOR_BED 1 opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \ - SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS \ + SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS NO_SD_AUTOSTART \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \ MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \ LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ From 182fdd95c3cd0151747c9292fe1b27febc43c6c2 Mon Sep 17 00:00:00 2001 From: ellensp Date: Tue, 8 Dec 2020 09:53:53 +1300 Subject: [PATCH 305/443] Shorten Filament Load/Unload Strings to Fit on Graphical Displays (#20369) Co-authored-by: ellensp Co-authored-by: Victor Mateus Oliveira --- Marlin/src/lcd/language/language_en.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 2892f79df8ab..0b96403b7285 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -431,9 +431,9 @@ namespace Language_en { PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Change Filament"); PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *"); PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Load Filament"); - PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load Filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load *"); PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); - PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload *"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Attach Media"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Change Media"); From fee375f31f655dde1026152f0d2c13c69eb9bae8 Mon Sep 17 00:00:00 2001 From: ellensp Date: Tue, 8 Dec 2020 09:57:00 +1300 Subject: [PATCH 306/443] Allow BTT EXP-MOT be used with Displays that needs only EXP 1 (#20396) Co-authored-by: ellensp Co-authored-by: Victor Mateus Oliveira --- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index e6cfc0afaf76..867b6b687136 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -34,7 +34,11 @@ //#define HAS_BTT_EXP_MOT 1 #if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT) - #ERROR "Having a LCD on EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possable." + #if EITHER(CR10_STOCKDISPLAY,ENDER2_STOCKDISPLAY) + #define EXP_MOT_USE_EXP2_ONLY + #else + #error "Having a LCD that uses both EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possible." + #endif #endif // Ignore temp readings during development. @@ -133,36 +137,48 @@ * (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG) * ----- ----- * EXP2 EXP1 + * + * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN */ // M1 on Driver Expansion Module #define E2_STEP_PIN EXPA2_05_PIN #define E2_DIR_PIN EXPA2_06_PIN #define E2_ENABLE_PIN EXPA2_04_PIN - #define E2_DIAG_PIN EXPA1_06_PIN - #define E2_CS_PIN EXPA1_05_PIN - #if HAS_TMC_UART - #define E2_SERIAL_TX_PIN EXPA1_05_PIN - #define E2_SERIAL_RX_PIN EXPA1_05_PIN + #ifndef EXP_MOT_USE_EXP2_ONLY + #define E2_DIAG_PIN EXPA1_06_PIN + #define E2_CS_PIN EXPA1_05_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXPA1_05_PIN + #define E2_SERIAL_RX_PIN EXPA1_05_PIN + #endif #endif // M2 on Driver Expansion Module #define E3_STEP_PIN EXPA2_08_PIN #define E3_DIR_PIN EXPA2_07_PIN - #define E3_ENABLE_PIN EXPA1_03_PIN - #define E3_DIAG_PIN EXPA1_08_PIN - #define E3_CS_PIN EXPA1_07_PIN - #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXPA1_07_PIN - #define E3_SERIAL_RX_PIN EXPA1_07_PIN + #ifndef EXP_MOT_USE_EXP2_ONLY + #define E3_ENABLE_PIN EXPA1_03_PIN + #define E3_DIAG_PIN EXPA1_08_PIN + #define E3_CS_PIN EXPA1_07_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXPA1_07_PIN + #define E3_SERIAL_RX_PIN EXPA1_07_PIN + #endif + #else + #define E3_ENABLE_PIN EXPA2_04_PIN #endif // M3 on Driver Expansion Module #define E4_STEP_PIN EXPA2_10_PIN #define E4_DIR_PIN EXPA2_09_PIN - #define E4_ENABLE_PIN EXPA1_04_PIN - #define E4_DIAG_PIN EXPA1_10_PIN - #define E4_CS_PIN EXPA1_09_PIN - #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXPA1_09_PIN - #define E4_SERIAL_RX_PIN EXPA1_09_PIN + #ifndef EXP_MOT_USE_EXP2_ONLY + #define E4_ENABLE_PIN EXPA1_04_PIN + #define E4_DIAG_PIN EXPA1_10_PIN + #define E4_CS_PIN EXPA1_09_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXPA1_09_PIN + #define E4_SERIAL_RX_PIN EXPA1_09_PIN + #endif + #else + #define E4_ENABLE_PIN EXPA2_04_PIN #endif #endif // HAS_BTT_EXP_MOT From af20db4512d7c51b7c033adfce43b0f1c539c3ac Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 8 Dec 2020 00:13:33 +0000 Subject: [PATCH 307/443] [cron] Bump distribution date (2020-12-08) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b66f4dadd951..3acde84f341f 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-07" + #define STRING_DISTRIBUTION_DATE "2020-12-08" #endif /** From 9ead6a30f2876700413802d2d1445b9a33f05838 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 8 Dec 2020 02:26:39 -0300 Subject: [PATCH 308/443] SPI TFT for STM32F4 boards (#20384) * fix pinsDebug for F1 boards * add MKS Robin PRO V2 board - development board * tft spi working with F4 boards * pins formating * sanity check for TFT on supported cores in STM32 * Fix tabs/spaces in pins file Co-authored-by: Jason Smith --- Marlin/src/HAL/STM32/inc/SanityCheck.h | 4 + Marlin/src/HAL/STM32/pinsDebug.h | 143 +++---- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 108 +++-- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 381 ++++++++++++++++++ platformio.ini | 20 + 7 files changed, 540 insertions(+), 119 deletions(-) create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index c51fecc7bdb9..64632475fd0c 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -51,3 +51,7 @@ #elif ENABLED(SERIAL_STATS_DROPPED_RX) #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." #endif + +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32F4xx, STM32F1xx) + #error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_U are currently only supported on STM32F4 and STM32F1 hardware." +#endif diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index 77c93ee41e36..64ee2b03dbbb 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -137,32 +137,19 @@ const XrefInfo pin_xref[] PROGMEM = { #endif uint8_t get_pin_mode(const pin_t Ard_num) { - uint32_t mode_all = 0; const PinName dp = digitalPinToPinName(Ard_num); - switch (PORT_ALPHA(dp)) { - case 'A' : mode_all = GPIOA->MODER; break; - case 'B' : mode_all = GPIOB->MODER; break; - case 'C' : mode_all = GPIOC->MODER; break; - case 'D' : mode_all = GPIOD->MODER; break; - #ifdef PE_0 - case 'E' : mode_all = GPIOE->MODER; break; - #elif defined(PF_0) - case 'F' : mode_all = GPIOF->MODER; break; - #elif defined(PG_0) - case 'G' : mode_all = GPIOG->MODER; break; - #elif defined(PH_0) - case 'H' : mode_all = GPIOH->MODER; break; - #elif defined(PI_0) - case 'I' : mode_all = GPIOI->MODER; break; - #elif defined(PJ_0) - case 'J' : mode_all = GPIOJ->MODER; break; - #elif defined(PK_0) - case 'K' : mode_all = GPIOK->MODER; break; - #elif defined(PL_0) - case 'L' : mode_all = GPIOL->MODER; break; - #endif + uint32_t ll_pin = STM_LL_GPIO_PIN(dp); + GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(dp)); + uint32_t mode = LL_GPIO_GetPinMode(port, ll_pin); + switch (mode) + { + case LL_GPIO_MODE_ANALOG: return MODE_PIN_ANALOG; + case LL_GPIO_MODE_INPUT: return MODE_PIN_INPUT; + case LL_GPIO_MODE_OUTPUT: return MODE_PIN_OUTPUT; + case LL_GPIO_MODE_ALTERNATE: return MODE_PIN_ALT; + TERN_(STM32F1xx, case LL_GPIO_MODE_FLOATING:) + default: return 0; } - return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03; } bool GET_PINMODE(const pin_t Ard_num) { @@ -217,58 +204,62 @@ bool pwm_status(const pin_t Ard_num) { } void pwm_details(const pin_t Ard_num) { - if (pwm_status(Ard_num)) { - uint32_t alt_all = 0; - const PinName dp = digitalPinToPinName(Ard_num); - pin_t pin_number = uint8_t(PIN_NUM(dp)); - const bool over_7 = pin_number >= 8; - const uint8_t ind = over_7 ? 1 : 0; - switch (PORT_ALPHA(dp)) { // get alt function - case 'A' : alt_all = GPIOA->AFR[ind]; break; - case 'B' : alt_all = GPIOB->AFR[ind]; break; - case 'C' : alt_all = GPIOC->AFR[ind]; break; - case 'D' : alt_all = GPIOD->AFR[ind]; break; - #ifdef PE_0 - case 'E' : alt_all = GPIOE->AFR[ind]; break; - #elif defined (PF_0) - case 'F' : alt_all = GPIOF->AFR[ind]; break; - #elif defined (PG_0) - case 'G' : alt_all = GPIOG->AFR[ind]; break; - #elif defined (PH_0) - case 'H' : alt_all = GPIOH->AFR[ind]; break; - #elif defined (PI_0) - case 'I' : alt_all = GPIOI->AFR[ind]; break; - #elif defined (PJ_0) - case 'J' : alt_all = GPIOJ->AFR[ind]; break; - #elif defined (PK_0) - case 'K' : alt_all = GPIOK->AFR[ind]; break; - #elif defined (PL_0) - case 'L' : alt_all = GPIOL->AFR[ind]; break; - #endif - } - if (over_7) pin_number -= 8; + #ifndef STM32F1xx + if (pwm_status(Ard_num)) { + uint32_t alt_all = 0; + const PinName dp = digitalPinToPinName(Ard_num); + pin_t pin_number = uint8_t(PIN_NUM(dp)); + const bool over_7 = pin_number >= 8; + const uint8_t ind = over_7 ? 1 : 0; + switch (PORT_ALPHA(dp)) { // get alt function + case 'A' : alt_all = GPIOA->AFR[ind]; break; + case 'B' : alt_all = GPIOB->AFR[ind]; break; + case 'C' : alt_all = GPIOC->AFR[ind]; break; + case 'D' : alt_all = GPIOD->AFR[ind]; break; + #ifdef PE_0 + case 'E' : alt_all = GPIOE->AFR[ind]; break; + #elif defined (PF_0) + case 'F' : alt_all = GPIOF->AFR[ind]; break; + #elif defined (PG_0) + case 'G' : alt_all = GPIOG->AFR[ind]; break; + #elif defined (PH_0) + case 'H' : alt_all = GPIOH->AFR[ind]; break; + #elif defined (PI_0) + case 'I' : alt_all = GPIOI->AFR[ind]; break; + #elif defined (PJ_0) + case 'J' : alt_all = GPIOJ->AFR[ind]; break; + #elif defined (PK_0) + case 'K' : alt_all = GPIOK->AFR[ind]; break; + #elif defined (PL_0) + case 'L' : alt_all = GPIOL->AFR[ind]; break; + #endif + } + if (over_7) pin_number -= 8; - uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; - SERIAL_ECHOPAIR("Alt Function: ", alt_func); - if (alt_func < 10) SERIAL_CHAR(' '); - SERIAL_ECHOPGM(" - "); - switch (alt_func) { - case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; - case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; - case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; - case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; - case 4 : SERIAL_ECHOPGM("I2C1..3"); break; - case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; - case 6 : SERIAL_ECHOPGM("SPI3"); break; - case 7 : SERIAL_ECHOPGM("USART1..3"); break; - case 8 : SERIAL_ECHOPGM("USART4..6"); break; - case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; - case 10 : SERIAL_ECHOPGM("OTG"); break; - case 11 : SERIAL_ECHOPGM("ETH"); break; - case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; - case 13 : SERIAL_ECHOPGM("DCMI"); break; - case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; - case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; + uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; + SERIAL_ECHOPAIR("Alt Function: ", alt_func); + if (alt_func < 10) SERIAL_CHAR(' '); + SERIAL_ECHOPGM(" - "); + switch (alt_func) { + case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; + case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; + case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; + case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; + case 4 : SERIAL_ECHOPGM("I2C1..3"); break; + case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; + case 6 : SERIAL_ECHOPGM("SPI3"); break; + case 7 : SERIAL_ECHOPGM("USART1..3"); break; + case 8 : SERIAL_ECHOPGM("USART4..6"); break; + case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; + case 10 : SERIAL_ECHOPGM("OTG"); break; + case 11 : SERIAL_ECHOPGM("ETH"); break; + case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; + case 13 : SERIAL_ECHOPGM("DCMI"); break; + case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; + case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; + } } - } + #else + // TODO: F1 doesn't support changing pins function, so we need to check the function of the PIN and if it's enabled + #endif } // pwm_details diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index aed15ad66df5..d64ebcfe4bb8 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -34,35 +34,25 @@ DMA_HandleTypeDef TFT_SPI::DMAtx; void TFT_SPI::Init() { SPI_TypeDef *spiInstance; - #if PIN_EXISTS(TFT_RESET) - OUT_WRITE(TFT_RESET_PIN, HIGH); - HAL_Delay(100); - #endif - - #if PIN_EXISTS(TFT_BACKLIGHT) - OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); - #endif - OUT_WRITE(TFT_A0_PIN, HIGH); OUT_WRITE(TFT_CS_PIN, HIGH); if ((spiInstance = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK)) == NP) return; if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI)) return; - #if PIN_EXISTS(TFT_MISO) && (TFT_MISO_PIN != TFT_MOSI_PIN) - if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return; + #if PIN_EXISTS(TFT_MISO) + if (TFT_MISO_PIN != TFT_MOSI_PIN) + if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return; #endif SPIx.Instance = spiInstance; SPIx.State = HAL_SPI_STATE_RESET; SPIx.Init.NSS = SPI_NSS_SOFT; SPIx.Init.Mode = SPI_MODE_MASTER; - SPIx.Init.Direction = - #if TFT_MISO_PIN == TFT_MOSI_PIN - SPI_DIRECTION_1LINE; - #else - SPI_DIRECTION_2LINES; - #endif + if (TFT_MISO_PIN == TFT_MOSI_PIN) + SPIx.Init.Direction = SPI_DIRECTION_1LINE; + else + SPIx.Init.Direction = SPI_DIRECTION_2LINES; SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; SPIx.Init.CLKPhase = SPI_PHASE_1EDGE; SPIx.Init.CLKPolarity = SPI_POLARITY_LOW; @@ -74,31 +64,50 @@ void TFT_SPI::Init() { pinmap_pinout(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK); pinmap_pinout(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI); - #if PIN_EXISTS(TFT_MISO) && (TFT_MISO_PIN != TFT_MOSI_PIN) - pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); + #if PIN_EXISTS(TFT_MISO) + if (TFT_MISO_PIN != TFT_MOSI_PIN) + pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); #endif pin_PullConfig(get_GPIO_Port(STM_PORT(digitalPinToPinName(TFT_SCK_PIN))), STM_LL_GPIO_PIN(digitalPinToPinName(TFT_SCK_PIN)), GPIO_PULLDOWN); #ifdef SPI1_BASE if (SPIx.Instance == SPI1) { __HAL_RCC_SPI1_CLK_ENABLE(); - __HAL_RCC_DMA1_CLK_ENABLE(); + #ifdef STM32F1xx + __HAL_RCC_DMA1_CLK_ENABLE(); + DMAtx.Instance = DMA1_Channel3; + #elif defined(STM32F4xx) + __HAL_RCC_DMA2_CLK_ENABLE(); + DMAtx.Instance = DMA2_Stream3; + DMAtx.Init.Channel = DMA_CHANNEL_3; + #endif SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; - DMAtx.Instance = DMA1_Channel3; } #endif #ifdef SPI2_BASE if (SPIx.Instance == SPI2) { __HAL_RCC_SPI2_CLK_ENABLE(); - __HAL_RCC_DMA1_CLK_ENABLE(); - DMAtx.Instance = DMA1_Channel5; + #ifdef STM32F1xx + __HAL_RCC_DMA1_CLK_ENABLE(); + DMAtx.Instance = DMA1_Channel5; + #elif defined(STM32F4xx) + __HAL_RCC_DMA1_CLK_ENABLE(); + DMAtx.Instance = DMA1_Stream4; + DMAtx.Init.Channel = DMA_CHANNEL_4; + #endif } #endif #ifdef SPI3_BASE if (SPIx.Instance == SPI3) { __HAL_RCC_SPI3_CLK_ENABLE(); - __HAL_RCC_DMA2_CLK_ENABLE(); - DMAtx.Instance = DMA2_Channel2; + #ifdef STM32F1xx + __HAL_RCC_DMA2_CLK_ENABLE(); + DMAtx.Instance = DMA2_Channel2; + #elif defined(STM32F4xx) + __HAL_RCC_DMA1_CLK_ENABLE(); + DMAtx.Instance = DMA1_Stream5; + DMAtx.Init.Channel = DMA_CHANNEL_5; + #endif } #endif @@ -110,6 +119,9 @@ void TFT_SPI::Init() { DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; DMAtx.Init.Mode = DMA_NORMAL; DMAtx.Init.Priority = DMA_PRIORITY_LOW; + #if defined(STM32F4xx) + DMAtx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + #endif } void TFT_SPI::DataTransferBegin(uint16_t DataSize) { @@ -142,12 +154,12 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { __HAL_SPI_ENABLE(&SPIx); for (i = 0; i < 4; i++) { - #if TFT_MISO_PIN != TFT_MOSI_PIN + if (TFT_MISO_PIN != TFT_MOSI_PIN) { //if (hspi->Init.Direction == SPI_DIRECTION_2LINES) { while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} SPIx.Instance->DR = 0; //} - #endif + } while ((SPIx.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {} Data = (Data << 8) | SPIx.Instance->DR; } @@ -162,21 +174,34 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { } bool TFT_SPI::isBusy() { - if (DMAtx.Instance->CCR & DMA_CCR_EN) + #if defined(STM32F1xx) + volatile bool dmaEnabled = (DMAtx.Instance->CCR & DMA_CCR_EN) != RESET; + #elif defined(STM32F4xx) + volatile bool dmaEnabled = DMAtx.Instance->CR & DMA_SxCR_EN; + #endif + if (dmaEnabled) { if (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) != 0 || __HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) != 0) Abort(); - return DMAtx.Instance->CCR & DMA_CCR_EN; + } + else { + Abort(); + } + return dmaEnabled; } void TFT_SPI::Abort() { - __HAL_DMA_DISABLE(&DMAtx); + // First, abort any running dma + HAL_DMA_Abort(&DMAtx); + // DeInit objects + HAL_DMA_DeInit(&DMAtx); + HAL_SPI_DeInit(&SPIx); + // Deselect CS DataTransferEnd(); } void TFT_SPI::Transmit(uint16_t Data) { - #if TFT_MISO_PIN == TFT_MOSI_PIN + if (TFT_MISO_PIN == TFT_MOSI_PIN) SPI_1LINE_TX(&SPIx); - #endif __HAL_SPI_ENABLE(&SPIx); @@ -185,26 +210,23 @@ void TFT_SPI::Transmit(uint16_t Data) { while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {} - #if TFT_MISO_PIN != TFT_MOSI_PIN + if (TFT_MISO_PIN != TFT_MOSI_PIN) __HAL_SPI_CLEAR_OVRFLAG(&SPIx); /* Clear overrun flag in 2 Lines communication mode because received is not read */ - #endif } void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) { + // Wait last dma finish, to start another + while(isBusy()) { } + DMAtx.Init.MemInc = MemoryIncrease; HAL_DMA_Init(&DMAtx); - DataTransferBegin(); - - #if TFT_MISO_PIN == TFT_MOSI_PIN + if (TFT_MISO_PIN == TFT_MOSI_PIN) SPI_1LINE_TX(&SPIx); - #endif - DMAtx.DmaBaseAddress->IFCR = (DMA_ISR_GIF1 << DMAtx.ChannelIndex); - DMAtx.Instance->CNDTR = Count; - DMAtx.Instance->CPAR = (uint32_t)&(SPIx.Instance->DR); - DMAtx.Instance->CMAR = (uint32_t)Data; - __HAL_DMA_ENABLE(&DMAtx); + DataTransferBegin(); + + HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count); __HAL_SPI_ENABLE(&SPIx); SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */ diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 643d577d1b13..7f0a99dca329 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -365,6 +365,7 @@ #define BOARD_FYSETC_S6_V2_0 4216 // FYSETC S6 v2.0 board #define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG) #define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE) +#define BOARD_MKS_ROBIN_PRO_V2 4219 // MKS Robin Pro V2 (STM32F407VE) // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index fbae5356ca53..c9f6f7b3b35f 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -588,6 +588,8 @@ #include "stm32f4/pins_FLYF407ZG.h" // STM32F4 env:FLYF407ZG #elif MB(MKS_ROBIN2) #include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2 +#elif MB(MKS_ROBIN_PRO_V2) + #include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2 // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h new file mode 100644 index 000000000000..e3065439d7eb --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -0,0 +1,381 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Robin Nano V3 supports up to 1 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "MKS Robin PRO V2" + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#define I2C_EEPROM + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// + +// +// Note: MKS Robin board is using SPI2 interface. +// +//#define SPI_MODULE 2 + +// +// Limit Switches +// +#define X_DIAG_PIN PA15 +#define Y_DIAG_PIN PA12 +#define Z_DIAG_PIN PA11 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +// + +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PA12 +#define Z_MIN_PIN PA11 +#define Z_MAX_PIN PC4 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA4 // MT_DET +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD7 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD4 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD9 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD8 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PD14 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PD1 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PD0 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN PD5 + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN PD7 + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN PD4 + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN PD9 + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN PD8 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif // TMC2208 || TMC2209 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PC2 // TH2 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC3 // HEATER1 +#define HEATER_1_PIN PB0 // HEATER2 +#define HEATER_BED_PIN PA0 // HOT BED + +#define FAN_PIN PB1 // FAN + +// +// Thermocouples +// +//#define MAX6675_SS_PIN PE5 // TC1 - CS1 +//#define MAX6675_SS_PIN PE6 // TC2 - CS2 + +// +// Misc. Functions +// +// #define POWER_LOSS_PIN PA2 // PW_DET +// #define PS_ON_PIN PA3 // PW_OFF +// #define SUICIDE_PIN PB2 // Enable MKSPWC support +// #define KILL_PIN PA2 // Enable MKSPWC support +// #define KILL_PIN_INVERTING true // Enable MKSPWC support +#define SERVO0_PIN PA8 // Enable BLTOUCH support +//#define LED_PIN PB2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// #define USE_NEW_SPI_API 1 + +// +// Onboard SD card +// NOT compatible with LCD +// +// detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled +#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + + #if USE_NEW_SPI_API + #define SD_SPI MARLIN_SPI(HardwareSPI3, PC9) + #else + #define ENABLE_SPI3 + #define SS_PIN -1 + #define SDSS PC9 + #define SCK_PIN PC10 + #define MISO_PIN PC11 + #define MOSI_PIN PC12 + #endif + #define SD_DETECT_PIN PD12 + #endif +#endif + +/* +// +// LCD SD +// +#if SDCARD_CONNECTION == LCD + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SCK_PIN PA5 + #define MISO_PIN PA6 + #define MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 + #endif +#endif +*/ + +// +// LCD / Controller +#define SPI_FLASH +// #define HAS_SPI_FLASH 1 +#define SPI_DEVICE 2 +#define SPI_FLASH_SIZE 0x1000000 +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif + +/** + * _____ _____ + * (BEEPER)PC5 | · · | PE13(BTN_ENC) (SPI1 MISO) PA6 | · · | PA5 (SPI1 SCK) + * (LCD_EN)PD13 | · · | PC6(LCD_RS) (BTN_EN1) PE8 | · · | PE10 (SPI1 CS) + * (LCD_D4)PE14 | · · | PE15(LCD_D5) (BTN_EN2) PE11 | · · | PA7 (SPI1 MOSI) + * (LCD_D6)PD11 | · · | PD10(LCD_D7) (SPI DET) PE12 | · · | RESET + * GND | · · | 5V GND | · · | 3.3V + *  ̄ ̄ ̄  ̄ ̄ ̄ + * EXP1 EXP2 + */ + +#if EITHER(TFT_480x320_SPI, TFT_LVGL_UI_SPI) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #define TFT_CS_PIN PD11 + #define TFT_SCK_PIN PA5 + #define TFT_MISO_PIN PA6 + #define TFT_MOSI_PIN PA7 + #define TFT_DC_PIN PD10 + #define TFT_RST_PIN PC6 + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN PC6 + #define TFT_BACKLIGHT_PIN PD13 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define LCD_BACKLIGHT_PIN PD13 + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + // #define TFT_DRIVER ST7796 + #define TFT_BUFFER_SIZE 14400 + +#elif HAS_SPI_LCD + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + //#define DOGLCD_SCK PA5 + //#define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + //#undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(600) + #endif + + #endif // !MKS_MINI_12864 + +#elif ENABLED(SPI_GRAPHICAL_TFT) + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 + + #define LCD_BACKLIGHT_PIN PD13 + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 +#endif // HAS_SPI_LCD diff --git a/platformio.ini b/platformio.ini index 237634a4546c..a8b81d755e34 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1351,6 +1351,26 @@ extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/stm32_bootloader.py buildroot/share/PlatformIO/scripts/mks_encrypt.py +# +# MKS Robin Pro V2 +# +[env:mks_robin_pro2] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DARDUINO_BLACK_F407VE +board = genericSTM32F407VET6 +board_build.core = stm32 +board_build.variant = MARLIN_F407VE +board_build.ldscript = ldscript.ld +board_build.firmware = Robin_nano35.bin +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC +debug_tool = jlink +upload_protocol = jlink +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/mks_encrypt.py + ################################# # # # Other Architectures # From 66834cf32488ffee53c352b06491972bee39d955 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 9 Dec 2020 00:13:32 +0000 Subject: [PATCH 309/443] [cron] Bump distribution date (2020-12-09) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3acde84f341f..ebb2a7519be2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-08" + #define STRING_DISTRIBUTION_DATE "2020-12-09" #endif /** From 885b0d2ec5f431d07aced632746eec5e7e371b6d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 8 Dec 2020 20:17:55 -0600 Subject: [PATCH 310/443] Style, spacing, typo cleanup for recent changes --- Marlin/src/HAL/STM32/inc/SanityCheck.h | 2 +- Marlin/src/HAL/STM32/pinsDebug.h | 3 +- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 35 +++--- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 4 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 118 +++++++++--------- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 76 +++++------ Marlin/src/pins/ramps/pins_K8600.h | 4 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 4 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 +- Marlin/src/pins/stm32f1/pins_CREALITY_V427.h | 4 +- Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 6 +- .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 2 +- platformio.ini | 8 +- 13 files changed, 133 insertions(+), 137 deletions(-) diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index 64632475fd0c..4df75a050558 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -53,5 +53,5 @@ #endif #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32F4xx, STM32F1xx) - #error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_U are currently only supported on STM32F4 and STM32F1 hardware." + #error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32F4 and STM32F1 hardware." #endif diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index 64ee2b03dbbb..048f788e3d08 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -141,8 +141,7 @@ uint8_t get_pin_mode(const pin_t Ard_num) { uint32_t ll_pin = STM_LL_GPIO_PIN(dp); GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(dp)); uint32_t mode = LL_GPIO_GetPinMode(port, ll_pin); - switch (mode) - { + switch (mode) { case LL_GPIO_MODE_ANALOG: return MODE_PIN_ANALOG; case LL_GPIO_MODE_INPUT: return MODE_PIN_INPUT; case LL_GPIO_MODE_OUTPUT: return MODE_PIN_OUTPUT; diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index d64ebcfe4bb8..1c61d09529af 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -40,19 +40,15 @@ void TFT_SPI::Init() { if ((spiInstance = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK)) == NP) return; if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI)) return; - #if PIN_EXISTS(TFT_MISO) - if (TFT_MISO_PIN != TFT_MOSI_PIN) - if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return; + #if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN + if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return; #endif SPIx.Instance = spiInstance; SPIx.State = HAL_SPI_STATE_RESET; SPIx.Init.NSS = SPI_NSS_SOFT; SPIx.Init.Mode = SPI_MODE_MASTER; - if (TFT_MISO_PIN == TFT_MOSI_PIN) - SPIx.Init.Direction = SPI_DIRECTION_1LINE; - else - SPIx.Init.Direction = SPI_DIRECTION_2LINES; + SPIx.Init.Direction = (TFT_MISO_PIN == TFT_MOSI_PIN) ? SPI_DIRECTION_1LINE : SPI_DIRECTION_2LINES; SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; SPIx.Init.CLKPhase = SPI_PHASE_1EDGE; SPIx.Init.CLKPolarity = SPI_POLARITY_LOW; @@ -64,9 +60,8 @@ void TFT_SPI::Init() { pinmap_pinout(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK); pinmap_pinout(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI); - #if PIN_EXISTS(TFT_MISO) - if (TFT_MISO_PIN != TFT_MOSI_PIN) - pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); + #if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN + pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); #endif pin_PullConfig(get_GPIO_Port(STM_PORT(digitalPinToPinName(TFT_SCK_PIN))), STM_LL_GPIO_PIN(digitalPinToPinName(TFT_SCK_PIN)), GPIO_PULLDOWN); @@ -119,7 +114,7 @@ void TFT_SPI::Init() { DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; DMAtx.Init.Mode = DMA_NORMAL; DMAtx.Init.Priority = DMA_PRIORITY_LOW; - #if defined(STM32F4xx) + #ifdef STM32F4xx DMAtx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; #endif } @@ -140,11 +135,10 @@ uint32_t TFT_SPI::GetID() { } uint32_t TFT_SPI::ReadID(uint16_t Reg) { - #if !PIN_EXISTS(TFT_MISO) - return 0; - #else + uint32_t Data = 0; + #if PIN_EXISTS(TFT_MISO) uint32_t BaudRatePrescaler = SPIx.Init.BaudRatePrescaler; - uint32_t i, Data = 0; + uint32_t i; SPIx.Init.BaudRatePrescaler = SPIx.Instance == SPI1 ? SPI_BAUDRATEPRESCALER_8 : SPI_BAUDRATEPRESCALER_4; DataTransferBegin(DATASIZE_8BIT); @@ -154,12 +148,12 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { __HAL_SPI_ENABLE(&SPIx); for (i = 0; i < 4; i++) { - if (TFT_MISO_PIN != TFT_MOSI_PIN) { + #if TFT_MISO_PIN != TFT_MOSI_PIN //if (hspi->Init.Direction == SPI_DIRECTION_2LINES) { while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} SPIx.Instance->DR = 0; //} - } + #endif while ((SPIx.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {} Data = (Data << 8) | SPIx.Instance->DR; } @@ -168,9 +162,9 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { DataTransferEnd(); SPIx.Init.BaudRatePrescaler = BaudRatePrescaler; - - return Data >> 7; #endif + + return Data >> 7; } bool TFT_SPI::isBusy() { @@ -183,9 +177,8 @@ bool TFT_SPI::isBusy() { if (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) != 0 || __HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) != 0) Abort(); } - else { + else Abort(); - } return dmaEnabled; } diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 0c9ab43fd3ac..f95a53240b86 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 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 04e9a2f80ad9..86fbd18ba28b 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -33,7 +33,7 @@ // SD Connection // #ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD + #define SDCARD_CONNECTION LCD #endif // @@ -244,7 +244,7 @@ // SD Connection // #if SD_CONNECTION_IS(LCD) - #define SS_PIN EXPA2_07_PIN + #define SS_PIN EXPA2_07_PIN #endif /** @@ -286,24 +286,24 @@ * LCD LCD */ - #define LCD_PINS_RS EXPA1_03_PIN + #define LCD_PINS_RS EXPA1_03_PIN - #define BTN_EN1 EXPA1_06_PIN - #define BTN_EN2 EXPA1_04_PIN - #define BTN_ENC EXPA1_08_PIN + #define BTN_EN1 EXPA1_06_PIN + #define BTN_EN2 EXPA1_04_PIN + #define BTN_ENC EXPA1_08_PIN - #define LCD_PINS_ENABLE EXPA1_05_PIN - #define LCD_PINS_D4 EXPA1_07_PIN + #define LCD_PINS_ENABLE EXPA1_05_PIN + #define LCD_PINS_D4 EXPA1_07_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC EXPA1_09_PIN // (58) open-drain - #define LCD_PINS_RS EXPA1_04_PIN + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_04_PIN - #define BTN_EN1 EXPA1_08_PIN - #define BTN_EN2 EXPA1_06_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN - #define LCD_PINS_ENABLE EXPA1_03_PIN - #define LCD_PINS_D4 EXPA1_05_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) @@ -318,36 +318,36 @@ * EXP1 */ - #define BTN_EN1 EXPA1_08_PIN - #define BTN_EN2 EXPA1_06_PIN - #define BTN_ENC EXPA1_09_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN - #define DOGLCD_CS EXPA1_04_PIN - #define DOGLCD_A0 EXPA1_05_PIN - #define DOGLCD_SCK EXPA1_10_PIN - #define DOGLCD_MOSI EXPA1_03_PIN + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN EXPA1_04_PIN - #define TFT_A0_PIN EXPA1_03_PIN - #define TFT_DC_PIN EXPA1_03_PIN - #define TFT_MISO_PIN EXPA2_10_PIN - #define TFT_BACKLIGHT_PIN EXPA1_08_PIN - #define TFT_RESET_PIN EXPA1_07_PIN + #define TFT_CS_PIN EXPA1_04_PIN + #define TFT_A0_PIN EXPA1_03_PIN + #define TFT_DC_PIN EXPA1_03_PIN + #define TFT_MISO_PIN EXPA2_10_PIN + #define TFT_BACKLIGHT_PIN EXPA1_08_PIN + #define TFT_RESET_PIN EXPA1_07_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN EXPA1_05_PIN - #define TOUCH_CS_PIN EXPA1_06_PIN + #define TOUCH_INT_PIN EXPA1_05_PIN + #define TOUCH_CS_PIN EXPA1_06_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 // SPI 1 - #define SCK_PIN EXPA2_09_PIN - #define MISO_PIN EXPA2_10_PIN - #define MOSI_PIN EXPA2_05_PIN + #define SCK_PIN EXPA2_09_PIN + #define MISO_PIN EXPA2_10_PIN + #define MOSI_PIN EXPA2_05_PIN // Disable any LCD related PINs config #define LCD_PINS_ENABLE -1 @@ -358,72 +358,72 @@ #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXPA2_08_PIN + #define TFTGLCD_CS EXPA2_08_PIN #endif - #define SD_DETECT_PIN EXPA2_04_PIN + #define SD_DETECT_PIN EXPA2_04_PIN #else - #define BTN_ENC EXPA1_09_PIN // (58) open-drain - #define LCD_PINS_RS EXPA1_07_PIN + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_07_PIN - #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4 - #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4 + #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4 - #define LCD_PINS_ENABLE EXPA1_08_PIN - #define LCD_PINS_D4 EXPA1_06_PIN + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN - #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4 + #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4 #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant) + #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant) #endif #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXPA1_08_PIN - #define DOGLCD_A0 EXPA1_07_PIN - #define DOGLCD_SCK EXPA2_09_PIN - #define DOGLCD_MOSI EXPA2_05_PIN + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN EXPA1_05_PIN + #define RGB_LED_R_PIN EXPA1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXPA1_04_PIN + #define RGB_LED_G_PIN EXPA1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXPA1_03_PIN + #define RGB_LED_B_PIN EXPA1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXPA1_05_PIN + #define NEOPIXEL_PIN EXPA1_05_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXPA1_05_PIN - #define DOGLCD_A0 EXPA1_04_PIN - #define DOGLCD_SCK EXPA2_09_PIN - #define DOGLCD_MOSI EXPA2_05_PIN + #define DOGLCD_CS EXPA1_05_PIN + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define FORCE_SOFT_SPI #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXPA1_05_PIN - #define LCD_PINS_D6 EXPA1_04_PIN - #define LCD_PINS_D7 EXPA1_03_PIN + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder + #define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 867b6b687136..a75eb6ae5d8f 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -33,8 +33,8 @@ // https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT //#define HAS_BTT_EXP_MOT 1 -#if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT) - #if EITHER(CR10_STOCKDISPLAY,ENDER2_STOCKDISPLAY) +#if BOTH(HAS_WIRED_LCD, HAS_BTT_EXP_MOT) + #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) #define EXP_MOT_USE_EXP2_ONLY #else #error "Having a LCD that uses both EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possible." @@ -129,56 +129,60 @@ #endif #if HAS_BTT_EXP_MOT -/* _____ _____ - * NC | · · | GND NC | · · | GND - * NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN) - * (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG) - * (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG) - * (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG) - * ----- ----- - * EXP2 EXP1 - * - * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN - */ + + /** _____ _____ + * NC | · · | GND NC | · · | GND + * NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN) + * (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG) + * (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG) + * (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG) + * ----- ----- + * EXP2 EXP1 + * + * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN + */ // M1 on Driver Expansion Module - #define E2_STEP_PIN EXPA2_05_PIN - #define E2_DIR_PIN EXPA2_06_PIN - #define E2_ENABLE_PIN EXPA2_04_PIN + #define E2_STEP_PIN EXPA2_05_PIN + #define E2_DIR_PIN EXPA2_06_PIN + #define E2_ENABLE_PIN EXPA2_04_PIN #ifndef EXP_MOT_USE_EXP2_ONLY - #define E2_DIAG_PIN EXPA1_06_PIN - #define E2_CS_PIN EXPA1_05_PIN + #define E2_DIAG_PIN EXPA1_06_PIN + #define E2_CS_PIN EXPA1_05_PIN #if HAS_TMC_UART - #define E2_SERIAL_TX_PIN EXPA1_05_PIN - #define E2_SERIAL_RX_PIN EXPA1_05_PIN + #define E2_SERIAL_TX_PIN EXPA1_05_PIN + #define E2_SERIAL_RX_PIN EXPA1_05_PIN #endif #endif + // M2 on Driver Expansion Module - #define E3_STEP_PIN EXPA2_08_PIN - #define E3_DIR_PIN EXPA2_07_PIN + #define E3_STEP_PIN EXPA2_08_PIN + #define E3_DIR_PIN EXPA2_07_PIN #ifndef EXP_MOT_USE_EXP2_ONLY - #define E3_ENABLE_PIN EXPA1_03_PIN - #define E3_DIAG_PIN EXPA1_08_PIN - #define E3_CS_PIN EXPA1_07_PIN + #define E3_ENABLE_PIN EXPA1_03_PIN + #define E3_DIAG_PIN EXPA1_08_PIN + #define E3_CS_PIN EXPA1_07_PIN #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXPA1_07_PIN - #define E3_SERIAL_RX_PIN EXPA1_07_PIN + #define E3_SERIAL_TX_PIN EXPA1_07_PIN + #define E3_SERIAL_RX_PIN EXPA1_07_PIN #endif #else - #define E3_ENABLE_PIN EXPA2_04_PIN + #define E3_ENABLE_PIN EXPA2_04_PIN #endif + // M3 on Driver Expansion Module - #define E4_STEP_PIN EXPA2_10_PIN - #define E4_DIR_PIN EXPA2_09_PIN + #define E4_STEP_PIN EXPA2_10_PIN + #define E4_DIR_PIN EXPA2_09_PIN #ifndef EXP_MOT_USE_EXP2_ONLY - #define E4_ENABLE_PIN EXPA1_04_PIN - #define E4_DIAG_PIN EXPA1_10_PIN - #define E4_CS_PIN EXPA1_09_PIN + #define E4_ENABLE_PIN EXPA1_04_PIN + #define E4_DIAG_PIN EXPA1_10_PIN + #define E4_CS_PIN EXPA1_09_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXPA1_09_PIN - #define E4_SERIAL_RX_PIN EXPA1_09_PIN + #define E4_SERIAL_TX_PIN EXPA1_09_PIN + #define E4_SERIAL_RX_PIN EXPA1_09_PIN #endif #else - #define E4_ENABLE_PIN EXPA2_04_PIN + #define E4_ENABLE_PIN EXPA2_04_PIN #endif + #endif // HAS_BTT_EXP_MOT diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index 60bb18204a4e..1a396b20f403 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 4257b2c40e1e..0c79f108f71b 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index a7c06cb99dae..44be73029d8e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h index 5b51ece07f08..d51aaa956a8b 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index 715fd89db813..f65e1d5474b5 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index e3065439d7eb..48943ad973f9 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/platformio.ini b/platformio.ini index a8b81d755e34..e2f1388efda3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1355,10 +1355,10 @@ extra_scripts = ${common.extra_scripts} # MKS Robin Pro V2 # [env:mks_robin_pro2] -platform = ${common_stm32.platform} -extends = common_stm32 -build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DARDUINO_BLACK_F407VE -board = genericSTM32F407VET6 +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DARDUINO_BLACK_F407VE +board = genericSTM32F407VET6 board_build.core = stm32 board_build.variant = MARLIN_F407VE board_build.ldscript = ldscript.ld From 2a4f8acd628254b1a75486b5caf9967511c0c7d5 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 8 Dec 2020 22:12:42 -0800 Subject: [PATCH 311/443] Clarify Delta & SCARA config location (#20403) --- Marlin/Configuration.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ebc3311d9eda..0f92f1141864 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -56,15 +56,15 @@ //=========================================================================== //============================= DELTA Printer =============================== //=========================================================================== -// For a Delta printer start with one of the configuration files in the -// config/examples/delta directory and customize for your machine. +// For a Delta printer, start with one of the configuration files in the config/examples/delta directory +// from https://github.com/MarlinFirmware/Configurations/branches/all and customize for your machine. // //=========================================================================== //============================= SCARA Printer =============================== //=========================================================================== -// For a SCARA printer start with the configuration files in -// config/examples/SCARA and customize for your machine. +// For a SCARA printer, start with one of the configuration files in the config/examples/SCARA directory +// from https://github.com/MarlinFirmware/Configurations/branches/all and customize for your machine. // // @section info From edb2a83e71105c67982a099b86578bf60ddd7b96 Mon Sep 17 00:00:00 2001 From: swissnorp <67485708+swissnorp@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:06:50 +0100 Subject: [PATCH 312/443] Allow positive Z nozzle to probe offset (#20344) * Allow a positive value for z offset from nozzle to probe without sanity checks * Simplify menu_probe_offset.cpp (HOMING_Z_WITH_PROBE) * Add some more explanation to Configuration Files * Raise after probe_at_point as if homed Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith --- Marlin/Configuration.h | 14 ++++++++++++-- Marlin/Configuration_adv.h | 3 ++- Marlin/src/inc/SanityCheck.h | 6 ------ Marlin/src/lcd/menu/menu_probe_offset.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0f92f1141864..d528a97bf783 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -954,10 +954,20 @@ /** * Nozzle-to-Probe offsets { X, Y, Z } * - * - Use a caliper or ruler to measure the distance from the tip of + * X and Y offset + * Use a caliper or ruler to measure the distance from the tip of * the Nozzle to the center-point of the Probe in the X and Y axes. + * + * Z offset * - For the Z offset use your best known value and adjust at runtime. - * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. + * - Common probes trigger below the nozzle and have negative values for Z offset. + * - Probes triggering above the nozzle height are uncommon but do exist. When using + * probes such as this, carefully set Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES + * to avoid collisions during probing. + * + * Tune and Adjust + * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. + * - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset. * * Assuming the typical work area orientation: * - Probe to RIGHT of the Nozzle has a Positive X offset diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 92de09eec9d2..f49749c045f5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1084,7 +1084,8 @@ #if ENABLED(PROBE_OFFSET_WIZARD) // // Enable to init the Probe Z-Offset when starting the Wizard. - // Use the estimated nozzle-to-probe Z offset, plus a little more. + // Use a height slightly above the estimated nozzle-to-probe Z offset. + // For example, with an offset of -5, consider a starting height of -4. // //#define PROBE_OFFSET_WIZARD_START_Z -4.0 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index eec9ff084464..36dc373ecc14 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1357,12 +1357,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); #else - static_assert(sanity_nozzle_to_probe_offset.z <= 0.25, - "Are you sure your Probe triggers above the nozzle? Set a negative Z value in the NOZZLE_TO_PROBE_OFFSET."); - #ifdef PROBE_OFFSET_WIZARD_START_Z - static_assert(PROBE_OFFSET_WIZARD_START_Z <= 0.25, - "Are you sure your Probe triggers above the nozzle? Set a negative value for PROBE_OFFSET_WIZARD_START_Z."); - #endif static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index f2b08afd79aa..8f87e82ae0ca 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -107,8 +107,8 @@ void probe_offset_wizard_menu() { ACTION_ITEM(MSG_BUTTON_CANCEL, []{ set_offset_and_go_back(z_offset_backup); - // If wizard-homing was done by probe with with PROBE_OFFSET_WIZARD_START_Z - #if EITHER(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) && defined(PROBE_OFFSET_WIZARD_START_Z) + // If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z + #if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z) set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction queue.inject_P(PSTR("G28Z")); #else // Otherwise do a Z clearance move like after Homing @@ -122,7 +122,7 @@ void probe_offset_wizard_menu() { void prepare_for_probe_offset_wizard() { if (ui.wait_for_move) return; - #if defined(PROBE_OFFSET_WIZARD_XY_POS) || NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) + #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); #ifndef PROBE_OFFSET_WIZARD_XY_POS @@ -133,7 +133,7 @@ void prepare_for_probe_offset_wizard() { // Probe for Z reference ui.wait_for_move = true; - z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true); + z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_RAISE, 0, true); ui.wait_for_move = false; #endif From 3e68e4b4185dfad5dfb4fb78400783c716edc52c Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Wed, 9 Dec 2020 04:29:33 -0600 Subject: [PATCH 313/443] Fix Spindle/Laser Control menu (#20347) --- Marlin/src/feature/spindle_laser.cpp | 2 +- Marlin/src/feature/spindle_laser.h | 11 ++++++---- Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/lcd/language/language_en.h | 13 ++++++------ Marlin/src/lcd/menu/menu.h | 2 ++ Marlin/src/lcd/menu/menu_main.cpp | 2 +- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 24 +++++++++++++--------- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 3b28b61b4944..3f6523478237 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -118,7 +118,7 @@ void SpindleLaser::apply_power(const uint8_t opwr) { // Set the spindle direction and apply immediately // Stop on direction change if SPINDLE_STOP_ON_DIR_CHANGE is enabled // - void SpindleLaser::set_direction(const bool reverse) { + void SpindleLaser::set_reverse(const bool reverse) { const bool dir_state = (reverse == SPINDLE_INVERT_DIR); // Forward (M3) HIGH when not inverted if (TERN0(SPINDLE_STOP_ON_DIR_CHANGE, enabled()) && READ(SPINDLE_DIR_PIN) != dir_state) disable(); WRITE(SPINDLE_DIR_PIN, dir_state); diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 74d06634a0ba..4d3c802411d7 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -57,7 +57,7 @@ class SpindleLaser { static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { constexpr cutter_cpower_t power_floor = TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0), power_range = SPEED_POWER_MAX - power_floor; - return unitPower ? round(100.0f * (cpwr - power_floor) / power_range) : 0; + return cpwr ? round(100.0f * (cpwr - power_floor) / power_range) : 0; } // Convert a cpower (e.g., SPEED_POWER_STARTUP) to unit power (upwr, upower), @@ -191,9 +191,11 @@ class SpindleLaser { } #if ENABLED(SPINDLE_CHANGE_DIR) - static void set_direction(const bool reverse); + static void set_reverse(const bool reverse); + static bool is_reverse() { return READ(SPINDLE_DIR_PIN) == SPINDLE_INVERT_DIR; } #else - static inline void set_direction(const bool) {} + static inline void set_reverse(const bool) {} + static bool is_reverse() { return false; } #endif static inline void disable() { isReady = false; set_enabled(false); } @@ -208,11 +210,12 @@ class SpindleLaser { else menuPower = cpwr_to_upwr(SPEED_POWER_STARTUP); unitPower = menuPower; - set_direction(reverse); + set_reverse(reverse); set_enabled(true); } FORCE_INLINE static void enable_forward() { enable_with_dir(false); } FORCE_INLINE static void enable_reverse() { enable_with_dir(true); } + FORCE_INLINE static void enable_same_dir() { enable_with_dir(is_reverse()); } #if ENABLED(SPINDLE_LASER_PWM) static inline void update_from_mpower() { diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 4ca103da5bac..711bb7e5e4a7 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -103,7 +103,7 @@ void GcodeSuite::M3_M4(const bool is_M4) { #endif planner.synchronize(); // Wait for previous movement commands (G0/G0/G2/G3) to complete before changing power - cutter.set_direction(is_M4); + cutter.set_reverse(is_M4); #if ENABLED(SPINDLE_LASER_PWM) if (parser.seenval('O')) { diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 0b96403b7285..ed9ad954f85e 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -107,16 +107,17 @@ namespace Language_en { #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preheat Custom"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Cooldown"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequency"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser Control"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); - PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindle Control"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Off"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle On"); - PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Power"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Pwr"); + PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Toggle Laser"); + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Toggle Spindle"); + PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Spindle Forward"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Reverse"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch Power On"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Switch Power Off"); PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrude"); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index cf2f6b163379..de11ee3a5af1 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -252,3 +252,5 @@ void _lcd_draw_homing(); extern uint8_t screen_history_depth; inline void clear_menu_history() { screen_history_depth = 0; } + +#define STICKY_SCREEN(S) []{ ui.defer_status_screen(); ui.goto_screen(S); } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 1b87e06cc808..968de3d4b82b 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -170,7 +170,7 @@ void menu_main() { } #if HAS_CUTTER - SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser); + SUBMENU(MSG_CUTTER(MENU), STICKY_SCREEN(menu_spindle_laser)); #endif #if HAS_TEMPERATURE diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index f1bf433c21ef..d5a291db740a 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -33,8 +33,10 @@ #include "../../feature/spindle_laser.h" void menu_spindle_laser() { - - const bool is_enabled = cutter.enabled() && cutter.isReady; + bool is_enabled = cutter.enabled() && cutter.isReady; + #if ENABLED(SPINDLE_CHANGE_DIR) + bool is_rev = cutter.is_reverse(); + #endif START_MENU(); BACK_ITEM(MSG_MAIN); @@ -46,18 +48,20 @@ cutter.mpower_min(), cutter.mpower_max(), cutter.update_from_mpower); #endif - if (is_enabled) - ACTION_ITEM(MSG_CUTTER(OFF), cutter.disable); - else { - ACTION_ITEM(MSG_CUTTER(ON), cutter.enable_forward); - #if ENABLED(SPINDLE_CHANGE_DIR) - ACTION_ITEM(MSG_SPINDLE_REVERSE, cutter.enable_reverse); - #endif - } + editable.state = is_enabled; + EDIT_ITEM(bool, MSG_CUTTER(TOGGLE), &is_enabled, []{ if (editable.state) cutter.disable(); else cutter.enable_same_dir(); }); + + #if ENABLED(SPINDLE_CHANGE_DIR) + if (!is_enabled) { + editable.state = is_rev; + ACTION_ITEM_P(is_rev ? GET_TEXT(MSG_CUTTER(REVERSE)) : GET_TEXT(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); }); + } + #endif #if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency); #endif + END_MENU(); } From f3bddc4e4eefbcf4dd6fee946b4b7d305ac50686 Mon Sep 17 00:00:00 2001 From: Marcio T Date: Wed, 9 Dec 2020 04:09:31 -0700 Subject: [PATCH 314/443] Fixes and additions to FTDI EVE Touch UI (#20393) - Fixed name conflict with "SUBSCRIPT_TWO" - Fixed rendering bugs in "Leveling Menu" - Only show "Bed Mesh Screen" when UBL is enabled - Removed CocoaPress code from generic "Main Menu" - Removed CocoaPress code from LulzBot Bio "Status" screen - Moved generic "Move Axis" functionality into a base class - Added CocoaPress custom screens: - Status Screen - Unload Cartridge - Load Chocolate - Main Menu - Advanced Settings - XYZ Move (based on "Move Axis" base class) - Extrusion Move (based on "Move Axis" base class) - CocoaPress tweaks to "Temperature" screen - Fix FTDI EVE Touch UI compilation errors when not using leveling. --- .../extended/unicode/western_char_set.cpp | 12 +- .../ftdi_eve_touch_ui/language/language_en.h | 24 +- .../screens/advanced_settings_menu.cpp | 2 +- .../screens/bed_mesh_screen.cpp | 2 +- .../screens/bio_status_screen.cpp | 177 +++------- .../cocoa_press_advanced_settings_menu.cpp | 102 ++++++ .../screens/cocoa_press_load_chocolate.cpp | 101 ++++++ .../screens/cocoa_press_main_menu.cpp | 89 +++++ .../screens/cocoa_press_move_e_screen.cpp | 62 ++++ .../screens/cocoa_press_move_xyz_screen.cpp | 53 +++ ..._menu.cpp => cocoa_press_preheat_menu.cpp} | 72 ++-- ...een.cpp => cocoa_press_preheat_screen.cpp} | 68 +++- .../screens/cocoa_press_status_screen.cpp | 307 ++++++++++++++++++ .../screens/cocoa_press_ui.h | 54 +++ .../screens/cocoa_press_unload_cartridge.cpp | 101 ++++++ .../screens/leveling_menu.cpp | 17 +- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 38 +-- .../screens/move_axis_screen.cpp | 10 +- .../lib/ftdi_eve_touch_ui/screens/screens.cpp | 4 + .../lib/ftdi_eve_touch_ui/screens/screens.h | 89 +++-- .../screens/temperature_screen.cpp | 19 +- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 4 +- .../screens/z_offset_screen.cpp | 2 +- 23 files changed, 1166 insertions(+), 243 deletions(-) create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp rename Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/{preheat_menu.cpp => cocoa_press_preheat_menu.cpp} (55%) rename Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/{preheat_timer_screen.cpp => cocoa_press_preheat_screen.cpp} (55%) create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp index 171637f03ab6..fc5d4de85dd2 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -71,9 +71,9 @@ YEN_SIGN, #endif #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) - SUPERSCRIPT_ONE, - SUPERSCRIPT_TWO, - SUPERSCRIPT_THREE, + SUPERSCRIPT_1, + SUPERSCRIPT_2, + SUPERSCRIPT_3, #endif #if ENABLED(TOUCH_UI_UTF8_ORDINALS) MASCULINE_ORDINAL, @@ -177,15 +177,15 @@ {UTF8('±'), 0 , NOT_SIGN, 32 }, #endif #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) - {UTF8('²'), 0 , SUPERSCRIPT_TWO, 16 }, - {UTF8('³'), 0 , SUPERSCRIPT_THREE, 16 }, + {UTF8('²'), 0 , SUPERSCRIPT_2, 16 }, + {UTF8('³'), 0 , SUPERSCRIPT_3, 16 }, #endif #if ENABLED(TOUCH_UI_UTF8_SYMBOLS) {UTF8('µ'), 0 , MICRON_SIGN, 28 }, {UTF8('¶'), 0 , PILCROW_SIGN, 24 }, #endif #if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) - {UTF8('¹'), 0 , SUPERSCRIPT_ONE, 16 }, + {UTF8('¹'), 0 , SUPERSCRIPT_1, 16 }, #endif #if ENABLED(TOUCH_UI_UTF8_ORDINALS) {UTF8('º'), 0 , MASCULINE_ORDINAL, 19 }, diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index 807c816307df..09ac965e4938 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -29,12 +29,6 @@ #define COPYRIGHT_SIGN u8"(c)" #endif -#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) - #define SUPERSCRIPT_TWO u8"²" -#else - #define SUPERSCRIPT_TWO u8"^2" -#endif - #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) #define DEGREE_SIGN u8"°" #else @@ -162,9 +156,21 @@ namespace Language_en { #endif #ifdef TOUCH_UI_COCOA_PRESS - PROGMEM Language_Str MSG_ZONE_1 = u8"Zone 1:"; - PROGMEM Language_Str MSG_ZONE_2 = u8"Zone 2:"; - PROGMEM Language_Str MSG_ZONE_3 = u8"Zone 3:"; + PROGMEM Language_Str MSG_BODY = u8"Body"; + PROGMEM Language_Str MSG_INTERNAL = u8"Internal"; + PROGMEM Language_Str MSG_EXTERNAL = u8"External"; + PROGMEM Language_Str MSG_CHOCOLATE = u8"Chocolate"; + PROGMEM Language_Str MSG_UNLOAD_CARTRIDGE = u8"Unload Cartridge"; + PROGMEM Language_Str MSG_LOAD_CHOCOLATE = u8"Load Chocolate"; + PROGMEM Language_Str MSG_CARTRIDGE_IN = u8"Cartridge In"; + PROGMEM Language_Str MSG_CARTRIDGE_OUT = u8"Cartridge Out"; + PROGMEM Language_Str MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished"; + PROGMEM Language_Str MSG_PREHEAT = u8"Preheat"; + PROGMEM Language_Str MSG_BUTTON_PAUSE = u8"Pause"; + PROGMEM Language_Str MSG_BUTTON_RESUME = u8"Resume"; + PROGMEM Language_Str MSG_ELAPSED_PRINT = u8"Elapsed Print"; + PROGMEM Language_Str MSG_XYZ_MOVE = u8"XYZ Move"; + PROGMEM Language_Str MSG_E_MOVE = u8"Extrusion Move"; #endif }; // namespace Language_en diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 3ffc88c385fb..431c60158193 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) +#if ENABLED(TOUCH_UI_FTDI_EVE) && NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS) #include "screens.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index c54a7e04b5e2..2cce884d3616 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -21,7 +21,7 @@ #include "../config.h" -#if BOTH(TOUCH_UI_FTDI_EVE, HAS_MESH) +#if BOTH(TOUCH_UI_FTDI_EVE, AUTO_BED_LEVELING_UBL) #include "screens.h" #include "screen_data.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index 2515732d43de..c95d2d1dba26 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -23,15 +23,13 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_LULZBOT_BIO) #include "screens.h" #include "../ftdi_eve_lib/extras/poly_ui.h" -#if ENABLED(TOUCH_UI_COCOA_PRESS) - #include "cocoa_press_ui.h" -#elif ENABLED(TOUCH_UI_PORTRAIT) +#if ENABLED(TOUCH_UI_PORTRAIT) #include "bio_printer_ui_portrait.h" #else #include "bio_printer_ui_landscape.h" @@ -72,55 +70,30 @@ void StatusScreen::draw_temperature(draw_mode_t what) { if (what & BACKGROUND) { cmd.cmd(COLOR_RGB(bg_color)); - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - // The LulzBot Bio shows the temperature for - // the bed. - - #ifdef TOUCH_UI_PORTRAIT - // Draw touch surfaces - ui.bounds(POLY(target_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - ui.bounds(POLY(actual_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - #else - ui.bounds(POLY(bed_temp), x, y, h, v); - cmd.rectangle(x, y, h, v); - #endif - ui.bounds(POLY(bed_icon), x, y, h, v); - cmd.rectangle(x, y, h, v); - - // Draw bed icon - cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) - .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) - .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) - .cmd(COLOR_RGB(shadow_rgb)) - .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2) - .cmd(COLOR_RGB(bg_text_enabled)) - .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); - #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) - // The CocoaPress shows the temperature for two - // heating zones, but has no bed temperature - - cmd.cmd(COLOR_RGB(bg_text_enabled)); - cmd.font(font_xsmall); + // The LulzBot Bio shows the temperature for + // the bed. - ui.bounds(POLY(h0_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_1)); - - ui.bounds(POLY(h1_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_2)); - - ui.bounds(POLY(h2_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_3)); - - ui.bounds(POLY(h3_label), x, y, h, v); - cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); + #ifdef TOUCH_UI_PORTRAIT + // Draw touch surfaces + ui.bounds(POLY(target_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); + ui.bounds(POLY(actual_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); #else - UNUSED(x); - UNUSED(y); - UNUSED(h); - UNUSED(v); + ui.bounds(POLY(bed_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); #endif + ui.bounds(POLY(bed_icon), x, y, h, v); + cmd.rectangle(x, y, h, v); + + // Draw bed icon + cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) + .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) + .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) + .cmd(COLOR_RGB(shadow_rgb)) + .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2) + .cmd(COLOR_RGB(bg_text_enabled)) + .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); #ifdef TOUCH_UI_USE_UTF8 load_utf8_bitmaps(cmd); // Restore font bitmap handles @@ -130,71 +103,29 @@ void StatusScreen::draw_temperature(draw_mode_t what) { if (what & FOREGROUND) { char str[15]; cmd.cmd(COLOR_RGB(bg_text_enabled)); - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - cmd.font(font_medium); - - #ifdef TOUCH_UI_PORTRAIT - if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) - format_temp(str, getTargetTemp_celsius(BED)); - else - strcpy_P(str, GET_TEXT(MSG_BED)); - - ui.bounds(POLY(target_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - format_temp(str, getActualTemp_celsius(BED)); - ui.bounds(POLY(actual_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - #else - if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) - format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); - else - format_temp_and_idle(str, getActualTemp_celsius(BED)); - - ui.bounds(POLY(bed_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - #endif - - #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) - // The CocoaPress shows the temperature for two - // heating zones, but has no bed temperature - - cmd.font(font_large); - - if (!isHeaterIdle(E0) && getTargetTemp_celsius(E0) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E0), getTargetTemp_celsius(E0)); - else - format_temp_and_idle(str, getActualTemp_celsius(E0)); + cmd.font(font_medium); - ui.bounds(POLY(h0_temp), x, y, h, v); - cmd.text(x, y, h, v, str); - - if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E1), getTargetTemp_celsius(E1)); + #ifdef TOUCH_UI_PORTRAIT + if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) + format_temp(str, getTargetTemp_celsius(BED)); else - format_temp_and_idle(str, getActualTemp_celsius(E1)); + strcpy_P(str, GET_TEXT(MSG_BED)); - ui.bounds(POLY(h1_temp), x, y, h, v); + ui.bounds(POLY(target_temp), x, y, h, v); cmd.text(x, y, h, v, str); - if (!isHeaterIdle(E2) && getTargetTemp_celsius(E2) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E2), getTargetTemp_celsius(E2)); - else - format_temp_and_idle(str, getActualTemp_celsius(E2)); - - ui.bounds(POLY(h2_temp), x, y, h, v); + format_temp(str, getActualTemp_celsius(BED)); + ui.bounds(POLY(actual_temp), x, y, h, v); cmd.text(x, y, h, v, str); - - if (!isHeaterIdle(CHAMBER) && getTargetTemp_celsius(CHAMBER) > 0) - format_temp_and_temp(str, getActualTemp_celsius(CHAMBER), getTargetTemp_celsius(CHAMBER)); + #else + if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) + format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); else - format_temp_and_idle(str, getActualTemp_celsius(CHAMBER)); + format_temp_and_idle(str, getActualTemp_celsius(BED)); - ui.bounds(POLY(h3_temp), x, y, h, v); + ui.bounds(POLY(bed_temp), x, y, h, v); cmd.text(x, y, h, v, str); - #else - UNUSED(str); - #endif + #endif } } @@ -207,7 +138,7 @@ void StatusScreen::draw_syringe(draw_mode_t what) { 0.75 #endif ); - const bool e_homed = TERN0(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0)); + const bool e_homed = TERN1(TOUCH_UI_LULZBOT_BIO, isAxisPositionKnown(E0)); CommandProcessor cmd; PolyUI ui(cmd, what); @@ -247,7 +178,7 @@ void StatusScreen::draw_arrows(draw_mode_t what) { ui.button_stroke(stroke_rgb, 28); ui.button_shadow(shadow_rgb, shadow_depth); - constexpr uint8_t style = TERN(TOUCH_UI_COCOA_PRESS, PolyUI::FILL | PolyUI::SHADOW, PolyUI::REGULAR); + constexpr uint8_t style = PolyUI::REGULAR; if ((what & BACKGROUND) || jog_xy) { ui.button(1, POLY(x_neg), style); @@ -262,9 +193,7 @@ void StatusScreen::draw_arrows(draw_mode_t what) { } if ((what & BACKGROUND) || e_homed) { - #if DISABLED(TOUCH_UI_COCOA_PRESS) - ui.button(7, POLY(e_neg), style); - #endif + ui.button(7, POLY(e_neg), style); ui.button(8, POLY(e_pos), style); } } @@ -304,11 +233,11 @@ void StatusScreen::draw_overlay_icons(draw_mode_t what) { PolyUI ui(cmd, what); if (what & FOREGROUND) { - ui.button_fill (TERN(TOUCH_UI_COCOA_PRESS, stroke_rgb, fill_rgb)); + ui.button_fill (fill_rgb); ui.button_stroke(stroke_rgb, 28); ui.button_shadow(shadow_rgb, shadow_depth); - constexpr uint8_t style = TERN(TOUCH_UI_COCOA_PRESS, PolyUI::FILL | PolyUI::SHADOW, PolyUI::REGULAR); + constexpr uint8_t style = PolyUI::REGULAR; if (!jog_xy) ui.button(12, POLY(padlock), style); if (!e_homed) ui.button(13, POLY(home_e), style); if (!z_homed) ui.button(14, POLY(home_z), style); @@ -389,9 +318,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { break; case 9: GOTO_SCREEN(FilesScreen); break; case 10: GOTO_SCREEN(MainMenu); break; - #if ENABLED(TOUCH_UI_LULZBOT_BIO) - case 13: GOTO_SCREEN(BioConfirmHomeE); break; - #endif + case 13: GOTO_SCREEN(BioConfirmHomeE); break; case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; case 15: GOTO_SCREEN(TemperatureScreen); break; case 16: fine_motion = !fine_motion; break; @@ -431,19 +358,11 @@ bool StatusScreen::onTouchHeld(uint8_t tag) { } void StatusScreen::setStatusMessage(progmem_str pstr) { - #ifdef TOUCH_UI_LULZBOT_BIO - BioPrintingDialogBox::setStatusMessage(pstr); - #else - UNUSED(pstr); - #endif + BioPrintingDialogBox::setStatusMessage(pstr); } void StatusScreen::setStatusMessage(const char * const str) { - #ifdef TOUCH_UI_LULZBOT_BIO - BioPrintingDialogBox::setStatusMessage(str); - #else - UNUSED(str); - #endif + BioPrintingDialogBox::setStatusMessage(str); } void StatusScreen::onIdle() { @@ -451,10 +370,8 @@ void StatusScreen::onIdle() { if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { if (!EventLoop::is_touch_held()) onRefresh(); - #ifdef TOUCH_UI_LULZBOT_BIO - if (isPrintingFromMedia()) - BioPrintingDialogBox::show(); - #endif + if (isPrintingFromMedia()) + BioPrintingDialogBox::show(); refresh_timer.start(); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp new file mode 100644 index 000000000000..23314d5c2740 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp @@ -0,0 +1,102 @@ +/***************************************** + * cocoa_press_advance_settings_menu.cpp * + *****************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_ROWS 4 +#define GRID_COLS 3 +#define STEPS_PER_MM_POS BTN_POS(1,1), BTN_SIZE(1,1) +#define TMC_CURRENT_POS BTN_POS(2,1), BTN_SIZE(1,1) +#define LIN_ADVANCE_POS BTN_POS(3,1), BTN_SIZE(1,1) +#define VELOCITY_POS BTN_POS(1,2), BTN_SIZE(1,1) +#define ACCELERATION_POS BTN_POS(2,2), BTN_SIZE(1,1) +#define JERK_POS BTN_POS(3,2), BTN_SIZE(1,1) +#define DISPLAY_POS BTN_POS(1,3), BTN_SIZE(1,1) +#define INTERFACE_POS BTN_POS(2,3), BTN_SIZE(1,1) +#define ENDSTOPS_POS BTN_POS(3,3), BTN_SIZE(1,1) +#define CASE_LIGHT_POS BTN_POS(1,4), BTN_SIZE(1,1) +#define RESTORE_DEFAULTS_POS BTN_POS(2,4), BTN_SIZE(1,1) +#define BACK_POS BTN_POS(3,4), BTN_SIZE(1,1) + +void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + .tag(2) .button( STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) + .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) + .tag(3) .button( TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) + .enabled(ENABLED(LIN_ADVANCE)) + .tag(4) .button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) + .tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) + .tag(7) .button( JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) + .tag(8) .button( ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(9) .button( INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) + .tag(10).button( DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) + .enabled(ENABLED(CASE_LIGHT_ENABLE)) + .tag(11).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(12).button( RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) + .colors(action_btn) + .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + } +} + +bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: GOTO_SCREEN(StepsScreen); break; + #if HAS_TRINAMIC_CONFIG + case 3: GOTO_SCREEN(StepperCurrentScreen); break; + #endif + #if ENABLED(LIN_ADVANCE) + case 4: GOTO_SCREEN(LinearAdvanceScreen); break; + #endif + case 5: GOTO_SCREEN(MaxVelocityScreen); break; + case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; + case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break; + case 8: GOTO_SCREEN(EndstopStatesScreen); break; + case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; + case 10: GOTO_SCREEN(DisplayTuningScreen); break; + #if ENABLED(CASE_LIGHT_ENABLE) + case 11: GOTO_SCREEN(CaseLightScreen); break; + #endif + case 12: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; + default: return false; + } + return true; +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp new file mode 100644 index 000000000000..36dc3404b90d --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_load_chocolate.cpp @@ -0,0 +1,101 @@ +/************************************ + * cocoa_press_unload_cartridge.cpp * + ************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2020 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && ENABLED(TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +using namespace ExtUI; +using namespace FTDI; +using namespace Theme; + +#define GRID_COLS 2 +#define GRID_ROWS 6 + +#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) +#define DESCRIPTION_POS BTN_POS(1,2), BTN_SIZE(2,3) +#define CARTRIDGE_OUT_BTN_POS BTN_POS(1,5), BTN_SIZE(1,1) +#define CARTRIDGE_IN_BTN_POS BTN_POS(2,5), BTN_SIZE(1,1) +#define BACK_BTN_POS BTN_POS(1,6), BTN_SIZE(2,1) + +void LoadChocolateScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + .font(font_large) + .text(TITLE_POS, GET_TEXT_F(MSG_LOAD_CHOCOLATE)); + draw_text_box(cmd, DESCRIPTION_POS, F( + "Drop your chocolate refill into the cartridge. " + "Press and hold the Cartridge Out button until " + "the plunger adapter is visible at the bottom of " + "the extruder. Securely attach a red plunger to " + "the plunger adapter and load the cartridge onto " + "the plunger. Press and hold Cartridge In button " + "until cartridge is fully loaded into the extruder, " + "and use the buttons to help follow the locking path " + "to lock"), + OPT_CENTERY, font_medium); + } + + if (what & FOREGROUND) { + cmd.font(font_medium) + .colors(normal_btn) + .tag(2).button(CARTRIDGE_OUT_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_OUT)) + .tag(3).button(CARTRIDGE_IN_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_IN)) + .colors(action_btn) + .tag(1).button(BACK_BTN_POS, GET_TEXT_F(MSG_BACK)); + } +} + +bool LoadChocolateScreen::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + } + return true; +} + +bool LoadChocolateScreen::onTouchHeld(uint8_t tag) { + if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate + constexpr float increment = 0.25; + MoveAxisScreen::setManualFeedrate(E0, increment); + #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); + #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); + switch (tag) { + case 2: UI_DECREMENT_AXIS(E0); break; + case 3: UI_INCREMENT_AXIS(E0); break; + default: return false; + } + #undef UI_DECREMENT_AXIS + #undef UI_INCREMENT_AXIS + return false; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp new file mode 100644 index 000000000000..da095eaab65f --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp @@ -0,0 +1,89 @@ +/***************************** + * cocoa_press_main_menu.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +#define GRID_ROWS 4 +#define GRID_COLS 2 + +#define MOVE_XYZ_POS BTN_POS(1,1), BTN_SIZE(1,1) +#define TEMPERATURE_POS BTN_POS(2,1), BTN_SIZE(1,1) +#define ZPROBE_ZOFFSET_POS BTN_POS(1,2), BTN_SIZE(1,1) +#define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1) +#define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1) +#define ADVANCED_SETTINGS_POS BTN_POS(2,3), BTN_SIZE(1,1) +#define ABOUT_PRINTER_POS BTN_POS(1,4), BTN_SIZE(1,1) +#define BACK_POS BTN_POS(2,4), BTN_SIZE(1,1) + +void MainMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + .tag(2).button( MOVE_XYZ_POS, GET_TEXT_F(MSG_XYZ_MOVE)) + .tag(3).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE)) + .tag(4).button( ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + .tag(5).button( MOVE_E_POS, GET_TEXT_F(MSG_E_MOVE)) + .tag(6).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(7).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag(8).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) + .colors(action_btn) + .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + } +} + +bool MainMenu::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: GOTO_SCREEN(MoveXYZScreen); break; + case 3: GOTO_SCREEN(TemperatureScreen); break; + #if BOTH(HAS_LEVELING, HAS_BED_PROBE) + case 4: GOTO_SCREEN(ZOffsetScreen); break; + #endif + case 5: GOTO_SCREEN(MoveEScreen); break; + case 6: GOTO_SCREEN(FeedratePercentScreen); break; + case 7: GOTO_SCREEN(AdvancedSettingsMenu); break; + case 8: GOTO_SCREEN(AboutScreen); break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp new file mode 100644 index 000000000000..6e2b4adc3936 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_e_screen.cpp @@ -0,0 +1,62 @@ +/********************************* + * cocoa_press_move_e_screen.cpp * + *********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace ExtUI; + +void MoveEScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(1); + w.units(GET_TEXT_F(MSG_UNITS_MM)); + w.heading( GET_TEXT_F(MSG_E_MOVE)); + w.color(Theme::e_axis); + #if EXTRUDERS == 1 + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + #elif HAS_MULTI_EXTRUDER + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); + #if EXTRUDERS > 2 + w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxisScreen.e_rel[2], canMove(E2)); + #endif + #if EXTRUDERS > 3 + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxisScreen.e_rel[3], canMove(E3)); + #endif + #endif + w.increments(); +} + +void MoveEScreen::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp new file mode 100644 index 000000000000..52a70448cd38 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_move_xyz_screen.cpp @@ -0,0 +1,53 @@ +/************************************ + * cocoa_press_move_xyz_screen.cpp * + ************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace ExtUI; + +void MoveXYZScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(1); + w.units(GET_TEXT_F(MSG_UNITS_MM)); + w.heading( GET_TEXT_F(MSG_XYZ_MOVE)); + w.home_buttons(20); + w.color(Theme::x_axis).adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisPosition_mm(X), canMove(X)); + w.color(Theme::y_axis).adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisPosition_mm(Y), canMove(Y)); + w.color(Theme::z_axis).adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisPosition_mm(Z), canMove(Z)); + w.increments(); +} + +void MoveXYZScreen::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp similarity index 55% rename from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp rename to Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp index 03f9e2c46593..476c5e468bf0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp @@ -1,6 +1,6 @@ -/******************** - * preheat_menu.cpp * - ********************/ +/******************************** + * cocoa_press_preheat_menu.cpp * + ********************************/ /**************************************************************************** * Written By Marcio Teixeira 2020 - Cocoa Press * @@ -29,28 +29,40 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; +#define GRID_ROWS 5 +#define GRID_COLS 2 + void PreheatMenu::onRedraw(draw_mode_t what) { + const int16_t w = has_extra_heater() ? BTN_W(1) : BTN_W(2); + const int16_t h = BTN_H(1); + if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) .cmd(CLEAR(true,true,true)) - .tag(0); + .tag(0) + .cmd(COLOR_RGB(bg_text_enabled)) + .font(Theme::font_medium) + .text ( BTN_POS(1,1), w, h, GET_TEXT_F(MSG_INTERNAL)); + if (has_extra_heater()) { + cmd.text( BTN_POS(2,1), w, h, GET_TEXT_F(MSG_EXTERNAL)); + } } - #define GRID_ROWS 3 - #define GRID_COLS 2 - if (what & FOREGROUND) { CommandProcessor cmd; - cmd.cmd(COLOR_RGB(bg_text_enabled)) - .font(Theme::font_medium) - .text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_PREHEAT_1)) + cmd.font(Theme::font_medium) .colors(normal_btn) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Dark Chocolate")) - .tag(3).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Milk Chocolate")) - .tag(4).button( BTN_POS(1,3), BTN_SIZE(1,1), F("White Chocolate")) - .colors(action_btn) - .tag(1) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); + .tag(2).button( BTN_POS(1,2), w, h, F("Dark Chocolate")) + .tag(3).button( BTN_POS(1,3), w, h, F("Milk Chocolate")) + .tag(4).button( BTN_POS(1,4), w, h, F("White Chocolate")); + if (has_extra_heater()) { + cmd.tag(5).button( BTN_POS(2,2), w, h, F("Dark Chocolate")) + .tag(6).button( BTN_POS(2,3), w, h, F("Milk Chocolate")) + .tag(7).button( BTN_POS(2,4), w, h, F("White Chocolate")); + } + cmd.colors(action_btn) + .tag(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); } } @@ -58,20 +70,38 @@ bool PreheatMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; case 2: - #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT - injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 3: - #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT - injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 4: - #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT - injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT)); + #endif + GOTO_SCREEN(PreheatTimerScreen); + break; + case 5: + #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT)); + #endif + GOTO_SCREEN(PreheatTimerScreen); + break; + case 6: + #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT)); + #endif + GOTO_SCREEN(PreheatTimerScreen); + break; + case 7: + #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp similarity index 55% rename from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp rename to Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp index c3110b77dc65..1aad1f5b4cc9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp @@ -33,7 +33,14 @@ using namespace ExtUI; using namespace Theme; #define GRID_COLS 2 -#define GRID_ROWS 5 +#define GRID_ROWS 8 + +#define HEADER_POS BTN_POS(2,1), BTN_SIZE(1,2) +#define NOZZLE_ADJ_POS BTN_POS(2,3), BTN_SIZE(1,2) +#define BODY_ADJ_POS BTN_POS(2,5), BTN_SIZE(1,2) +#define CHAMBER_ADJ_POS BTN_POS(2,7), BTN_SIZE(1,2) +#define PROGRESS_POS BTN_POS(1,1), BTN_SIZE(1,7) +#define BACK_POS BTN_POS(1,8), BTN_SIZE(1,1) void PreheatTimerScreen::draw_message(draw_mode_t what) { if (what & BACKGROUND) { @@ -42,7 +49,7 @@ void PreheatTimerScreen::draw_message(draw_mode_t what) { .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .tag(0); - draw_text_box(cmd, BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large); + draw_text_box(cmd, HEADER_POS, GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large); } } @@ -62,7 +69,7 @@ void PreheatTimerScreen::draw_time_remaining(draw_mode_t what) { CommandProcessor cmd; cmd.font(font_xlarge); - draw_circular_progress(cmd, BTN_POS(1,1), BTN_SIZE(1,5), float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest); + draw_circular_progress(cmd, PROGRESS_POS, float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest); } } @@ -71,10 +78,45 @@ void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(font_medium) - .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Cancel")); + .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); } } +void PreheatTimerScreen::draw_adjuster(draw_mode_t what, uint8_t tag, progmem_str label, float value, int16_t x, int16_t y, int16_t w, int16_t h) { + #define SUB_COLS 9 + #define SUB_ROWS 2 + #define SUB_GRID_W(W) ((W)*w/SUB_COLS) + #define SUB_GRID_H(H) ((H)*h/SUB_ROWS) + #define SUB_GRID_X(X) (SUB_GRID_W((X)-1) + x) + #define SUB_GRID_Y(Y) (SUB_GRID_H((Y)-1) + y) + #define SUB_X(X) (SUB_GRID_X(X) + MARGIN_L) + #define SUB_Y(Y) (SUB_GRID_Y(Y) + MARGIN_T) + #define SUB_W(W) (SUB_GRID_W(W) - MARGIN_L - MARGIN_R) + #define SUB_H(H) (SUB_GRID_H(H) - MARGIN_T - MARGIN_B) + #define SUB_POS(X,Y) SUB_X(X), SUB_Y(Y) + #define SUB_SIZE(W,H) SUB_W(W), SUB_H(H) + + CommandProcessor cmd; + cmd.tag(0) + .font(font_small); + if (what & BACKGROUND) { + cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) + .button( SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); + } + + if (what & FOREGROUND) { + char str[32]; + dtostrf(value, 5, 1, str); + strcat_P(str, PSTR(" ")); + strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C)); + + cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str) + .font(font_medium) + .tag(tag ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-")) + .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+")); + } +} + void PreheatTimerScreen::onEntry() { screen_data.PreheatTimerScreen.start_ms = millis(); } @@ -83,6 +125,24 @@ void PreheatTimerScreen::onRedraw(draw_mode_t what) { draw_message(what); draw_time_remaining(what); draw_interaction_buttons(what); + draw_adjuster(what, 1, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0), NOZZLE_ADJ_POS); + draw_adjuster(what, 3, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1), BODY_ADJ_POS); + draw_adjuster(what, 5, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); +} + +bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { + const float increment = (tag == 5 || tag == 6) ? 1 : 0.1; + switch (tag) { + case 1: UI_DECREMENT(TargetTemp_celsius, E0); break; + case 2: UI_INCREMENT(TargetTemp_celsius, E0); break; + case 3: UI_DECREMENT(TargetTemp_celsius, E1); break; + case 4: UI_INCREMENT(TargetTemp_celsius, E1); break; + case 5: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; + case 6: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + default: + return false; + } + return true; } bool PreheatTimerScreen::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp new file mode 100644 index 000000000000..e3310abaa775 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp @@ -0,0 +1,307 @@ +/********************************* + * cocoa_press_status_screen.cpp * + *********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" + +#include "../ftdi_eve_lib/extras/poly_ui.h" + +#include "cocoa_press_ui.h" + +#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) + +const uint8_t shadow_depth = 5; + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +float StatusScreen::increment; + +void StatusScreen::loadBitmaps() { + constexpr uint32_t base = ftdi_memory_map::RAM_G; + + // Load fonts for internationalization + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_data(base + UTF8_FONT_OFFSET); + #endif +} + +void StatusScreen::draw_progress(draw_mode_t what) { + CommandProcessor cmd; + PolyUI ui(cmd, what); + + int16_t x, y, h, v; + + cmd.cmd(COLOR_RGB(accent_color_1)); + cmd.font(font_medium); + + if (what & BACKGROUND) { + ui.bounds(POLY(print_time_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_ELAPSED_PRINT)); + } + + if (what & FOREGROUND) { + const uint32_t elapsed = getProgress_seconds_elapsed(); + const uint8_t hrs = elapsed/3600; + const uint8_t min = (elapsed/60)%60; + + char str[10]; + sprintf_P(str, PSTR(" %02d : %02d"), hrs, min); + ui.bounds(POLY(print_time_hms), x, y, h, v); + cmd.text(x, y, h, v, str); + + sprintf_P(str, PSTR("%-3d%%"), getProgress_percent() ); + ui.bounds(POLY(print_time_percent), x, y, h, v); + cmd.text(x, y, h, v, str); + } +} + +void StatusScreen::draw_temperature(draw_mode_t what) { + CommandProcessor cmd; + PolyUI ui(cmd, what); + + int16_t x, y, h, v; + + if (what & BACKGROUND) { + cmd.cmd(COLOR_RGB(bg_color)); + + cmd.cmd(COLOR_RGB(fluid_rgb)); + cmd.font(font_medium); + + ui.bounds(POLY(chocolate_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHOCOLATE)); + + ui.bounds(POLY(h0_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_NOZZLE)); + + ui.bounds(POLY(h1_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_BODY)); + + #if ENABLED(COCOA_PRESS_EXTRA_HEATER) + if (has_extra_heater()) { + ui.bounds(POLY(h2_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_EXTERNAL)); + } + #endif + + ui.bounds(POLY(h3_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); + + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); // Restore font bitmap handles + #endif + } + + if (what & FOREGROUND) { + char str[15]; + cmd.cmd(COLOR_RGB(fluid_rgb)); + + cmd.font(font_large); + + format_temp(str, getActualTemp_celsius(E0)); + ui.bounds(POLY(h0_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + format_temp(str, getActualTemp_celsius(E1)); + ui.bounds(POLY(h1_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + #if ENABLED(COCOA_PRESS_EXTRA_HEATER) + if (has_extra_heater()) { + format_temp(str, getActualTemp_celsius(E2)); + ui.bounds(POLY(h2_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + } + #endif + + format_temp(str, getActualTemp_celsius(CHAMBER)); + ui.bounds(POLY(h3_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + } +} + +void StatusScreen::draw_syringe(draw_mode_t what) { + #if NUM_SERVOS < 2 + // Note, this requires a new pin 108 to be added to to access ADC9 + // "ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/variant.cpp" + const int val = analogRead(108); + const float fill_level = float(val) / 1024; + #else + constexpr float fill_level = 1.0f; + #endif + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + if (what & BACKGROUND) { + // Paint the shadow for the syringe + ui.color(shadow_rgb); + ui.shadow(POLY(syringe_outline), shadow_depth); + } + + if (what & FOREGROUND) { + int16_t x, y, h, v; + + // Paint the syringe icon + ui.color(syringe_rgb); + ui.fill(POLY(syringe_outline)); + + ui.color(fluid_rgb); + ui.bounds(POLY(syringe_fluid), x, y, h, v); + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(SCISSOR_XY(x,y + v * (1.0 - fill_level))); + cmd.cmd(SCISSOR_SIZE(h, v * fill_level)); + ui.fill(POLY(syringe_fluid), false); + cmd.cmd(RESTORE_CONTEXT()); + + ui.color(stroke_rgb); + ui.fill(POLY(syringe)); + } +} + +void StatusScreen::draw_buttons(draw_mode_t what) { + int16_t x, y, h, v; + + const bool can_print = isMediaInserted() && !isPrintingFromMedia(); + const bool sdOrHostPrinting = ExtUI::isPrinting(); + const bool sdOrHostPaused = ExtUI::isPrintingPaused(); + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + ui.bounds(POLY(unload_cartridge_btn), x, y, h, v); + + cmd.font(font_medium).colors(normal_btn); + + ui.bounds(POLY(unload_cartridge_btn), x, y, h, v); + cmd.tag(1).button(x, y, h, v, GET_TEXT_F(MSG_UNLOAD_CARTRIDGE)); + + ui.bounds(POLY(load_chocolate_btn), x, y, h, v); + cmd.tag(2).button(x, y, h, v, GET_TEXT_F(MSG_LOAD_CHOCOLATE)); + + ui.bounds(POLY(preheat_chocolate_btn), x, y, h, v); + cmd.tag(3).button(x, y, h, v, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE)); + + ui.bounds(POLY(menu_btn), x, y, h, v); + cmd.tag(4).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_MENU)); + + ui.bounds(POLY(pause_btn), x, y, h, v); + cmd.tag(sdOrHostPaused ? 6 : 5).enabled(sdOrHostPrinting).button(x, y, h, v, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE)); + + ui.bounds(POLY(stop_btn), x, y, h, v); + cmd.tag(7).enabled(sdOrHostPrinting).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_STOP)); + + ui.bounds(POLY(extrude_btn), x, y, h, v); + cmd.tag(8).button(x, y, h, v, GET_TEXT_F(MSG_EXTRUDE)); + + ui.bounds(POLY(print_btn), x, y, h, v); + cmd.tag(9).colors(action_btn).enabled(can_print).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_PRINT)); +} + +void StatusScreen::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + } + + draw_progress(what); + draw_syringe(what); + draw_temperature(what); + draw_buttons(what); +} + +bool StatusScreen::onTouchStart(uint8_t) { + increment = 0; + return true; +} + +bool StatusScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_SCREEN(UnloadCartridgeScreen); break; + case 2: GOTO_SCREEN(LoadChocolateScreen); break; + case 3: GOTO_SCREEN(PreheatMenu); break; + case 4: GOTO_SCREEN(MainMenu); break; + case 5: + sound.play(twinkle, PLAY_ASYNCHRONOUS); + if (ExtUI::isPrintingFromMedia()) + ExtUI::pausePrint(); + #ifdef ACTION_ON_PAUSE + else host_action_pause(); + #endif + GOTO_SCREEN(StatusScreen); + break; + case 6: + sound.play(twinkle, PLAY_ASYNCHRONOUS); + if (ExtUI::isPrintingFromMedia()) + ExtUI::resumePrint(); + #ifdef ACTION_ON_RESUME + else host_action_resume(); + #endif + GOTO_SCREEN(StatusScreen); + break; + case 7: + GOTO_SCREEN(ConfirmAbortPrintDialogBox); + current_screen.forget(); + PUSH_SCREEN(StatusScreen); + break; + case 9: GOTO_SCREEN(FilesScreen); break; + default: return false; + } + // If a passcode is enabled, the LockScreen will prevent the + // user from proceeding. + LockScreen::check_passcode(); + return true; +} + +bool StatusScreen::onTouchHeld(uint8_t tag) { + if (tag == 8 && !ExtUI::isMoving()) { + increment = 0.05; + MoveAxisScreen::setManualFeedrate(E0, increment); + UI_INCREMENT(AxisPosition_mm, E0); + current_screen.onRefresh(); + } + return false; +} + +void StatusScreen::setStatusMessage(progmem_str) { +} + +void StatusScreen::setStatusMessage(const char * const) { +} + +void StatusScreen::onIdle() { + reset_menu_timeout(); + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + if (!EventLoop::is_touch_held()) + onRefresh(); + refresh_timer.start(); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h new file mode 100644 index 000000000000..5cbaced7f6b5 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_ui.h @@ -0,0 +1,54 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; +constexpr float x_max = 480.000000; +constexpr float y_min = 0.000000; +constexpr float y_max = 272.000000; + +const PROGMEM uint16_t syringe_outline[] = {0xED96, 0x14F0, 0xE65D, 0x10E9, 0xDED2, 0x0F9C, 0xD74B, 0x110E, 0xD01B, 0x1543, 0xCE80, 0x1836, 0xCE0A, 0x1C3A, 0xCE0F, 0x27AD, 0xCF0A, 0x2BD3, 0xD127, 0x2E5B, 0xD2A1, 0x2FF0, 0xD2A2, 0x9FC9, 0xD407, 0xA97A, 0xD7B9, 0xB10C, 0xD7BF, 0xBB58, 0xD978, 0xC2BE, 0xDD55, 0xC6EB, 0xDD58, 0xD159, 0xDE3B, 0xD3A8, 0xDFCF, 0xD3AF, 0xE0B8, 0xD04C, 0xE0B8, 0xC6EB, 0xE4A7, 0xC299, 0xE652, 0xBAF6, 0xE652, 0xB10C, 0xEA2E, 0xA8EA, 0xEB6C, 0x9E86, 0xEB6C, 0x2F58, 0xEF3C, 0x2B4E, 0xF003, 0x2583, 0xEFFD, 0x1AC2, 0xED96, 0x14F0, 0xED96, 0x14F0}; +const PROGMEM uint16_t syringe_fluid[] = {0xDE73, 0x2512, 0xDA0C, 0x261D, 0xD5B8, 0x29A0, 0xD4AE, 0x2D87, 0xD4AE, 0x9F60, 0xD585, 0xA63B, 0xDE44, 0xA9DE, 0xE32A, 0xA942, 0xE7E3, 0xA6A5, 0xE930, 0xA342, 0xE95D, 0x9C1D, 0xE95B, 0x31B8, 0xE955, 0x2B63, 0xE867, 0x2A67, 0xE790, 0x28DE, 0xE342, 0x25CB, 0xDE73, 0x2512}; +const PROGMEM uint16_t syringe[] = {0xED91, 0x1502, 0xE658, 0x10FB, 0xDECE, 0x0FAE, 0xD746, 0x1120, 0xD016, 0x1555, 0xCE7B, 0x1848, 0xCE05, 0x1C4D, 0xCE0A, 0x27BF, 0xCF05, 0x2BE5, 0xD122, 0x2E6E, 0xD29C, 0x3002, 0xD29D, 0x9FDB, 0xD402, 0xA98C, 0xD7B4, 0xB11F, 0xD7BA, 0xBB6A, 0xD973, 0xC2D1, 0xDD50, 0xC6FD, 0xDD53, 0xD16C, 0xDE36, 0xD3BA, 0xDFCA, 0xD3C2, 0xE0B3, 0xD05E, 0xE0B3, 0xC6FD, 0xE4A2, 0xC2AB, 0xE64D, 0xBB09, 0xE64D, 0xB11F, 0xEA29, 0xA8FC, 0xEB67, 0x9E98, 0xEB67, 0x2F6B, 0xEF37, 0x2B60, 0xEFFE, 0x2595, 0xEFF8, 0x1AD5, 0xED91, 0x1502, 0xED91, 0x1502, 0xFFFF, 0xD1CF, 0x1A7E, 0xD84F, 0x16DB, 0xDF19, 0x15A9, 0xE5E0, 0x16EA, 0xEC5B, 0x1AA4, 0xEC9D, 0x1D34, 0xEC9D, 0x20CC, 0xE5F1, 0x1D41, 0xDF02, 0x1C12, 0xD812, 0x1D41, 0xD166, 0x20CC, 0xD16C, 0x1B45, 0xD1CF, 0x1A7E, 0xFFFF, 0xE3BD, 0xACFD, 0xDE8E, 0xAF4F, 0xD988, 0xAC0F, 0xD7CC, 0xA8CD, 0xDD1C, 0xAAA9, 0xE287, 0xAA5B, 0xE655, 0xA8BE, 0xE3BD, 0xACFD, 0xFFFF, 0xE802, 0x2DC5, 0xE809, 0x343C, 0xE808, 0x9FC8, 0xE7E3, 0xA296, 0xE70D, 0xA4B1, 0xE2C9, 0xA70E, 0xDE4E, 0xA790, 0xD6A1, 0xA457, 0xD5FF, 0x9F2B, 0xD5FF, 0x2DFD, 0xD6B2, 0x2B72, 0xDA78, 0x2861, 0xDE9D, 0x276F, 0xE300, 0x2824, 0xE70D, 0x2B13, 0xE7FF, 0x2DB6, 0xE800, 0x2DC5, 0xE802, 0x2DC5, 0xFFFF, 0xE2ED, 0xBA8B, 0xE1CC, 0xBF52, 0xDF1C, 0xC165, 0xDC64, 0xBF99, 0xDB1B, 0xBAFF, 0xDB19, 0xB433, 0xDF04, 0xB552, 0xE2EF, 0xB438, 0xE2ED, 0xBA8B, 0xFFFF, 0xEC09, 0x2893, 0xE925, 0x2A08, 0xE57D, 0x261D, 0xE149, 0x246F, 0xDBDE, 0x24A0, 0xD6BC, 0x2795, 0xD484, 0x2A46, 0xD1C0, 0x2853, 0xD166, 0x251E, 0xD80D, 0x2151, 0xDF02, 0x200C, 0xE5F6, 0x2151, 0xEC9D, 0x251E, 0xEC09, 0x2893}; +const PROGMEM uint16_t unload_cartridge_btn[] = {0x0AAA, 0x0E1E, 0x57FF, 0x0E1E, 0x57FF, 0x33C3, 0x0AAA, 0x33C3, 0x0AAA, 0x0E1E}; +const PROGMEM uint16_t pause_btn[] = {0x47FF, 0xCA58, 0x7FFF, 0xCA58, 0x7FFF, 0xEFFE, 0x47FF, 0xEFFE, 0x47FF, 0xCA58}; +const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAA, 0x3D2C, 0x57FF, 0x3D2C, 0x57FF, 0x62D2, 0x0AAA, 0x62D2, 0x0AAA, 0x3D2C}; +const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAA, 0x6C3B, 0x57FF, 0x6C3B, 0x57FF, 0x91E0, 0x0AAA, 0x91E0, 0x0AAA, 0x6C3B}; +const PROGMEM uint16_t menu_btn[] = {0x0AAA, 0x9B4A, 0x57FF, 0x9B4A, 0x57FF, 0xC0EF, 0x0AAA, 0xC0EF, 0x0AAA, 0x9B4A}; +const PROGMEM uint16_t print_btn[] = {0x0AAA, 0xCA58, 0x42AA, 0xCA58, 0x42AA, 0xEFFE, 0x0AAA, 0xEFFE, 0x0AAA, 0xCA58}; +const PROGMEM uint16_t stop_btn[] = {0x8554, 0xCA58, 0xBD53, 0xCA58, 0xBD53, 0xEFFE, 0x8554, 0xEFFE, 0x8554, 0xCA58}; +const PROGMEM uint16_t print_time_hms[] = {0x62A9, 0xA968, 0x8FFE, 0xA968, 0x8FFE, 0xC0EF, 0x62A9, 0xC0EF, 0x62A9, 0xA968}; +const PROGMEM uint16_t print_time_percent[] = {0x8FFE, 0xA968, 0xBD53, 0xA968, 0xBD53, 0xC0EF, 0x8FFE, 0xC0EF, 0x8FFE, 0xA968}; +const PROGMEM uint16_t print_time_label[] = {0x62A9, 0x91E0, 0xBD53, 0x91E0, 0xBD53, 0xA986, 0x62A9, 0xA986, 0x62A9, 0x91E0}; +const PROGMEM uint16_t h3_temp[] = {0x62A9, 0x75A4, 0x8FFE, 0x75A4, 0x8FFE, 0x8D2C, 0x62A9, 0x8D2C, 0x62A9, 0x75A4}; +const PROGMEM uint16_t h3_label[] = {0x62A9, 0x5E1D, 0x8FFE, 0x5E1D, 0x8FFE, 0x75A4, 0x62A9, 0x75A4, 0x62A9, 0x5E1D}; +const PROGMEM uint16_t chocolate_label[] = {0x62A9, 0x12D2, 0xBD53, 0x12D2, 0xBD53, 0x2A5A, 0x62A9, 0x2A5A, 0x62A9, 0x12D2}; +const PROGMEM uint16_t h0_label[] = {0x62A9, 0x2A5A, 0x8FFE, 0x2A5A, 0x8FFE, 0x41E1, 0x62A9, 0x41E1, 0x62A9, 0x2A5A}; +const PROGMEM uint16_t h0_temp[] = {0x62A9, 0x41E1, 0x8FFE, 0x41E1, 0x8FFE, 0x5968, 0x62A9, 0x5968, 0x62A9, 0x41E1}; +const PROGMEM uint16_t h1_label[] = {0x8FFE, 0x2A5A, 0xBD53, 0x2A5A, 0xBD53, 0x41E1, 0x8FFE, 0x41E1, 0x8FFE, 0x2A5A}; +const PROGMEM uint16_t h1_temp[] = {0x8FFE, 0x41E1, 0xBD53, 0x41E1, 0xBD53, 0x5968, 0x8FFE, 0x5968, 0x8FFE, 0x41E1}; +const PROGMEM uint16_t extrude_btn[] = {0xC859, 0xDD2B, 0xF5AE, 0xDD2B, 0xF5AE, 0xEFFE, 0xC859, 0xEFFE, 0xC859, 0xDD2B}; +const PROGMEM uint16_t h2_label[] = {0x8FFE, 0x5E1D, 0xBD53, 0x5E1D, 0xBD53, 0x75A4, 0x8FFE, 0x75A4, 0x8FFE, 0x5E1D}; +const PROGMEM uint16_t h2_temp[] = {0x8FFE, 0x75A4, 0xBD53, 0x75A4, 0xBD53, 0x8D2C, 0x8FFE, 0x8D2C, 0x8FFE, 0x75A4}; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp new file mode 100644 index 000000000000..2e7109337026 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_unload_cartridge.cpp @@ -0,0 +1,101 @@ +/************************************ + * cocoa_press_unload_cartridge.cpp * + ************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2020 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && ENABLED(TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +using namespace ExtUI; +using namespace FTDI; +using namespace Theme; + +#define GRID_COLS 2 +#define GRID_ROWS 6 + +#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) +#define DESCRIPTION_POS BTN_POS(1,2), BTN_SIZE(2,3) +#define CARTRIDGE_OUT_BTN_POS BTN_POS(1,5), BTN_SIZE(1,1) +#define CARTRIDGE_IN_BTN_POS BTN_POS(2,5), BTN_SIZE(1,1) +#define BACK_BTN_POS BTN_POS(1,6), BTN_SIZE(2,1) + +void UnloadCartridgeScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + .font(font_large) + .text(TITLE_POS, GET_TEXT_F(MSG_UNLOAD_CARTRIDGE)); + draw_text_box(cmd, DESCRIPTION_POS, F( + "Press and hold the buttons below to help " + "you unlock the cartridge. After unlocking, " + "press and hold the Cartridge Out button " + "until the cartridge is sticking out of the " + "extruder enough to grip and remove. After " + "removing the cartridge, continue holding the " + "Cartridge Out button until the plunger adapter is " + "visible at the bottom of the extruder." + ), + OPT_CENTERY, font_medium); + } + + if (what & FOREGROUND) { + cmd.font(font_medium) + .colors(normal_btn) + .tag(2).button(CARTRIDGE_OUT_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_OUT)) + .tag(3).button(CARTRIDGE_IN_BTN_POS, GET_TEXT_F(MSG_CARTRIDGE_IN)) + .colors(action_btn) + .tag(1).button(BACK_BTN_POS, GET_TEXT_F(MSG_BACK)); + } +} + +bool UnloadCartridgeScreen::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + } + return true; +} + +bool UnloadCartridgeScreen::onTouchHeld(uint8_t tag) { + if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate + constexpr float increment = 0.25; + MoveAxisScreen::setManualFeedrate(E0, increment); + #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); + #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); + switch (tag) { + case 2: UI_DECREMENT_AXIS(E0); break; + case 3: UI_INCREMENT_AXIS(E0); break; + default: return false; + } + #undef UI_DECREMENT_AXIS + #undef UI_INCREMENT_AXIS + return false; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp index a202a611ec70..bf1e2d522e5d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp @@ -69,20 +69,23 @@ void LevelingMenu::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { CommandProcessor cmd; cmd.font(font_large) + .cmd(COLOR_RGB(bg_text_enabled)) .text(TITLE_POS, GET_TEXT_F(MSG_LEVELING)) + #if ENABLED(BLTOUCH) + .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) + #endif .font(font_medium).colors(normal_btn) #if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION) .tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) #endif .tag(3).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED)) .enabled(ENABLED(HAS_MESH)) - .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH)); + .tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH)) #if ENABLED(BLTOUCH) - cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) - .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) - .tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)); + .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) + .tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)) #endif - cmd.colors(action_btn) + .colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } @@ -97,13 +100,13 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) { #ifndef BED_LEVELING_COMMANDS #define BED_LEVELING_COMMANDS "G29" #endif - #if HAS_MESH + #if ENABLED(AUTO_BED_LEVELING_UBL) BedMeshScreen::startMeshProbe(); #else SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS)); #endif break; - #if HAS_MESH + #if ENABLED(AUTO_BED_LEVELING_UBL) case 4: GOTO_SCREEN(BedMeshScreen); break; #endif #if ENABLED(BLTOUCH) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 85006566bb18..4bd22cdabd09 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -23,7 +23,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) +#if ENABLED(TOUCH_UI_FTDI_EVE) && NONE(TOUCH_UI_LULZBOT_BIO,TOUCH_UI_COCOA_PRESS) #include "screens.h" @@ -69,24 +69,20 @@ void MainMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .tag(2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME)) - .enabled( - #if ANY(NOZZLE_CLEAN_FEATURE, TOUCH_UI_COCOA_PRESS) - 1 - #endif - ) - .tag(3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_PREHEAT_1, MSG_CLEAN_NOZZLE))) - .tag(4).button( MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) - .tag(5).button( DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) - .tag(6).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .tag( 2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME)) + .enabled(ENABLED(NOZZLE_CLEAN_FEATURE)) + .tag( 3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(MSG_CLEAN_NOZZLE)) + .tag( 4).button( MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) + .tag( 5).button( DISABLE_STEPPERS_POS,GET_TEXT_F(MSG_DISABLE_STEPPERS)) + .tag( 6).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) .enabled(IF_DISABLED(TOUCH_UI_LULZBOT_BIO, 1)) - .tag(7).button( FILAMENTCHANGE_POS, GET_TEXT_F(TERN(TOUCH_UI_COCOA_PRESS, MSG_CASE_LIGHT, MSG_FILAMENTCHANGE)) - .tag(8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag( 7).button( FILAMENTCHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) + .tag( 8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .enabled(TERN_(HAS_LEVELING, 1)) - .tag(9).button( LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) - .tag(10).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) + .tag( 9).button( LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) + .tag(10).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); } } @@ -96,22 +92,16 @@ bool MainMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; - #if ENABLED(TOUCH_UI_COCOA_PRESS) - case 3: GOTO_SCREEN(PreheatMenu); break; - #elif ENABLED(NOZZLE_CLEAN_FEATURE) + #if ENABLED(NOZZLE_CLEAN_FEATURE) case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; #endif case 4: GOTO_SCREEN(MoveAxisScreen); break; case 5: injectCommands_P(PSTR("M84")); break; case 6: GOTO_SCREEN(TemperatureScreen); break; - #if BOTH(TOUCH_UI_COCOA_PRESS, CASE_LIGHT_ENABLE) - case 7: GOTO_SCREEN(CaseLightScreen); break; - #else case 7: GOTO_SCREEN(ChangeFilamentScreen); break; - #endif case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; #ifdef HAS_LEVELING - case 9: GOTO_SCREEN(LevelingMenu); break; + case 9: GOTO_SCREEN(LevelingMenu); break; #endif case 10: GOTO_SCREEN(AboutScreen); break; default: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp index 06faf303e2f2..972b7580241f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace ExtUI; -void MoveAxisScreen::onEntry() { +void BaseMoveAxisScreen::onEntry() { // Since Marlin keeps only one absolute position for all the extruders, // we have to keep track of the relative motion of individual extruders // ourselves. The relative distances are reset to zero whenever this @@ -68,7 +68,7 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) { w.increments(); } -bool MoveAxisScreen::onTouchHeld(uint8_t tag) { +bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) { #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); const float increment = getIncrement(); @@ -106,7 +106,7 @@ bool MoveAxisScreen::onTouchHeld(uint8_t tag) { return true; } -float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { +float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { // Compute feedrate so that the tool lags the adjuster when it is // being held down, this allows enough margin for the planner to // connect segments and even out the motion. @@ -114,11 +114,11 @@ float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { return min(max_manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f)); } -void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { +void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); } -void MoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { +void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index 64927d58d936..ff85689ef2b5 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -115,6 +115,10 @@ SCREEN_TABLE { #if ENABLED(TOUCH_UI_COCOA_PRESS) DECL_SCREEN(PreheatMenu), DECL_SCREEN(PreheatTimerScreen), + DECL_SCREEN(UnloadCartridgeScreen), + DECL_SCREEN(LoadChocolateScreen), + DECL_SCREEN(MoveXYZScreen), + DECL_SCREEN(MoveEScreen), #endif #if ENABLED(TOUCH_UI_DEVELOPER_MENU) DECL_SCREEN(DeveloperMenu), diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 7b062045f97d..3fa18d9f67c7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -98,6 +98,10 @@ enum { #if ENABLED(TOUCH_UI_COCOA_PRESS) PREHEAT_MENU_CACHE, PREHEAT_TIMER_SCREEN_CACHE, + UNLOAD_CARTRIDGE_SCREEN_CACHE, + LOAD_CHOCOLATE_SCREEN_CACHE, + MOVE_XYZ_SCREEN_CACHE, + MOVE_E_SCREEN_CACHE, #endif #if ENABLED(SDSUPPORT) FILES_SCREEN_CACHE, @@ -112,7 +116,7 @@ enum { // To save MCU RAM, the status message is "baked" in to the status screen // cache, so we reserve a large chunk of memory for the DL cache -#define STATUS_SCREEN_DL_SIZE 2048 +#define STATUS_SCREEN_DL_SIZE 4096 #define ALERT_BOX_DL_SIZE 3072 #define SPINNER_DL_SIZE 3072 #define FILE_SCREEN_DL_SIZE 4160 @@ -280,6 +284,7 @@ class StatusScreen : public BaseScreen, public CachedScreen { - public: - static void onRedraw(draw_mode_t); - static bool onTouchEnd(uint8_t tag); - }; - - class PreheatTimerScreen : public BaseScreen, public CachedScreen { - private: - static uint16_t secondsRemaining(); - - static void draw_message(draw_mode_t); - static void draw_time_remaining(draw_mode_t); - static void draw_interaction_buttons(draw_mode_t); - public: - static void onRedraw(draw_mode_t); - - static void onEntry(); - static void onIdle(); - static bool onTouchEnd(uint8_t tag); - }; -#endif - class MainMenu : public BaseScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -467,7 +449,7 @@ class BaseNumericAdjustmentScreen : public BaseScreen { static bool onTouchEnd(uint8_t tag); }; -class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen { +class BaseMoveAxisScreen : public BaseNumericAdjustmentScreen { private: static float getManualFeedrate(uint8_t axis, float increment_mm); public: @@ -475,8 +457,12 @@ class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); static void onIdle(); }; @@ -852,3 +838,54 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen { static bool onTouchEnd(uint8_t tag); }; #endif + +#if ENABLED(TOUCH_UI_COCOA_PRESS) + class PreheatMenu : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; + + class PreheatTimerScreen : public BaseScreen, public CachedScreen { + private: + static uint16_t secondsRemaining(); + + static void draw_message(draw_mode_t); + static void draw_time_remaining(draw_mode_t); + static void draw_interaction_buttons(draw_mode_t); + static void draw_adjuster(draw_mode_t, uint8_t tag, progmem_str label, float value, int16_t x, int16_t y, int16_t w, int16_t h); + public: + static void onRedraw(draw_mode_t); + + static void onEntry(); + static void onIdle(); + static bool onTouchHeld(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + }; + + class UnloadCartridgeScreen : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static bool onTouchHeld(uint8_t tag); + }; + + class LoadChocolateScreen : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static bool onTouchHeld(uint8_t tag); + }; + + class MoveXYZScreen : public BaseMoveAxisScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static void onIdle(); + }; + + class MoveEScreen : public BaseMoveAxisScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static void onIdle(); + }; +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp index e320bf5a015a..0011306c7e9b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -33,7 +33,7 @@ using namespace ExtUI; void TemperatureScreen::onRedraw(draw_mode_t what) { widgets_t w(what); #if TOUCH_UI_LCD_TEMP_SCALING == 10 - w.precision(1) + w.precision(1, DEFAULT_MIDRANGE) #else w.precision(0, getTargetTemp_celsius(E0) == 0 ? DEFAULT_HIGHEST : DEFAULT_MIDRANGE) #endif @@ -41,7 +41,14 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { w.heading(GET_TEXT_F(MSG_TEMPERATURE)); w.button(30, GET_TEXT_F(MSG_COOLDOWN)); #ifndef NO_TOOLHEAD_HEATER_GCODE - #if HOTENDS == 1 + #ifdef TOUCH_UI_COCOA_PRESS + w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); + w.adjuster( 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1)); + #if ENABLED(COCOA_PRESS_EXTRA_HEATER) + if (has_extra_heater()) + w.adjuster(6, GET_TEXT_F(MSG_EXTERNAL), getTargetTemp_celsius(E2)); + #endif + #elif HOTENDS == 1 w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); #else w.adjuster( 2, F(LCD_STR_E0), getTargetTemp_celsius(E0)); @@ -95,12 +102,12 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) { case 11: UI_INCREMENT(TargetFan_percent, FAN0); break; #endif case 30: - #define _HOTEND_OFF(N) setTargetTemp_celsius(0,E##N); + #define _HOTEND_OFF(N) setTargetTemp_celsius(0, E##N); REPEAT(HOTENDS, _HOTEND_OFF); - TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0,BED)); - TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0,CHAMBER)); + TERN_(HAS_HEATED_BED, setTargetTemp_celsius(0, BED)); + TERN_(HAS_HEATED_CHAMBER, setTargetTemp_celsius(0, CHAMBER)); #if HAS_FAN - setTargetFan_percent(0,FAN0); + setTargetFan_percent(0, FAN0); #endif break; default: diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 10cbb8af5333..f70851521a16 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -76,7 +76,7 @@ void TuneMenu::onRedraw(draw_mode_t what) { .tag(3).button( FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) .tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) - .enabled(EITHER(HAS_BED_PROBE, BABYSTEPPING)) + .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE) || ENABLED(BABYSTEPPING)) .tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET))) .tag(5).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .enabled(sdOrHostPrinting) @@ -103,7 +103,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { case 4: #if ENABLED(BABYSTEPPING) GOTO_SCREEN(NudgeNozzleScreen); - #elif HAS_BED_PROBE + #elif BOTH(HAS_LEVELING, HAS_BED_PROBE) GOTO_SCREEN(ZOffsetScreen); #endif break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp index dd211e343962..0acfbb07d624 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if BOTH(TOUCH_UI_FTDI_EVE, HAS_BED_PROBE) +#if ENABLED(TOUCH_UI_FTDI_EVE) && BOTH(HAS_LEVELING, HAS_BED_PROBE) #include "screens.h" From 3404cb1fc4eced0f608cdea4e752e20daf9f9112 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Wed, 9 Dec 2020 12:07:26 -0500 Subject: [PATCH 315/443] Move ExtUI ABL mesh edit, limit to bilinear (#20381) * Move ExtUI call Co-authored-by: Scott Lahteine Co-authored-by: Victor Mateus Oliveira Co-authored-by: Sebastiaan Dammann --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 15555d5f8d43..05260955bf4d 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -177,8 +177,6 @@ G29_TYPE GcodeSuite::G29() { if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false); #endif - TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); - const bool seenA = TERN0(PROBE_MANUALLY, parser.seen('A')), no_action = seenA || seenQ, faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action; @@ -399,6 +397,10 @@ G29_TYPE GcodeSuite::G29() { points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points #endif + #if BOTH(AUTO_BED_LEVELING_BILINEAR, EXTENSIBLE_UI) + ExtUI::onMeshLevelingStart(); + #endif + if (!faux) remember_feedrate_scaling_off(); // Disable auto bed leveling during G29. From 6e4925e6b6ec2053865e5fd86df65882999f85eb Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 9 Dec 2020 18:43:49 -0300 Subject: [PATCH 316/443] MKS Robin Pins fixes for STM32 and STM32F1 (#20404) Co-authored-by: Scott Lahteine --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 40 +++++++++++-------- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 7 +--- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 581dd5375ba4..a36b8a32e673 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -23,7 +23,6 @@ /** * MKS Robin (STM32F130ZET6) board pin assignments - * * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware */ @@ -121,18 +120,9 @@ #define PS_ON_PIN PA3 // PW_OFF #define FIL_RUNOUT_PIN PF11 // MT_DET -#ifdef ARDUINO_ARCH_STM32F1 - #define BEEPER_PIN PC13 -#else - #define BEEPER_PIN -1 -#endif +#define BEEPER_PIN PC13 #define LED_PIN PB2 -#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT - #define TFT_CS_PIN PG12 // NE4 - #define TFT_RS_PIN PF0 // A0 -#endif - #if HAS_FSMC_TFT /** * Note: MKS Robin TFT screens use various TFT controllers @@ -140,23 +130,27 @@ * ILI9488 is not supported * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp * - * If the screen stays white, disable 'LCD_RESET_PIN' + * If the screen stays white, disable 'TFT_RESET_PIN' * to let the bootloader init the screen. * - * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu + * Setting an 'TFT_RESET_PIN' may cause a flicker when entering the LCD menu * because Marlin uses the reset as a failsafe to revive a glitchy LCD. */ - //#define LCD_RESET_PIN PF6 - #define LCD_BACKLIGHT_PIN PG11 + #define TFT_CS_PIN PG12 // NE4 + #define TFT_RS_PIN PF0 // A0 + #define FSMC_CS_PIN TFT_CS_PIN #define FSMC_RS_PIN TFT_RS_PIN #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 -#elif HAS_GRAPHICAL_TFT + #define TFT_RESET_PIN PF6 #define TFT_BACKLIGHT_PIN PG11 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 #endif #if NEED_TOUCH_PINS @@ -170,11 +164,23 @@ // SPI1(PA7) & SPI3(PB5) not available #define SPI_DEVICE 2 +#define SDIO_SUPPORT #if ENABLED(SDIO_SUPPORT) #define SCK_PIN PB13 // SPI2 #define MISO_PIN PB14 // SPI2 #define MOSI_PIN PB15 // SPI2 - #define SD_DETECT_PIN PF12 // SD_CD + /** + * MKS Robin has a few hardware revisions + * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware + * + * MKS Robin less or equal to V2.3 don't have SD_DETECT_PIN. + * + * MKS Robin greater or equal to V2.4 have SD_DETECT_PIN at PF12. + * + * You can uncomment it here, or you can add it SD_DETECT_PIN to your Configuration.h + */ + //#define SD_DETECT_PIN -1 + //#define SD_DETECT_PIN PF12 // SD_CD #else // SD as custom software SPI (SDIO pins) #define SCK_PIN PC12 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 760f27060ec2..4b644d693b8a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -23,6 +23,7 @@ /** * MKS Robin nano (STM32F130VET6) board pin assignments + * https://github.com/makerbase-mks/MKS-Robin-Nano-V1.X/tree/master/hardware */ #if NOT_TARGET(STM32F1, STM32F1xx) @@ -167,18 +168,14 @@ /** * Note: MKS Robin TFT screens use various TFT controllers. - * If the screen stays white, disable 'LCD_RESET_PIN' + * If the screen stays white, disable 'TFT_RESET_PIN' * to let the bootloader init the screen. */ - // Shared FSMC Configs #if HAS_FSMC_TFT #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 - #define TOUCH_CS_PIN PA7 // SPI2_NSS #define TOUCH_SCK_PIN PB13 // SPI2_SCK #define TOUCH_MISO_PIN PB14 // SPI2_MISO From 65577511996fd14c0db028bb36525e6b44818fb3 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 10 Dec 2020 00:13:42 +0000 Subject: [PATCH 317/443] [cron] Bump distribution date (2020-12-10) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ebb2a7519be2..a8039cf8bd02 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-09" + #define STRING_DISTRIBUTION_DATE "2020-12-10" #endif /** From 6cf4b888e1b6723ddf0a5cbe3fad27940a29fca2 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 10 Dec 2020 10:27:02 -0800 Subject: [PATCH 318/443] Clarify "not Interrupt-capable" error message (#20419) --- Marlin/src/HAL/AVR/endstop_interrupts.h | 34 ++++++++++----------- Marlin/src/HAL/LPC1768/endstop_interrupts.h | 26 ++++++++-------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Marlin/src/HAL/AVR/endstop_interrupts.h b/Marlin/src/HAL/AVR/endstop_interrupts.h index ae9a605accce..9fd9c38b86ad 100644 --- a/Marlin/src/HAL/AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/AVR/endstop_interrupts.h @@ -124,7 +124,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(X_MAX_PIN); #else - static_assert(digitalPinHasPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(X_MAX_PIN); #endif #endif @@ -132,7 +132,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(X_MIN_PIN); #else - static_assert(digitalPinHasPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(X_MIN_PIN); #endif #endif @@ -140,7 +140,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Y_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Y_MAX_PIN); #endif #endif @@ -148,7 +148,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Y_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Y_MIN_PIN); #endif #endif @@ -156,7 +156,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z_MAX_PIN); #endif #endif @@ -164,7 +164,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z_MIN_PIN); #endif #endif @@ -172,7 +172,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(X2_MAX_PIN); #else - static_assert(digitalPinHasPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(X2_MAX_PIN); #endif #endif @@ -180,7 +180,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(X2_MIN_PIN); #else - static_assert(digitalPinHasPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(X2_MIN_PIN); #endif #endif @@ -188,7 +188,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Y2_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Y2_MAX_PIN); #endif #endif @@ -196,7 +196,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Y2_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Y2_MIN_PIN); #endif #endif @@ -204,7 +204,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z2_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z2_MAX_PIN); #endif #endif @@ -212,7 +212,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z2_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z2_MIN_PIN); #endif #endif @@ -220,7 +220,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z3_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z3_MAX_PIN); #endif #endif @@ -228,7 +228,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z3_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z3_MIN_PIN); #endif #endif @@ -236,7 +236,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z4_MAX_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z4_MAX_PIN); #else - static_assert(digitalPinHasPCICR(Z4_MAX_PIN), "Z4_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z4_MAX_PIN), "Z4_MAX_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z4_MAX_PIN); #endif #endif @@ -244,7 +244,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z4_MIN_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z4_MIN_PIN); #else - static_assert(digitalPinHasPCICR(Z4_MIN_PIN), "Z4_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z4_MIN_PIN), "Z4_MIN_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z4_MIN_PIN); #endif #endif @@ -252,7 +252,7 @@ void setup_endstop_interrupts() { #if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT) _ATTACH(Z_MIN_PROBE_PIN); #else - static_assert(digitalPinHasPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."); pciSetup(Z_MIN_PROBE_PIN); #endif #endif diff --git a/Marlin/src/HAL/LPC1768/endstop_interrupts.h b/Marlin/src/HAL/LPC1768/endstop_interrupts.h index b0d0c0ec5c0a..126d6e7d5bb2 100644 --- a/Marlin/src/HAL/LPC1768/endstop_interrupts.h +++ b/Marlin/src/HAL/LPC1768/endstop_interrupts.h @@ -46,79 +46,79 @@ void setup_endstop_interrupts() { #if HAS_X_MAX #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN) - #error "X_MAX_PIN is not INTERRUPT-capable." + #error "X_MAX_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN #if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN) - #error "X_MIN_PIN is not INTERRUPT-capable." + #error "X_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX #if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN) - #error "Y_MAX_PIN is not INTERRUPT-capable." + #error "Y_MAX_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN #if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN) - #error "Y_MIN_PIN is not INTERRUPT-capable." + #error "Y_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX #if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN) - #error "Z_MAX_PIN is not INTERRUPT-capable." + #error "Z_MAX_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) - #error "Z_MIN_PIN is not INTERRUPT-capable." + #error "Z_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX #if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN) - #error "Z2_MAX_PIN is not INTERRUPT-capable." + #error "Z2_MAX_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN #if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN) - #error "Z2_MIN_PIN is not INTERRUPT-capable." + #error "Z2_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX #if !LPC1768_PIN_INTERRUPT_M(Z3_MAX_PIN) - #error "Z3_MIN_PIN is not INTERRUPT-capable." + #error "Z3_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not INTERRUPT-capable." + #error "Z3_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z4_MAX #if !LPC1768_PIN_INTERRUPT_M(Z4_MAX_PIN) - #error "Z4_MIN_PIN is not INTERRUPT-capable." + #error "Z4_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z4_MAX_PIN); #endif #if HAS_Z4_MIN #if !LPC1768_PIN_INTERRUPT_M(Z4_MIN_PIN) - #error "Z4_MIN_PIN is not INTERRUPT-capable." + #error "Z4_MIN_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z4_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN) - #error "Z_MIN_PROBE_PIN is not INTERRUPT-capable." + #error "Z_MIN_PROBE_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #endif _ATTACH(Z_MIN_PROBE_PIN); #endif From 22de37ad5037eb829de9e817f74d25768bd8e117 Mon Sep 17 00:00:00 2001 From: ellensp Date: Fri, 11 Dec 2020 07:30:58 +1300 Subject: [PATCH 319/443] Fix UBL Debug Messages (#20423) Co-authored-by: ellensp --- Marlin/src/module/settings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index c6eee271a08f..ec549ea2f66f 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -563,7 +563,7 @@ void MarlinSettings::postprocess() { "ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE is insufficient to capture all EEPROM data."); #endif -//#define DEBUG_OUT 1 +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" #if ENABLED(EEPROM_SETTINGS) @@ -2294,14 +2294,14 @@ void MarlinSettings::postprocess() { if (!ubl.sanity_check()) { SERIAL_EOL(); - #if ENABLED(EEPROM_CHITCHAT) + #if BOTH(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) ubl.echo_name(); DEBUG_ECHOLNPGM(" initialized.\n"); #endif } else { eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) + #if BOTH(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) DEBUG_ECHOPGM("?Can't enable "); ubl.echo_name(); DEBUG_ECHOLNPGM("."); From af70e80816c33a6f44b3ae2cfa8df554e6be3490 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 11 Dec 2020 00:13:48 +0000 Subject: [PATCH 320/443] [cron] Bump distribution date (2020-12-11) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a8039cf8bd02..5113e71d5680 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-10" + #define STRING_DISTRIBUTION_DATE "2020-12-11" #endif /** From 04a3bd0d34c1a749c00b60c4eff6385ea8af977e Mon Sep 17 00:00:00 2001 From: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com> Date: Fri, 11 Dec 2020 18:33:29 +1100 Subject: [PATCH 321/443] Z_SENSORLESS sanity checks (#20421) Co-authored-by: Jason Smith --- Marlin/src/inc/SanityCheck.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 36dc373ecc14..857f12e4548b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2654,6 +2654,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #if ENABLED(SENSORLESS_PROBING) #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS) #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes." + #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." + #elif ENABLED(USE_PROBE_FOR_Z_HOMING) + #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING." #elif !Z_SENSORLESS #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z." #endif From 43222d5879db55fda108301ace88f4225f8d0f6d Mon Sep 17 00:00:00 2001 From: FanDjango <51046875+FanDjango@users.noreply.github.com> Date: Fri, 11 Dec 2020 09:06:57 +0100 Subject: [PATCH 322/443] Probe offset wizard fixes (#20414) * STOW probe, reverting incorrect earlier change from #20344 * Adjust soft endstop disables, to ensure travel below bed functions properly Co-authored-by: FanDjango --- Marlin/src/lcd/menu/menu_probe_offset.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 8f87e82ae0ca..e5b1da3d0beb 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -133,11 +133,13 @@ void prepare_for_probe_offset_wizard() { // Probe for Z reference ui.wait_for_move = true; - z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_RAISE, 0, true); + z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true); ui.wait_for_move = false; #endif + SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement + // Move Nozzle to Probing/Homing Position ui.wait_for_move = true; current_position += probe.offset_xy; @@ -173,7 +175,6 @@ void goto_probe_offset_wizard() { ui.goto_screen([]{ _lcd_draw_homing(); if (all_axes_homed()) { - SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement z_offset_ref = 0; // Set Z Value for Wizard Position to 0 ui.goto_screen(prepare_for_probe_offset_wizard); ui.defer_status_screen(); From 8a4f8e72dfe1ae0c25e9a77caaaa6d1453b0d096 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 11 Dec 2020 01:39:51 -0800 Subject: [PATCH 323/443] SENSORLESS_PROBING sanity check followup (#20438) --- buildroot/tests/LPC1769-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index f661babc40f0..ebfa4cc8dcea 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -67,7 +67,7 @@ opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT MECHANICAL TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ SENSORLESS_PROBING Z_SAFE_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG \ EXPERIMENTAL_I2CBUS -opt_disable PSU_CONTROL +opt_disable PSU_CONTROL Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING" "$3" # clean up From 8f008ac75d818d3bd319e27b93178fc2b0e75549 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 12 Dec 2020 00:13:47 +0000 Subject: [PATCH 324/443] [cron] Bump distribution date (2020-12-12) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 5113e71d5680..9cfe9407c530 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-11" + #define STRING_DISTRIBUTION_DATE "2020-12-12" #endif /** From 9c9113e225d746a0391528ee1d1ff4a08a07b28c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 11 Dec 2020 18:21:56 -0600 Subject: [PATCH 325/443] Better animated boot screen --- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 12 ++++++++++-- Marlin/src/lcd/tft/ui_320x240.cpp | 6 +----- Marlin/src/lcd/tft/ui_480x320.cpp | 6 +----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 4e265a8ee4df..54735175b449 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -144,10 +144,16 @@ bool MarlinUI::detected() { return true; } constexpr millis_t d = 0; constexpr uint8_t f = 0; #else - constexpr millis_t d = CUSTOM_BOOTSCREEN_FRAME_TIME; + #if DISABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME) + constexpr millis_t d = CUSTOM_BOOTSCREEN_FRAME_TIME; + #endif LOOP_L_N(f, COUNT(custom_bootscreen_animation)) #endif { + #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME) + const uint8_t fr = _MIN(f, COUNT(custom_bootscreen_frame_time) - 1); + const millis_t d = custom_bootscreen_frame_time[fr]; + #endif u8g.firstPage(); do { draw_custom_bootscreen(f); } while (u8g.nextPage()); if (d) safe_delay(d); @@ -156,7 +162,9 @@ bool MarlinUI::detected() { return true; } #ifndef CUSTOM_BOOTSCREEN_TIMEOUT #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 #endif - safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); + #if CUSTOM_BOOTSCREEN_TIMEOUT + safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); + #endif } #endif // SHOW_CUSTOM_BOOTSCREEN diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 51f65c59b563..ceea4a428eb3 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -88,10 +88,6 @@ void MarlinUI::clear_lcd() { } #if ENABLED(SHOW_BOOTSCREEN) - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 1500 - #endif - void MarlinUI::show_bootscreen() { tft.queue.reset(); @@ -106,7 +102,7 @@ void MarlinUI::clear_lcd() { safe_delay(BOOTSCREEN_TIMEOUT); clear_lcd(); } -#endif // SHOW_BOOTSCREEN +#endif void MarlinUI::draw_kill_screen() { tft.queue.reset(); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 343d187d26ba..9e387b240215 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -90,10 +90,6 @@ void MarlinUI::clear_lcd() { } #if ENABLED(SHOW_BOOTSCREEN) - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 1500 - #endif - #undef BOOTSCREEN_TIMEOUT #define BOOTSCREEN_TIMEOUT 5000 @@ -112,7 +108,7 @@ void MarlinUI::clear_lcd() { safe_delay(BOOTSCREEN_TIMEOUT); clear_lcd(); } -#endif // SHOW_BOOTSCREEN +#endif void MarlinUI::draw_kill_screen() { tft.queue.reset(); From 087a6fea13bb9f9c1f261607e7b7dbbca94a4cbd Mon Sep 17 00:00:00 2001 From: leodoener Date: Sat, 12 Dec 2020 03:20:24 +0100 Subject: [PATCH 326/443] Fix SDCARD_SORT_ALPHA on Ender 3 V2 (#20443) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 5a2100069849..db44782fde08 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -1690,7 +1690,7 @@ inline void Draw_SDItem(const uint16_t item, int16_t row=-1) { return; } - card.getfilename_sorted(item - is_subdir); + card.getfilename_sorted(SD_ORDER(item - is_subdir, card.get_num_Files())); char * const name = card.longest_filename(); #if ENABLED(SCROLL_LONG_FILENAMES) From 2eab92093500784a31175112e64887455b76d274 Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 13 Dec 2020 07:59:17 +1300 Subject: [PATCH 327/443] Add HAS_PIN_27_BOARD for CREALITY_V4 (#20446) Co-authored-by: ellensp --- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 44be73029d8e..69371f0f73df 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -48,17 +48,21 @@ #endif #if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb #endif // // Servos // -#define SERVO0_PIN PB0 // BLTouch OUT +#ifndef HAS_PIN_27_BOARD + #define SERVO0_PIN PB0 // BLTouch OUT +#else + #define SERVO0_PIN PC6 +#endif // // Limit Switches @@ -156,7 +160,9 @@ #define BTN_EN1 PB10 #define BTN_EN2 PB14 - #define BEEPER_PIN PC6 + #ifndef HAS_PIN_27_BOARD + #define BEEPER_PIN PC6 + #endif #elif ENABLED(VET6_12864_LCD) From ea9b4dc82c97450c6b8d8c5489efcd1d6e2844b4 Mon Sep 17 00:00:00 2001 From: qwewer0 <57561110+qwewer0@users.noreply.github.com> Date: Sat, 12 Dec 2020 20:03:28 +0100 Subject: [PATCH 328/443] Improve ASSISTED_TRAMMING_WIZARD probe stowing (#20437) * When BLTOUCH_HS_MODE enabled, stow pin before user interaction * For all probes, ensure probe stows at end of wizard --- Marlin/src/lcd/menu/menu_tramming.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index c9043a118bd8..a0dad20e6247 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -43,11 +43,9 @@ float z_measured[G35_PROBE_COUNT] = { 0 }; static uint8_t tram_index = 0; bool probe_single_point() { - // In BLTOUCH HS mode, the probe travels in a deployed state. - // Users of Tramming Wizard might have a badly misaligned bed, so raise Z by the - // length of the deployed pin (BLTOUCH stroke < 7mm) - do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7)); - const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true); + do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES)); + //Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety + const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true); DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); z_measured[tram_index] = z_probed_height; @@ -81,7 +79,10 @@ void tramming_wizard_menu() { LOOP_L_N(i, G35_PROBE_COUNT) SUBMENU_N_P(i, (char*)pgm_read_ptr(&tramming_point_name[i]), []{ _menu_single_probe(MenuItemBase::itemIndex); }); - ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen_no_defer(); }); + ACTION_ITEM(MSG_BUTTON_DONE, []{ + probe.stow(); // Stow before exiting Tramming Wizard + ui.goto_previous_screen_no_defer(); + }); END_MENU(); } From 8723440d1dcdcfbd979e11a5fe3111500a6ee407 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 13 Dec 2020 00:14:25 +0000 Subject: [PATCH 329/443] [cron] Bump distribution date (2020-12-13) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9cfe9407c530..a40953130ca3 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-12" + #define STRING_DISTRIBUTION_DATE "2020-12-13" #endif /** From 1a9644cef97814c4088002027f0dde2153b1c5af Mon Sep 17 00:00:00 2001 From: FanDjango <51046875+FanDjango@users.noreply.github.com> Date: Sun, 13 Dec 2020 02:18:33 +0100 Subject: [PATCH 330/443] Probe Offset Wizard followupBack to PROBE_PT_RAISE/separate STOW, make "PROBING" msg appear (#20439) * Go back to always use PROBE_PT_RAISE with a discrete stow. This ensures a raise above the bed, while stowing prior to exiting the wizard. * Fix issue preventing text while moving to X/Y position Co-authored-by: FanDjango --- Marlin/src/lcd/menu/menu_probe_offset.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index e5b1da3d0beb..b73945ea09cd 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -120,11 +120,11 @@ void probe_offset_wizard_menu() { } void prepare_for_probe_offset_wizard() { - if (ui.wait_for_move) return; - #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); + if (ui.wait_for_move) return; + #ifndef PROBE_OFFSET_WIZARD_XY_POS #define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER #endif @@ -133,13 +133,16 @@ void prepare_for_probe_offset_wizard() { // Probe for Z reference ui.wait_for_move = true; - z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true); + z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_RAISE, 0, true); ui.wait_for_move = false; + // Stow the probe, as the last call to probe.probe_at_point(...) left + // the probe deployed if it was successful. + probe.stow(); + #else + if (ui.wait_for_move) return; #endif - SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement - // Move Nozzle to Probing/Homing Position ui.wait_for_move = true; current_position += probe.offset_xy; @@ -147,6 +150,8 @@ void prepare_for_probe_offset_wizard() { ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING)); ui.wait_for_move = false; + SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement + // Go to Calibration Menu ui.goto_screen(probe_offset_wizard_menu); ui.defer_status_screen(); From c824086825c6763f45f145326adf33e050d88490 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Dec 2020 01:53:21 -0600 Subject: [PATCH 331/443] Adjust planner debugging --- Marlin/src/module/planner.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 147adb12e3d2..5897d10cd581 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1765,14 +1765,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif /* <-- add a slash to enable - SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s, - " A:", target.a, " (", da, " steps)" - " B:", target.b, " (", db, " steps)" - " C:", target.c, " (", dc, " steps)" - #if EXTRUDERS - " E:", target.e, " (", de, " steps)" - #endif - ); + SERIAL_ECHOLNPAIR( + " _populate_block FR:", fr_mm_s, + " A:", target.a, " (", da, " steps)" + " B:", target.b, " (", db, " steps)" + " C:", target.c, " (", dc, " steps)" + #if EXTRUDERS + " E:", target.e, " (", de, " steps)" + #endif + ); //*/ #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) From b0392be4bf872954d0134c90cd027ea3610d5b9a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Dec 2020 01:50:02 -0600 Subject: [PATCH 332/443] SHORT_MANUAL_Z_MOVE => FINE_MANUAL_MOVE --- Marlin/Configuration_adv.h | 2 +- Marlin/src/inc/SanityCheck.h | 4 +++- Marlin/src/lcd/language/language_an.h | 2 +- Marlin/src/lcd/language/language_bg.h | 2 +- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 2 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_de.h | 2 +- Marlin/src/lcd/language/language_el.h | 2 +- Marlin/src/lcd/language/language_el_gr.h | 2 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_es.h | 2 +- Marlin/src/lcd/language/language_eu.h | 2 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 2 +- Marlin/src/lcd/language/language_jp_kana.h | 2 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 +- Marlin/src/lcd/language/language_pt.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 2 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 2 +- Marlin/src/lcd/language/language_tr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/language/language_zh_TW.h | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 18 +++++++++--------- Marlin/src/lcd/menu/menu_probe_offset.cpp | 12 ++++++------ 33 files changed, 48 insertions(+), 46 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f49749c045f5..9e5ebb33ba7f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1055,7 +1055,7 @@ #if EITHER(IS_ULTIPANEL, EXTENSIBLE_UI) #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines #if IS_ULTIPANEL #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 857f12e4548b..10a196b9583b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -531,6 +531,8 @@ #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z." #elif defined(POWER_LOSS_PULL) #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)." +#elif defined(SHORT_MANUAL_Z_MOVE) + #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers." #elif defined(FIL_RUNOUT_INVERTING) #if FIL_RUNOUT_INVERTING #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH." @@ -2657,7 +2659,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." #elif ENABLED(USE_PROBE_FOR_Z_HOMING) - #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING." + #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING." #elif !Z_SENSORLESS #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z." #endif diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 8eb6ab5794c7..0513de7f7d8f 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -85,7 +85,7 @@ namespace Language_an { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mover %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 62b291b7c3e3..59646521567a 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -75,7 +75,7 @@ namespace Language_bg { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Движение по Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Премести с %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Премести с %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Премести с 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Премести с 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Премести с 10mm"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index b924e3472d89..6709a0ce5543 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -85,7 +85,7 @@ namespace Language_ca { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mou Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mou %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mou %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mou 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mou 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mou 10mm"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 97bc2a30cc48..f102e021883c 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -241,7 +241,7 @@ namespace Language_cz { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunout o %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Posunout o %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunout o 0,1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunout o 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunout o 10mm"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index ff0751aebfad..925881284376 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -75,7 +75,7 @@ namespace Language_da { PROGMEM Language_Str MSG_MOVE_X = _UxGT("Flyt X"); PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Flyt Y"); PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Flyt Z"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Flyt %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Flyt %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Flyt 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Flyt 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Flyt 10mm"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 17dabddb3a86..1827fd062d3a 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -234,7 +234,7 @@ namespace Language_de { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Bewege Extruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Bewege Extruder *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT(" %s mm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT(" %s mm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT(" 0,1 mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1,0 mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10,0 mm"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index d1dce1b958c1..ebe27fecbd9a 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -83,7 +83,7 @@ namespace Language_el { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Μετακίνηση %s μμ"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index db67540ffba1..e6909ad5bfb7 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -84,7 +84,7 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Μετακίνηση %s μμ"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index ed9ad954f85e..b7d767aa3bdb 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -257,7 +257,7 @@ namespace Language_en { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Move %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Move %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 1ec1e3dbda1a..362d2480c146 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -236,7 +236,7 @@ namespace Language_es { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend muy frio"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mover %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 01ba4b5200c9..1c1c9e423dcd 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -139,7 +139,7 @@ namespace Language_eu { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mugitu Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusorea"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusorea *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mugitu %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mugitu %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mugitu 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mugitu 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mugitu 10mm"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 4f10adfc3e43..9954f1dd8aaf 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -72,7 +72,7 @@ namespace Language_fi { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Liikuta Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Liikuta %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Liikuta %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Liikuta 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Liikuta 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Liikuta 10mm"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 3a741a605797..4e58e4005ce9 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -225,7 +225,7 @@ namespace Language_fr { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudeur"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudeur *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Buse trop froide"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Déplacer %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Déplacer %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Déplacer 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Déplacer 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Déplacer 10mm"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 5b0da33649c9..b0a42a9f90db 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -233,7 +233,7 @@ namespace Language_gl { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Bico moi frío"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mover %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 0ef2ad6c351a..1684ad0e1bc2 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -79,7 +79,7 @@ namespace Language_hr { PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveliraj bed"); PROGMEM Language_Str MSG_MOVE_X = _UxGT("Miči X"); PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Miči Y"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Miči %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Miči %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Miči 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Miči 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Miči 10mm"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 94a7ba485846..e07c0f6ac756 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -235,7 +235,7 @@ namespace Language_hu { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Adagoló"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Adagoló *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("A fúvóka túl hideg"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mozgás %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mozgás %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mozgás 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mozgás 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mozgás 10mm"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 6a10afec07d5..61cb3ec28427 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -250,7 +250,7 @@ namespace Language_it { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusore"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusore *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Muovi di %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Muovi di %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index d17d3aaf2d8e..8431d86d1c66 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -94,7 +94,7 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Yジク イドウ"); // "Move Y" PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Zジク イドウ"); // "Move Z" PROGMEM Language_Str MSG_MOVE_E = _UxGT("エクストルーダー"); // "Extruder" - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm イドウ"); // "Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("%smm イドウ"); // "Move 0.025mm" PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm イドウ"); // "Move 0.1mm" PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1mm イドウ"); // "Move 1mm" PROGMEM Language_Str MSG_MOVE_10MM = _UxGT(" 10mm イドウ"); // "Move 10mm" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index c4e0b7f1619a..82e5c292c68b 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -87,7 +87,7 @@ namespace Language_nl { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Verplaats Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Verplaats %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Verplaats %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Verplaats 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Verplaats 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 3b6479dfa89b..47d7162dee15 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -230,7 +230,7 @@ namespace Language_pl { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruzja (os E)"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruzja (os E) *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Dysza za zimna"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Przesuń co %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Przesuń co %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Przesuń co .1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Przesuń co 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Przesuń co 10mm"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index fb41cb99a58a..2dc53993b69a 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -81,7 +81,7 @@ namespace Language_pt { PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mover %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 05fc639f8395..06226b84edbd 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -214,7 +214,7 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Extrus. mto fria"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Mover %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index c2e50fc69807..459cc5ee3ddb 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -232,7 +232,7 @@ namespace Language_ro { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Capat Prea Rece"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Move %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Move %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 0be6cb5eb3bd..85dc58a15a67 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -290,7 +290,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Экструдер"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Экструдер *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Сопло не нагрето"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Движение %sмм"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Движение %sмм"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Движение 0.1мм"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Движение 1мм"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Движение 10мм"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 2e05ee45132f..9a1e13e2c808 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -247,7 +247,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunúť o %smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Posunúť o %smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 307abf118a8c..57c814ad4808 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -235,7 +235,7 @@ namespace Language_tr { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruder"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruder *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Nozul Çok Soğuk"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("%smm"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10mm"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 71b4cd018d7d..2aa483de506e 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -286,7 +286,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Сопло дуже холодне"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Рух по %sмм"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Рух по %sмм"); PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Рух по 0.1мм"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Рух по 1мм"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Рух по 10мм"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 0e1de36b57cd..a4134969aa18 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -230,7 +230,7 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_MOVE_E = _UxGT("挤出机"); //"Extruder" PROGMEM Language_Str MSG_MOVE_EN = _UxGT("挤出机 *"); //"Extruder" PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("热端太冷"); - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移动 %s mm"); //"Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("移动 %s mm"); //"Move 0.025mm" PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移动 0.1 mm"); //"Move 0.1mm" PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移动 1 mm"); //"Move 1mm" PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移动 10 mm"); //"Move 10mm" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 9708bbda9c0c..4654f770ea5b 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -228,7 +228,7 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_MOVE_E = _UxGT("擠出機"); //"Extruder" PROGMEM Language_Str MSG_MOVE_EN = _UxGT("擠出機 *"); //"Extruder *" PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("噴嘴溫度不夠"); //"Hotend too cold" - PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移動 %s mm"); //"Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("移動 %s mm"); //"Move 0.025mm" PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移動 0.1 mm"); //"Move 0.1mm" PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移動 1 mm"); //"Move 1mm" PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移動 10 mm"); //"Move 10mm" diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 42fdbfceda07..627d8565ed92 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -143,8 +143,8 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } // "Motion" > "Move Xmm" > "Move XYZ" submenu // -#ifndef SHORT_MANUAL_Z_MOVE - #define SHORT_MANUAL_Z_MOVE 0.025 +#ifndef FINE_MANUAL_MOVE + #define FINE_MANUAL_MOVE 0.025 #endif screenFunc_t _manual_move_func_ptr; @@ -180,22 +180,22 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); - if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { + if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { // Determine digits needed right of decimal - constexpr uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; - PGM_P const label = GET_TEXT(MSG_MOVE_Z_DIST); + constexpr uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : + !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; + PGM_P const label = GET_TEXT(MSG_MOVE_N_MM); char tmp[strlen_P(label) + 10 + 1], numstr[10]; - sprintf_P(tmp, label, dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) extern const char NUL_STR[]; - SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); #else - SUBMENU_P(tmp, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + SUBMENU_P(tmp, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); #endif } } diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index b73945ea09cd..7804e732eca4 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -81,20 +81,20 @@ void probe_offset_wizard_menu() { SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); - if ((SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { + if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { char tmp[20], numstr[10]; // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : + !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; + sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) extern const char NUL_STR[]; - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); }); + SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); #else - SUBMENU_P(tmp, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); }); + SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); #endif } From 8c0505395135bcffad426e5d557742838a9eceda Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 14 Dec 2020 00:14:07 +0000 Subject: [PATCH 333/443] [cron] Bump distribution date (2020-12-14) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a40953130ca3..3ce75f4d91a0 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-13" + #define STRING_DISTRIBUTION_DATE "2020-12-14" #endif /** From 9fd358f10cccfacf210890e788fb8ddf73335bdd Mon Sep 17 00:00:00 2001 From: Chris Pepper Date: Mon, 14 Dec 2020 22:36:25 +0000 Subject: [PATCH 334/443] LPC176x framework update (#20469) --- Marlin/src/HAL/LPC1768/HAL.h | 3 --- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- platformio.ini | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 9a1852d94d38..f2347bf5a7fe 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -47,9 +47,6 @@ extern "C" volatile uint32_t _millis; #include #include -// i2c uses 8-bit shifted address -#define I2C_ADDRESS(A) uint8_t((A) << 1) - // // Default graphical display delays // diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 21d149fcafe6..06e060d93a42 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -24,7 +24,7 @@ #if PIO_PLATFORM_VERSION < 1001 #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically." #endif -#if PIO_FRAMEWORK_VERSION < 2005 +#if PIO_FRAMEWORK_VERSION < 2006 #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries." #endif diff --git a/platformio.ini b/platformio.ini index e2f1388efda3..753140467c83 100644 --- a/platformio.ini +++ b/platformio.ini @@ -683,7 +683,7 @@ debug_tool = jlink # [common_LPC] platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip -platform_packages = framework-arduino-lpc176x@^0.2.5 +platform_packages = framework-arduino-lpc176x@^0.2.6 board = nxp_lpc1768 lib_ldf_mode = off lib_compat_mode = strict From dee475cee1ab01dc4b22e3d9e6f5a813c4536dce Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 15 Dec 2020 00:13:55 +0000 Subject: [PATCH 335/443] [cron] Bump distribution date (2020-12-15) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3ce75f4d91a0..e984c9360f9d 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-14" + #define STRING_DISTRIBUTION_DATE "2020-12-15" #endif /** From fbefe55102e52f0a93e35eb8d6eea71e1463ce49 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 14 Dec 2020 20:34:15 -0600 Subject: [PATCH 336/443] Fix formatting --- Marlin/src/lcd/menu/menu_tramming.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index a0dad20e6247..e51cd0a31849 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -44,7 +44,7 @@ static uint8_t tram_index = 0; bool probe_single_point() { do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES)); - //Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety + // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true); DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); z_measured[tram_index] = z_probed_height; @@ -82,7 +82,7 @@ void tramming_wizard_menu() { ACTION_ITEM(MSG_BUTTON_DONE, []{ probe.stow(); // Stow before exiting Tramming Wizard ui.goto_previous_screen_no_defer(); - }); + }); END_MENU(); } From e349a44c6013a4a9d8d218e02dd334f70f3a79ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 19:56:16 -0600 Subject: [PATCH 337/443] Preheat before leveling --- Marlin/Configuration.h | 9 +++++++++ Marlin/src/gcode/bedlevel/abl/G29.cpp | 23 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d528a97bf783..f904803cc1f6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1289,6 +1289,15 @@ */ //#define RESTORE_LEVELING_AFTER_G28 +/** + * Auto-leveling needs preheating + */ +//#define PREHEAT_BEFORE_LEVELING +#if ENABLED(PREHEAT_BEFORE_LEVELING) + #define LEVELING_NOZZLE_TEMP 120 + #define LEVELING_BED_TEMP 50 +#endif + /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 05260955bf4d..157353c0630b 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -36,9 +36,12 @@ #include "../../../module/probe.h" #include "../../queue.h" +#if EITHER(PROBE_TEMP_COMPENSATION, PREHEAT_BEFORE_LEVELING) + #include "../../../module/temperature.h" +#endif + #if ENABLED(PROBE_TEMP_COMPENSATION) #include "../../../feature/probe_temp_comp.h" - #include "../../../module/temperature.h" #endif #if HAS_DISPLAY @@ -403,6 +406,24 @@ G29_TYPE GcodeSuite::G29() { if (!faux) remember_feedrate_scaling_off(); + #if ENABLED(PREHEAT_BEFORE_LEVELING) + #ifndef LEVELING_NOZZLE_TEMP + #define LEVELING_NOZZLE_TEMP 0 + #endif + #ifndef LEVELING_BED_TEMP + #define LEVELING_BED_TEMP 0 + #endif + if (!dryrun && !faux) { + constexpr uint16_t hotendPreheat = LEVELING_NOZZLE_TEMP, bedPreheat = LEVELING_BED_TEMP; + if (DEBUGGING(LEVELING)) + DEBUG_ECHOLNPAIR("Preheating hotend (", hotendPreheat, ") and bed (", bedPreheat, ")"); + if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0); + if (bedPreheat) thermalManager.setTargetBed(bedPreheat); + if (hotendPreheat) thermalManager.wait_for_hotend(0); + if (bedPreheat) thermalManager.wait_for_bed_heating(); + } + #endif + // Disable auto bed leveling during G29. // Be formal so G29 can be done successively without G28. if (!no_action) set_bed_leveling_enabled(false); From 80bde7b6b52a752a3f9b7cd925bbde4a0525c875 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Dec 2020 20:10:13 -0600 Subject: [PATCH 338/443] Always enable leveling after G28 --- Marlin/Configuration.h | 6 ++++-- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f904803cc1f6..4b3371226e61 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1284,10 +1284,12 @@ //#define MESH_BED_LEVELING /** - * Normally G28 leaves leveling disabled on completion. Enable - * this option to have G28 restore the prior leveling state. + * Normally G28 leaves leveling disabled on completion. Enable one of + * these options to restore the prior leveling state or to always enable + * leveling immediately after G28. */ //#define RESTORE_LEVELING_AFTER_G28 +//#define ENABLE_LEVELING_AFTER_G28 /** * Auto-leveling needs preheating diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index f54b2fb7d467..092d8d643ac1 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -241,7 +241,7 @@ void GcodeSuite::G28() { // Disable the leveling matrix before homing #if HAS_LEVELING - TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active); + const bool leveling_restore_state = ENABLED(ENABLE_LEVELING_AFTER_G28) || TERN0(RESTORE_LEVELING_AFTER_G28, planner.leveling_active); TERN_(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session set_bed_leveling_enabled(false); #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 10a196b9583b..c75cb1cd4180 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1445,7 +1445,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) + #elif !defined(RESTORE_LEVELING_AFTER_G28) && !defined(ENABLE_LEVELING_AFTER_G28) #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." #endif @@ -1473,6 +1473,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif +#if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28) + #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both." +#endif + #if HAS_MESH && HAS_CLASSIC_JERK static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); #endif From 81a0206df8b1eb2c3e99c3bffbb6f26324691339 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 14 Dec 2020 19:02:46 -0800 Subject: [PATCH 339/443] Trust that script -x flags will always be set (#20453) --- Makefile | 4 ---- buildroot/tests/ARMED-tests | 0 buildroot/tests/BIGTREE_BTT002-tests | 0 buildroot/tests/BIGTREE_GTR_V1_0-tests | 0 buildroot/tests/BIGTREE_SKR_PRO-tests | 0 buildroot/tests/FLYF407ZG-tests | 0 buildroot/tests/FYSETC_F6_13-tests | 0 buildroot/tests/FYSETC_S6-tests | 0 buildroot/tests/LERDGEX-tests | 0 buildroot/tests/NUCLEO_F767ZI-tests | 0 buildroot/tests/REMRAM_V1-tests | 0 buildroot/tests/SAMD51_grandcentral_m4-tests | 0 buildroot/tests/STM32F070CB_malyan-tests | 0 buildroot/tests/STM32F070RB_malyan-tests | 0 buildroot/tests/STM32F103CB_malyan-tests | 0 buildroot/tests/STM32F103RC_btt-tests | 0 buildroot/tests/STM32F103RC_btt_USB-tests | 0 buildroot/tests/STM32F103RC_fysetc-tests | 0 buildroot/tests/STM32F103RC_meeb-tests | 0 buildroot/tests/STM32F103RET6_creality-tests | 0 buildroot/tests/STM32F103RE_btt-tests | 0 buildroot/tests/STM32F103RE_btt_USB-tests | 0 buildroot/tests/STM32F401VE_STEVAL-tests | 0 buildroot/tests/at90usb1286_cdc-tests | 0 buildroot/tests/at90usb1286_dfu-tests | 0 buildroot/tests/jgaurora_a5s_a1-tests | 0 buildroot/tests/mega1280-tests | 0 buildroot/tests/mks_robin-tests | 0 buildroot/tests/mks_robin_lite-tests | 0 buildroot/tests/mks_robin_mini-tests | 0 buildroot/tests/mks_robin_nano35-tests | 0 buildroot/tests/mks_robin_nano35_stm32-tests | 0 buildroot/tests/mks_robin_pro-tests | 0 buildroot/tests/mks_robin_stm32-tests | 0 buildroot/tests/rambo-tests | 0 buildroot/tests/rumba32-tests | 0 buildroot/tests/sanguino1284p-tests | 0 buildroot/tests/sanguino644p-tests | 0 buildroot/tests/teensy41-tests | 0 39 files changed, 4 deletions(-) mode change 100644 => 100755 buildroot/tests/ARMED-tests mode change 100644 => 100755 buildroot/tests/BIGTREE_BTT002-tests mode change 100644 => 100755 buildroot/tests/BIGTREE_GTR_V1_0-tests mode change 100644 => 100755 buildroot/tests/BIGTREE_SKR_PRO-tests mode change 100644 => 100755 buildroot/tests/FLYF407ZG-tests mode change 100644 => 100755 buildroot/tests/FYSETC_F6_13-tests mode change 100644 => 100755 buildroot/tests/FYSETC_S6-tests mode change 100644 => 100755 buildroot/tests/LERDGEX-tests mode change 100644 => 100755 buildroot/tests/NUCLEO_F767ZI-tests mode change 100644 => 100755 buildroot/tests/REMRAM_V1-tests mode change 100644 => 100755 buildroot/tests/SAMD51_grandcentral_m4-tests mode change 100644 => 100755 buildroot/tests/STM32F070CB_malyan-tests mode change 100644 => 100755 buildroot/tests/STM32F070RB_malyan-tests mode change 100644 => 100755 buildroot/tests/STM32F103CB_malyan-tests mode change 100644 => 100755 buildroot/tests/STM32F103RC_btt-tests mode change 100644 => 100755 buildroot/tests/STM32F103RC_btt_USB-tests mode change 100644 => 100755 buildroot/tests/STM32F103RC_fysetc-tests mode change 100644 => 100755 buildroot/tests/STM32F103RC_meeb-tests mode change 100644 => 100755 buildroot/tests/STM32F103RET6_creality-tests mode change 100644 => 100755 buildroot/tests/STM32F103RE_btt-tests mode change 100644 => 100755 buildroot/tests/STM32F103RE_btt_USB-tests mode change 100644 => 100755 buildroot/tests/STM32F401VE_STEVAL-tests mode change 100644 => 100755 buildroot/tests/at90usb1286_cdc-tests mode change 100644 => 100755 buildroot/tests/at90usb1286_dfu-tests mode change 100644 => 100755 buildroot/tests/jgaurora_a5s_a1-tests mode change 100644 => 100755 buildroot/tests/mega1280-tests mode change 100644 => 100755 buildroot/tests/mks_robin-tests mode change 100644 => 100755 buildroot/tests/mks_robin_lite-tests mode change 100644 => 100755 buildroot/tests/mks_robin_mini-tests mode change 100644 => 100755 buildroot/tests/mks_robin_nano35-tests mode change 100644 => 100755 buildroot/tests/mks_robin_nano35_stm32-tests mode change 100644 => 100755 buildroot/tests/mks_robin_pro-tests mode change 100644 => 100755 buildroot/tests/mks_robin_stm32-tests mode change 100644 => 100755 buildroot/tests/rambo-tests mode change 100644 => 100755 buildroot/tests/rumba32-tests mode change 100644 => 100755 buildroot/tests/sanguino1284p-tests mode change 100644 => 100755 buildroot/tests/sanguino644p-tests mode change 100644 => 100755 buildroot/tests/teensy41-tests diff --git a/Makefile b/Makefile index 8e1c77aa9935..ebcdf25e2d6a 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,6 @@ tests-single-ci: tests-single-local: @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET= or use make tests-all-local" ; return 1; fi - chmod +x buildroot/bin/* - chmod +x buildroot/tests/* export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && run_tests . $(TEST_TARGET) "$(ONLY_TEST)" @@ -40,8 +38,6 @@ tests-single-local-docker: .PHONY: tests-single-local-docker tests-all-local: - chmod +x buildroot/bin/* - chmod +x buildroot/tests/* export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done diff --git a/buildroot/tests/ARMED-tests b/buildroot/tests/ARMED-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/BIGTREE_BTT002-tests b/buildroot/tests/BIGTREE_BTT002-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/BIGTREE_SKR_PRO-tests b/buildroot/tests/BIGTREE_SKR_PRO-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/FLYF407ZG-tests b/buildroot/tests/FLYF407ZG-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/FYSETC_F6_13-tests b/buildroot/tests/FYSETC_F6_13-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/FYSETC_S6-tests b/buildroot/tests/FYSETC_S6-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/LERDGEX-tests b/buildroot/tests/LERDGEX-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/NUCLEO_F767ZI-tests b/buildroot/tests/NUCLEO_F767ZI-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/REMRAM_V1-tests b/buildroot/tests/REMRAM_V1-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/SAMD51_grandcentral_m4-tests b/buildroot/tests/SAMD51_grandcentral_m4-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F070CB_malyan-tests b/buildroot/tests/STM32F070CB_malyan-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F070RB_malyan-tests b/buildroot/tests/STM32F070RB_malyan-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103CB_malyan-tests b/buildroot/tests/STM32F103CB_malyan-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RC_btt-tests b/buildroot/tests/STM32F103RC_btt-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RC_btt_USB-tests b/buildroot/tests/STM32F103RC_btt_USB-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RC_fysetc-tests b/buildroot/tests/STM32F103RC_fysetc-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RC_meeb-tests b/buildroot/tests/STM32F103RC_meeb-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RE_btt-tests b/buildroot/tests/STM32F103RE_btt-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F103RE_btt_USB-tests b/buildroot/tests/STM32F103RE_btt_USB-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/STM32F401VE_STEVAL-tests b/buildroot/tests/STM32F401VE_STEVAL-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/at90usb1286_cdc-tests b/buildroot/tests/at90usb1286_cdc-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/at90usb1286_dfu-tests b/buildroot/tests/at90usb1286_dfu-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/jgaurora_a5s_a1-tests b/buildroot/tests/jgaurora_a5s_a1-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mega1280-tests b/buildroot/tests/mega1280-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin-tests b/buildroot/tests/mks_robin-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_lite-tests b/buildroot/tests/mks_robin_lite-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_mini-tests b/buildroot/tests/mks_robin_mini-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_nano35_stm32-tests b/buildroot/tests/mks_robin_nano35_stm32-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_pro-tests b/buildroot/tests/mks_robin_pro-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/mks_robin_stm32-tests b/buildroot/tests/mks_robin_stm32-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/rumba32-tests b/buildroot/tests/rumba32-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/sanguino1284p-tests b/buildroot/tests/sanguino1284p-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/sanguino644p-tests b/buildroot/tests/sanguino644p-tests old mode 100644 new mode 100755 diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests old mode 100644 new mode 100755 From 7be57ff9f0ef3158e6cf4ce7ef44473d09702478 Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Tue, 15 Dec 2020 05:04:45 +0200 Subject: [PATCH 340/443] Fix M1001 auto-check logic (#20456) --- Marlin/src/gcode/sd/M1001.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 406cd074c3c2..8e24b60493f5 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -65,7 +65,7 @@ */ void GcodeSuite::M1001() { // If there's another auto#.g file to run... - if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return; + if (TERN(NO_SD_AUTOSTART, false, !card.autofile_check())) return; // Purge the recovery file... TERN_(POWER_LOSS_RECOVERY, recovery.purge()); From 5a6fc3e5b7e4f834fb63603fe663ce12ac5e3ecc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 14 Dec 2020 21:06:56 -0600 Subject: [PATCH 341/443] Auto-check followup --- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 8e24b60493f5..406cd074c3c2 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -65,7 +65,7 @@ */ void GcodeSuite::M1001() { // If there's another auto#.g file to run... - if (TERN(NO_SD_AUTOSTART, false, !card.autofile_check())) return; + if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return; // Purge the recovery file... TERN_(POWER_LOSS_RECOVERY, recovery.purge()); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index fe8bc4879a78..88b42f836d2f 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -755,10 +755,10 @@ void CardReader::write_command(char * const buf) { * - After finishing the previous auto#.g file * - From the LCD command to begin the auto#.g files * - * Return 'true' if there was nothing to do + * Return 'true' if an auto file was started */ bool CardReader::autofile_check() { - if (!autofile_index) return true; + if (!autofile_index) return false; if (!isMounted()) mount(); @@ -773,11 +773,11 @@ void CardReader::write_command(char * const buf) { cdroot(); openAndPrintFile(autoname); autofile_index++; - return false; + return true; } } autofile_cancel(); - return true; + return false; } #endif From 69999f962a7783f0a79c4fc87b62caaf07d93187 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 14 Dec 2020 21:27:05 -0600 Subject: [PATCH 342/443] Please install the EditorConfig plugin --- Marlin/Configuration.h | 4 ++-- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4b3371226e61..8b29a4ba80c2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -957,14 +957,14 @@ * X and Y offset * Use a caliper or ruler to measure the distance from the tip of * the Nozzle to the center-point of the Probe in the X and Y axes. - * + * * Z offset * - For the Z offset use your best known value and adjust at runtime. * - Common probes trigger below the nozzle and have negative values for Z offset. * - Probes triggering above the nozzle height are uncommon but do exist. When using * probes such as this, carefully set Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES * to avoid collisions during probing. - * + * * Tune and Adjust * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. * - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset. diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 69371f0f73df..8b5b8562a2bb 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -60,7 +60,7 @@ // #ifndef HAS_PIN_27_BOARD #define SERVO0_PIN PB0 // BLTouch OUT -#else +#else #define SERVO0_PIN PC6 #endif From 1be16e3d8c44965f2e3f58b2845f9ac8ecdbc74b Mon Sep 17 00:00:00 2001 From: JoAnn Manges Date: Tue, 15 Dec 2020 01:16:50 -0500 Subject: [PATCH 343/443] Fix RESTORE_LEVELING_AFTER_G28 (#20471) --- Marlin/src/gcode/calibrate/G28.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 092d8d643ac1..23c4d56d936a 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -435,7 +435,7 @@ void GcodeSuite::G28() { do_blocking_move_to_z(delta_clip_start_height); #endif - TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_was_active)); + TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_restore_state)); restore_feedrate_and_scaling(); From 686bb056a44369f19a98964d38a68b6857d5a83a Mon Sep 17 00:00:00 2001 From: Sebastiaan Dammann Date: Mon, 14 Dec 2020 21:29:59 +0100 Subject: [PATCH 344/443] Creality v4.5.3 (CR-6 SE, CR-6 MAX) (#20468) --- Marlin/src/core/boards.h | 9 +- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 90 +-------------- Marlin/src/pins/stm32f1/pins_CREALITY_V453.h | 38 +++++++ Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h | 113 +++++++++++++++++++ 5 files changed, 162 insertions(+), 90 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V453.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 7f0a99dca329..172cdd6b5a75 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -330,10 +330,11 @@ #define BOARD_CREALITY_V4 4037 // Creality v4.x (STM32F103RE) #define BOARD_CREALITY_V427 4038 // Creality v4.2.7 (STM32F103RE) #define BOARD_CREALITY_V452 4039 // Creality v4.5.2 (STM32F103RE) -#define BOARD_TRIGORILLA_PRO 4040 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4041 // FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4042 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4043 // STM32F103RET6 Libmaple-based controller +#define BOARD_CREALITY_V453 4040 // Creality v4.5.3 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4041 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4042 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4043 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4044 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index c9f6f7b3b35f..52e6d26b142e 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -532,6 +532,8 @@ #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality #elif MB(CREALITY_V452) #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality +#elif MB(CREALITY_V453) + #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RET6_creality #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro #elif MB(FLY_MINI) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index f65e1d5474b5..35eea1da7891 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -24,97 +24,15 @@ * Creality v4.5.2 (STM32F103RET6) board pin assignments */ -#if NOT_TARGET(__STM32F1__) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#elif HOTENDS > 1 || E_STEPPERS > 1 - #error "CREALITY_V452 supports up to 1 hotends / E-steppers. Comment out this line to continue." +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "Creality v4.5.2 only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_NAME "Creality v4.5.2" -#define DEFAULT_MACHINE_NAME "Creality3D" -// -// Release PB4 (Z_STEP_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG - -#define BOARD_NO_NATIVE_USB - -// -// EEPROM -// -#if NO_EEPROM_SELECTED - #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 - //#define SDCARD_EEPROM_EMULATION -#endif - -#if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) -#elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb -#endif - -// -// Limit Switches -// -#define X_STOP_PIN PC4 -#define Y_STOP_PIN PC5 -#define Z_STOP_PIN PA4 - -#define FIL_RUNOUT_PIN PA7 - -// -// Probe -// -#define PROBE_TARE_PIN PA5 -#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe - -// -// Steppers -// -#define X_ENABLE_PIN PC3 -#define X_STEP_PIN PB8 -#define X_DIR_PIN PB7 - -#define Y_ENABLE_PIN PC3 -#define Y_STEP_PIN PB6 -#define Y_DIR_PIN PB5 - -#define Z_ENABLE_PIN PC3 -#define Z_STEP_PIN PB4 -#define Z_DIR_PIN PB3 - -#define E0_ENABLE_PIN PC3 -#define E0_STEP_PIN PC2 -#define E0_DIR_PIN PB9 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PB1 // TH1 -#define TEMP_BED_PIN PB0 // TB1 - -// -// Heaters / Fans -// #define HEATER_0_PIN PA1 // HEATER1 #define HEATER_BED_PIN PA2 // HOT BED - #define FAN_PIN PA0 // FAN -#define FAN_SOFT_PWM - -// -// SD Card -// -#define SD_DETECT_PIN PC7 -#define NO_SD_HOST_DRIVE // SD is only seen by the printer - -#define SDIO_SUPPORT // Extra added by Creality -#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h +#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe -// -// Misc. Functions -// -#define CASE_LIGHT_PIN PA6 +#include "pins_CREALITY_V45x.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h new file mode 100644 index 000000000000..836e5a91f1b6 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Creality v4.5.3 (STM32F103RET6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "Creality v4.5.3 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_NAME "Creality v4.5.3" + +#define HEATER_0_PIN PB14 // HEATER1 +#define HEATER_BED_PIN PB13 // HOT BED +#define FAN_PIN PB15 // FAN +#define PROBE_ENABLE_PIN PB2 // Optoswitch to Enable Z Probe + +#include "pins_CREALITY_V45x.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h new file mode 100644 index 000000000000..f2be2895305f --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h @@ -0,0 +1,113 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Creality v4.5.2 and v4.5.3 (STM32F103RET6) board pin assignments + */ + +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define DEFAULT_MACHINE_NAME "Creality3D" + +// +// Release PB4 (Z_STEP_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +#define BOARD_NO_NATIVE_USB + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + //#define SDCARD_EEPROM_EMULATION +#endif + +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2Kb +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PC4 +#define Y_STOP_PIN PC5 +#define Z_STOP_PIN PA4 + +#define FIL_RUNOUT_PIN PA7 + +// +// Probe +// +#define PROBE_TARE_PIN PA5 + +// +// Steppers +// +#define X_ENABLE_PIN PC3 +#define X_STEP_PIN PB8 +#define X_DIR_PIN PB7 + +#define Y_ENABLE_PIN PC3 +#define Y_STEP_PIN PB6 +#define Y_DIR_PIN PB5 + +#define Z_ENABLE_PIN PC3 +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB3 + +#define E0_ENABLE_PIN PC3 +#define E0_STEP_PIN PC2 +#define E0_DIR_PIN PB9 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PB1 // TH1 +#define TEMP_BED_PIN PB0 // TB1 + +// +// Heaters / Fans +// + +#define FAN_SOFT_PWM + +// +// SD Card +// +#define SD_DETECT_PIN PC7 +#define NO_SD_HOST_DRIVE // SD is only seen by the printer + +#define SDIO_SUPPORT // Extra added by Creality +#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h + +// +// Misc. Functions +// +#define CASE_LIGHT_PIN PA6 From 7243ea549dee2519fa24b2a3f6810a28b46b2331 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 15 Dec 2020 00:44:00 -0600 Subject: [PATCH 345/443] Update some pins errors --- Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h | 2 +- Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 2 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 2 +- Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 4 ++-- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 2 +- Marlin/src/pins/stm32f7/pins_REMRAM_V1.h | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h index 3bcaae96a330..6fcb7b94e0c2 100644 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h @@ -28,7 +28,7 @@ #if NOT_TARGET(__AVR_ATmega2560__) #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "Longer3D LGT KIT V1.0 board only supports 1 hotend / E-stepper. Comment out this line to continue." + #error "Longer3D LGT KIT V1.0 board only supports one hotend / E-stepper. Comment out this line to continue." #endif #if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 diff --git a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h index 513c7fe8d5d6..d9964242dd58 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 1 || E_STEPPERS > 1 - #error "Ender-4 supports only 1 hotend / E-stepper. Comment out this line to continue." + #error "Ender-4 only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "Ender-4" diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 0e94249a993c..a255160829ad 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -24,7 +24,7 @@ #if NOT_TARGET(TARGET_STM32F1) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "CCROBOT-ONLINE MEEB_3DP only supports 1 hotend / E-stepper. Comment out this line to continue." + #error "CCROBOT-ONLINE MEEB_3DP only supports one hotend / E-stepper. Comment out this line to continue." #endif // https://github.com/ccrobot-online/MEEB_3DP diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 7541f8272941..c20af310cc2a 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -32,7 +32,7 @@ #if NOT_TARGET(__STM32F1__, STM32F1xx) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "FLSUN HiSpeedV1 supports 1 hotend / E-stepper. Comment out this line to continue." + #error "FLSUN HiSpeedV1 only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "FLSun HiSpeedV1" diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index f86acf1f2414..4f02b0e23cde 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -31,10 +31,10 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue." + #error "JGAurora A5S A1 only supports one hotend / E-stepper. Comment out this line to continue." #endif -#define BOARD_INFO_NAME "JGAurora A5S A1 board" +#define BOARD_INFO_NAME "JGAurora A5S A1" #define BOARD_NO_NATIVE_USB diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index fd5c57387846..33f995dcaef0 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -25,7 +25,7 @@ #if NOT_TARGET(__STM32F1__, STM32F1xx) #error "Oops! Select a STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "Longer3D board only supports 1 hotend / E-stepper. Comment out this line to continue." + #error "Longer3D only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "Longer3D" diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index d7c4aebe37dc..1ad18a6497cf 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -24,7 +24,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin Lite supports only 1 hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin Lite only supports one hotend / E-stepper. Comment out this line to continue." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index ae6835758993..e6a1e929993b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -28,7 +28,7 @@ #if NOT_TARGET(__STM32F1__) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "MKS Robin mini only supports 1 hotend / E-stepper. Comment out this line to continue." + #error "MKS Robin mini only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "MKS Robin Mini" 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 660ba29e97d1..af2ebce9ed8b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -24,7 +24,7 @@ #if NOT_TARGET(STM32F4) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "BIGTREE BTT002 V1.0 only supports one hotend / E-stepper." + #error "BIGTREE BTT002 V1.0 only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "BTT BTT002 V1.0" diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index 075aec6e9bf8..6e0b3e14a786 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -21,7 +21,7 @@ #if NOT_TARGET(STM32F4, STM32F4xx) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 1 || E_STEPPERS > 1 - #error "LERDGE X only supports one hotend / E-steppers" + #error "LERDGE X only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "Lerdge X" diff --git a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index f07cf824d22c..133dcd2935d3 100644 --- a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h @@ -33,7 +33,7 @@ #endif #if HOTENDS > 1 || E_STEPPERS > 1 - #error "RemRam only supports one hotend / E-stepper." + #error "RemRam only supports one hotend / E-stepper. Comment out this line to continue." #endif // From 637123f34013a7a094b7bca5e298e56124d477ef Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 15 Dec 2020 01:00:28 -0600 Subject: [PATCH 346/443] Update some LCD includes --- Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h | 2 ++ Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h | 2 ++ Marlin/src/libs/buzzer.h | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp index ed26cac3c503..536640ec9526 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp @@ -26,7 +26,7 @@ #if ENABLED(DGUS_LCD_UI_HIPRECY) -#include "../DGUSDisplayDef.h" +#include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h index 3ff5e06dc18c..d18989a48b00 100644 --- a/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h @@ -21,6 +21,8 @@ */ #pragma once +#include "../DGUSDisplayDef.h" + enum DGUSLCD_Screens : uint8_t { DGUSLCD_SCREEN_BOOT = 160, DGUSLCD_SCREEN_MAIN = 1, diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp index 46e542a9598a..28e66e5d7ce4 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp @@ -26,7 +26,7 @@ #if ENABLED(DGUS_LCD_UI_ORIGIN) -#include "../DGUSDisplayDef.h" +#include "DGUSDisplayDef.h" #include "../DGUSDisplay.h" #include "../DGUSScreenHandler.h" diff --git a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h index 451c11adba16..5c5a315de6dc 100644 --- a/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.h @@ -21,6 +21,8 @@ */ #pragma once +#include "../DGUSDisplayDef.h" + enum DGUSLCD_Screens : uint8_t { DGUSLCD_SCREEN_BOOT = 0, DGUSLCD_SCREEN_MAIN = 10, diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index e901660c87d1..b86fe998fa05 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -118,6 +118,7 @@ #elif HAS_BUZZER // Buzz indirectly via the MarlinUI instance + #include "../lcd/marlinui.h" #define BUZZ(d,f) ui.buzz(d,f) #else From 3f93b8baed5cc905267674b6534a229a9bfacbf2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 15 Dec 2020 00:53:53 -0600 Subject: [PATCH 347/443] Trust STM32 gcc versions --- Marlin/src/HAL/STM32/HAL.h | 10 +++------- Marlin/src/HAL/STM32F1/HAL.h | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 9842cdaae4b0..f2fb5ddb6a25 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -143,19 +143,15 @@ void _delay_ms(const int delay); extern "C" char* _sbrk(int incr); -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wunused-function" -#endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic pop -#endif +#pragma GCC diagnostic pop // // ADC diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 2c852f22e1c3..7163db43a2fd 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -191,10 +191,8 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader void _delay_ms(const int delay); -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wunused-function" -#endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" /* extern "C" { @@ -209,9 +207,7 @@ static inline int freeMemory() { return &top - _sbrk(0); } -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic pop -#endif +#pragma GCC diagnostic pop // // ADC From 1c4f125cb094775f8947396b8063240453df766c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 16 Dec 2020 00:14:09 +0000 Subject: [PATCH 348/443] [cron] Bump distribution date (2020-12-16) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e984c9360f9d..47d937759187 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-15" + #define STRING_DISTRIBUTION_DATE "2020-12-16" #endif /** From e6fdf530b868e4bb4857da6f5b23e62cff5e17c5 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 16 Dec 2020 07:35:13 +0100 Subject: [PATCH 349/443] Update Italian language (#20480) --- Marlin/src/lcd/language/language_it.h | 40 ++++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 61cb3ec28427..ffc6d31a9a00 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -71,7 +71,6 @@ namespace Language_it { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home asse Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); - PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Tramming assistito"); PROGMEM Language_Str MSG_ITERATION = _UxGT("Iterazione G34: %i"); PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Precis.in calo!"); PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precis.raggiunta"); @@ -83,6 +82,10 @@ namespace Language_it { PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Imp. offset home"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Imposta Origine"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Tramming assistito"); + PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); + PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); + PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Ultimo valore "); #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preriscalda ") PREHEAT_1_LABEL; PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preriscalda ") PREHEAT_1_LABEL " ~"; @@ -120,6 +123,8 @@ namespace Language_it { PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Livella piano"); PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Livella piano"); PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Livella spigoli"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Sollevare il letto finché la sonda non viene attivata"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Tutti gli angoli entro tolleranza. Livella il piano"); PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Prossimo spigolo"); PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mesh"); PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifica Mesh"); @@ -129,7 +134,6 @@ namespace Language_it { PROGMEM Language_Str MSG_MESH_Y = _UxGT("Indice Y"); PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valore di Z"); PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comandi personaliz."); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); PROGMEM Language_Str MSG_M48_TEST = _UxGT("Test sonda M48"); PROGMEM Language_Str MSG_M48_POINT = _UxGT("Punto M48"); PROGMEM Language_Str MSG_M48_OUT_OF_BOUNDS = _UxGT("Sonda oltre i limiti"); @@ -140,12 +144,14 @@ namespace Language_it { PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicazione"); PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia speculare"); PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pieno controllo"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("X-Gap-X duplicato"); PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2° ugello X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2° ugello Y"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2° ugello Z"); PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 in corso"); PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Strumenti UBL"); - PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Livel.letto unificato"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Mesh Manuale"); PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Metti spes. e misura"); PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Misura"); @@ -254,6 +260,9 @@ namespace Language_it { PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); + PROGMEM Language_Str MSG_MOVE_0001IN = _UxGT("Muovi di 0.001in"); + PROGMEM Language_Str MSG_MOVE_001IN = _UxGT("Muovi di 0.01in"); + PROGMEM Language_Str MSG_MOVE_01IN = _UxGT("Muovi di 0.1in"); PROGMEM Language_Str MSG_SPEED = _UxGT("Velocità"); PROGMEM Language_Str MSG_BED_Z = _UxGT("Piatto Z"); PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ugello"); @@ -372,6 +381,7 @@ namespace Language_it { PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Fatto"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Indietro"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procedi"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Salta"); PROGMEM Language_Str MSG_PAUSING = _UxGT("Messa in pausa..."); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Riprendi stampa"); @@ -554,14 +564,14 @@ namespace Language_it { PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Agg.firmware MMU!"); PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU chiede attenz."); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Riprendi stampa"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Ripresa..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Carica filamento"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Carica tutto"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("MMU riprendi"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU ripresa..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU carica"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU carica tutto"); PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Carica fino ugello"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Espelli filamento"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Espelli filam.~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Scarica filamento"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU espelli"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU espelli ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU scarica"); PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Caric.fil. %i..."); PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Esplus.filam. ..."); PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Scaric.filam. ..."); @@ -662,5 +672,15 @@ namespace Language_it { PROGMEM Language_Str MSG_REHEATING = _UxGT("Riscaldando..."); PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Proc.guid.sonda Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Tasteggio rif.Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Movim.a pos.tasteg."); + PROGMEM Language_Str MSG_SOUND = _UxGT("Suono"); + + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Alto Sinistra"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Basso Sinistra"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Alto Destra"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Basso Destra"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibrazione completata"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibrazion fallita"); } From f934b774a173f6cb984fd524f8950143c8a7c82f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 16 Dec 2020 00:41:55 -0600 Subject: [PATCH 350/443] Update Hungarian language Co-Authored-By: Zs.Antal <45710979+AntoszHUN@users.noreply.github.com> --- Marlin/src/lcd/language/language_hu.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index e07c0f6ac756..acd27c96aa4d 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -375,8 +375,8 @@ namespace Language_hu { PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Ugrás mm"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Visszah.helyre mm"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Csere.Visszah.helyre mm"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Unretract V"); - PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Visszavonás V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S Vi.vo V"); PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoVisszah."); PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Visszahúzás Távolság"); PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Extra Csere"); @@ -422,11 +422,11 @@ namespace Language_hu { PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("VESZÉLY: A rossz beállítások kárt okozhatnak! Biztos továbblép?"); PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Kezd TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Teszt"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Eltolás Teszt"); PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Mentés"); PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI Használ"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Probe Használ"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Probe Elhelyezés"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Szonda Használ"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Szonda Elhelyezés"); PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Elsö %s%s%s Kell"); PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Szonda Eltolások"); PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Szonda X Eltolás"); @@ -439,9 +439,9 @@ namespace Language_hu { PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!"); PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Fütés hiba!"); PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Hiba: SZÜKSÉGTELEN HÖFOK"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FÜTÉS KIMARADÁS"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ÁGY FÜTÉS KIMARADÁS"); - PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMRA FÜTÉS KIMARADÁS"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FÜTÉSKIMARADÁS"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ÁGY FÜTÉSKIMARADÁS"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMRA FÜTÉSKIMARADÁS"); PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Hiba: MAX Höfok"); PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Hiba: MIN Höfok"); PROGMEM Language_Str MSG_HALTED = _UxGT("A NYOMTATÓ LEFAGYOTT"); @@ -585,7 +585,7 @@ namespace Language_hu { PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Várj a", "szál betöltésére")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Várj a", "szál tisztításra")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Kattints a készre", "szál tiszta")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Várj a nyomtatóra", "majd foltyat...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Várj a nyomtatóra", "majd folytat...")); #else PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Katt a folytatáshoz")); PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parkolás...")); From c6dcf9d0067fdd6c81f8f229dd18aa34ac84c90a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 16 Dec 2020 07:46:10 +0100 Subject: [PATCH 351/443] Update French language (#20472) --- Marlin/src/lcd/language/language_fr.h | 35 +++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 4e58e4005ce9..031db358bd31 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -69,6 +69,10 @@ namespace Language_fr { PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Régl. décal origine"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Régler origine"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assistant Molettes"); + PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes"); + PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin + PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Ecart origine "); #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Préchauffage ") PREHEAT_1_LABEL; PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Préchauffage ") PREHEAT_1_LABEL " ~"; @@ -99,6 +103,8 @@ namespace Language_fr { PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Régler Niv. lit"); PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveau du lit"); PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Niveau des coins"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Relever le coin jusqu'à la sonde"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Coins dans la tolérance. Niveau lit "); PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Coin suivant"); PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Modif. maille"); // 13 car. max PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifier grille"); @@ -313,6 +319,7 @@ namespace Language_fr { PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Terminé"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Retour"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procéder"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Passer"); PROGMEM Language_Str MSG_PAUSING = _UxGT("Mise en pause..."); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause impression"); PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Reprendre impr."); @@ -571,12 +578,26 @@ namespace Language_fr { PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Lissage"); - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Haut à Gauche"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bas à Gauche"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Haut à Droite"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Bas à Droite"); - PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration Terminée"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Échec de l'étalonnage"); + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Niveau axe X"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Etalon. auto."); + #if ENABLED(TOUCH_UI_FTDI_EVE) + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("En protection, temp. réduite. Ok pour rechauffer et continuer."); + #else + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("En protection"); #endif + PROGMEM Language_Str MSG_REHEAT = _UxGT("Chauffer"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Réchauffe..."); + + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Assistant Sonde Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Mesure référence"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Dépl. vers pos"); + + PROGMEM Language_Str MSG_SOUND = _UxGT("Sons"); + + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Coin haut gauche"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Coin bas gauche"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Coin haut droit"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Coin bas droit"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration terminée"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Échec de l'étalonnage"); } From 6d47baee5dfcdfc7b8753eb76f4fb01be2fb5d4a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 17 Dec 2020 00:15:48 +0000 Subject: [PATCH 352/443] [cron] Bump distribution date (2020-12-17) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 47d937759187..d16aa57e63e0 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-16" + #define STRING_DISTRIBUTION_DATE "2020-12-17" #endif /** From 20b3af1cc2c4a5e8505d1aae3419ab9418ed88ab Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 16 Dec 2020 22:18:40 -0600 Subject: [PATCH 353/443] Use homing_feedrate function --- Marlin/src/core/types.h | 1 - Marlin/src/feature/encoder_i2c.cpp | 4 ++-- Marlin/src/feature/powerloss.cpp | 2 +- Marlin/src/gcode/calibrate/G34.cpp | 2 +- Marlin/src/gcode/feature/pause/G61.cpp | 11 +++++++---- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 6 +++--- .../src/lcd/extui/lib/mks_ui/draw_filament_change.cpp | 2 -- Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp | 2 -- Marlin/src/lcd/menu/menu_probe_offset.cpp | 2 +- Marlin/src/module/motion.cpp | 2 +- Marlin/src/module/motion.h | 6 +++++- Marlin/src/module/planner.h | 2 +- Marlin/src/module/probe.cpp | 11 +++-------- 13 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index a5b78caabbe4..20519e1888b5 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -75,7 +75,6 @@ typedef float feedRate_t; // Conversion macros #define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f) #define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f) -#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage) // // Coordinates structures for XY, XYZ, XYZE... diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 8a3e959e0702..028e3abe5489 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -332,7 +332,7 @@ bool I2CPositionEncoder::test_axis() { const float startPosition = soft_endstop.min[encoderAxis] + 10, endPosition = soft_endstop.max[encoderAxis] - 10; - const feedRate_t fr_mm_s = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); + const feedRate_t fr_mm_s = FLOOR(homing_feedrate(encoderAxis)); ec = false; @@ -382,7 +382,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { int32_t startCount, stopCount; - const feedRate_t fr_mm_s = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); + const feedRate_t fr_mm_s = homing_feedrate(encoderAxis); bool oldec = ec; ec = false; diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index c55b278a724a..c679e6b68f8a 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -180,7 +180,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/ // Machine state info.current_position = current_position; - info.feedrate = uint16_t(feedrate_mm_s * 60.0f); + info.feedrate = uint16_t(MMS_TO_MMM(feedrate_mm_s)); info.zraise = zraise; TERN_(GCODE_REPEAT_MARKERS, info.stored_repeat = repeat); diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index 85e843c2c8f1..a96eac0a882f 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -63,7 +63,7 @@ void GcodeSuite::G34() { // Move Z to pounce position if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Setting Z Pounce"); - do_blocking_move_to_z(zpounce, MMM_TO_MMS(HOMING_FEEDRATE_Z)); + do_blocking_move_to_z(zpounce, homing_feedrate(Z_AXIS)); // Store current motor settings, then apply reduced value diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index d8049f02bcef..5d89af0ab84e 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -49,10 +49,6 @@ void GcodeSuite::G61(void) { // No saved position? No axes being restored? if (!TEST(saved_slots[slot >> 3], slot & 0x07) || !parser.seen("XYZ")) return; - // Apply any given feedrate over 0.0 - const float fr = parser.linearval('F'); - if (fr > 0.0) feedrate_mm_s = MMM_TO_MMS(fr); - SERIAL_ECHOPAIR(STR_RESTORING_POS " S", int(slot)); LOOP_XYZ(i) { destination[i] = parser.seen(XYZ_CHAR(i)) @@ -63,8 +59,15 @@ void GcodeSuite::G61(void) { } SERIAL_EOL(); + // Apply any given feedrate over 0.0 + feedRate_t saved_feedrate = feedrate_mm_s; + const float fr = parser.linearval('F'); + if (fr > 0.0) feedrate_mm_s = MMM_TO_MMS(fr); + // Move to the saved position prepare_line_to_destination(); + + feedrate_mm_s = saved_feedrate; } #endif // SAVED_POSITIONS diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index db44782fde08..38e41ba11eae 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -1166,7 +1166,7 @@ void HMI_Move_X() { if (!planner.is_full()) { // Wait for planner moves to finish! planner.synchronize(); - planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_XY), active_extruder); + planner.buffer_line(current_position, homing_feedrate(X_AXIS), active_extruder); } DWIN_UpdateLCD(); return; @@ -1189,7 +1189,7 @@ void HMI_Move_Y() { if (!planner.is_full()) { // Wait for planner moves to finish! planner.synchronize(); - planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_XY), active_extruder); + planner.buffer_line(current_position, homing_feedrate(Y_AXIS), active_extruder); } DWIN_UpdateLCD(); return; @@ -1212,7 +1212,7 @@ void HMI_Move_Z() { if (!planner.is_full()) { // Wait for planner moves to finish! planner.synchronize(); - planner.buffer_line(current_position, MMM_TO_MMS(HOMING_FEEDRATE_Z), active_extruder); + planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); } DWIN_UpdateLCD(); return; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index 1db11a20e687..4ab60321b6a7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -45,8 +45,6 @@ enum { ID_FILAMNT_RETURN }; -extern feedRate_t feedrate_mm_s; - static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index 518ddbd25145..ec68c27212da 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -53,8 +53,6 @@ enum { static lv_obj_t *label_PowerOff; static lv_obj_t *buttonPowerOff; -extern feedRate_t feedrate_mm_s; - static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; switch (obj->mks_obj_id) { diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 7804e732eca4..5b88c8e805cc 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -146,7 +146,7 @@ void prepare_for_probe_offset_wizard() { // Move Nozzle to Probing/Homing Position ui.wait_for_move = true; current_position += probe.offset_xy; - line_to_current_position(MMM_TO_MMS(HOMING_FEEDRATE_XY)); + line_to_current_position(MMM_TO_MMS(XY_PROBE_SPEED)); ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING)); ui.wait_for_move = false; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 7b4c89e759a1..28bf16a310c6 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -510,7 +510,7 @@ void do_z_clearance(const float &zclear, const bool z_trusted/*=true*/, const bo const bool rel = raise_on_untrusted && !z_trusted; float zdest = zclear + (rel ? current_position.z : 0.0f); if (!lower_allowed) NOLESS(zdest, current_position.z); - do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), MMM_TO_MMS(TERN(HAS_BED_PROBE, Z_PROBE_SPEED_FAST, HOMING_FEEDRATE_Z))); + do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST), homing_feedrate(Z_AXIS))); } // diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index efbfd7de4dda..2eb54f36fbc1 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -73,12 +73,16 @@ extern const feedRate_t homing_feedrate_mm_s[XYZ]; FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } feedRate_t get_homing_bump_feedrate(const AxisEnum axis); +/** + * The default feedrate for many moves, set by the most recent move + */ extern feedRate_t feedrate_mm_s; /** - * Feedrate scaling + * Feedrate scaling is applied to all G0/G1, G2/G3, and G5 moves */ extern int16_t feedrate_percentage; +#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage) // The active extruder (tool). Set with T command. #if HAS_MULTI_EXTRUDER diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index ac30938f2a4a..5050f060b0a6 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -978,6 +978,6 @@ class Planner { #endif // !CLASSIC_JERK }; -#define PLANNER_XY_FEEDRATE() (_MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS])) +#define PLANNER_XY_FEEDRATE() _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) extern Planner planner; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 400206f83ae1..edf7ba3e2000 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -152,8 +152,8 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() inline void run_stow_moves_script() { const xyz_pos_t oldpos = current_position; endstops.enable_z_probe(false); - do_blocking_move_to_z(TOUCH_MI_RETRACT_Z, MMM_TO_MMS(HOMING_FEEDRATE_Z)); - do_blocking_move_to(oldpos, MMM_TO_MMS(HOMING_FEEDRATE_Z)); + do_blocking_move_to_z(TOUCH_MI_RETRACT_Z, homing_feedrate(Z_AXIS)); + do_blocking_move_to(oldpos, homing_feedrate(Z_AXIS)); } #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -664,11 +664,8 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise } else if (!position_is_reachable(npos)) return NAN; // The given position is in terms of the nozzle - const float old_feedrate_mm_s = feedrate_mm_s; - feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; - // Move the probe to the starting XYZ - do_blocking_move_to(npos); + do_blocking_move_to(npos, feedRate_t(XY_PROBE_FEEDRATE_MM_S)); float measured_z = NAN; if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z; @@ -683,8 +680,6 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise SERIAL_ECHOLNPAIR("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z); } - feedrate_mm_s = old_feedrate_mm_s; - if (isnan(measured_z)) { stow(); LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); From fbcc07261d944222cca30ef8590fb387f53fcc70 Mon Sep 17 00:00:00 2001 From: rafaljot Date: Thu, 17 Dec 2020 13:02:05 +0100 Subject: [PATCH 354/443] Homing feedrates as XYZ array (#20426) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 5 ++--- Marlin/src/inc/Conditionals_post.h | 6 +----- Marlin/src/inc/SanityCheck.h | 4 +++- Marlin/src/module/motion.cpp | 16 +++------------- Marlin/src/module/motion.h | 22 +++++++++++++++++++--- Marlin/src/module/probe.cpp | 12 ++++++------ 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8b29a4ba80c2..adf6a3d5361f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1001,7 +1001,7 @@ #define XY_PROBE_SPEED (133*60) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2) -#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z +#define Z_PROBE_SPEED_FAST (4*60) // Feedrate (mm/min) for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) @@ -1458,8 +1458,7 @@ #endif // Homing speeds (mm/min) -#define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z (4*60) +#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) } // Validate that endstops are triggered on homing moves #define VALIDATE_HOMING_ENDSTOPS diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 092dc818b84f..3510cb211554 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2317,11 +2317,7 @@ #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #ifndef XY_PROBE_SPEED - #ifdef HOMING_FEEDRATE_XY - #define XY_PROBE_SPEED HOMING_FEEDRATE_XY - #else - #define XY_PROBE_SPEED 4000 - #endif + #define XY_PROBE_SPEED ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2) #endif #ifndef NOZZLE_TO_PROBE_OFFSET #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c75cb1cd4180..6c4c4cc3403f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -189,7 +189,9 @@ #elif defined(ENDSTOPS_ONLY_FOR_HOMING) #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #elif defined(HOMING_FEEDRATE) - #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." + #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead." +#elif defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z) + #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead." #elif defined(MANUAL_HOME_POSITIONS) #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." #elif defined(PID_ADD_EXTRUSION_RATE) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 28bf16a310c6..127ba80788d4 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -143,16 +143,6 @@ xyze_pos_t destination; // {0} feedRate_t feedrate_mm_s = MMM_TO_MMS(1500); int16_t feedrate_percentage = 100; -// Homing feedrate is const progmem - compare to constexpr in the header -const feedRate_t homing_feedrate_mm_s[XYZ] PROGMEM = { - #if ENABLED(DELTA) - MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), - #else - MMM_TO_MMS(HOMING_FEEDRATE_XY), MMM_TO_MMS(HOMING_FEEDRATE_XY), - #endif - MMM_TO_MMS(HOMING_FEEDRATE_Z) -}; - // Cartesian conversion result goes here: xyz_pos_t cartes; @@ -195,7 +185,7 @@ xyz_pos_t cartes; #endif #if HAS_ABL_NOT_UBL - float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); + feedRate_t xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); #endif /** @@ -510,7 +500,7 @@ void do_z_clearance(const float &zclear, const bool z_trusted/*=true*/, const bo const bool rel = raise_on_untrusted && !z_trusted; float zdest = zclear + (rel ? current_position.z : 0.0f); if (!lower_allowed) NOLESS(zdest, current_position.z); - do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST), homing_feedrate(Z_AXIS))); + do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, z_probe_fast_mm_s, homing_feedrate(Z_AXIS))); } // @@ -1841,7 +1831,7 @@ void homeaxis(const AxisEnum axis) { current_position[axis] -= ABS(endstop_backoff[axis]) * axis_home_dir; line_to_current_position( #if HOMING_Z_WITH_PROBE - (axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : + (axis == Z_AXIS) ? z_probe_fast_mm_s : #endif homing_feedrate(axis) ); diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 2eb54f36fbc1..18d8aa9f2e9e 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -57,7 +57,7 @@ extern xyz_pos_t cartes; #endif #if HAS_ABL_NOT_UBL - extern float xy_probe_feedrate_mm_s; + extern feedRate_t xy_probe_feedrate_mm_s; #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s #elif defined(XY_PROBE_SPEED) #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_SPEED) @@ -65,12 +65,28 @@ extern xyz_pos_t cartes; #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() #endif +constexpr feedRate_t z_probe_fast_mm_s = MMM_TO_MMS(Z_PROBE_SPEED_FAST); + /** * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. */ -extern const feedRate_t homing_feedrate_mm_s[XYZ]; -FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } +constexpr xyz_feedrate_t homing_feedrate_mm_m = HOMING_FEEDRATE_MM_M; +FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { + float v; + #if ENABLED(DELTA) + v = homing_feedrate_mm_m.z; + #else + switch (a) { + case X_AXIS: v = homing_feedrate_mm_m.x; break; + case Y_AXIS: v = homing_feedrate_mm_m.y; break; + case Z_AXIS: + default: v = homing_feedrate_mm_m.z; + } + #endif + return MMM_TO_MMS(v); +} + feedRate_t get_homing_bump_feedrate(const AxisEnum axis); /** diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index edf7ba3e2000..17949a442049 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -516,7 +516,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if TOTAL_PROBING == 2 // Do a first probe at the fast speed - if (try_to_probe(PSTR("FAST"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST), + if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s, sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; const float first_probe_z = current_position.z; @@ -524,7 +524,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("1st Probe Z:", first_probe_z); // Raise to give the probe clearance - do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s); #elif Z_PROBE_SPEED_FAST != Z_PROBE_SPEED_SLOW @@ -533,8 +533,8 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (offset.z < 0 ? -offset.z : 0); if (current_position.z > z) { // Probe down fast. If the probe never triggered, raise for probe clearance - if (!probe_down_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) - do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + if (!probe_down_to_z(z, z_probe_fast_mm_s)) + do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, z_probe_fast_mm_s); } #endif @@ -582,7 +582,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if EXTRA_PROBING > 0 < TOTAL_PROBING - 1 #endif - ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s); #endif } @@ -672,7 +672,7 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise if (!isnan(measured_z)) { const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; if (big_raise || raise_after == PROBE_PT_RAISE) - do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); + do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), z_probe_fast_mm_s); else if (raise_after == PROBE_PT_STOW) if (stow()) measured_z = NAN; // Error on stow? From 31337826a3ed0630baa33e0206a47f267725bd99 Mon Sep 17 00:00:00 2001 From: ellensp Date: Fri, 18 Dec 2020 01:05:25 +1300 Subject: [PATCH 355/443] Fix ZoneStar LCD 2004 buttons (#20489) --- Marlin/src/lcd/marlinui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 241d3a171213..fb37643cd2c8 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -923,7 +923,7 @@ void MarlinUI::update() { TERN_(HAS_SLOW_BUTTONS, slow_buttons = read_slow_buttons()); // Buttons that take too long to read in interrupt context - if (TERN0(REPRAPWORLD_KEYPAD, handle_keypad())) + if (TERN0(IS_RRW_KEYPAD, handle_keypad())) RESET_STATUS_TIMEOUT(); uint8_t abs_diff = ABS(encoderDiff); From 978d93af8875c32394c2a872d8cf04d60d24edda Mon Sep 17 00:00:00 2001 From: nb-rapidia <43864438+nb-rapidia@users.noreply.github.com> Date: Thu, 17 Dec 2020 04:13:07 -0800 Subject: [PATCH 356/443] Make M220 B / R a standard feature (#20355) --- Marlin/src/gcode/config/M220.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index 37fe7d3a5f28..75339f10b9fc 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -37,11 +37,9 @@ */ void GcodeSuite::M220() { - #if HAS_PRUSA_MMU2 - static int16_t backup_feedrate_percentage = 100; - if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; - if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; - #endif + static int16_t backup_feedrate_percentage = 100; + if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; + if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; if (parser.seenval('S')) feedrate_percentage = parser.value_int(); From 7b9ff164ccabccee77567c2611857e779f36fe48 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 17 Dec 2020 04:18:07 -0800 Subject: [PATCH 357/443] Balance CI tests (#20485) --- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 3 +- buildroot/tests/FYSETC_F6_13-tests | 61 +++++++++++ buildroot/tests/LPC1769-tests | 20 +--- buildroot/tests/mega2560-tests | 119 +--------------------- buildroot/tests/mks_robin-tests | 8 ++ buildroot/tests/mks_robin_nano35-tests | 9 -- buildroot/tests/rambo-tests | 46 +++++++++ buildroot/tests/sanguino1284p-tests | 6 +- get_test_targets.py | 0 10 files changed, 125 insertions(+), 149 deletions(-) mode change 100644 => 100755 get_test_targets.py diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6c4c4cc3403f..be7d97e2cac6 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1916,7 +1916,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * LED Backlight Timeout */ -#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)) +#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)) #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch." #endif diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 15ac2f447b18..6133a6417e01 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -226,7 +226,7 @@ #define DOGLCD_SCK 17 #define DOGLCD_A0 LCD_PINS_DC - #define KILL_PIN -1 // NC + #undef KILL_PIN #define NEOPIXEL_PIN 27 #else @@ -243,7 +243,6 @@ #define LCD_BACKLIGHT_PIN 27 #endif - #define KILL_PIN 41 #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. // Seems to work best if left open. diff --git a/buildroot/tests/FYSETC_F6_13-tests b/buildroot/tests/FYSETC_F6_13-tests index a3e9f4ef39a6..cc7f33409916 100755 --- a/buildroot/tests/FYSETC_F6_13-tests +++ b/buildroot/tests/FYSETC_F6_13-tests @@ -14,5 +14,66 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 opt_enable DGUS_LCD_UI_FYSETC exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3" +# +# Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2 +# +use_example_configs delta/generic +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +opt_enable RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS EEPROM_CHITCHAT \ + Z_PROBE_ALLEN_KEY AUTO_BED_LEVELING_UBL \ + OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY DELTA_CALIBRATION_MENU +opt_set LCD_LANGUAGE ko_KR +opt_set X_DRIVER_TYPE L6470 +opt_set Y_DRIVER_TYPE L6470 +opt_set Z_DRIVER_TYPE L6470 +opt_add L6470_CHAIN_SCK_PIN 53 +opt_add L6470_CHAIN_MISO_PIN 49 +opt_add L6470_CHAIN_MOSI_PIN 40 +opt_add L6470_CHAIN_SS_PIN 42 +opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP" +exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." "$3" + +# +# Test mixed TMC config +# +restore_configs +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +opt_set LCD_LANGUAGE vi +opt_set X_DRIVER_TYPE TMC2160 +opt_set Y_DRIVER_TYPE TMC5160 +opt_set Z_DRIVER_TYPE TMC2208_STANDALONE +opt_set E0_DRIVER_TYPE TMC2130 +opt_set X_MIN_ENDSTOP_INVERTING true +opt_set Y_MIN_ENDSTOP_INVERTING true +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ + MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ + MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ + USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG M114_DETAIL +exec_test $1 $2 "RAMPS | Mixed TMC | Sensorless | RRDFGSC | Games" "$3" + +# +# Delta Config (FLSUN AC because it's complex) +# +use_example_configs delta/FLSUN/auto_calibrate +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" "$3" + +# +# SCARA with Mixed TMC +# +use_example_configs SCARA/Morgan +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +opt_set LCD_LANGUAGE es +opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ + FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \ + STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING +opt_set X_MAX_ENDSTOP_INVERTING false +opt_set X_DRIVER_TYPE TMC2209 +opt_set Y_DRIVER_TYPE TMC2130 +opt_set Z_DRIVER_TYPE TMC2130_STANDALONE +opt_set E0_DRIVER_TYPE TMC2660 +opt_add X_HARDWARE_SERIAL Serial2 +exec_test $1 $2 "FYSETC_F6 | SCARA | Mixed TMC | EEPROM" "$3" + # clean up restore_configs diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index ebfa4cc8dcea..0a61d4280002 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -12,22 +12,6 @@ set -e use_example_configs Azteeg/X5GT exec_test $1 $2 "Azteeg X5GT Example Configuration" "$3" -restore_configs -opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_1 -1 -opt_set TEMP_SENSOR_BED 5 -opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ - FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - LEVEL_BED_CORNERS LEVEL_CORNERS_USE_PROBE LEVEL_CORNERS_VERIFY_RAISED \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER -opt_disable SD_PROCEDURE_DEPTH -opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard with many features" "$3" - restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD opt_set EXTRUDERS 2 @@ -35,12 +19,12 @@ opt_set TEMP_SENSOR_1 -1 opt_set TEMP_SENSOR_BED 5 opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET LEVEL_CORNERS_USE_PROBE LEVEL_CORNERS_VERIFY_RAISED \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI" "$3" +exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI and many features" "$3" #restore_configs #opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index 0a17cacba1a0..12bbceab87cb 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -60,21 +60,6 @@ opt_disable SEGMENT_LEVELED_MOVES opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL M114_DETAIL exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sled Probe | Skew | JP-Kana | Babystep offsets ..." "$3" -# -# Test a Servo Probe -# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES -# -restore_configs -opt_set LCD_LANGUAGE zh_CN -opt_set MMU_MODEL PRUSA_MMU2S -opt_set EXTRUDERS 5 -opt_set NUM_SERVOS 1 -opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ - AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ - NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ - MMU2_MENUS DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ - FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING -exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2S | Servo | 3-Point + Debug | G38 ..." "$3" # # 5 runout sensors with distinct states @@ -100,27 +85,6 @@ opt_set FIL_RUNOUT4_PIN 46 opt_set FIL_RUNOUT5_PIN 47 exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" "$3" -# -# Test MINIRAMBO with PWM_MOTOR_CURRENT and many features -# -restore_configs -opt_set MOTHERBOARD BOARD_MEGACONTROLLER -opt_set LCD_LANGUAGE de -opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ - MINIPANEL SDSUPPORT PCA9632 LCD_INFO_MENU SOUND_MENU_ITEM GCODE_REPEAT_MARKERS \ - AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ - LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ - INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS M100_FREE_MEMORY_WATCHER \ - NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ - ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ - PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 M114_DETAIL \ - USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE -opt_set CONTROLLERFAN_SPEED_IDLE 128 -opt_add M100_FREE_MEMORY_DUMPER -opt_add M100_FREE_MEMORY_CORRUPTOR -opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" -opt_set I2C_SLAVE_ADDRESS 63 -exec_test $1 $2 "MEGACONTROLLER | Minipanel | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." "$3" # # Mixing Extruder with 5 steppers, Greek @@ -150,31 +114,6 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3" #opt_enable COREXY #exec_test $1 $2 "Stuff" "$3" -# -# Test many less common options -# -restore_configs -opt_set MOTHERBOARD BOARD_MIGHTYBOARD_REVE -opt_set TEMP_SENSOR_0 -2 -opt_set DIGIPOT_I2C_NUM_CHANNELS 5 -opt_set LCD_LANGUAGE it -opt_set MIXING_STEPPERS 2 -opt_set SERVO_DELAY "{ 300, 300, 300 }" -opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \ - BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \ - REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \ - ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \ - FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR PROBE_OFFSET_WIZARD \ - Z_SAFE_HOMING SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ - SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT \ - USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_USE_Z_ONLY -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -opt_add FILWIDTH_PIN 5 -exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." "$3" - ######## Other Standard LCD/Panels ############## # # ULTRA_LCD @@ -277,71 +216,15 @@ exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3" # # BQ Hephestos 2 #restore_configs -#use_example_configs Hephestos_2 +#use_example_configs BQ/Hephestos_2 #exec_test $1 $2 "Stuff" "$3" -# -# Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2 -# -use_example_configs delta/generic -opt_enable RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS EEPROM_CHITCHAT \ - Z_PROBE_ALLEN_KEY AUTO_BED_LEVELING_UBL \ - OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY DELTA_CALIBRATION_MENU -opt_set LCD_LANGUAGE ko_KR -opt_set X_DRIVER_TYPE L6470 -opt_set Y_DRIVER_TYPE L6470 -opt_set Z_DRIVER_TYPE L6470 -opt_add L6470_CHAIN_SCK_PIN 53 -opt_add L6470_CHAIN_MISO_PIN 49 -opt_add L6470_CHAIN_MOSI_PIN 40 -opt_add L6470_CHAIN_SS_PIN 42 -opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP" -exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." "$3" - -# -# Delta Config (FLSUN AC because it's complex) -# -use_example_configs delta/FLSUN/auto_calibrate -exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" "$3" - # # Makibox Config need to check board type for Teensy++ 2.0 # #use_example_configs makibox #exec_test $1 $2 "Stuff" "$3" -# -# Test mixed TMC config -# -restore_configs -opt_set LCD_LANGUAGE vi -opt_set X_DRIVER_TYPE TMC2160 -opt_set Y_DRIVER_TYPE TMC5160 -opt_set Z_DRIVER_TYPE TMC2208_STANDALONE -opt_set E0_DRIVER_TYPE TMC2130 -opt_set X_MIN_ENDSTOP_INVERTING true -opt_set Y_MIN_ENDSTOP_INVERTING true -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ - MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ - MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ - USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG M114_DETAIL -exec_test $1 $2 "RAMPS | Mixed TMC | Sensorless | RRDFGSC | Games" "$3" - -# -# SCARA with Mixed TMC -# -use_example_configs SCARA/Morgan -opt_set LCD_LANGUAGE es -opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ - MKS_12864OLED EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \ - STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING -opt_set X_MAX_ENDSTOP_INVERTING false -opt_set X_DRIVER_TYPE TMC2209 -opt_set Y_DRIVER_TYPE TMC2130 -opt_set Z_DRIVER_TYPE TMC2130_STANDALONE -opt_set E0_DRIVER_TYPE TMC2660 -exec_test $1 $2 "RAMPS | SCARA | Mixed TMC | EEPROM" "$3" - # # tvrrug Config need to check board type for sanguino atmega644p # diff --git a/buildroot/tests/mks_robin-tests b/buildroot/tests/mks_robin-tests index 3fccc87c5919..652147f86707 100755 --- a/buildroot/tests/mks_robin-tests +++ b/buildroot/tests/mks_robin-tests @@ -10,5 +10,13 @@ set -e use_example_configs Mks/Robin exec_test $1 $2 "MKS Robin config (FSMC Color UI)" "$3" +# +# MKS Robin LVGL FSMC +# +use_example_configs Mks/Robin +opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 +opt_enable TFT_LVGL_UI TFT_RES_480x320 +exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" "$3" + # cleanup restore_configs diff --git a/buildroot/tests/mks_robin_nano35-tests b/buildroot/tests/mks_robin_nano35-tests index 391566f6d7c1..3c5d1bb66f06 100755 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -24,15 +24,6 @@ opt_disable TFT_INTERFACE_FSMC opt_enable TFT_INTERFACE_SPI exec_test $1 $2 "MKS Robin v2 nano Emulated DOGM SPI" "$3" -# -# MKS Robin nano v1.2 LVGL FSMC -# -use_example_configs Mks/Robin -opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO -opt_disable TFT_CLASSIC_UI TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 -opt_enable TFT_LVGL_UI TFT_RES_480x320 -exec_test $1 $2 "MKS Robin nano v1.2 LVGL FSMC" "$3" - # # MKS Robin v2 nano LVGL SPI # (Robin v2 nano has no FSMC interface) diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index 6d2ef4f58a6d..f93b2d14f255 100755 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -81,5 +81,51 @@ opt_set Z_DRIVER_TYPE TMC2130 opt_set E0_DRIVER_TYPE TMC2130 exec_test $1 $2 "Einsy RAMBo with TMC2130" "$3" +# +# Test MINIRAMBO with PWM_MOTOR_CURRENT and many features +# +restore_configs +opt_set MOTHERBOARD BOARD_MINIRAMBO +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ + SDSUPPORT PCA9632 SOUND_MENU_ITEM GCODE_REPEAT_MARKERS \ + AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ + LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ + INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS M100_FREE_MEMORY_WATCHER \ + NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ + ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 M114_DETAIL +opt_set CONTROLLERFAN_SPEED_IDLE 128 +opt_add M100_FREE_MEMORY_DUMPER +opt_add M100_FREE_MEMORY_CORRUPTOR +opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" +opt_set I2C_SLAVE_ADDRESS 63 +exec_test $1 $2 "MINIRAMBO | RRDGFSC | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." "$3" + +# +# Test many less common options +# +restore_configs +opt_set MOTHERBOARD BOARD_RAMBO +opt_set TEMP_SENSOR_0 -2 +opt_set DIGIPOT_I2C_NUM_CHANNELS 5 +opt_set LCD_LANGUAGE it +opt_set MIXING_STEPPERS 2 +opt_set SERVO_DELAY "{ 300, 300, 300 }" +opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \ + BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \ + ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \ + FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR PROBE_OFFSET_WIZARD \ + Z_SAFE_HOMING SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ + SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \ + VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT \ + USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_USE_Z_ONLY +opt_set CONTROLLER_FAN_PIN X_MAX_PIN +opt_set FAN_MIN_PWM 50 +opt_set FAN_KICKSTART_TIME 100 +opt_set XY_FREQUENCY_LIMIT 15 +opt_add FILWIDTH_PIN 5 +exec_test $1 $2 "Rambo | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." "$3" + # clean up restore_configs diff --git a/buildroot/tests/sanguino1284p-tests b/buildroot/tests/sanguino1284p-tests index 748d2a8fa3ba..a513f095f9cd 100755 --- a/buildroot/tests/sanguino1284p-tests +++ b/buildroot/tests/sanguino1284p-tests @@ -11,7 +11,11 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 -exec_test $1 $2 "Default Configuration" "$3" +opt_set LCD_LANGUAGE de +opt_enable MINIPANEL USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE +opt_set CONTROLLER_FAN_PIN 27 +exec_test $1 $2 "Default Configuration | MINIPANAL | CONTROLLER_FAN" "$3" + # clean up restore_configs diff --git a/get_test_targets.py b/get_test_targets.py old mode 100644 new mode 100755 From e9677594ea164319dea1c6cc2dc905237ad0dec4 Mon Sep 17 00:00:00 2001 From: grauerfuchs <42082416+grauerfuchs@users.noreply.github.com> Date: Thu, 17 Dec 2020 18:22:59 -0500 Subject: [PATCH 358/443] Fix and optimize MightyBoard (#20493) --- Marlin/Configuration_adv.h | 2 +- .../src/feature/digipot/digipot_mcp4018.cpp | 18 +++++------ Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 1 + platformio.ini | 32 +++++++++++-------- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 9e5ebb33ba7f..aed29d0f2c59 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1022,7 +1022,7 @@ /** * I2C-based DIGIPOTs (e.g., Azteeg X3 Pro) */ -//#define DIGIPOT_MCP4018 // Requires https://github.com/stawel/SlowSoftI2CMaster +//#define DIGIPOT_MCP4018 // Requires https://github.com/felias-fogg/SlowSoftI2CMaster //#define DIGIPOT_MCP4451 #if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451) #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT:4 AZTEEG_X3_PRO:8 MKS_SBASE:5 MIGHTYBOARD_REVE:5 diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 4b90cc4ead6b..37853ff428bc 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -27,7 +27,7 @@ #include "digipot.h" #include -#include // https://github.com/stawel/SlowSoftI2CMaster +#include // https://github.com/felias-fogg/SlowSoftI2CMaster // Settings for the I2C based DIGIPOT (MCP4018) based on WT150 @@ -46,21 +46,21 @@ static byte current_to_wiper(const float current) { } static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { - SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL) + SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 1 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 2 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 3 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 4 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 5 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 6 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #if DIGIPOT_I2C_NUM_CHANNELS > 7 - , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL) + , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL, ENABLED(DIGIPOT_ENABLE_I2C_PULLUPS)) #endif #endif #endif diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index d074db8b256a..b260a27867da 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -118,6 +118,7 @@ #ifndef DIGIPOT_I2C_ADDRESS_A #define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) #endif +#define DIGIPOT_ENABLE_I2C_PULLUPS // MightyBoard doesn't have hardware I2C pin pull-ups. // // Temperature Sensors diff --git a/platformio.ini b/platformio.ini index 753140467c83..2a0901d14d9f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -457,7 +457,6 @@ board = megaatmega2560 [env:mega2560ext] platform = atmelavr extends = env:mega2560 -board = megaatmega2560 board_build.variant = megaextendedpins extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py @@ -471,24 +470,31 @@ extends = common_avr8 board = megaatmega1280 # -# MightyBoard ATmega2560 (MegaCore 100 pin boards variants) +# MightyBoard AVR with extended pins +# +[mega_extended_optimized] +extends = common_avr8 +board_build.variant = megaextendedpins +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py +upload_speed = 57600 +build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues + +# +# MightyBoard ATmega1280 # [env:MightyBoard1280] -platform = atmelavr -extends = common_avr8 -board = ATmega1280 -upload_speed = 57600 +platform = atmelavr +extends = mega_extended_optimized +board = megamega1280 # -# MightyBoard ATmega2560 (MegaCore 100 pin boards variants) +# MightyBoard ATmega2560 # [env:MightyBoard2560] -platform = atmelavr -extends = common_avr8 -board = ATmega2560 -upload_protocol = wiring -upload_speed = 57600 -board_upload.maximum_size = 253952 +platform = atmelavr +extends = mega_extended_optimized +board = megaatmega2560 # # RAMBo From fae3c860a124aae5b3ecce14fc021ad585169dab Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 18 Dec 2020 00:15:25 +0000 Subject: [PATCH 359/443] [cron] Bump distribution date (2020-12-18) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d16aa57e63e0..0d324f8c2ec2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-17" + #define STRING_DISTRIBUTION_DATE "2020-12-18" #endif /** From b167cd242754a6e451d5443416c30774bc969e4d Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 18 Dec 2020 19:18:04 -0300 Subject: [PATCH 360/443] MKS Robin Nano V3 and STM32F4x0Vx Variant (#20430) --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 367 +++++++++++++ .../boards/genericSTM32F407VGT6.json | 56 ++ .../variants/MARLIN_F4x7Vx/PeripheralPins.c | 408 +++++++++++++++ .../variants/MARLIN_F4x7Vx/PinNamesVar.h | 50 ++ .../variants/MARLIN_F4x7Vx/hal_conf_extra.h | 495 ++++++++++++++++++ .../variants/MARLIN_F4x7Vx/ldscript.ld | 203 +++++++ .../variants/MARLIN_F4x7Vx/variant.cpp | 275 ++++++++++ .../variants/MARLIN_F4x7Vx/variant.h | 199 +++++++ platformio.ini | 22 + 11 files changed, 2078 insertions(+) create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h create mode 100644 buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PinNamesVar.h create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/ldscript.ld create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 172cdd6b5a75..15362c49084e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -367,6 +367,7 @@ #define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG) #define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE) #define BOARD_MKS_ROBIN_PRO_V2 4219 // MKS Robin Pro V2 (STM32F407VE) +#define BOARD_MKS_ROBIN_NANO_V3 4220 // MKS Robin Nano V3 (STM32F407VG) // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 52e6d26b142e..9d1dab10f60c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -592,6 +592,8 @@ #include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2 #elif MB(MKS_ROBIN_PRO_V2) #include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2 +#elif MB(MKS_ROBIN_NANO_V3) + #include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3 // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h new file mode 100644 index 000000000000..5ff29a1f1caa --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -0,0 +1,367 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Robin Nano V3 supports up to 2 hotends / E-steppers." +#elif HAS_FSMC_TFT + #error "MKS Robin Nano V3 doesn't support FSMC-based TFT displays." +#endif + +#define BOARD_INFO_NAME "MKS Robin Nano V3" + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#define I2C_EEPROM + +// +// Release PB4 (Z_DIR_PIN) from JTAG NRST role +// + +// +// Limit Switches +// +#define X_DIAG_PIN PD15 +#define Y_DIAG_PIN PD2 +#define Z_DIAG_PIN PC8 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +// +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PD2 +#define Z_MIN_PIN PC8 +#define Z_MAX_PIN PC4 + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD7 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD4 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD9 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD8 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +// This board only support SW SPI for stepper drivers +#if HAS_TMC_SPI + #define TMC_USE_SW_SPI +#endif +#if ENABLED(TMC_USE_SW_SPI) + #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1 + #define TMC_SW_MOSI PD14 + #endif + #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1 + #define TMC_SW_MISO PD1 + #endif + #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1 + #define TMC_SW_SCK PD0 + #endif +#endif + +#if HAS_TMC_UART + // + // Software serial + // No Hardware serial for steppers + // + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN PD5 + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN PD7 + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN PD4 + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN PD9 + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN PD8 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PA2 // TH2 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PE5 // HEATER1 +#define HEATER_1_PIN PB0 // HEATER2 +#define HEATER_BED_PIN PA0 // HOT BED + +#define FAN_PIN PB1 // FAN +#define FAN1_PIN PC14 // FAN1 + +// +// Thermocouples +// +//#define MAX6675_SS_PIN HEATER_0_PIN // TC1 - CS1 +//#define MAX6675_SS_PIN HEATER_1_PIN // TC2 - CS2 + +// +// Misc. Functions +// +#define MT_DET_1 PA4 +#define MT_DET_2 PE6 +#define PW_DET PA13 +#define PW_OFF PB2 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN MT_DET_1 +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN MT_DET_2 +#endif + +#define POWER_LOSS_PIN PW_DET +#define PS_ON_PIN PW_OFF +// +// Enable MKSPWC support +// +//#define SUICIDE_PIN PB2 +//#define KILL_PIN PA2 +//#define KILL_PIN_INVERTING true + +#define SERVO0_PIN PA8 // Enable BLTOUCH support +//#define LED_PIN PB2 + +// Random Info +#define USB_SERIAL -1 //Usb Serial +#define WIFI_SERIAL 3 //USART3 +#define MKS_WIFI_MODULE_SERIAL 1 //USART1 +#define MKS_WIFI_MODULE_SPI 2 //SPI2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// +// Onboard SD card +// +// detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled +#if SD_CONNECTION_IS(ONBOARD) + #define CUSTOM_SPI_PINS // TODO: needed because is the only way to set SPI3 for SD on STM32 (by now) + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI3 + #define SS_PIN -1 + #define SDSS PC9 + #define SCK_PIN PC10 + #define MISO_PIN PC11 + #define MOSI_PIN PC12 + #define SD_DETECT_PIN PD12 + #endif +#endif + +// +// LCD SD +// +#if SD_CONNECTION_IS(LCD) + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SCK_PIN PA5 + #define MISO_PIN PA6 + #define MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 + #endif +#endif + +// +// LCD / Controller +#define SPI_FLASH +#define HAS_SPI_FLASH 1 +#define SPI_DEVICE 2 +#define SPI_FLASH_SIZE 0x1000000 +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PC3 + #define W25QXX_MISO_PIN PC2 + #define W25QXX_SCK_PIN PB13 +#endif + +/** + * _____ _____ + * (BEEPER)PC5 | · · | PE13(BTN_ENC) (SPI1 MISO) PA6 | · · | PA5 (SPI1 SCK) + * (LCD_EN)PD13 | · · | PC6(LCD_RS) (BTN_EN1) PE8 | · · | PE10 (SPI1 CS) + * (LCD_D4)PE14 | · · PE15(LCD_D5) (BTN_EN2) PE11 | · · PA7 (SPI1 MOSI) + * (LCD_D6)PD11 | · · | PD10(LCD_D7) (SPI1_RS) PE12 | · · | RESET + * GND | · · | 5V GND | · · | 3.3V + *  ̄ ̄ ̄  ̄ ̄ ̄ + * EXP1 EXP2 + */ + +#if EITHER(TFT_480x320_SPI, TFT_LVGL_UI_SPI) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #define TFT_CS_PIN PD11 + #define TFT_SCK_PIN PA5 + #define TFT_MISO_PIN PA6 + #define TFT_MOSI_PIN PA7 + #define TFT_DC_PIN PD10 + #define TFT_RST_PIN PC6 + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN PC6 + #define TFT_BACKLIGHT_PIN PD13 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define LCD_BACKLIGHT_PIN PD13 + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + #define TFT_BUFFER_SIZE 14400 + +#elif HAS_SPI_LCD + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + //#define DOGLCD_SCK PA5 + //#define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + //#undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + + #endif // !MKS_MINI_12864 + +#elif ENABLED(SPI_GRAPHICAL_TFT) + #define SPI_TFT_CS_PIN PD11 + #define SPI_TFT_SCK_PIN PA5 + #define SPI_TFT_MISO_PIN PA6 + #define SPI_TFT_MOSI_PIN PA7 + #define SPI_TFT_DC_PIN PD10 + #define SPI_TFT_RST_PIN PC6 + + #define LCD_BACKLIGHT_PIN PD13 + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 +#endif // HAS_SPI_LCD + +#define HAS_OTG_USB_HOST_SUPPORT diff --git a/buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json b/buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json new file mode 100644 index 000000000000..8c211a854900 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json @@ -0,0 +1,56 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F407xx -DSTM32F4", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407vgt6", + "product_line": "STM32F407xx", + "variant": "Generic_F4x7Vx" + }, + "debug": { + "default_tools": [ + "stlink" + ], + "jlink_device": "STM32F407VG", + "openocd_extra_args": [ + "-c", + "reset_config none" + ], + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd" + }, + "frameworks": [ + "arduino", + "cmsis", + "stm32cube", + "libopencm3" + ], + "name": "STM32F407VG (128k RAM, 64k CCM RAM, 1024k Flash", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 131072, + "maximum_size": 1048576, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f4-series/stm32f407-417/stm32f407vg.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c new file mode 100644 index 000000000000..0fbd848dab74 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c @@ -0,0 +1,408 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + * Automatically generated from STM32F407V(E-G)Tx.xml + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Note: Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + // {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 + // {PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + // {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + // {PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + // {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 + // {PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + // {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + // {PA_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + // {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + // {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + // {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + // {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + // {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + // {PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + // {PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 + // {PC_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + // {PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + // {PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + // {PC_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 + // {PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + // {PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 + // {PC_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13 + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + // {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 + // {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +// Some pins can perform PWM from more than one timer. These were selected to utilize as many channels as +// possible from timers which were already dedicated to PWM output. + +// TIM1 = Pins are using for OTG FS +// TIM2 = [HEATER_BED], TIM2 is used OTG HS SOF +// TIM6 = Tone +// TIM8 = [FAN0, HEATER_1] OTG HS +// TIM7 = Servo +// TIM9 = [HEATER_0, ] +// TIM1, TIM8, TIM12 = Pins are using for OTG HS +// No timer = [FAN1 ] + +WEAK const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + // {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + // {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + // {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + // {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + // {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + // {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + // {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + // {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + // {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + // {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + // {PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + // {PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + // {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + // {PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + // {PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + // {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + // {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 + // {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + {PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RX[] = { + {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + // {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_5, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PD_0, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_CAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_TD[] = { + {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_6, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {PD_1, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + {NC, NP, 0} +}; +#endif + +//*** ETHERNET *** + +#ifdef HAL_ETH_MODULE_ENABLED +WEAK const PinMap PinMap_Ethernet[] = { + {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS + {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK|ETH_RX_CLK + {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO + {PA_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL + {PA_7, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV|ETH_RX_DV + {PB_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2 + {PB_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3 + {PB_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT + {PB_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER + {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN + {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0 + {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1 + {PC_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC + {PC_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2 + {PC_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK + {PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0 + {PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1 + {PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {NC, NP, 0} +}; +#endif + +//*** No QUADSPI *** + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB_OTG_FS[] = { + // {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF + // {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS + // {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB_OTG_HS[] = { +#ifdef USE_USB_HS_IN_FS + // {PA_4, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF + // {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID + // {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS + {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP +#else + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0 + {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_CK + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D4 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT +#endif /* USE_USB_HS_IN_FS */ + {NC, NP, 0} +}; +#endif + +//*** SD *** + +#ifdef HAL_SD_MODULE_ENABLED +WEAK const PinMap PinMap_SD[] = { + {PB_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4 + {PB_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5 + {PC_6, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6 + {PC_7, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7 + {PC_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0 + {PC_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1 + {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2 + {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3 + {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK + {PD_2, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PinNamesVar.h new file mode 100644 index 000000000000..24248859373b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PinNamesVar.h @@ -0,0 +1,50 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h new file mode 100644 index 000000000000..d3c2f6bd026b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

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

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

© COPYRIGHT(c) 2019 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. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp new file mode 100644 index 000000000000..3721d4f5b5aa --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp @@ -0,0 +1,275 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library 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 2.1 of the License, or (at your option) any later version. + + This library 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Digital PinName array +const PinName digitalPin[] = { + PA_0, // Digital pin 0 + PA_1, // Digital pin 1 + PA_2, // Digital pin 2 + PA_3, // Digital pin 3 + PA_4, // Digital pin 4 + PA_5, // Digital pin 5 + PA_6, // Digital pin 6 + PA_7, // Digital pin 7 + PA_8, // Digital pin 8 + PA_9, // Digital pin 9 + PA_10, // Digital pin 10 + PA_11, // Digital pin 11 + PA_12, // Digital pin 12 + PA_13, // Digital pin 13 + PA_14, // Digital pin 14 + PA_15, // Digital pin 15 + + PB_0, // Digital pin 16 + PB_1, // Digital pin 17 + PB_2, // Digital pin 18 + PB_3, // Digital pin 19 + PB_4, // Digital pin 20 + PB_5, // Digital pin 21 + PB_6, // Digital pin 22 + PB_7, // Digital pin 23 + PB_8, // Digital pin 24 + PB_9, // Digital pin 25 + PB_10, // Digital pin 26 + PB_11, // Digital pin 27 + PB_12, // Digital pin 28 + PB_13, // Digital pin 29 + PB_14, // Digital pin 30 + PB_15, // Digital pin 31 + + PC_0, // Digital pin 32 + PC_1, // Digital pin 33 + PC_2, // Digital pin 34 + PC_3, // Digital pin 35 + PC_4, // Digital pin 36 + PC_5, // Digital pin 37 + PC_6, // Digital pin 38 + PC_7, // Digital pin 39 + PC_8, // Digital pin 40 + PC_9, // Digital pin 41 + PC_10, // Digital pin 42 + PC_11, // Digital pin 43 + PC_12, // Digital pin 44 + PC_13, // Digital pin 45 + PC_14, // Digital pin 46 + PC_15, // Digital pin 47 + + PD_0, // Digital pin 48 + PD_1, // Digital pin 49 + PD_2, // Digital pin 50 + PD_3, // Digital pin 51 + PD_4, // Digital pin 52 + PD_5, // Digital pin 53 + PD_6, // Digital pin 54 + PD_7, // Digital pin 55 + PD_8, // Digital pin 56 + PD_9, // Digital pin 57 + PD_10, // Digital pin 58 + PD_11, // Digital pin 59 + PD_12, // Digital pin 60 + PD_13, // Digital pin 61 + PD_14, // Digital pin 62 + PD_15, // Digital pin 63 + + PE_0, // Digital pin 64 + PE_1, // Digital pin 65 + PE_2, // Digital pin 66 + PE_3, // Digital pin 67 + PE_4, // Digital pin 68 + PE_5, // Digital pin 69 + PE_6, // Digital pin 70 + PE_7, // Digital pin 71 + PE_8, // Digital pin 72 + PE_9, // Digital pin 73 + PE_10, // Digital pin 74 + PE_11, // Digital pin 75 + PE_12, // Digital pin 76 + PE_13, // Digital pin 77 + PE_14, // Digital pin 78 + PE_15, // Digital pin 79 + + PH_0, // Digital pin 80, used by the external oscillator + PH_1 // Digital pin 81, used by the external oscillator +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 0, // A0, PA0 + 1, // A1, PA1 + 2, // A2, PA2 + 3, // A3, PA3 + 4, // A4, PA4 + 5, // A5, PA5 + 6, // A6, PA6 + 7, // A7, PA7 + 16, // A8, PB0 + 17, // A9, PB1 + 32, // A10, PC0 + 33, // A11, PC1 + 34, // A12, PC2 + 35, // A13, PC3 + 36, // A14, PC4 + 37 // A15, PC5 +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * @brief Configures the System clock source, PLL Multiplier and Divider factors, + * AHB/APBx prescalers and Flash settings + * @note This function should be called only once the RCC clock configuration + * is reset to the default reset state (done in SystemInit() function). + * @param None + * @retval None + */ + +/******************************************************************************/ +/* PLL (clocked by HSE) used as System clock source */ +/******************************************************************************/ +static uint8_t SetSysClock_PLL_HSE(uint8_t bypass) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + // Enable HSE oscillator and activate PLL with HSE as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + if (bypass == 0) { + RCC_OscInitStruct.HSEState = RCC_HSE_ON; // External 8 MHz xtal on OSC_IN/OSC_OUT + } else { + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; // External 8 MHz clock on OSC_IN + } + + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE / 1000000L; // Expects an 8 MHz external clock by default. Redefine HSE_VALUE if not + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; // PLLCLK = 168 MHz (336 MHz / 2) + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + // Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 168 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + /* + if (bypass == 0) + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_2); // 4 MHz + else + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); // 8 MHz + */ + + return 1; // OK +} + +/******************************************************************************/ +/* PLL (clocked by HSI) used as System clock source */ +/******************************************************************************/ +uint8_t SetSysClock_PLL_HSI(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + // Enable HSI oscillator and activate PLL with HSI as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSEState = RCC_HSE_OFF; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLM = 16; // VCO input clock = 1 MHz (16 MHz / 16) + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; // PLLCLK = 168 MHz (336 MHz / 2) + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 168 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz + + return 1; // OK +} + +WEAK void SystemClock_Config(void) +{ + /* 1- If fail try to start with HSE and external xtal */ + if (SetSysClock_PLL_HSE(0) == 0) { + /* 2- Try to start with HSE and external clock */ + if (SetSysClock_PLL_HSE(1) == 0) { + /* 3- If fail start with HSI clock */ + if (SetSysClock_PLL_HSI() == 0) { + Error_Handler(); + } + } + } + + /* Ensure CCM RAM clock is enabled */ + __HAL_RCC_CCMDATARAMEN_CLK_ENABLE(); + + /* Output clock on MCO2 pin(PC9) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h new file mode 100644 index 000000000000..b53ad32d0f29 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h @@ -0,0 +1,199 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library 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 2.1 of the License, or (at your option) any later version. + + This library 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// | DIGITAL | ANALOG IN | ANALOG OUT | UART/USART | TWI | SPI | SPECIAL | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PA0 PIN_A0 // | 0 | A0 (ADC1) | | UART4_TX | | | | +#define PA1 PIN_A1 // | 1 | A1 (ADC1) | | UART4_RX | | | | +#define PA2 PIN_A2 // | 2 | A2 (ADC1) | | USART2_TX | | | | +#define PA3 PIN_A3 // | 3 | A3 (ADC1) | | USART2_RX | | | | +#define PA4 PIN_A4 // | 4 | A4 (ADC1) | DAC_OUT1 | | | SPI1_SS, (SPI3_SS) | | +#define PA5 PIN_A5 // | 5 | A5 (ADC1) | DAC_OUT2 | | | SPI1_SCK | | +#define PA6 PIN_A6 // | 6 | A6 (ADC1) | | | | SPI1_MISO | | +#define PA7 PIN_A7 // | 7 | A7 (ADC1) | | | | SPI1_MOSI | | +#define PA8 8 // | 8 | | | | TWI3_SCL | | | +#define PA9 9 // | 9 | | | USART1_TX | | | | +#define PA10 10 // | 10 | | | USART1_RX | | | | +#define PA11 11 // | 11 | | | | | | | +#define PA12 12 // | 12 | | | | | | | +#define PA13 13 // | 13 | | | | | | SWD_SWDIO | +#define PA14 14 // | 14 | | | | | | SWD_SWCLK | +#define PA15 15 // | 15 | | | | | SPI3_SS, (SPI1_SS) | | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PB0 PIN_A8 // | 16 | A8 (ADC1) | | | | | | +#define PB1 PIN_A9 // | 17 | A9 (ADC1) | | | | | | +#define PB2 18 // | 18 | | | | | | BOOT1 | +#define PB3 19 // | 19 | | | | | SPI3_SCK, (SPI1_SCK) | | +#define PB4 20 // | 20 | | | | | SPI3_MISO, (SPI1_MISO) | | +#define PB5 21 // | 21 | | | | | SPI3_MOSI, (SPI1_MOSI) | | +#define PB6 22 // | 22 | | | USART1_TX | TWI1_SCL | | | +#define PB7 23 // | 23 | | | USART1_RX | TWI1_SDA | | | +#define PB8 24 // | 24 | | | | TWI1_SCL | | | +#define PB9 25 // | 25 | | | | TWI1_SDA | SPI2_SS | | +#define PB10 26 // | 26 | | | USART3_TX, (UART4_TX) | TWI2_SCL | SPI2_SCK | | +#define PB11 27 // | 27 | | | USART3_RX | TWI2_SDA | | | +#define PB12 28 // | 28 | | | | | SPI2_SS | | +#define PB13 29 // | 29 | | | | | SPI2_SCK | | +#define PB14 30 // | 30 | | | | | SPI2_MISO | | +#define PB15 31 // | 31 | | | | | SPI2_MOSI | | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PC0 PIN_A10 // | 32 | A10 (ADC1) | | | | | | +#define PC1 PIN_A11 // | 33 | A11 (ADC1) | | | | | | +#define PC2 PIN_A12 // | 34 | A12 (ADC1) | | | | SPI2_MISO | | +#define PC3 PIN_A13 // | 35 | A13 (ADC1) | | | | SPI2_MOSI | | +#define PC4 PIN_A14 // | 36 | A14 (ADC1) | | | | | | +#define PC5 PIN_A15 // | 37 | A15 (ADC1) | | USART3_RX | | | | +#define PC6 38 // | 38 | | | USART6_TX | | | | +#define PC7 39 // | 39 | | | USART6_RX | | | | +#define PC8 40 // | 40 | | | | | | | +#define PC9 41 // | 41 | | | USART3_TX | TWI3_SDA | | | +#define PC10 42 // | 42 | | | | | SPI3_SCK | | +#define PC11 43 // | 43 | | | USART3_RX, (UART4_RX) | | SPI3_MISO | | +#define PC12 44 // | 44 | | | UART5_TX | | SPI3_MOSI | | +#define PC13 45 // | 45 | | | | | | | +#define PC14 46 // | 46 | | | | | | OSC32_IN | +#define PC15 47 // | 47 | | | | | | OSC32_OUT | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PD0 48 // | 48 | | | | | | | +#define PD1 49 // | 49 | | | | | | | +#define PD2 50 // | 50 | | | UART5_RX | | | | +#define PD3 51 // | 51 | | | | | | | +#define PD4 52 // | 52 | | | | | | | +#define PD5 53 // | 53 | | | USART2_TX | | | | +#define PD6 54 // | 54 | | | USART2_RX | | | | +#define PD7 55 // | 55 | | | | | | | +#define PD8 56 // | 56 | | | USART3_TX | | | | +#define PD9 57 // | 57 | | | USART3_RX | | | | +#define PD10 58 // | 58 | | | | | | | +#define PD11 59 // | 59 | | | | | | | +#define PD12 60 // | 60 | | | | | | | +#define PD13 61 // | 61 | | | | | | | +#define PD14 62 // | 62 | | | | | | | +#define PD15 63 // | 63 | | | | | | | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PE0 64 // | 64 | | | | | | | +#define PE1 65 // | 65 | | | | | | | +#define PE2 66 // | 66 | | | | | | | +#define PE3 67 // | 67 | | | | | | | +#define PE4 68 // | 68 | | | | | | | +#define PE5 69 // | 69 | | | | | | | +#define PE6 70 // | 70 | | | | | | | +#define PE7 71 // | 71 | | | | | | | +#define PE8 72 // | 72 | | | | | | | +#define PE9 73 // | 73 | | | | | | | +#define PE10 74 // | 74 | | | | | | | +#define PE11 75 // | 75 | | | | | | | +#define PE12 76 // | 76 | | | | | | | +#define PE13 77 // | 77 | | | | | | | +#define PE14 78 // | 78 | | | | | | | +#define PE15 79 // | 79 | | | | | | | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| +#define PH0 80 // | 80 | | | | | | OSC_IN | +#define PH1 81 // | 81 | | | | | | OSC_OUT | +// |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| + +/// This must be a literal +#define NUM_DIGITAL_PINS 82 +#define NUM_ANALOG_INPUTS 16 + +// On-board LED pin number +#ifndef LED_BUILTIN +#define LED_BUILTIN PA5 +#endif +#define LED_GREEN LED_BUILTIN + +// On-board user button +#ifndef USER_BTN +#define USER_BTN PC13 +#endif + +// SPI definitions +#define PIN_SPI_SS PA4 +#define PIN_SPI_SS1 PA4 +#define PIN_SPI_SS2 PB12 +#define PIN_SPI_SS3 PA15 +#define PIN_SPI_MOSI PA7 +#define PIN_SPI_MISO PA6 +#define PIN_SPI_SCK PA5 + +// I2C definitions +#define PIN_WIRE_SDA PB9 +#define PIN_WIRE_SCL PB8 + +// Timer Definitions +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin +#ifndef TIMER_TONE + #define TIMER_TONE TIM6 +#endif +#ifndef TIMER_SERVO + #define TIMER_SERVO TIM7 +#endif +#ifndef TIMER_SERIAL + #define TIMER_SERIAL TIM5 +#endif + +// UART Definitions +#define SERIAL_UART_INSTANCE 2 + +// Default pin used for 'Serial' instance +// Mandatory for Firmata +#define PIN_SERIAL_RX PA3 +#define PIN_SERIAL_TX PA2 + +/* Extra HAL modules */ +#define HAL_DAC_MODULE_ENABLED + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #define SERIAL_PORT_MONITOR Serial + #define SERIAL_PORT_HARDWARE Serial1 +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/platformio.ini b/platformio.ini index 2a0901d14d9f..11918bc35af0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1377,6 +1377,28 @@ extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/stm32_bootloader.py buildroot/share/PlatformIO/scripts/mks_encrypt.py +# +# MKS Robin Nano V3 +# +[env:mks_robin_nano_v3] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DUSBCON -DUSBD_USE_CDC +board = genericSTM32F407VGT6 +board_build.core = stm32 +board_build.variant = MARLIN_F4x7Vx +board_build.ldscript = ldscript.ld +board_build.firmware = Robin_nano_v3.bin +board_build.offset = 0xC000 +board_upload.offset_address = 0x0800C000 +build_unflags = ${common_stm32.build_unflags} +debug_tool = jlink +upload_protocol = jlink +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/mks_encrypt.py + ################################# # # # Other Architectures # From 017d97fd0ea5d10aafaf677358ca9224bebd870c Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 18 Dec 2020 23:21:00 +0100 Subject: [PATCH 361/443] DOGM: Slow down touchscreen calibration (#20454) --- Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 600d7e3faa37..cbb05bc356a7 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -525,6 +525,11 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, lcd_put_u8str(0, LCD_PIXEL_HEIGHT / 2, str); } while (u8g.nextPage()); drawing_screen = false; + safe_delay(250); + if (calibration_stage == CALIBRATION_SUCCESS) { + safe_delay(500); + ui.goto_previous_screen(); + } } #endif // TOUCH_SCREEN_CALIBRATION From a33ae10c568522ad61ae4c05d49c670a31a6b3c2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 19 Dec 2020 00:15:28 +0000 Subject: [PATCH 362/443] [cron] Bump distribution date (2020-12-19) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0d324f8c2ec2..23770ca9495d 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-18" + #define STRING_DISTRIBUTION_DATE "2020-12-19" #endif /** From e5d0b27aafa9c33931e2abf668e498a3532b3dc2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 18 Dec 2020 21:13:37 -0600 Subject: [PATCH 363/443] Rename QUIET_PROBING --- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 4 ++-- Marlin/src/module/motion.cpp | 4 ++-- Marlin/src/module/probe.cpp | 10 +++++----- Marlin/src/module/probe.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3510cb211554..3ce7043f4fb7 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2373,7 +2373,7 @@ #endif #if HAS_BED_PROBE && (EITHER(PROBING_HEATERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0) - #define QUIET_PROBING 1 + #define HAS_QUIET_PROBING 1 #endif #if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF) #define HEATER_IDLE_HANDLER 1 diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index ad91c404aa7a..acd19d69e41b 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -104,7 +104,7 @@ static int8_t bed_corner; #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) bltouch.deploy(); // DEPLOY in LOW SPEED MODE on every probe action #endif - TERN_(QUIET_PROBING, probe.set_probing_paused(true)); + TERN_(HAS_QUIET_PROBING, probe.set_probing_paused(true)); // Move down until the probe is triggered do_blocking_move_to_z(last_z - (LEVEL_CORNERS_PROBE_TOLERANCE), manual_feedrate_mm_s.z); @@ -141,7 +141,7 @@ static int8_t bed_corner; TERN_(LEVEL_CORNERS_VERIFY_RAISED, verify_corner = true); } - TERN_(QUIET_PROBING, probe.set_probing_paused(false)); + TERN_(HAS_QUIET_PROBING, probe.set_probing_paused(false)); #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) bltouch.stow(); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 127ba80788d4..45ec51314946 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1321,7 +1321,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t if (is_home_dir) { - #if HOMING_Z_WITH_PROBE && QUIET_PROBING + #if HOMING_Z_WITH_PROBE && HAS_QUIET_PROBING if (axis == Z_AXIS) probe.set_probing_paused(true); #endif @@ -1360,7 +1360,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t if (is_home_dir) { - #if HOMING_Z_WITH_PROBE && QUIET_PROBING + #if HOMING_Z_WITH_PROBE && HAS_QUIET_PROBING if (axis == Z_AXIS) probe.set_probing_paused(false); #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 17949a442049..bcd3a03a9aeb 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -73,7 +73,7 @@ #include "../feature/tmc_util.h" #endif -#if QUIET_PROBING +#if HAS_QUIET_PROBING #include "stepper/indirection.h" #endif @@ -236,7 +236,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #endif // Z_PROBE_ALLEN_KEY -#if QUIET_PROBING +#if HAS_QUIET_PROBING void Probe::set_probing_paused(const bool p) { TERN_(PROBING_HEATERS_OFF, thermalManager.pause(p)); @@ -254,7 +254,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() ); } -#endif // QUIET_PROBING +#endif // HAS_QUIET_PROBING /** * Raise Z to a minimum height to make room for a probe to move @@ -437,7 +437,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { endstops.enable(true); #endif - TERN_(QUIET_PROBING, set_probing_paused(true)); + TERN_(HAS_QUIET_PROBING, set_probing_paused(true)); // Move down until the probe is triggered do_blocking_move_to_z(z, fr_mm_s); @@ -451,7 +451,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { #endif ; - TERN_(QUIET_PROBING, set_probing_paused(false)); + TERN_(HAS_QUIET_PROBING, set_probing_paused(false)); // Re-enable stealthChop if used. Disable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index e5ad892e379f..137d360175e4 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -202,7 +202,7 @@ class Probe { static void servo_probe_init(); #endif - #if QUIET_PROBING + #if HAS_QUIET_PROBING static void set_probing_paused(const bool p); #endif From 45b11553f40c48f03bfa10b542f27a9555cb2583 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 8 Dec 2020 20:22:30 -0600 Subject: [PATCH 364/443] Tweaks for pins_BTT_SKR_common.h --- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index a75eb6ae5d8f..279c7e810076 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -21,7 +21,7 @@ */ #pragma once -#ifdef SKR_HAS_LPC1769 +#if ENABLED(SKR_HAS_LPC1769) #if NOT_TARGET(MCU_LPC1769) #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif @@ -35,9 +35,9 @@ #if BOTH(HAS_WIRED_LCD, HAS_BTT_EXP_MOT) #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) - #define EXP_MOT_USE_EXP2_ONLY + #define EXP_MOT_USE_EXP2_ONLY 1 #else - #error "Having a LCD that uses both EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possible." + #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time." #endif #endif @@ -146,7 +146,7 @@ #define E2_STEP_PIN EXPA2_05_PIN #define E2_DIR_PIN EXPA2_06_PIN #define E2_ENABLE_PIN EXPA2_04_PIN - #ifndef EXP_MOT_USE_EXP2_ONLY + #if !EXP_MOT_USE_EXP2_ONLY #define E2_DIAG_PIN EXPA1_06_PIN #define E2_CS_PIN EXPA1_05_PIN #if HAS_TMC_UART @@ -158,7 +158,7 @@ // M2 on Driver Expansion Module #define E3_STEP_PIN EXPA2_08_PIN #define E3_DIR_PIN EXPA2_07_PIN - #ifndef EXP_MOT_USE_EXP2_ONLY + #if !EXP_MOT_USE_EXP2_ONLY #define E3_ENABLE_PIN EXPA1_03_PIN #define E3_DIAG_PIN EXPA1_08_PIN #define E3_CS_PIN EXPA1_07_PIN @@ -173,7 +173,7 @@ // M3 on Driver Expansion Module #define E4_STEP_PIN EXPA2_10_PIN #define E4_DIR_PIN EXPA2_09_PIN - #ifndef EXP_MOT_USE_EXP2_ONLY + #if !EXP_MOT_USE_EXP2_ONLY #define E4_ENABLE_PIN EXPA1_04_PIN #define E4_DIAG_PIN EXPA1_10_PIN #define E4_CS_PIN EXPA1_09_PIN From 57f4d0523e1465bcc459acc3bc57ef9476d4a172 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 20 Dec 2020 00:14:49 +0000 Subject: [PATCH 365/443] [cron] Bump distribution date (2020-12-20) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 23770ca9495d..311faa2124b3 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-19" + #define STRING_DISTRIBUTION_DATE "2020-12-20" #endif /** From 9a8f8f8284cf0f27aa696e7c1b74bb7196c273d8 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 19 Dec 2020 19:48:31 -0800 Subject: [PATCH 366/443] Let boards set Default TMC Slave Addresses (#20498) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 32 ++++++------- Marlin/src/inc/Conditionals_post.h | 48 +++++++++++++++++++ .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h | 14 ++++++ .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h | 22 +++++++-- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 18 +++++-- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 24 ++++++++-- buildroot/tests/STM32F103RC_btt-tests | 4 -- 7 files changed, 130 insertions(+), 32 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index aed29d0f2c59..51c2b8f99419 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2473,22 +2473,22 @@ * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers * on the same serial port, either here or in your board's pins file. */ - #define X_SLAVE_ADDRESS 0 - #define Y_SLAVE_ADDRESS 0 - #define Z_SLAVE_ADDRESS 0 - #define X2_SLAVE_ADDRESS 0 - #define Y2_SLAVE_ADDRESS 0 - #define Z2_SLAVE_ADDRESS 0 - #define Z3_SLAVE_ADDRESS 0 - #define Z4_SLAVE_ADDRESS 0 - #define E0_SLAVE_ADDRESS 0 - #define E1_SLAVE_ADDRESS 0 - #define E2_SLAVE_ADDRESS 0 - #define E3_SLAVE_ADDRESS 0 - #define E4_SLAVE_ADDRESS 0 - #define E5_SLAVE_ADDRESS 0 - #define E6_SLAVE_ADDRESS 0 - #define E7_SLAVE_ADDRESS 0 + //#define X_SLAVE_ADDRESS 0 + //#define Y_SLAVE_ADDRESS 0 + //#define Z_SLAVE_ADDRESS 0 + //#define X2_SLAVE_ADDRESS 0 + //#define Y2_SLAVE_ADDRESS 0 + //#define Z2_SLAVE_ADDRESS 0 + //#define Z3_SLAVE_ADDRESS 0 + //#define Z4_SLAVE_ADDRESS 0 + //#define E0_SLAVE_ADDRESS 0 + //#define E1_SLAVE_ADDRESS 0 + //#define E2_SLAVE_ADDRESS 0 + //#define E3_SLAVE_ADDRESS 0 + //#define E4_SLAVE_ADDRESS 0 + //#define E5_SLAVE_ADDRESS 0 + //#define E6_SLAVE_ADDRESS 0 + //#define E7_SLAVE_ADDRESS 0 /** * Software enable diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3ce7043f4fb7..e9ea26aa7a9b 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1647,6 +1647,54 @@ #ifndef E7_INTERPOLATE #define E7_INTERPOLATE INTERPOLATE #endif + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 0 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 0 + #endif + #ifndef X2_SLAVE_ADDRESS + #define X2_SLAVE_ADDRESS 0 + #endif + #ifndef Y2_SLAVE_ADDRESS + #define Y2_SLAVE_ADDRESS 0 + #endif + #ifndef Z2_SLAVE_ADDRESS + #define Z2_SLAVE_ADDRESS 0 + #endif + #ifndef Z3_SLAVE_ADDRESS + #define Z3_SLAVE_ADDRESS 0 + #endif + #ifndef Z4_SLAVE_ADDRESS + #define Z4_SLAVE_ADDRESS 0 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 0 + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 0 + #endif + #ifndef E2_SLAVE_ADDRESS + #define E2_SLAVE_ADDRESS 0 + #endif + #ifndef E3_SLAVE_ADDRESS + #define E3_SLAVE_ADDRESS 0 + #endif + #ifndef E4_SLAVE_ADDRESS + #define E4_SLAVE_ADDRESS 0 + #endif + #ifndef E5_SLAVE_ADDRESS + #define E5_SLAVE_ADDRESS 0 + #endif + #ifndef E6_SLAVE_ADDRESS + #define E6_SLAVE_ADDRESS 0 + #endif + #ifndef E7_SLAVE_ADDRESS + #define E7_SLAVE_ADDRESS 0 + #endif #endif #if (HAS_E_DRIVER(TMC2660) \ diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h index 78751a6bac87..a09da02e1584 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h @@ -34,4 +34,18 @@ #define Y_HARDWARE_SERIAL MSerial4 #define Z_HARDWARE_SERIAL MSerial4 #define E0_HARDWARE_SERIAL MSerial4 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h index 8ed30bffb733..cc4bf46e15a6 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h @@ -49,13 +49,27 @@ #define CONTROLLER_FAN_PIN FAN1_PIN #endif -/** - * TMC220x stepper drivers - * Hardware serial communication ports. - */ #if HAS_TMC_UART + /** + * TMC220x stepper drivers + * Hardware serial communication ports + */ #define X_HARDWARE_SERIAL MSerial4 #define Y_HARDWARE_SERIAL MSerial4 #define Z_HARDWARE_SERIAL MSerial4 #define E0_HARDWARE_SERIAL MSerial4 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index aebb776b2961..3919723f3788 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -87,19 +87,30 @@ #define E0_ENABLE_PIN PC13 #if HAS_TMC_UART - /** * TMC2208/TMC2209 stepper drivers */ - // // Hardware serial with switch - // #define X_HARDWARE_SERIAL MSerial2 #define Y_HARDWARE_SERIAL MSerial2 #define Z_HARDWARE_SERIAL MSerial2 #define E0_HARDWARE_SERIAL MSerial2 + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + // The 4xTMC2209 module doesn't have a serial multiplexer and // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0 #if HAS_DRIVER(TMC2208) @@ -110,7 +121,6 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 - #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index b8a4ccf770c4..c978092ab22c 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -80,10 +80,26 @@ #define E0_DIR_PIN PC14 #define E0_ENABLE_PIN PC13 -#define X_HARDWARE_SERIAL MSerial2 -#define Y_HARDWARE_SERIAL MSerial2 -#define Z_HARDWARE_SERIAL MSerial2 -#define E0_HARDWARE_SERIAL MSerial2 +#if HAS_TMC_UART + #define X_HARDWARE_SERIAL MSerial2 + #define Y_HARDWARE_SERIAL MSerial2 + #define Z_HARDWARE_SERIAL MSerial2 + #define E0_HARDWARE_SERIAL MSerial2 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif +#endif // // Heaters / Fans diff --git a/buildroot/tests/STM32F103RC_btt-tests b/buildroot/tests/STM32F103RC_btt-tests index 5d695c9296b1..0084f59a0ce8 100755 --- a/buildroot/tests/STM32F103RC_btt-tests +++ b/buildroot/tests/STM32F103RC_btt-tests @@ -17,10 +17,6 @@ opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2209 opt_set Z_DRIVER_TYPE TMC2209 opt_set E0_DRIVER_TYPE TMC2209 -opt_set X_SLAVE_ADDRESS 0 -opt_set Y_SLAVE_ADDRESS 1 -opt_set Z_SLAVE_ADDRESS 2 -opt_set E0_SLAVE_ADDRESS 3 opt_enable PINS_DEBUGGING exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" From 7a168205eb2463022ab1a4306bafa8152ab2d8bc Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 19 Dec 2020 23:02:38 -0500 Subject: [PATCH 367/443] Minimum temp options for Probing and G12 Nozzle Clean (#20383) Co-authored-by: Jason Smith Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 13 ++++++++++- Marlin/src/gcode/bedlevel/abl/G29.cpp | 27 +++++----------------- Marlin/src/inc/Conditionals_LCD.h | 16 +++++++++++++ Marlin/src/inc/SanityCheck.h | 4 ++++ Marlin/src/libs/nozzle.cpp | 17 ++++++++++++++ Marlin/src/module/probe.cpp | 33 +++++++++++++++++++++++++++ Marlin/src/module/probe.h | 4 ++++ buildroot/tests/LPC1768-tests | 3 ++- buildroot/tests/rambo-tests | 2 +- 9 files changed, 95 insertions(+), 24 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index adf6a3d5361f..0c166d5dda8a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1067,6 +1067,13 @@ //#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing //#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors +// Require minimum nozzle and/or bed temperature for probing. +//#define PREHEAT_BEFORE_PROBING +#if ENABLED(PREHEAT_BEFORE_PROBING) + #define PROBING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time + #define PROBING_BED_TEMP 50 +#endif + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 @@ -1296,7 +1303,7 @@ */ //#define PREHEAT_BEFORE_LEVELING #if ENABLED(PREHEAT_BEFORE_LEVELING) - #define LEVELING_NOZZLE_TEMP 120 + #define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time #define LEVELING_BED_TEMP 50 #endif @@ -1666,6 +1673,10 @@ // For a purge/clean station mounted on the X axis //#define NOZZLE_CLEAN_NO_Y + // Require a minimum hotend temperature for cleaning + #define NOZZLE_CLEAN_MIN_TEMP 170 + //#define NOZZLE_CLEAN_HEATUP // Heat up the nozzle instead of skipping wipe + // Explicit wipe G-code script applies to a G12 with no arguments. //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0" diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 157353c0630b..8e87bb4f7d6f 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -36,12 +36,9 @@ #include "../../../module/probe.h" #include "../../queue.h" -#if EITHER(PROBE_TEMP_COMPENSATION, PREHEAT_BEFORE_LEVELING) - #include "../../../module/temperature.h" -#endif - #if ENABLED(PROBE_TEMP_COMPENSATION) #include "../../../feature/probe_temp_comp.h" + #include "../../../module/temperature.h" #endif #if HAS_DISPLAY @@ -404,25 +401,13 @@ G29_TYPE GcodeSuite::G29() { ExtUI::onMeshLevelingStart(); #endif - if (!faux) remember_feedrate_scaling_off(); + if (!faux) { + remember_feedrate_scaling_off(); - #if ENABLED(PREHEAT_BEFORE_LEVELING) - #ifndef LEVELING_NOZZLE_TEMP - #define LEVELING_NOZZLE_TEMP 0 + #if ENABLED(PREHEAT_BEFORE_LEVELING) + if (!dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP); #endif - #ifndef LEVELING_BED_TEMP - #define LEVELING_BED_TEMP 0 - #endif - if (!dryrun && !faux) { - constexpr uint16_t hotendPreheat = LEVELING_NOZZLE_TEMP, bedPreheat = LEVELING_BED_TEMP; - if (DEBUGGING(LEVELING)) - DEBUG_ECHOLNPAIR("Preheating hotend (", hotendPreheat, ") and bed (", bedPreheat, ")"); - if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0); - if (bedPreheat) thermalManager.setTargetBed(bedPreheat); - if (hotendPreheat) thermalManager.wait_for_hotend(0); - if (bedPreheat) thermalManager.wait_for_bed_heating(); - } - #endif + } // Disable auto bed leveling during G29. // Be formal so G29 can be done successively without G28. diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9c080ee2869d..c6837536001e 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -819,6 +819,22 @@ #define TOTAL_PROBING MULTIPLE_PROBING #endif #endif + #if ENABLED(PREHEAT_BEFORE_PROBING) + #ifndef PROBING_NOZZLE_TEMP + #define PROBING_NOZZLE_TEMP 0 + #endif + #ifndef PROBING_BED_TEMP + #define PROBING_BED_TEMP 0 + #endif + #endif + #if ENABLED(PREHEAT_BEFORE_LEVELING) + #ifndef LEVELING_NOZZLE_TEMP + #define LEVELING_NOZZLE_TEMP 0 + #endif + #ifndef LEVELING_BED_TEMP + #define LEVELING_BED_TEMP 0 + #endif + #endif #else // Clear probe pin settings when no probe is selected #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index be7d97e2cac6..904ef0d38a4e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1514,6 +1514,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +#if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING) + #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING." +#endif + /** * Homing */ diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 10021005e5b3..4277e8d8d047 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -31,6 +31,10 @@ Nozzle nozzle; #include "../MarlinCore.h" #include "../module/motion.h" +#if NOZZLE_CLEAN_MIN_TEMP > 20 + #include "../module/temperature.h" +#endif + #if ENABLED(NOZZLE_CLEAN_FEATURE) /** @@ -153,6 +157,19 @@ Nozzle nozzle; const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; + #if NOZZLE_CLEAN_MIN_TEMP > 20 + if (thermalManager.degTargetHotend(arrPos) < NOZZLE_CLEAN_MIN_TEMP) { + #if ENABLED(NOZZLE_CLEAN_HEATUP) + SERIAL_ECHOLNPGM("Nozzle too Cold - Heating"); + thermalManager.setTargetHotend(NOZZLE_CLEAN_MIN_TEMP, arrPos); + thermalManager.wait_for_hotend(arrPos); + #else + SERIAL_ECHOLNPGM("Nozzle too cold - Skipping wipe"); + return; + #endif + } + #endif + #if HAS_SOFTWARE_ENDSTOPS #define LIMIT_AXIS(A) do{ \ diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index bcd3a03a9aeb..63b1928c7622 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -325,6 +325,36 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #endif } +#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING) + + /** + * Do preheating as required before leveling or probing + */ + void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) { + #if PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP + #define WAIT_FOR_NOZZLE_HEAT + #endif + #if PROBING_BED_TEMP || LEVELING_BED_TEMP + #define WAIT_FOR_BED_HEAT + #endif + const uint16_t hotendPreheat = TERN0(WAIT_FOR_NOZZLE_HEAT, thermalManager.degHotend(0) < hotend_temp) ? hotend_temp : 0, + bedPreheat = TERN0(WAIT_FOR_BED_HEAT, thermalManager.degBed() < bed_temp) ? bed_temp : 0; + DEBUG_ECHOPGM("Preheating "); + if (hotendPreheat) { + DEBUG_ECHOPAIR("hotend (", hotendPreheat, ") "); + if (bedPreheat) DEBUG_ECHOPGM("and "); + } + if (bedPreheat) DEBUG_ECHOPAIR("bed (", bedPreheat, ") "); + DEBUG_EOL(); + + TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0)); + TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.setTargetBed(bedPreheat)); + TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.wait_for_hotend(0)); + TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.wait_for_bed_heating()); + } + +#endif + /** * Attempt to deploy or stow the probe * @@ -392,6 +422,9 @@ bool Probe::set_deployed(const bool deploy) { #endif + // If preheating is required before any probing... + TERN_(PREHEAT_BEFORE_PROBING, if (deploy) preheat_for_probing(PROBING_NOZZLE_TEMP, PROBING_BED_TEMP)); + do_blocking_move_to(old_xy); endstops.enable_z_probe(deploy); return false; diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 137d360175e4..3ee699b4db30 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -51,6 +51,10 @@ class Probe { static xyz_pos_t offset; + #if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING) + static void preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp); + #endif + static bool set_deployed(const bool deploy); #if IS_KINEMATIC diff --git a/buildroot/tests/LPC1768-tests b/buildroot/tests/LPC1768-tests index b8d073031409..72d794634f95 100755 --- a/buildroot/tests/LPC1768-tests +++ b/buildroot/tests/LPC1768-tests @@ -39,7 +39,7 @@ opt_set TEMP_SENSOR_1 -1 opt_set TEMP_SENSOR_BED 5 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \ - NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ @@ -47,6 +47,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER opt_set GRID_MAX_POINTS_X 16 opt_set NOZZLE_TO_PROBE_OFFSET "{ 0, 0, 0 }" +opt_set NOZZLE_CLEAN_MIN_TEMP 170 exec_test $1 $2 "Re-ARM with NOZZLE_AS_PROBE and many features." "$3" # clean up diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index f93b2d14f255..5bc1b39f7e1f 100755 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -25,7 +25,7 @@ opt_set FANMUX0_PIN 53 opt_disable USE_WATCHDOG opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \ - PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \ + PREHEAT_BEFORE_PROBING PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \ EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \ BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ From 2963229dfa6648246951de90e4a86bf537cc876a Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 19 Dec 2020 23:11:43 -0500 Subject: [PATCH 368/443] Probe Tare, Probe Activation Switch (#20379) Co-authored-by: Scott Lahteine Co-authored-by: Victor Mateus Oliveira Co-authored-by: Jason Smith --- Marlin/Configuration.h | 27 ++++++++++++++ Marlin/src/core/language.h | 1 + Marlin/src/gcode/probe/M401_M402.cpp | 1 + Marlin/src/inc/SanityCheck.h | 8 +++++ Marlin/src/module/endstops.cpp | 21 ++++++++--- Marlin/src/module/motion.cpp | 7 ++-- Marlin/src/module/probe.cpp | 37 +++++++++++++++++++- Marlin/src/module/probe.h | 4 +++ buildroot/tests/STM32F103RET6_creality-tests | 9 +++++ 9 files changed, 108 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0c166d5dda8a..5fe746a77ff3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1006,6 +1006,33 @@ // Feedrate (mm/min) for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +/** + * Probe Activation Switch + * A switch indicating proper deployment, or an optical + * switch triggered when the carriage is near the bed. + */ +//#define PROBE_ACTIVATION_SWITCH +#if ENABLED(PROBE_ACTIVATION_SWITCH) + #define PROBE_ACTIVATION_SWITCH_STATE LOW // State indicating probe is active + //#define PROBE_ACTIVATION_SWITCH_PIN PC6 // Override default pin +#endif + +/** + * Tare Probe (determine zero-point) prior to each probe. + * Useful for a strain gauge or piezo sensor that needs to factor out + * elements such as cables pulling on the carriage. + */ +//#define PROBE_TARE +#if ENABLED(PROBE_TARE) + #define PROBE_TARE_TIME 200 // (ms) Time to hold tare pin + #define PROBE_TARE_DELAY 200 // (ms) Delay after tare before + #define PROBE_TARE_STATE HIGH // State to write pin for tare + //#define PROBE_TARE_PIN PA5 // Override default pin + #if ENABLED(PROBE_ACTIVATION_SWITCH) + //#define PROBE_TARE_ONLY_WHILE_INACTIVE // Fail to tare/probe if PROBE_ACTIVATION_SWITCH is active + #endif +#endif + /** * Multiple Probing * diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index f1e477933ad9..98d155e1d185 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -154,6 +154,7 @@ #define STR_Z4_MIN "z4_min" #define STR_Z4_MAX "z4_max" #define STR_Z_PROBE "z_probe" +#define STR_PROBE_EN "probe_en" #define STR_FILAMENT_RUNOUT_SENSOR "filament" #define STR_PROBE_OFFSET "Probe Offset" #define STR_SKEW_MIN "min_skew_factor: " diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp index 8e9bd11b81d7..bd9bb44c4061 100644 --- a/Marlin/src/gcode/probe/M401_M402.cpp +++ b/Marlin/src/gcode/probe/M401_M402.cpp @@ -33,6 +33,7 @@ */ void GcodeSuite::M401() { probe.deploy(); + TERN_(PROBE_TARE, probe.tare()); report_current_position(); } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 904ef0d38a4e..0ff80dc96469 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1409,6 +1409,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable it or comment out this line to continue." #endif + #if ENABLED(PROBE_ACTIVATION_SWITCH) + #ifndef PROBE_ACTIVATION_SWITCH_STATE + #error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH." + #elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH) + #error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH." + #endif + #endif + #else /** diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index ef0b92a7ee05..1467e1b70de5 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -280,6 +280,12 @@ void Endstops::init() { #endif #endif + #if ENABLED(PROBE_ACTIVATION_SWITCH) + SET_INPUT(PROBE_ACTIVATION_SWITCH_PIN); + #endif + + TERN_(PROBE_TARE, probe.tare()); + TERN_(ENDSTOP_INTERRUPTS_FEATURE, setup_endstop_interrupts()); // Enable endstops @@ -458,6 +464,9 @@ void _O2 Endstops::report_states() { #if HAS_Z4_MAX ES_REPORT(Z4_MAX); #endif + #if BOTH(MARLIN_DEV_MODE, PROBE_ACTIVATION_SWITCH) + print_es_state(READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE, PSTR(STR_PROBE_EN)); + #endif #if HAS_CUSTOM_PROBE_PIN print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE)); #endif @@ -582,7 +591,7 @@ void Endstops::update() { #endif #endif - #if HAS_Z_MIN && !Z_SPI_SENSORLESS + #if HAS_Z_MIN && NONE(Z_SPI_SENSORLESS, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) UPDATE_ENDSTOP_BIT(Z, MIN); #if ENABLED(Z_MULTI_ENDSTOPS) #if HAS_Z2_MIN @@ -607,9 +616,13 @@ void Endstops::update() { #endif #endif - // When closing the gap check the enabled probe - #if HAS_CUSTOM_PROBE_PIN - UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); + #if HAS_BED_PROBE + // When closing the gap check the enabled probe + if (true + #if ENABLED(PROBE_ACTIVATION_SWITCH) + || READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE + #endif + ) UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN)); #endif #if HAS_Z_MAX && !Z_SPI_SENSORLESS diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 45ec51314946..3800bc6b0a94 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1589,8 +1589,11 @@ void homeaxis(const AxisEnum axis) { // Fast move towards endstop until triggered if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 1 Fast:"); - #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) - if (axis == Z_AXIS && bltouch.deploy()) return; // The initial DEPLOY + #if HOMING_Z_WITH_PROBE + if (axis == Z_AXIS) { + if (TERN0(BLTOUCH, bltouch.deploy())) return; + if (TERN0(PROBE_TARE, probe.tare())) return; + } #endif #if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 63b1928c7622..261fde491314 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -512,6 +512,33 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { return !probe_triggered; } +#if ENABLED(PROBE_TARE) + /** + * @brief Tare the Z probe + * + * @details Signal to the probe to tare itself + * + * @return TRUE if the tare cold not be completed + */ + bool Probe::tare() { + #if BOTH(PROBE_ACTIVATION_SWITCH, PROBE_TARE_ONLY_WHILE_INACTIVE) + if (READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE) { + SERIAL_ECHOLNPGM("Cannot tare an active probe"); + return true; + } + #endif + + SERIAL_ECHOLNPGM("Taring probe"); + OUT_WRITE(PROBE_TARE_PIN, PROBE_TARE_STATE); + delay(PROBE_TARE_TIME); + OUT_WRITE(PROBE_TARE_PIN, !PROBE_TARE_STATE); + delay(PROBE_TARE_DELAY); + + endstops.hit_on_purpose(); + return false; + } +#endif + /** * @brief Probe at the current XY (possibly more than once) to find the bed Z. * @@ -523,8 +550,11 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { float Probe::run_z_probe(const bool sanity_check/*=true*/) { DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING)); - auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) { + auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) -> bool { // Do a first probe at the fast speed + + if (TERN0(PROBE_TARE, tare())) return true; + const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger? early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high? #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -549,6 +579,8 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #if TOTAL_PROBING == 2 // Do a first probe at the fast speed + if (TERN0(PROBE_TARE, tare())) return NAN; + if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s, sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; @@ -586,6 +618,9 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { ) #endif { + // If the probe won't tare, return + if (TERN0(PROBE_TARE, tare())) return true; + // Probe downward slowly to find the bed if (try_to_probe(PSTR("SLOW"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW), sanity_check, Z_CLEARANCE_MULTI_PROBE) ) return NAN; diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 3ee699b4db30..49520eb3344c 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -210,6 +210,10 @@ class Probe { static void set_probing_paused(const bool p); #endif + #if ENABLED(PROBE_TARE) + static bool tare(); + #endif + private: static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s); static void do_z_raise(const float z_raise); diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index 4e6c4f988b3f..cc3275741b5c 100755 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -19,3 +19,12 @@ opt_add SDCARD_EEPROM_EMULATION exec_test $1 $2 "Ender 3 v2, SD EEPROM, w/o CLASSIC_JERK" "$3" restore_configs +opt_set SERIAL_PORT 1 +opt_set MOTHERBOARD BOARD_CREALITY_V452 +opt_disable NOZZLE_TO_PROBE_OFFSET +opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +opt_enable PROBE_ACTIVATION_SWITCH PROBE_ACTIVATION_SWITCH_PIN PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE +exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" + +# clean up +restore_configs From 6dfcd491d02a6ad99c0d43d92da0b14d76d67228 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sat, 19 Dec 2020 21:55:57 -0800 Subject: [PATCH 369/443] Fix Creality EEPROM watchdog freq. (#20510) --- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 9a7e4d799d49..a6395698aae7 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -48,6 +48,7 @@ bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { + size_t written = 0; while (size--) { uint8_t v = *value; uint8_t * const p = (uint8_t * const)pos; @@ -55,7 +56,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui // so only write bytes that have changed! if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); - if (size & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes + if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes if (eeprom_read_byte(p) != v) { SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; From 0a99f8feed0f8d486a17315ce7412f03f6f166cb Mon Sep 17 00:00:00 2001 From: Foxies Date: Sun, 20 Dec 2020 07:17:24 +0100 Subject: [PATCH 370/443] Migrate Hispeedv1 (QQS-Pro) to HAL/STM32 (#20354) --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 59 ++++++++++---------- platformio.ini | 29 ++++++---- 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index c20af310cc2a..4d83e5703cc8 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -60,6 +60,9 @@ // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // #define SPI_DEVICE 2 +#define SCK_PIN PB13 // SPI2 +#define MISO_PIN PB14 // SPI2 +#define MOSI_PIN PB15 // SPI2 // SPI Flash #define HAS_SPI_FLASH 1 @@ -269,43 +272,42 @@ #error "FLSun HiSpeed default BEEPER_PIN is not a SPEAKER." #endif -/** - * Note: MKS Robin TFT screens use various TFT controllers - * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240) - * ILI9488 is not supported - * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp - * - * If the screen stays white, disable 'LCD_RESET_PIN' - * to let the bootloader init the screen. - * - * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu - * because Marlin uses the reset as a failsafe to revive a glitchy LCD. - */ - -// QQS-Pro uses MKS Robin TFT v2.0 320x240 +#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT + #define TFT_CS_PIN PD7 // NE4 + #define TFT_RS_PIN PD11 // A0 +#endif -// Shared FSMC Configs #if HAS_FSMC_TFT - #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h - #define DOGLCD_SCK -1 - - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 - - #define TFT_RESET_PIN PC6 // FSMC_RST + /** + * Note: MKS Robin TFT screens use various TFT controllers + * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240) + * ILI9488 is not supported + * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp + * + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. + * + * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu + * because Marlin uses the reset as a failsafe to revive a glitchy LCD. + */ + //#define TFT_RESET_PIN PC6 // FSMC_RST #define TFT_BACKLIGHT_PIN PD13 + #define FSMC_CS_PIN TFT_CS_PIN // NE4 + #define FSMC_RS_PIN TFT_RS_PIN // A0 #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - - #define TFT_BUFFER_SIZE 14400 - #if ENABLED(TFT_CLASSIC_UI) - #define TFT_MARLINBG_COLOR 0x3186 // White - #define TFT_MARLINUI_COLOR 0xC7B6 // green + #ifdef TFT_CLASSIC_UI + #define TFT_MARLINBG_COLOR 0x3186 // Grey + #define TFT_MARLINUI_COLOR 0xC7B6 // Green #define TFT_BTARROWS_COLOR 0xDEE6 // Yellow #define TFT_BTOKMENU_COLOR 0x145F // Cyan - #endif + #endif + #define TFT_BUFFER_SIZE 14400 +#elif HAS_GRAPHICAL_TFT + #define TFT_RESET_PIN PC6 + #define TFT_BACKLIGHT_PIN PD13 #endif #if NEED_TOUCH_PINS @@ -313,4 +315,5 @@ #define TOUCH_SCK_PIN PB13 // SPI2_SCK #define TOUCH_MISO_PIN PB14 // SPI2_MISO #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #define TOUCH_INT_PIN -1 #endif diff --git a/platformio.ini b/platformio.ini index 11918bc35af0..d907ee68d0f2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1150,18 +1150,25 @@ debug_tool = jlink upload_protocol = jlink # -# FLSUN QQ (STM32F103VET6) +# FLSUN QQS Pro (STM32F103VET6) using hal STM32 +# board Hispeedv1 # -[env:flsun_hispeed] -platform = ${common_stm32f1.platform} -extends = common_stm32f1 -board = genericSTM32F103VE -extra_scripts = ${common.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_mini.py - buildroot/share/PlatformIO/scripts/add_nanolib.py -build_flags = ${common_stm32f1.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -lib_deps = SoftwareSerialM - #Adafruit NeoPixel=https://github.com/Foxies-CSTL/Robin-NeoPixel-Lib/archive/master.zip +[env:flsun_hispeedv1] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +board = genericSTM32F103VE +board_build.core = stm32 +board_build.variant = MARLIN_F103Vx +board_build.ldscript = ldscript.ld +board_build.offset = 0x7000 +board_build.firmware = Robin_mini.bin +board_upload.offset_address = 0x08007000 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/mks_encrypt.py # # STM32F401VE From 62cc65cafeb79626e6ff5520620e7ff29cb36304 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 20 Dec 2020 00:27:04 -0600 Subject: [PATCH 371/443] Languages cleanup --- Marlin/src/lcd/language/language_cz.h | 4 ---- Marlin/src/lcd/language/language_de.h | 4 ---- Marlin/src/lcd/language/language_en.h | 14 ++++++-------- Marlin/src/lcd/language/language_es.h | 4 ---- Marlin/src/lcd/language/language_gl.h | 4 ---- Marlin/src/lcd/language/language_hu.h | 4 ---- Marlin/src/lcd/language/language_it.h | 4 ---- Marlin/src/lcd/language/language_pl.h | 4 ---- Marlin/src/lcd/language/language_pt.h | 14 ++++++-------- Marlin/src/lcd/language/language_pt_br.h | 14 ++++++-------- Marlin/src/lcd/language/language_ro.h | 4 ---- Marlin/src/lcd/language/language_ru.h | 4 ---- Marlin/src/lcd/language/language_sk.h | 18 ++++++------------ Marlin/src/lcd/language/language_tr.h | 4 ---- Marlin/src/lcd/language/language_uk.h | 4 ---- Marlin/src/lcd/language/language_zh_CN.h | 4 ---- Marlin/src/lcd/language/language_zh_TW.h | 4 ---- 17 files changed, 24 insertions(+), 88 deletions(-) diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index f102e021883c..adcbba772015 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -98,12 +98,8 @@ namespace Language_cz { PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Zahřát vlastní"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Zchladit"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Ovládání laseru"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnout laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnout laser"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon laseru"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Vřeteno ovládání"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Vřeteno vyp"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Vřeteno zap"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Vřeteno výkon"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Vřeteno opačně"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnout napájení"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 1827fd062d3a..265c30c7336b 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -92,12 +92,8 @@ namespace Language_de { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Abkühlen"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequenz"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser aus"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser an"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laserleistung"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindel-Steuerung"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindel aus"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindel an"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindelleistung"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindelrichtung"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Netzteil ein"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index b7d767aa3bdb..194a75c6a080 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -682,14 +682,12 @@ namespace Language_en { PROGMEM Language_Str MSG_SOUND = _UxGT("Sound"); - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Top Left"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bottom Left"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Top Right"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Bottom Right"); - PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration Completed"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibration Failed"); - #endif + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Top Left"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Bottom Left"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Top Right"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Bottom Right"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibration Completed"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibration Failed"); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 362d2480c146..7a25ca7a934c 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -95,12 +95,8 @@ namespace Language_es { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecuencia"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Láser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Apagar Láser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Encender Láser"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potencia Láser"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Control Mandrino"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Apagar Mandrino"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Encender Mandrino"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potencia Mandrino"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Invertir giro"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Encender Fuente"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index b0a42a9f90db..379a25497f7c 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -92,12 +92,8 @@ namespace Language_gl { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefriar"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecuencia"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Láser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Láser Apagado"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Láser Aceso"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potencia Láser"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Control Fuso"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Fuso Apagado"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Fuso Aceso"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potencia Fuso"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverter xiro"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Acender"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index acd27c96aa4d..21655be6fb20 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -94,12 +94,8 @@ namespace Language_hu { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Visszahütés"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frekvencia"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Lézer Vezérlés"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Lézer Ki"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Lézer Be"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Lézer Teljesítmény"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Orsó Vezérlés"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Orsó Ki"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Orsó Be"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Orsó Teljesítmény"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Orsó Hátra"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Bekapcsolás"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index ffc6d31a9a00..ba2fef456a47 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -107,12 +107,8 @@ namespace Language_it { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Raffredda"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequenza"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Controllo laser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potenza laser"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Controllo mandrino"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Mandrino Off"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Mandrino On"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potenza mandrino"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverti mandrino"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Accendi aliment."); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 47d7162dee15..bf7d32e2223a 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -89,12 +89,8 @@ namespace Language_pl { PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Rozgrzej własne ust."); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Chłodzenie"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Sterowanie Lasera"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Wyłącz Laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Włącz Laser"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Zasilanie Lasera"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Sterowanie wrzeciona"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Wyłącz wrzeciono"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Włącz wrzeciono"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Zasilanie wrzeciona"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Rewers wrzeciona"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Włącz zasilacz"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 2dc53993b69a..60b0c550564f 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -161,12 +161,10 @@ namespace Language_pt { PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); - PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); - #endif + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); } diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 06226b84edbd..4ddf424b3d67 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -479,12 +479,10 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Continuando...")); #endif - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); - PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); - #endif + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Superior Esquerdo"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Inferior Esquerdo"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Superior Direto"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Inferior Direto"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibração Completa"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibração Falhou"); } diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 459cc5ee3ddb..db07ac5c6855 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -91,12 +91,8 @@ namespace Language_ro { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Racire"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frecventa"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Laser"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Oprit"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser Pornit"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Puterea Laserului"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Controlul Spindle"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Oprit"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle Pornit"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Puterea Spindle"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Invers"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Porneste"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 85dc58a15a67..30a8d2fec1cd 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -98,12 +98,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждение"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Управление лазером"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Выключить лазер"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Включить лазер"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Мощность лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Управление шпинделем"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Выключить шпиндель"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Включить шпиндель"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощность шпинделя"); #else diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 9a1e13e2c808..1900f5371945 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -102,12 +102,8 @@ namespace Language_sk { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Schladiť"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frekvencia"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Nastavenie lasera"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnúť laser"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnúť laser"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon lasera"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Nastavenie vretena"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Vypnúť vreteno"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Zapnúť vreteno"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Výkon vretena"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spätný chod"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnúť napájanie"); @@ -656,12 +652,10 @@ namespace Language_sk { PROGMEM Language_Str MSG_SOUND = _UxGT("Zvuk"); - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Ľavý horný"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Ľavý dolný"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Pravý horný"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Pravý dolný"); - PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Kalibrácia dokončená"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Kalibrácia zlyhala"); - #endif + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Ľavý horný"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Ľavý dolný"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Pravý horný"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Pravý dolný"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Kalibrácia dokončená"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Kalibrácia zlyhala"); } diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 57c814ad4808..ca6357027c9b 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -94,12 +94,8 @@ namespace Language_tr { PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isınma"); PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Soğut/(Durdur)"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Lazer Kontrolü"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Lazeri Kapat"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Lazeri Aç"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Lazer Gücü"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindle Kontrolü"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Kapat"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle Aç"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Gücü"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Ters Yön"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Gücü Aç"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 2aa483de506e..8916effd2764 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -100,8 +100,6 @@ namespace Language_uk { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Вимкнути нагрів"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Керування лазером"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Вимкнути лазер"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("Увімкнути лазер"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потужність лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керування шпінделем"); @@ -109,8 +107,6 @@ namespace Language_uk { PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потуж.лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керув. шпінделем"); #endif - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Вимкнути шпіндель"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Увімкнути шпіндель"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Потуж. шпінделя"); #else diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index a4134969aa18..cd43ee3b396a 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -89,12 +89,8 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降温"); //"Cooldown" PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("切割频率"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("激光控制"); - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("激光关"); - PROGMEM Language_Str MSG_LASER_ON = _UxGT("激光开"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("激光电源"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("主轴控制"); - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("主轴关"); - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("主轴开"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("主轴电源"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("主轴反转"); PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("电源打开"); //"Switch power on" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 4654f770ea5b..f86b15351fdf 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -87,12 +87,8 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("自定預熱"); //"Preheat Custom" PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降溫"); //"Cooldown" PROGMEM Language_Str MSG_LASER_MENU = _UxGT("激光控制"); //"Laser Control" - PROGMEM Language_Str MSG_LASER_OFF = _UxGT("激光 關"); //"Laser Off" - PROGMEM Language_Str MSG_LASER_ON = _UxGT("激光 開"); //"Laser On" PROGMEM Language_Str MSG_LASER_POWER = _UxGT("激光電源"); //"Laser Power" PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("主軸控告制"); //"Spindle Control" - PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("主軸 關"); //"Spindle Off" - PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("主軸 開"); //"Spindle On" PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("主軸電源"); //"Spindle Power" PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("主軸反轉"); //"Spindle Reverse" PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("電源打開"); //"Switch power on" From d8687512b1b98cc88516597d66d7f77c2946d074 Mon Sep 17 00:00:00 2001 From: Serhiy-K <52166448+Serhiy-K@users.noreply.github.com> Date: Sun, 20 Dec 2020 08:33:23 +0200 Subject: [PATCH 372/443] Update Russian and Ukrainian languages (#20508) --- Marlin/src/lcd/language/language_ru.h | 73 ++++++++++++++++++++++++--- Marlin/src/lcd/language/language_uk.h | 72 ++++++++++++++++++++++++-- 2 files changed, 135 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 30a8d2fec1cd..ffaa406f18c5 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -43,6 +43,11 @@ namespace Language_ru { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD-карта вставлена"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD-карта извлечена"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Вставьте SD-карту"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("Сбой инициализации SD"); + #else + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("Сбой инициализ. SD"); + #endif PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Ошибка считывания"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB диск удалён"); PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Ошибка USB диска"); @@ -65,6 +70,9 @@ namespace Language_ru { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Парковка Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Парковка Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Авто Z-выравнивание"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Итерация: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Уменьшение точности!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Точность достигнута"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Нулевое положение"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Нажмите чтобы начать"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Следующая точка"); @@ -98,14 +106,18 @@ namespace Language_ru { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждение"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Управление лазером"); + PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Переключить лазер"); PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Мощность лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Управление шпинделем"); + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Переключить шпиндель"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощность шпинделя"); #else PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Мощн.шпинделя"); #endif + PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Шпиндель вперёд"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Инверсия шпинделя"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Включить питание"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Выключить питание"); PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Экструзия"); @@ -132,14 +144,15 @@ namespace Language_ru { PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 тест Z-зонда"); PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Отклонение"); PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 точка"); + PROGMEM Language_Str MSG_M48_OUT_OF_BOUNDS = _UxGT("Зонд за пределами"); PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Меню IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Размещение сопел"); PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Авто парковка"); PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Размножение"); PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Зеркальная копия"); PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Полный контроль"); - - PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Размещение сопел"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Дублировать X-зазор"); PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2-е сопло X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2-е сопло Y"); @@ -161,10 +174,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Двигаемся дальше"); PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Активировать UBL"); PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Деактивировать UBL"); - PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Редактор сеток"); PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Править свою сетку"); - #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура стола"); PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура стола"); @@ -249,6 +260,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Нет хранилища"); PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Ошибка: Сохран. UBL"); PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Ошибка: Восстан.UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Смещение Z: "); PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Смещение Z останов."); PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL пошагово"); PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Строить холодную"); @@ -271,6 +283,14 @@ namespace Language_ru { PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Фиолетовый"); PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Белый"); PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Свет по умолчанию"); + PROGMEM Language_Str MSG_LED_CHANNEL_N = _UxGT("Канал ="); + PROGMEM Language_Str MSG_LEDS2 = _UxGT("Свет #2"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Свет #2 предустановки"); + #else + PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Свет #2 предустан."); + #endif + PROGMEM Language_Str MSG_NEO2_BRIGHTNESS = _UxGT("Яркость"); PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Свой цвет подсветки"); PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Уровень красного"); PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Уровень зелёного"); @@ -414,9 +434,11 @@ namespace Language_ru { PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Назад"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Продолжить"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Пропустить"); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Пауза печати"); PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Продолжить печать"); + PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Старт с хоста"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Остановить печать"); PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Печать объекта"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Завершить объект"); @@ -519,6 +541,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Смещение X"); PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Смещение Y"); PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Смещение Z"); + PROGMEM Language_Str MSG_MOVE_NOZZLE_TO_BED = _UxGT("Двигать сопло к столу"); PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Микрошаг X"); PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Микрошаг Y"); PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Микрошаг Z"); @@ -539,8 +562,10 @@ namespace Language_ru { PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрев..."); PROGMEM Language_Str MSG_COOLING = _UxGT("Охлаждение..."); PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрев стола..."); - PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Нагрев камеры..."); PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охлаждение стола..."); + PROGMEM Language_Str MSG_PROBE_HEATING = _UxGT("Нагрев зонда..."); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Охлаждение зонда..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Нагрев камеры..."); PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охладжение камеры..."); PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калибровка Delta"); PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калибровать X"); @@ -660,6 +685,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Перезапуск MMU"); PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Удалите и нажмите"); + #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_MIX = _UxGT("Смешивание"); #else @@ -679,8 +705,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Конец В-инструмента"); PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдоним В-инструмента"); PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Сброс В-инструментов"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструменти сброшены"); PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструменти"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструменти сброшены"); #else PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перекл. смешивание"); PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-инструм."); @@ -688,8 +714,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_END_VTOOL = _UxGT("В-инструм.кон."); PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдоним В-инстр."); PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Сброс В-инструм."); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструм. сброшены"); PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструм."); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструм. сброшены"); #endif PROGMEM Language_Str MSG_START_Z = _UxGT("Начало Z"); PROGMEM Language_Str MSG_END_Z = _UxGT(" Конец Z"); @@ -708,6 +734,21 @@ namespace Language_ru { PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скор.стран."); #endif + PROGMEM Language_Str MSG_EDIT_PASSWORD = _UxGT("Редактировать пароль"); + PROGMEM Language_Str MSG_LOGIN_REQUIRED = _UxGT("Нужен логин"); + PROGMEM Language_Str MSG_PASSWORD_SETTINGS = _UxGT("Настройки пароля"); + PROGMEM Language_Str MSG_ENTER_DIGIT = _UxGT("Введите цифру"); + PROGMEM Language_Str MSG_CHANGE_PASSWORD = _UxGT("Смените пароль"); + PROGMEM Language_Str MSG_REMOVE_PASSWORD = _UxGT("Удалить пароль"); + PROGMEM Language_Str MSG_PASSWORD_SET = _UxGT("Пароль это "); + PROGMEM Language_Str MSG_START_OVER = _UxGT("Старт через"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запомни для сохранения!"); + #else + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запомни, сохрани!"); + #endif + PROGMEM Language_Str MSG_PASSWORD_REMOVED = _UxGT("Пароль удалён"); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Парковка...")); // // Filament Change screens show up to 3 lines on a 4-line display @@ -759,6 +800,24 @@ namespace Language_ru { #endif PROGMEM Language_Str MSG_REHEAT = _UxGT("Возобновить нагрев"); PROGMEM Language_Str MSG_REHEATING = _UxGT("Нагрев..."); + + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Мастер Z-зонда"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Зондиров. контрольной точки Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Движение к точке зондирования"); + #else + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Зондир.контр.точки Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Движ. к точке зондир."); + #endif + + PROGMEM Language_Str MSG_SOUND = _UxGT("Звук"); + + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Верхний левый"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Нижний левый"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Верхний правый"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Нижний правый"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Калибровка успешна"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Ошибка калибровки"); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 8916effd2764..b0bffd2009ef 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -44,6 +44,11 @@ namespace Language_uk { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD-картка вставлена"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD-картка видалена"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Вставте SD-картку"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("Збій ініціалізації SD"); + #else + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("Збій ініціаліз. SD"); + #endif PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Помилка зчитування"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB диск видалений"); PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Помилка USB диску"); @@ -67,6 +72,9 @@ namespace Language_uk { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Паркування Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Паркування Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Авто Z-вирівнювання"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Ітерація: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Зменьшення точності!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Точність досягнута"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Паркування XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Почати"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Наступна точка"); @@ -100,6 +108,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Вимкнути нагрів"); PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Частота"); PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Керування лазером"); + PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Перемкнути лазер"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потужність лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керування шпінделем"); @@ -107,12 +116,15 @@ namespace Language_uk { PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Потуж.лазера"); PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Керув. шпінделем"); #endif + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Перемкнути шпіндель"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Потуж. шпінделя"); #else PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Потуж. шпінд."); #endif + PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Шпіндель вперед"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Напрямок шпінделя"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Увімкнути живлення"); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Вимкнути живлення"); PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Екструзія"); @@ -134,15 +146,20 @@ namespace Language_uk { PROGMEM Language_Str MSG_MESH_Y = _UxGT("Індекс Y"); PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Значення Z"); PROGMEM Language_Str MSG_USER_MENU = _UxGT("Власні команди"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 тест зонду"); PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 точка"); + PROGMEM Language_Str MSG_M48_OUT_OF_BOUNDS = _UxGT("Зонд за межами"); PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Відхилення"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Меню IDEX"); PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Зміщення сопел"); PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Авто паркування"); PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Розмноження"); PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Дзеркальна копія"); - PROGMEM Language_Str MSG_IDEX_MODE_FU1L_CTRL = _UxGT("Повний контроль"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Повний контроль"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Дублювати X-зазор"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("Друге сопло X"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("Друге сопло Y"); PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("Друге сопло Z"); @@ -267,6 +284,14 @@ namespace Language_uk { PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Фіолетовий"); PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Білий"); PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("За умовчанням"); + PROGMEM Language_Str MSG_LED_CHANNEL_N = _UxGT("Канал ="); + PROGMEM Language_Str MSG_LEDS2 = _UxGT("Світло #2"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Світло #2 передустановки"); + #else + PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Світло #2 передустан."); + #endif + PROGMEM Language_Str MSG_NEO2_BRIGHTNESS = _UxGT("Яскравість"); PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Свої кольори"); PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Рівень червоного"); PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Рівень зеленого"); @@ -412,10 +437,12 @@ namespace Language_uk { PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Назад"); PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Продовжити"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Пропустити"); PROGMEM Language_Str MSG_PAUSING = _UxGT("Призупинення..."); PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Призупинити друк"); PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Відновити друк"); + PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Старт з хосту"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Скасувати друк"); PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Друк об'єкта"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Завершити об'єкт"); @@ -513,6 +540,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Тест зміщення X"); PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Тест зміщення Y"); PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Тест зміщення Z"); + PROGMEM Language_Str MSG_MOVE_NOZZLE_TO_BED = _UxGT("Рухати сопло до столу"); PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Мікрокрок X"); PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Мікрокрок Y"); PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Мікрокрок Z"); @@ -534,13 +562,16 @@ namespace Language_uk { PROGMEM Language_Str MSG_COOLING = _UxGT("Охолодження..."); PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрів столу..."); PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Нагрів камери..."); + PROGMEM Language_Str MSG_PROBE_HEATING = _UxGT("Нагрів зонду..."); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охолодження столу..."); PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охолодження камери..."); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Охолодження зонду..."); PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрування Delta"); #else PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охол. столу..."); PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охол. камери..."); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Охол. зонду..."); PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрув. Delta"); #endif PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калібрувати X"); @@ -598,6 +629,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Підсвітка"); PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яскравість світла"); PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("НЕ ТОЙ ПРИНТЕР"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); #if LCD_WIDTH >= 20 @@ -662,6 +694,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Перезапуск MMU"); PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Видаліть, натисніть"); + #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_MIX = _UxGT("Змішування"); #else @@ -681,8 +714,8 @@ namespace Language_uk { PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Кінець В-інструменту"); PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інструменту"); PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструментів"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструменти зкинуті"); PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Змішати В-інструменти"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструменти зкинуті"); #else PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перемкнути змішув."); PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-інструм."); @@ -690,8 +723,8 @@ namespace Language_uk { PROGMEM Language_Str MSG_END_VTOOL = _UxGT("В-інструм. кін."); PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інстр."); PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструм"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструм. зкинуті"); PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Змішати В-інструм."); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструм. зкинуті"); #endif PROGMEM Language_Str MSG_START_Z = _UxGT("Початок Z"); PROGMEM Language_Str MSG_END_Z = _UxGT(" Кінець Z"); @@ -710,6 +743,21 @@ namespace Language_uk { PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Погана швидк.стор"); #endif + PROGMEM Language_Str MSG_EDIT_PASSWORD = _UxGT("Редагувати пароль"); + PROGMEM Language_Str MSG_LOGIN_REQUIRED = _UxGT("Потрібен логін"); + PROGMEM Language_Str MSG_PASSWORD_SETTINGS = _UxGT("Параметри паролю"); + PROGMEM Language_Str MSG_ENTER_DIGIT = _UxGT("Введіть цифру"); + PROGMEM Language_Str MSG_CHANGE_PASSWORD = _UxGT("Змінити пароль"); + PROGMEM Language_Str MSG_REMOVE_PASSWORD = _UxGT("Видалити пароль"); + PROGMEM Language_Str MSG_PASSWORD_SET = _UxGT("Пароль це "); + PROGMEM Language_Str MSG_START_OVER = _UxGT("Старт через"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запам'ятай для збереження!"); + #else + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запам'ятай, збережи!"); + #endif + PROGMEM Language_Str MSG_PASSWORD_REMOVED = _UxGT("Пароль видалений"); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Паркування...")); #if LCD_HEIGHT >= 4 // Up to 3 lines allowed @@ -754,6 +802,24 @@ namespace Language_uk { PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Час нагрівача збіг"); PROGMEM Language_Str MSG_REHEAT = _UxGT("Поновити нагрів"); PROGMEM Language_Str MSG_REHEATING = _UxGT("Нагрівання..."); + + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Майстер Z-зонда"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Зондув. контрольної точки Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Рух до точки зондування"); + #else + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Зондув.контр.точки Z"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Рух до точки зондув."); + #endif + + PROGMEM Language_Str MSG_SOUND = _UxGT("Звук"); + + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Верхній лівий"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Нижній лівий"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Верхній правий"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Нижній правий"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Калібрування успішне"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Збій калібрування"); } #if FAN_COUNT == 1 From 777c50a1ecd68c8b35531b654498e73bd5078b24 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 20 Dec 2020 00:38:10 -0600 Subject: [PATCH 373/443] Fix PIO typo --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index d907ee68d0f2..e7f22e3f09e7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -486,7 +486,7 @@ build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide [env:MightyBoard1280] platform = atmelavr extends = mega_extended_optimized -board = megamega1280 +board = megaatmega1280 # # MightyBoard ATmega2560 From 4764e2c54478d266a8ad16f9532f1c9bd4104c4e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 21 Dec 2020 00:17:17 +0000 Subject: [PATCH 374/443] [cron] Bump distribution date (2020-12-21) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 311faa2124b3..7fa5e978ed28 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-20" + #define STRING_DISTRIBUTION_DATE "2020-12-21" #endif /** From 71bec0824c7457a922f2fc53ab79f8a9499021b8 Mon Sep 17 00:00:00 2001 From: Dick Streefland Date: Mon, 21 Dec 2020 08:47:49 +0100 Subject: [PATCH 375/443] Get E3V2 DWIN `MACHINE_SIZE` from config (#20526) --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 38e41ba11eae..5a9d555970b1 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -86,7 +86,7 @@ #endif #ifndef MACHINE_SIZE - #define MACHINE_SIZE "220x220x250" + #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif #ifndef CORP_WEBSITE_C #define CORP_WEBSITE_C "www.cxsw3d.com" From 7afd274d0ce9c7149c3edf3bd23aadd28154ccfb Mon Sep 17 00:00:00 2001 From: Dick Streefland Date: Mon, 21 Dec 2020 08:49:00 +0100 Subject: [PATCH 376/443] Apply HOME_AFTER_DEACTIVATE for 'G28 O' (#20525) --- Marlin/src/gcode/calibrate/G28.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 23c4d56d936a..57c21df765fc 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -227,7 +227,7 @@ void GcodeSuite::G28() { #endif // Home (O)nly if position is unknown - if (!homing_needed() && parser.boolval('O')) { + if (!axes_should_home() && parser.boolval('O')) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip"); return; } From c7ecfe28e7ee83e88c180d4f6a859969513c599f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Dec 2020 17:36:15 -0600 Subject: [PATCH 377/443] Clean up some pins --- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 10 +++--- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 12 +++---- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 36 +++++++++---------- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 2 +- 4 files changed, 28 insertions(+), 32 deletions(-) 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 c748dbbed3cf..a124b4d5835c 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -48,20 +48,20 @@ // // Limit Switches // -#define X_STOP_PIN PC1 // "X-STOP" -#define Y_STOP_PIN PC0 // "Y-STOP" -#define Z_STOP_PIN PC15 // "Z-STOP" +#define X_STOP_PIN PC1 // X-STOP +#define Y_STOP_PIN PC0 // Y-STOP +#define Z_STOP_PIN PC15 // Z-STOP // // Z Probe must be this pin // -#define Z_MIN_PROBE_PIN PC14 // "PROBE" +#define Z_MIN_PROBE_PIN PC14 // PROBE // // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC2 // "E0-STOP" + #define FIL_RUNOUT_PIN PC2 // E0-STOP #endif // 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 b65411be8a3b..9f2513cc82ad 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 @@ -41,25 +41,25 @@ // // Servos // -#define SERVO0_PIN PA1 // "SERVOS" +#define SERVO0_PIN PA1 // SERVOS // // Limit Switches // -#define X_STOP_PIN PC0 // "X-STOP" -#define Y_STOP_PIN PC1 // "Y-STOP" -#define Z_STOP_PIN PC2 // "Z-STOP" +#define X_STOP_PIN PC0 // X-STOP +#define Y_STOP_PIN PC1 // Y-STOP +#define Z_STOP_PIN PC2 // Z-STOP // // Z Probe must be this pin // -#define Z_MIN_PROBE_PIN PC14 // "PROBE" +#define Z_MIN_PROBE_PIN PC14 // PROBE // // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC15 // "E0-STOP" + #define FIL_RUNOUT_PIN PC15 // E0-STOP #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 4d83e5703cc8..93403b9ddda4 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -117,11 +117,7 @@ * Several wiring options are provided below, defaulting to * to the most compatible. */ - -// -// Drivers -// -#if HAS_TMC220x +#if HAS_TMC_UART // SoftwareSerial with one pin per driver // Compatible with TMC2208 and TMC2209 drivers #define X_SERIAL_TX_PIN PA10 // RXD1 @@ -140,20 +136,20 @@ #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } #endif -/** - * MKS Robin_Wifi or another ESP8266 module - * - * __ESP(M1)__ -J1- - * GND| 15 | | 08 |+3v3 (22) RXD1 (PA10) - * | 16 | | 07 |MOSI (21) TXD1 (PA9) Active LOW, probably OK to leave floating - * IO2| 17 | | 06 |MISO (19) IO1 (PC7) Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * IO0| 18 | | 05 |CLK (18) IO0 (PA8) Must be HIGH (ESP3D software configures this with a pullup so OK to leave as floating) - * IO1| 19 | | 03 |EN (03) WIFI_EN Must be HIGH for module to run - * | nc | | nc | (01) WIFI_CTRL (PA5) - * RX| 21 | | nc | - * TX| 22 | | 01 |RST - *  ̄ ̄ AE ̄ ̄ - */ + /** + * MKS Robin_Wifi or another ESP8266 module + * + * __ESP(M1)__ -J1- + * GND| 15 | | 08 |+3v3 (22) RXD1 (PA10) + * | 16 | | 07 |MOSI (21) TXD1 (PA9) Active LOW, probably OK to leave floating + * IO2| 17 | | 06 |MISO (19) IO1 (PC7) Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * IO0| 18 | | 05 |CLK (18) IO0 (PA8) Must be HIGH (ESP3D software configures this with a pullup so OK to leave as floating) + * IO1| 19 | | 03 |EN (03) WIFI_EN Must be HIGH for module to run + * | nc | | nc | (01) WIFI_CTRL (PA5) + * RX| 21 | | nc | + * TX| 22 | | 01 |RST + *  ̄ ̄ AE ̄ ̄ + */ // Module ESP-WIFI #define ESP_WIFI_MODULE_COM 2 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 @@ -303,7 +299,7 @@ #define TFT_MARLINUI_COLOR 0xC7B6 // Green #define TFT_BTARROWS_COLOR 0xDEE6 // Yellow #define TFT_BTOKMENU_COLOR 0x145F // Cyan - #endif + #endif #define TFT_BUFFER_SIZE 14400 #elif HAS_GRAPHICAL_TFT #define TFT_RESET_PIN PC6 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 1362d2208619..66d90e019477 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -82,7 +82,7 @@ #define E0_DIR_PIN PB3 #define E0_ENABLE_PIN PB5 -#if HAS_TMC220x +#if HAS_TMC_UART /** * TMC2208/TMC2209 stepper drivers * From 3ec59b36ebf9aa009ab6a43f2d8a9d28abc8b284 Mon Sep 17 00:00:00 2001 From: Sebastiaan Dammann Date: Sun, 20 Dec 2020 18:10:03 +0100 Subject: [PATCH 378/443] Add BTT SKR CR6 board (#20522) --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h | 180 +++++++++++++++++++++ buildroot/tests/STM32F103RE_btt_USB-tests | 12 ++ 4 files changed, 195 insertions(+) create mode 100644 Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 15362c49084e..ec39ad4e7188 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -335,6 +335,7 @@ #define BOARD_FLY_MINI 4042 // FLY MINI (STM32F103RCT6) #define BOARD_FLSUN_HISPEED 4043 // FLSUN HiSpeedV1 (STM32F103VET6) #define BOARD_BEAST 4044 // STM32F103RET6 Libmaple-based controller +#define BOARD_BTT_SKR_CR6 4045 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9d1dab10f60c..dbafed2d4e92 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -542,6 +542,8 @@ #include "stm32f1/pins_FLSUN_HISPEED.h" // STM32F1 env:flsun_hispeed #elif MB(BEAST) #include "stm32f1/pins_BEAST.h" // STM32F1 env:STM32F103RE +#elif MB(BTT_SKR_CR6) + #include "stm32f1/pins_BTT_SKR_CR6.h" // STM32F1 env:STM32F103RC_btt_512K_USB // // ARM Cortex-M4F diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h new file mode 100644 index 000000000000..d8c37d85eb15 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -0,0 +1,180 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * BigTreeTech SKR CR-6 (STM32F103RET6) board pin assignments + */ + +#define DEFAULT_MACHINE_NAME "Creality3D" +#define BOARD_INFO_NAME "BTT SKR CR-6" + +#if NOT_TARGET(__STM32F1__) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +// +// Release PB4 (Z_STEP_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// USB connect control +// +#define USB_CONNECT_PIN PA14 +#define USB_CONNECT_INVERTING false + +// +// EEPROM +// + +#if NO_EEPROM_SELECTED + #define I2C_EEPROM +#endif + +/* I2C */ +#if ENABLED(I2C_EEPROM) + #define IIC_EEPROM_SDA PB7 + #define IIC_EEPROM_SCL PB6 + + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +#define E2END (MARLIN_EEPROM_SIZE - 1) // 2KB + +// +// Limit Switches +// + +#define X_STOP_PIN PC0 +#define Y_STOP_PIN PC1 +#define Z_STOP_PIN PC14 // Endtop or Probe + +#define FIL_RUNOUT_PIN PC15 + +// +// Probe +// +#define PROBE_TARE_PIN PA1 +#define PROBE_ACTIVATION_SWITCH_PIN PC2 // Optoswitch to Enable Z Probe + +// +// Steppers +// +#define X_ENABLE_PIN PB14 +#define X_STEP_PIN PB13 +#define X_DIR_PIN PB12 + +#define Y_ENABLE_PIN PB11 +#define Y_STEP_PIN PB10 +#define Y_DIR_PIN PB2 + +#define Z_ENABLE_PIN PB1 +#define Z_STEP_PIN PB0 +#define Z_DIR_PIN PC5 + +#define E0_ENABLE_PIN PD2 +#define E0_STEP_PIN PB3 +#define E0_DIR_PIN PB4 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // TH1 +#define TEMP_BED_PIN PC3 // TB1 + +// +// Heaters / Fans +// + +#define HEATER_0_PIN PC8 // HEATER1 +#define HEATER_BED_PIN PC9 // HOT BED + +#define FAN_PIN PC6 // FAN +#define FAN_SOFT_PWM + +#define CONTROLLER_FAN_PIN PC7 + +// +// LCD / Controller +// +#if ENABLED(CR10_STOCKDISPLAY) + #define BTN_ENC PA15 + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + + #define LCD_PINS_RS PB8 + #define LCD_PINS_ENABLE PB15 + #define LCD_PINS_D4 PB9 + + #define BEEPER_PIN PB5 +#endif + +#if HAS_TMC_UART + /** + * TMC2209 stepper drivers + * Hardware serial communication ports. + */ + #define X_HARDWARE_SERIAL MSerial4 + #define Y_HARDWARE_SERIAL MSerial4 + #define Z_HARDWARE_SERIAL MSerial4 + #define E0_HARDWARE_SERIAL MSerial4 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif +#endif + +// +// SD Card +// + +#define HAS_ONBOARD_SD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN PC4 + + #define ON_BOARD_SPI_DEVICE 1 // SPI1 + #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card +#endif + +// +// Misc. Functions +// +#define LED_CONTROL_PIN PA13 +#define NEOPIXEL_PIN PA8 diff --git a/buildroot/tests/STM32F103RE_btt_USB-tests b/buildroot/tests/STM32F103RE_btt_USB-tests index e35d68898cf4..43162b68a4b3 100755 --- a/buildroot/tests/STM32F103RE_btt_USB-tests +++ b/buildroot/tests/STM32F103RE_btt_USB-tests @@ -15,5 +15,17 @@ opt_set SERIAL_PORT 1 opt_set SERIAL_PORT_2 -1 exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" +restore_configs +opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 +opt_set SERIAL_PORT -1 +opt_set SERIAL_PORT_2 2 +opt_set TEMP_SENSOR_BED 1 +opt_enable CR10_STOCKDISPLAY \ + 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 +opt_disable NOZZLE_TO_PROBE_OFFSET +exec_test $1 $2 "BigTreeTech SKR CR6 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" + # clean up restore_configs From 0d95f67f2e82bd5d1812094f7fe7fd6191d1c331 Mon Sep 17 00:00:00 2001 From: cr20-123 <66994235+cr20-123@users.noreply.github.com> Date: Mon, 21 Dec 2020 18:43:45 -0500 Subject: [PATCH 379/443] Fix G34 compile with bed leveling disabled (#20537) --- Marlin/src/gcode/calibrate/G34.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index a96eac0a882f..e8d48411720b 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -41,8 +41,9 @@ void GcodeSuite::G34() { // Home before the alignment procedure if (!all_axes_trusted()) home_all_axes(); + TERN_(HAS_LEVELING, TEMPORARY_BED_LEVELING_STATE(false)); + SET_SOFT_ENDSTOP_LOOSE(true); - TEMPORARY_BED_LEVELING_STATE(false); TemporaryGlobalEndstopsState unlock_z(false); #ifdef GANTRY_CALIBRATION_COMMANDS_PRE From ba16c5321811bfb1e944fcee1619742c70ea8f87 Mon Sep 17 00:00:00 2001 From: LinFor Date: Tue, 22 Dec 2020 02:45:00 +0300 Subject: [PATCH 380/443] Fix some Russian (#20529) --- Marlin/src/lcd/language/language_ru.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index ffaa406f18c5..b3176c0a5443 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -694,7 +694,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Компонент ="); PROGMEM Language_Str MSG_MIXER = _UxGT("Смеситель"); PROGMEM Language_Str MSG_GRADIENT = _UxGT("Градиент"); - PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Полний градиент"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Полный градиент"); PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Цикличное смешивание"); PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Градиент смешивания"); PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Сменить градиент"); @@ -705,8 +705,8 @@ namespace Language_ru { PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Конец В-инструмента"); PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдоним В-инструмента"); PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Сброс В-инструментов"); - PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструменти"); - PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструменти сброшены"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Смешать В-инструменты"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-инструменты сброшены"); #else PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перекл. смешивание"); PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-инструм."); @@ -728,10 +728,10 @@ namespace Language_ru { #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Плохой индекс страницы"); - PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скорость страницы"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Плохая скорость страницы"); #else - PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Полохая страница"); - PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скор.стран."); + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Плохая страница"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Плохая скор.стран."); #endif PROGMEM Language_Str MSG_EDIT_PASSWORD = _UxGT("Редактировать пароль"); @@ -779,10 +779,10 @@ namespace Language_ru { #endif PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Драйвера TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Текущие настройки"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Ток двигателей"); PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Гибридный режим"); PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Режим без эндстопов"); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Режим шага"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Режим драйвера"); PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Тихий режим вкл"); PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Сброс"); From 6429be6efcd23e05d1efa0380451157430c1fb72 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Dec 2020 20:47:18 -0600 Subject: [PATCH 381/443] Robin pins followup --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index a36b8a32e673..ebfb00bfb668 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -173,11 +173,10 @@ * MKS Robin has a few hardware revisions * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware * - * MKS Robin less or equal to V2.3 don't have SD_DETECT_PIN. + * MKS Robin <= V2.3 have no SD_DETECT_PIN. + * MKS Robin >= V2.4 have SD_DETECT_PIN on PF12. * - * MKS Robin greater or equal to V2.4 have SD_DETECT_PIN at PF12. - * - * You can uncomment it here, or you can add it SD_DETECT_PIN to your Configuration.h + * Uncomment here or add SD_DETECT_PIN to Configuration.h. */ //#define SD_DETECT_PIN -1 //#define SD_DETECT_PIN PF12 // SD_CD From 34b6bca0069c685df5ba9f4e91e4382682656696 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Dec 2020 17:48:03 -0600 Subject: [PATCH 382/443] Tweak FTDI spacing --- .../screens/advanced_settings_menu.cpp | 32 ++++++++--------- .../base_numeric_adjustment_screen.cpp | 4 +-- .../screens/bed_mesh_screen.cpp | 2 +- .../screens/bio_advanced_settings.cpp | 28 +++++++-------- .../screens/bio_main_menu.cpp | 18 +++++----- .../screens/bio_printing_dialog_box.cpp | 2 +- .../screens/bio_tune_menu.cpp | 14 ++++---- .../cocoa_press_advanced_settings_menu.cpp | 22 ++++++------ .../screens/cocoa_press_main_menu.cpp | 16 ++++----- .../screens/cocoa_press_preheat_menu.cpp | 14 ++++---- .../screens/cocoa_press_preheat_screen.cpp | 4 +-- .../screens/default_acceleration_screen.cpp | 2 +- .../screens/developer_menu.cpp | 36 +++++++++---------- .../screens/dialog_box_base_class.cpp | 8 ++--- .../screens/endstop_state_screen.cpp | 2 +- .../screens/files_screen.cpp | 12 +++---- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 20 +++++------ .../screens/status_screen.cpp | 22 ++++++------ .../screens/touch_registers_screen.cpp | 26 +++++++------- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 18 +++++----- 20 files changed, 151 insertions(+), 151 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 431c60158193..0b2dc911f10c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -90,29 +90,29 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { cmd.colors(normal_btn) .font(Theme::font_medium) .enabled(ENABLED(HAS_BED_PROBE)) - .tag(2) .button( ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + .tag(2) .button(ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) .enabled(ENABLED(CASE_LIGHT_ENABLE)) - .tag(16).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) - .tag(3) .button( STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) + .tag(16).button(CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(3) .button(STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) - .tag(13).button( TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) + .tag(13).button(TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) .enabled(ENABLED(SENSORLESS_HOMING)) - .tag(14).button( TMC_HOMING_THRS_POS, GET_TEXT_F(MSG_TMC_HOMING_THRS)) + .tag(14).button(TMC_HOMING_THRS_POS, GET_TEXT_F(MSG_TMC_HOMING_THRS)) .enabled(ENABLED(HAS_MULTI_HOTEND)) - .tag(4) .button( OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(4) .button(OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU)) .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) - .tag(11).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) - .tag(12).button( ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .tag(15).button( DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) - .tag(9) .button( INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) - .tag(10).button( RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) - .tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) - .tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) - .tag(7) .button( JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) + .tag(11).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) + .tag(12).button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) + .tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) + .tag(10).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) + .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .enabled(ENABLED(BACKLASH_GCODE)) - .tag(8).button( BACKLASH_POS, GET_TEXT_F(MSG_BACKLASH)) + .tag(8).button(BACKLASH_POS, GET_TEXT_F(MSG_BACKLASH)) .colors(action_btn) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp index 10cbd3bc62a0..a118d851df5e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -219,7 +219,7 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, prog .font(font_small) .text( BTN_POS(1,_line), BTN_SIZE(4,1), label); _button_style(cmd, TEXT_AREA); - cmd.fgcolor(_color).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT); + cmd.fgcolor(_color).button(BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT); } cmd.font(font_medium); @@ -282,7 +282,7 @@ void BaseNumericAdjustmentScreen::widgets_t::text_field(uint8_t tag, progmem_str _button_style(cmd, TEXT_AREA); cmd.fgcolor(_color) .tag(tag) - .button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT); + .button(BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT); } if (_what & FOREGROUND) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index 2cce884d3616..dbc4ba3b4b6f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -250,7 +250,7 @@ void BedMeshScreen::drawHighlightedPointValue() { .text(Z_LABEL_POS, GET_TEXT_F(MSG_MESH_EDIT_Z)) .text(Z_VALUE_POS, str) .colors(action_btn) - .tag(1).button( OKAY_POS, GET_TEXT_F(MSG_BUTTON_OKAY)) + .tag(1).button(OKAY_POS, GET_TEXT_F(MSG_BUTTON_OKAY)) .tag(0); switch (screen_data.BedMeshScreen.message) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp index 196f26fe22b2..cabcd5ded74e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -43,50 +43,50 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #define GRID_ROWS 9 #define GRID_COLS 2 - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) + .tag(2) .button(BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) .enabled( #if HAS_TRINAMIC_CONFIG 1 #endif ) - .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) + .tag(3) .button(BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) .enabled( #if HAS_TRINAMIC_CONFIG 1 #endif ) - .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) - .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(4) .button(BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) + .tag(5) .button(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .enabled( #if HAS_MULTI_HOTEND 1 #endif ) - .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(6) .button(BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) - .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) - .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) - .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) + .tag(7) .button(BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) + .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) + .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) #if HAS_JUNCTION_DEVIATION - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) + .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) #else - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) + .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) #endif .enabled( #if ENABLED(BACKLASH_GCODE) 1 #endif ) - .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) + .tag(11) .button(BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) .enabled( #if ENABLED(LIN_ADVANCE) 1 #endif ) - .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) - .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) + .tag(12) .button(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) + .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) + .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); #undef GRID_COLS diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp index dacbaf686642..53203cd35e34 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp @@ -46,16 +46,16 @@ void MainMenu::onRedraw(draw_mode_t what) { .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN)) .colors(normal_btn) .font(font_medium) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) - .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) - .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) - .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) - .tag(8).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .tag(9).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) + .tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) + .tag(3).button(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) + .tag(4).button(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) + .tag(5).button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) + .tag(6).button(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) + .tag(7).button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) + .tag(8).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag(9).button(BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) - .tag(1).button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + .tag(1).button(BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); } #undef GRID_COLS diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp index 38426377034e..65b996dd511d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -81,7 +81,7 @@ void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) { .enabled(isPrinting() ? TERN0(SDSUPPORT, isPrintingFromMedia()) : 1) .tag(3) .colors(isPrinting() ? normal_btn : action_btn) - .button( BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); + .button(BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp index ceea3742b0d6..dacc1cb6eaf6 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp @@ -48,14 +48,14 @@ void TuneMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(font_medium) - .enabled( isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) + .enabled( isPrinting()).tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(3).button(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) .enabled(TERN_(BABYSTEPPING, true)) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) - .enabled(!isPrinting()).tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) - .enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) - .enabled(!isPrinting()).tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) - .colors(action_btn) .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + .tag(4).button(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) + .enabled(!isPrinting()).tag(5).button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) + .enabled(!isPrinting()).tag(6).button(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) + .enabled(!isPrinting()).tag(7).button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) + .colors(action_btn) .tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); } #undef GRID_COLS #undef GRID_ROWS diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp index 23314d5c2740..656bf1db13d1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_advanced_settings_menu.cpp @@ -56,22 +56,22 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .tag(2) .button( STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) + .tag(2) .button(STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) - .tag(3) .button( TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) + .tag(3) .button(TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) .enabled(ENABLED(LIN_ADVANCE)) .tag(4) .button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .tag(5) .button( VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) - .tag(6) .button( ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) - .tag(7) .button( JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) - .tag(8) .button( ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .tag(9) .button( INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) - .tag(10).button( DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) + .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) + .tag(8) .button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) + .tag(10).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) .enabled(ENABLED(CASE_LIGHT_ENABLE)) - .tag(11).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) - .tag(12).button( RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) + .tag(11).button(CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(12).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp index da095eaab65f..9c8ad062aae1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_main_menu.cpp @@ -53,16 +53,16 @@ void MainMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .tag(2).button( MOVE_XYZ_POS, GET_TEXT_F(MSG_XYZ_MOVE)) - .tag(3).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .tag(2).button(MOVE_XYZ_POS, GET_TEXT_F(MSG_XYZ_MOVE)) + .tag(3).button(TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE)) - .tag(4).button( ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) - .tag(5).button( MOVE_E_POS, GET_TEXT_F(MSG_E_MOVE)) - .tag(6).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) - .tag(7).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .tag(8).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) + .tag(4).button(ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + .tag(5).button(MOVE_E_POS, GET_TEXT_F(MSG_E_MOVE)) + .tag(6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(7).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag(8).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp index 476c5e468bf0..4707924b2079 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_menu.cpp @@ -53,16 +53,16 @@ void PreheatMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.font(Theme::font_medium) .colors(normal_btn) - .tag(2).button( BTN_POS(1,2), w, h, F("Dark Chocolate")) - .tag(3).button( BTN_POS(1,3), w, h, F("Milk Chocolate")) - .tag(4).button( BTN_POS(1,4), w, h, F("White Chocolate")); + .tag(2).button(BTN_POS(1,2), w, h, F("Dark Chocolate")) + .tag(3).button(BTN_POS(1,3), w, h, F("Milk Chocolate")) + .tag(4).button(BTN_POS(1,4), w, h, F("White Chocolate")); if (has_extra_heater()) { - cmd.tag(5).button( BTN_POS(2,2), w, h, F("Dark Chocolate")) - .tag(6).button( BTN_POS(2,3), w, h, F("Milk Chocolate")) - .tag(7).button( BTN_POS(2,4), w, h, F("White Chocolate")); + cmd.tag(5).button(BTN_POS(2,2), w, h, F("Dark Chocolate")) + .tag(6).button(BTN_POS(2,3), w, h, F("Milk Chocolate")) + .tag(7).button(BTN_POS(2,4), w, h, F("White Chocolate")); } cmd.colors(action_btn) - .tag(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + .tag(1) .button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp index 1aad1f5b4cc9..e9996e4bc044 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_preheat_screen.cpp @@ -78,7 +78,7 @@ void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(font_medium) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } @@ -101,7 +101,7 @@ void PreheatTimerScreen::draw_adjuster(draw_mode_t what, uint8_t tag, progmem_st .font(font_small); if (what & BACKGROUND) { cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) - .button( SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); + .button(SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); } if (what & FOREGROUND) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp index 203b2b037e30..de617d437427 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp @@ -40,7 +40,7 @@ void DefaultAccelerationScreen::onRedraw(draw_mode_t what) { w.adjuster( 4, GET_TEXT_F(MSG_ACCEL_TRAVEL), getTravelAcceleration_mm_s2() ); w.adjuster( 6, GET_TEXT_F(MSG_ACCEL_RETRACT), getRetractAcceleration_mm_s2() ); w.increments(); - w.button( 8, GET_TEXT_F(MSG_SET_MAXIMUM)); + w.button( 8, GET_TEXT_F(MSG_SET_MAXIMUM)); } bool DefaultAccelerationScreen::onTouchHeld(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp index 3a5abf944936..89a7e1edf7eb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -57,32 +57,32 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { #define GRID_COLS 1 cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) .colors(normal_btn) - .tag(2).font(font_medium) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) - .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Stress Test")) - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Touch Registers")) - .tag(5) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) - .tag(6).enabled(has_media).button( BTN_POS(1,6), BTN_SIZE(1,1), F("Play Video from Media")) - .tag(7).enabled(has_flash).button( BTN_POS(1,7), BTN_SIZE(1,1), F("Play Video from SPI Flash")) - .tag(8).enabled(has_flash).button( BTN_POS(1,8), BTN_SIZE(1,1), F("Load Video to SPI Flash")) - .tag(9).enabled(has_flash).button( BTN_POS(1,9), BTN_SIZE(1,1), F("Erase SPI Flash")) + .tag(2).font(font_medium) .button(BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) + .tag(3) .button(BTN_POS(1,3), BTN_SIZE(1,1), F("Stress Test")) + .tag(4) .button(BTN_POS(1,4), BTN_SIZE(1,1), F("Show Touch Registers")) + .tag(5) .button(BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) + .tag(6).enabled(has_media).button(BTN_POS(1,6), BTN_SIZE(1,1), F("Play Video from Media")) + .tag(7).enabled(has_flash).button(BTN_POS(1,7), BTN_SIZE(1,1), F("Play Video from SPI Flash")) + .tag(8).enabled(has_flash).button(BTN_POS(1,8), BTN_SIZE(1,1), F("Load Video to SPI Flash")) + .tag(9).enabled(has_flash).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Erase SPI Flash")) .tag(1).colors(action_btn) - .button( BTN_POS(1,10), BTN_SIZE(1,1), F("Back")); + .button(BTN_POS(1,10), BTN_SIZE(1,1), F("Back")); #else #define GRID_ROWS 6 #define GRID_COLS 2 cmd.font(font_medium) .text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Developer Menu")) .colors(normal_btn) - .tag(2).font(font_small) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) - .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Show Touch Registers")) - .tag(9) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Pin States")) - .tag(4) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) - .tag(5).enabled(has_media).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Play Video from Media")) - .tag(6).enabled(has_flash).button( BTN_POS(2,3), BTN_SIZE(1,1), F("Play Video from SPI Flash")) - .tag(7).enabled(has_flash).button( BTN_POS(2,4), BTN_SIZE(1,1), F("Load Video to SPI Flash")) - .tag(8).enabled(has_flash).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Erase SPI Flash")) + .tag(2).font(font_small) .button(BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) + .tag(3) .button(BTN_POS(1,3), BTN_SIZE(1,1), F("Show Touch Registers")) + .tag(9) .button(BTN_POS(1,4), BTN_SIZE(1,1), F("Show Pin States")) + .tag(4) .button(BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) + .tag(5).enabled(has_media).button(BTN_POS(2,2), BTN_SIZE(1,1), F("Play Video from Media")) + .tag(6).enabled(has_flash).button(BTN_POS(2,3), BTN_SIZE(1,1), F("Play Video from SPI Flash")) + .tag(7).enabled(has_flash).button(BTN_POS(2,4), BTN_SIZE(1,1), F("Load Video to SPI Flash")) + .tag(8).enabled(has_flash).button(BTN_POS(2,5), BTN_SIZE(1,1), F("Erase SPI Flash")) .tag(1).colors(action_btn) - .button( BTN_POS(1,6), BTN_SIZE(2,1), F("Back")); + .button(BTN_POS(1,6), BTN_SIZE(2,1), F("Back")); #endif } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp index 2ae3d7b049fd..6fe7be492d01 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp @@ -50,20 +50,20 @@ template void DialogBoxBaseClass::drawMessage(progmem_str, int16_t font); void DialogBoxBaseClass::drawYesNoButtons(uint8_t default_btn) { CommandProcessor cmd; cmd.font(font_medium) - .colors(default_btn == 1 ? action_btn : normal_btn).tag(1).button( BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_YES)) - .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button( BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_NO)); + .colors(default_btn == 1 ? action_btn : normal_btn).tag(1).button(BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_YES)) + .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button(BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_NO)); } void DialogBoxBaseClass::drawOkayButton() { CommandProcessor cmd; cmd.font(font_medium) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY)); + .tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY)); } void DialogBoxBaseClass::drawButton(const progmem_str label) { CommandProcessor cmd; cmd.font(font_medium) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), label); + .tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), label); } void DialogBoxBaseClass::drawSpinner() { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 09561edc0219..864ba286231f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -121,7 +121,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { cmd.font(font_medium) .colors(action_btn) - .tag(1).button( BTN_POS(1,7), BTN_SIZE(6,1), GET_TEXT_F(MSG_BACK)); + .tag(1).button(BTN_POS(1,7), BTN_SIZE(6,1), GET_TEXT_F(MSG_BACK)); #undef GRID_COLS #undef GRID_ROWS } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index aed81045f4de..7c0129610d6f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -141,11 +141,11 @@ void FilesScreen::drawHeader() { CommandProcessor cmd; cmd.colors(normal_btn) .font(font_small) - .tag(0).button( BTN_POS(2,1), BTN_SIZE(4,header_h), str, OPT_CENTER | OPT_FLAT) + .tag(0).button(BTN_POS(2,1), BTN_SIZE(4,header_h), str, OPT_CENTER | OPT_FLAT) .font(font_medium) .colors(action_btn) - .tag(241).enabled(prev_enabled).button( BTN_POS(1,1), BTN_SIZE(1,header_h), F("<")) - .tag(242).enabled(next_enabled).button( BTN_POS(6,1), BTN_SIZE(1,header_h), F(">")); + .tag(241).enabled(prev_enabled).button(BTN_POS(1,1), BTN_SIZE(1,header_h), F("<")) + .tag(242).enabled(next_enabled).button(BTN_POS(6,1), BTN_SIZE(1,header_h), F(">")); } void FilesScreen::drawFooter() { @@ -167,14 +167,14 @@ void FilesScreen::drawFooter() { cmd.colors(normal_btn) .font(font_medium) .colors(has_selection ? normal_btn : action_btn) - .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK)) + .tag(back_tag).button(BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK)) .enabled(has_selection) .colors(has_selection ? action_btn : normal_btn); if (screen_data.FilesScreen.flags.is_dir) - cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN)); + cmd.tag(244).button(BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN)); else - cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT)); + cmd.tag(243).button(BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT)); } void FilesScreen::onRedraw(draw_mode_t what) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 4bd22cdabd09..89b5899e7a56 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -69,20 +69,20 @@ void MainMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - .tag( 2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME)) + .tag( 2).button(AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME)) .enabled(ENABLED(NOZZLE_CLEAN_FEATURE)) - .tag( 3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(MSG_CLEAN_NOZZLE)) - .tag( 4).button( MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) - .tag( 5).button( DISABLE_STEPPERS_POS,GET_TEXT_F(MSG_DISABLE_STEPPERS)) - .tag( 6).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .tag( 3).button(CLEAN_NOZZLE_POS, GET_TEXT_F(MSG_CLEAN_NOZZLE)) + .tag( 4).button(MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) + .tag( 5).button(DISABLE_STEPPERS_POS,GET_TEXT_F(MSG_DISABLE_STEPPERS)) + .tag( 6).button(TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) .enabled(IF_DISABLED(TOUCH_UI_LULZBOT_BIO, 1)) - .tag( 7).button( FILAMENTCHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) - .tag( 8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag( 7).button(FILAMENTCHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) + .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .enabled(TERN_(HAS_LEVELING, 1)) - .tag( 9).button( LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) - .tag(10).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) + .tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) + .tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) - .tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index 8aef5dd41375..61f59844c04d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -66,13 +66,13 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { cmd.tag(6) .fgcolor(Theme::axis_label) .font(Theme::font_large) - .button( UNION_POS(X_LBL_POS, X_VAL_POS), F(""), OPT_FLAT) - .button( UNION_POS(Y_LBL_POS, Y_VAL_POS), F(""), OPT_FLAT) - .button( UNION_POS(Z_LBL_POS, Z_VAL_POS), F(""), OPT_FLAT) + .button(UNION_POS(X_LBL_POS, X_VAL_POS), F(""), OPT_FLAT) + .button(UNION_POS(Y_LBL_POS, Y_VAL_POS), F(""), OPT_FLAT) + .button(UNION_POS(Z_LBL_POS, Z_VAL_POS), F(""), OPT_FLAT) .font(Theme::font_medium) - .fgcolor(Theme::x_axis) .button( X_VAL_POS, F(""), OPT_FLAT) - .fgcolor(Theme::y_axis) .button( Y_VAL_POS, F(""), OPT_FLAT) - .fgcolor(Theme::z_axis) .button( Z_VAL_POS, F(""), OPT_FLAT) + .fgcolor(Theme::x_axis) .button(X_VAL_POS, F(""), OPT_FLAT) + .fgcolor(Theme::y_axis) .button(Y_VAL_POS, F(""), OPT_FLAT) + .fgcolor(Theme::z_axis) .button(Z_VAL_POS, F(""), OPT_FLAT) .font(Theme::font_small) .text ( X_LBL_POS, GET_TEXT_F(MSG_AXIS_X)) .text ( Y_LBL_POS, GET_TEXT_F(MSG_AXIS_Y)) @@ -137,9 +137,9 @@ void StatusScreen::draw_temperature(draw_mode_t what) { if (what & BACKGROUND) { cmd.font(Theme::font_small) .tag(5) - .fgcolor(temp) .button( TEMP_RECT_1, F(""), OPT_FLAT) - .button( TEMP_RECT_2, F(""), OPT_FLAT) - .fgcolor(fan_speed).button( FAN_POS, F(""), OPT_FLAT) + .fgcolor(temp) .button(TEMP_RECT_1, F(""), OPT_FLAT) + .button(TEMP_RECT_2, F(""), OPT_FLAT) + .fgcolor(fan_speed).button(FAN_POS, F(""), OPT_FLAT) .tag(0); // Draw Extruder Bitmap on Extruder Temperature Button @@ -269,7 +269,7 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { .enabled(has_media) .tag(3).button(MEDIA_BTN_POS, isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA)) .colors(!has_media ? action_btn : normal_btn) - .tag(4).button( MENU_BTN_POS, GET_TEXT_F(MSG_BUTTON_MENU)); + .tag(4).button(MENU_BTN_POS, GET_TEXT_F(MSG_BUTTON_MENU)); } #undef GRID_COLS } @@ -287,7 +287,7 @@ void StatusScreen::draw_status_message(draw_mode_t what, const char* message) { CommandProcessor cmd; cmd.fgcolor(Theme::status_msg) .tag(0) - .button( STATUS_POS, F(""), OPT_FLAT); + .button(STATUS_POS, F(""), OPT_FLAT); draw_text_box(cmd, STATUS_POS, message, OPT_CENTER, font_large); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp index cd5cedf46304..373941321300 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp @@ -47,19 +47,19 @@ void TouchRegistersScreen::onRedraw(draw_mode_t) { #define GRID_COLS 2 cmd.tag(0) .font(font_xsmall) - .fgcolor(transformA) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("TOUCH_XFORM_A")) - .fgcolor(transformB) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("TOUCH_XFORM_B")) - .fgcolor(transformC) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("TOUCH_XFORM_C")) - .fgcolor(transformD) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("TOUCH_XFORM_D")) - .fgcolor(transformE) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("TOUCH_XFORM_E")) - .fgcolor(transformF) .button( BTN_POS(1,6), BTN_SIZE(1,1), F("TOUCH_XFORM_F")) + .fgcolor(transformA) .button(BTN_POS(1,1), BTN_SIZE(1,1), F("TOUCH_XFORM_A")) + .fgcolor(transformB) .button(BTN_POS(1,2), BTN_SIZE(1,1), F("TOUCH_XFORM_B")) + .fgcolor(transformC) .button(BTN_POS(1,3), BTN_SIZE(1,1), F("TOUCH_XFORM_C")) + .fgcolor(transformD) .button(BTN_POS(1,4), BTN_SIZE(1,1), F("TOUCH_XFORM_D")) + .fgcolor(transformE) .button(BTN_POS(1,5), BTN_SIZE(1,1), F("TOUCH_XFORM_E")) + .fgcolor(transformF) .button(BTN_POS(1,6), BTN_SIZE(1,1), F("TOUCH_XFORM_F")) - .fgcolor(transformVal).button( BTN_POS(2,1), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,2), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,3), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,4), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,5), BTN_SIZE(1,1), F(""), OPT_FLAT) - .fgcolor(transformVal).button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT); + .fgcolor(transformVal).button(BTN_POS(2,1), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button(BTN_POS(2,2), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button(BTN_POS(2,3), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button(BTN_POS(2,4), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button(BTN_POS(2,5), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button(BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT); sprintf_P(b, PSTR("0x%08lX"), T_Transform_A); cmd.text( BTN_POS(2,1), BTN_SIZE(1,1), b); sprintf_P(b, PSTR("0x%08lX"), T_Transform_B); cmd.text( BTN_POS(2,2), BTN_SIZE(1,1), b); @@ -69,7 +69,7 @@ void TouchRegistersScreen::onRedraw(draw_mode_t) { sprintf_P(b, PSTR("0x%08lX"), T_Transform_F); cmd.text( BTN_POS(2,6), BTN_SIZE(1,1), b); cmd.colors(action_btn).font(font_medium) - .tag(1).button( BTN_POS(2,7), BTN_SIZE(1,1), F("Back")); + .tag(1).button(BTN_POS(2,7), BTN_SIZE(1,1), F("Back")); #undef GRID_COLS #undef GRID_ROWS } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index f70851521a16..2246b34a5584 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -71,23 +71,23 @@ void TuneMenu::onRedraw(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(font_medium) - .tag(2).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) + .tag(2).button(TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) .enabled(!sdOrHostPrinting || sdOrHostPaused) - .tag(3).button( FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) + .tag(3).button(FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) .enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) - .tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) + .tag(9).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE) || ENABLED(BABYSTEPPING)) - .tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET))) - .tag(5).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(4).button(NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET))) + .tag(5).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .enabled(sdOrHostPrinting) .tag(sdOrHostPaused ? 7 : 6) - .button( PAUSE_POS, sdOrHostPaused ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) + .button(PAUSE_POS, sdOrHostPaused ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) .enabled(sdOrHostPrinting) - .tag(8).button( STOP_POS, GET_TEXT_F(MSG_STOP_PRINT)) + .tag(8).button(STOP_POS, GET_TEXT_F(MSG_STOP_PRINT)) .enabled(ENABLED(CASE_LIGHT_ENABLE)) - .tag(10).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(10).button(CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) .tag(1).colors(action_btn) - .button( BACK_POS, GET_TEXT_F(MSG_BACK)); + .button(BACK_POS, GET_TEXT_F(MSG_BACK)); } #undef GRID_COLS #undef GRID_ROWS From 9b3e16cdd0c9f534039e02f6bd78b2163dfc6c9c Mon Sep 17 00:00:00 2001 From: LinFor Date: Tue, 22 Dec 2020 03:06:27 +0300 Subject: [PATCH 383/443] Add Tune -> Advanced Settings to FTDI EVE (#20532) --- .../lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index 2246b34a5584..f9df61bf6d4d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -49,7 +49,8 @@ void TuneMenu::onRedraw(draw_mode_t what) { #define PAUSE_POS BTN_POS(1,6), BTN_SIZE(2,1) #define STOP_POS BTN_POS(1,7), BTN_SIZE(2,1) #define CASE_LIGHT_POS BTN_POS(1,8), BTN_SIZE(2,1) - #define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1) + #define ADVANCED_SETTINGS_POS BTN_POS(1,9), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(2,9), BTN_SIZE(1,1) #else #define GRID_ROWS 5 #define GRID_COLS 2 @@ -61,7 +62,8 @@ void TuneMenu::onRedraw(draw_mode_t what) { #define STOP_POS BTN_POS(2,3), BTN_SIZE(1,1) #define FILAMENT_POS BTN_POS(1,4), BTN_SIZE(1,1) #define CASE_LIGHT_POS BTN_POS(2,4), BTN_SIZE(1,1) - #define BACK_POS BTN_POS(1,5), BTN_SIZE(2,1) + #define ADVANCED_SETTINGS_POS BTN_POS(1,5), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(2,5), BTN_SIZE(2,1) #endif if (what & FOREGROUND) { @@ -86,6 +88,7 @@ void TuneMenu::onRedraw(draw_mode_t what) { .tag(8).button(STOP_POS, GET_TEXT_F(MSG_STOP_PRINT)) .enabled(ENABLED(CASE_LIGHT_ENABLE)) .tag(10).button(CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(11).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .tag(1).colors(action_btn) .button(BACK_POS, GET_TEXT_F(MSG_BACK)); } @@ -121,6 +124,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { #if ENABLED(CASE_LIGHT_ENABLE) case 10: GOTO_SCREEN(CaseLightScreen); break; #endif + case 11: GOTO_SCREEN(AdvancedSettingsMenu); break; default: return false; } From ba1176108a9ee1e8ab8e6096b7ce8ce3144f7ac4 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 22 Dec 2020 00:19:00 +0000 Subject: [PATCH 384/443] [cron] Bump distribution date (2020-12-22) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 7fa5e978ed28..c51cfee706b2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-21" + #define STRING_DISTRIBUTION_DATE "2020-12-22" #endif /** From 36aff1e4646ada018512ff0ee0c8a27205d8c260 Mon Sep 17 00:00:00 2001 From: LinFor Date: Tue, 22 Dec 2020 03:30:03 +0300 Subject: [PATCH 385/443] 12-bit ADC resolution for STM32 (#20519) --- Marlin/src/HAL/STM32/HAL.h | 6 +++--- Marlin/src/module/thermistor/thermistors.h | 2 ++ .../share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index f2fb5ddb6a25..b1c27e4ec5fb 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -159,14 +159,14 @@ static inline int freeMemory() { #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) -inline void HAL_adc_init() {} - #define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 +#define HAL_ADC_RESOLUTION ADC_RESOLUTION // 12 #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true +inline void HAL_adc_init() { analogReadResolution(HAL_ADC_RESOLUTION); } + void HAL_adc_start_conversion(const uint8_t adc_pin); uint16_t HAL_adc_get_result(); diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 340712e22d99..03ed5c2a57df 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -27,6 +27,8 @@ #define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / _BV(THERMISTOR_TABLE_ADC_RESOLUTION)) #if ENABLED(HAL_ADC_FILTERED) #define OVERSAMPLENR 1 +#elif HAL_ADC_RESOLUTION > 10 + #define OVERSAMPLENR (20 - HAL_ADC_RESOLUTION) #else #define OVERSAMPLENR 16 #endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h index ee4b1ef29608..07e2cad3f977 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h @@ -114,6 +114,8 @@ extern "C" { #define NUM_ANALOG_INPUTS 7 #define NUM_ANALOG_FIRST 80 +#define ADC_RESOLUTION 12 + // PWM resolution // #define PWM_RESOLUTION 12 #define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans From 82540be931940651f247e011071c1f18c0b96ed0 Mon Sep 17 00:00:00 2001 From: LinFor Date: Tue, 22 Dec 2020 09:31:14 +0300 Subject: [PATCH 386/443] FTDI EVE custom user menus (#20518) --- .../screens/custom_user_menus.cpp | 215 ++++++++++++++++++ .../ftdi_eve_touch_ui/screens/main_menu.cpp | 64 +++++- .../lib/ftdi_eve_touch_ui/screens/screens.cpp | 161 +++++++------ .../lib/ftdi_eve_touch_ui/screens/screens.h | 205 ++++++++++------- 4 files changed, 484 insertions(+), 161 deletions(-) create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp new file mode 100644 index 000000000000..4132226977d7 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp @@ -0,0 +1,215 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, CUSTOM_USER_MENUS) && NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define _ITEM_TAG(N) (10+N) +#define _USER_DESC(N) USER_DESC_##N +#define _USER_GCODE(N) USER_GCODE_##N +#define _USER_ITEM(N) .tag(_ITEM_TAG(N)).button(USER_ITEM_POS(N), _USER_DESC(N)) +#define _USER_ACTION(N) case _ITEM_TAG(N): injectCommands_P(PSTR(_USER_GCODE(N))); TERN_(USER_SCRIPT_RETURN, GOTO_SCREEN(StatusScreen)); break; + +#define _HAS_1(N) (defined(USER_DESC_##N) && defined(USER_GCODE_##N)) +#define HAS_USER_ITEM(V...) DO(HAS,||,V) + +void CustomUserMenus::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true, true, true)); + } + + #if HAS_USER_ITEM(16, 17, 18, 19, 20) + #define _MORE_THAN_FIFTEEN 1 + #else + #define _MORE_THAN_FIFTEEN 0 + #endif + #if _MORE_THAN_FIFTEEN || HAS_USER_ITEM(11, 12, 13, 14, 15) + #define _MORE_THAN_TEN 1 + #else + #define _MORE_THAN_TEN 0 + #endif + + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 11 + #define GRID_COLS (1 + _MORE_THAN_TEN) + #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,11), BTN_SIZE(1,1) + #else + #if _MORE_THAN_TEN || HAS_USER_ITEM(6, 7, 8, 9, 10) + #define _MORE_THAN_FIVE 1 + #else + #define _MORE_THAN_FIVE 0 + #endif + #define GRID_ROWS 6 + #define GRID_COLS (1 + _MORE_THAN_FIVE + _MORE_THAN_TEN + _MORE_THAN_FIFTEEN) + #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/5)), ((N-1) % 5 + 1)), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,6), BTN_SIZE(GRID_COLS,1) + #endif + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + #if HAS_USER_ITEM(1) + _USER_ITEM(1) + #endif + #if HAS_USER_ITEM(2) + _USER_ITEM(2) + #endif + #if HAS_USER_ITEM(3) + _USER_ITEM(3) + #endif + #if HAS_USER_ITEM(4) + _USER_ITEM(4) + #endif + #if HAS_USER_ITEM(5) + _USER_ITEM(5) + #endif + #if HAS_USER_ITEM(6) + _USER_ITEM(6) + #endif + #if HAS_USER_ITEM(7) + _USER_ITEM(7) + #endif + #if HAS_USER_ITEM(8) + _USER_ITEM(8) + #endif + #if HAS_USER_ITEM(9) + _USER_ITEM(9) + #endif + #if HAS_USER_ITEM(10) + _USER_ITEM(10) + #endif + #if HAS_USER_ITEM(11) + _USER_ITEM(11) + #endif + #if HAS_USER_ITEM(12) + _USER_ITEM(12) + #endif + #if HAS_USER_ITEM(13) + _USER_ITEM(13) + #endif + #if HAS_USER_ITEM(14) + _USER_ITEM(14) + #endif + #if HAS_USER_ITEM(15) + _USER_ITEM(15) + #endif + #if HAS_USER_ITEM(16) + _USER_ITEM(16) + #endif + #if HAS_USER_ITEM(17) + _USER_ITEM(17) + #endif + #if HAS_USER_ITEM(18) + _USER_ITEM(18) + #endif + #if HAS_USER_ITEM(19) + _USER_ITEM(19) + #endif + #if HAS_USER_ITEM(20) + _USER_ITEM(20) + #endif + .colors(action_btn) + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); + } +} + +bool CustomUserMenus::onTouchEnd(uint8_t tag) { + switch (tag) { + #if HAS_USER_ITEM(1) + _USER_ACTION(1) + #endif + #if HAS_USER_ITEM(2) + _USER_ACTION(2) + #endif + #if HAS_USER_ITEM(3) + _USER_ACTION(3) + #endif + #if HAS_USER_ITEM(4) + _USER_ACTION(4) + #endif + #if HAS_USER_ITEM(5) + _USER_ACTION(5) + #endif + #if HAS_USER_ITEM(6) + _USER_ACTION(6) + #endif + #if HAS_USER_ITEM(7) + _USER_ACTION(7) + #endif + #if HAS_USER_ITEM(8) + _USER_ACTION(8) + #endif + #if HAS_USER_ITEM(9) + _USER_ACTION(9) + #endif + #if HAS_USER_ITEM(10) + _USER_ACTION(10) + #endif + #if HAS_USER_ITEM(11) + _USER_ACTION(11) + #endif + #if HAS_USER_ITEM(12) + _USER_ACTION(12) + #endif + #if HAS_USER_ITEM(13) + _USER_ACTION(13) + #endif + #if HAS_USER_ITEM(14) + _USER_ACTION(14) + #endif + #if HAS_USER_ITEM(15) + _USER_ACTION(15) + #endif + #if HAS_USER_ITEM(16) + _USER_ACTION(16) + #endif + #if HAS_USER_ITEM(17) + _USER_ACTION(17) + #endif + #if HAS_USER_ITEM(18) + _USER_ACTION(18) + #endif + #if HAS_USER_ITEM(19) + _USER_ACTION(19) + #endif + #if HAS_USER_ITEM(20) + _USER_ACTION(20) + #endif + + case 1: GOTO_PREVIOUS(); break; + default: return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE && CUSTOM_USER_MENUS && !TOUCH_UI_LULZBOT_BIO && !TOUCH_UI_COCOA_PRESS diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 89b5899e7a56..529daa2f83df 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -1,3 +1,25 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + /***************** * main_menu.cpp * *****************/ @@ -42,7 +64,12 @@ void MainMenu::onRedraw(draw_mode_t what) { #define GRID_COLS 2 #define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1) #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1) - #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(2,1) + #if ENABLED(CUSTOM_USER_MENUS) + #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(1,1) + #define CUSTOM_USER_MENUS_POS BTN_POS(2,3), BTN_SIZE(1,1) + #else + #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(2,1) + #endif #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(2,1) #define DISABLE_STEPPERS_POS BTN_POS(1,5), BTN_SIZE(2,1) #define MOVE_AXIS_POS BTN_POS(1,6), BTN_SIZE(1,1) @@ -52,17 +79,23 @@ void MainMenu::onRedraw(draw_mode_t what) { #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) #else #define GRID_ROWS 5 - #define GRID_COLS 2 - #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(1,1) - #define ABOUT_PRINTER_POS BTN_POS(2,1), BTN_SIZE(1,1) - #define AUTO_HOME_POS BTN_POS(1,2), BTN_SIZE(1,1) - #define CLEAN_NOZZLE_POS BTN_POS(2,2), BTN_SIZE(1,1) - #define MOVE_AXIS_POS BTN_POS(1,3), BTN_SIZE(1,1) - #define DISABLE_STEPPERS_POS BTN_POS(2,3), BTN_SIZE(1,1) - #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(1,1) - #define FILAMENTCHANGE_POS BTN_POS(2,4), BTN_SIZE(1,1) - #define LEVELING_POS BTN_POS(1,5), BTN_SIZE(1,1) - #define BACK_POS BTN_POS(2,5), BTN_SIZE(1,1) + #define GRID_COLS 6 + #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(3,1) + #define ABOUT_PRINTER_POS BTN_POS(4,1), BTN_SIZE(3,1) + #define AUTO_HOME_POS BTN_POS(1,2), BTN_SIZE(3,1) + #define CLEAN_NOZZLE_POS BTN_POS(4,2), BTN_SIZE(3,1) + #define MOVE_AXIS_POS BTN_POS(1,3), BTN_SIZE(3,1) + #define DISABLE_STEPPERS_POS BTN_POS(4,3), BTN_SIZE(3,1) + #if ENABLED(CUSTOM_USER_MENUS) + #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(2,1) + #define FILAMENTCHANGE_POS BTN_POS(3,4), BTN_SIZE(2,1) + #define CUSTOM_USER_MENUS_POS BTN_POS(5,4), BTN_SIZE(2,1) + #else + #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(3,1) + #define FILAMENTCHANGE_POS BTN_POS(4,4), BTN_SIZE(3,1) + #endif + #define LEVELING_POS BTN_POS(1,5), BTN_SIZE(3,1) + #define BACK_POS BTN_POS(4,5), BTN_SIZE(3,1) #endif if (what & FOREGROUND) { @@ -81,6 +114,9 @@ void MainMenu::onRedraw(draw_mode_t what) { .enabled(TERN_(HAS_LEVELING, 1)) .tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) + #if ENABLED(CUSTOM_USER_MENUS) + .tag(11).button(CUSTOM_USER_MENUS_POS, GET_TEXT_F(MSG_USER_MENU)) + #endif .colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } @@ -104,6 +140,10 @@ bool MainMenu::onTouchEnd(uint8_t tag) { case 9: GOTO_SCREEN(LevelingMenu); break; #endif case 10: GOTO_SCREEN(AboutScreen); break; + #if ENABLED(CUSTOM_USER_MENUS) + case 11: GOTO_SCREEN(CustomUserMenus); break; + #endif + default: return false; } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index ff85689ef2b5..5b3f9a201fee 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -1,3 +1,25 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + /*************** * screens.cpp * ***************/ @@ -45,88 +67,91 @@ SCREEN_TABLE { DECL_SCREEN(SaveSettingsDialogBox), DECL_SCREEN(ConfirmStartPrintDialogBox), DECL_SCREEN(ConfirmAbortPrintDialogBox), -#if ENABLED(CALIBRATION_GCODE) - DECL_SCREEN(ConfirmAutoCalibrationDialogBox), -#endif + #if ENABLED(CALIBRATION_GCODE) + DECL_SCREEN(ConfirmAutoCalibrationDialogBox), + #endif + #if ENABLED(CUSTOM_USER_MENUS) + DECL_SCREEN(CustomUserMenus), + #endif DECL_SCREEN(SpinnerDialogBox), DECL_SCREEN(AboutScreen), -#if ENABLED(PRINTCOUNTER) - DECL_SCREEN(StatisticsScreen), -#endif -#if ENABLED(BABYSTEPPING) - DECL_SCREEN(NudgeNozzleScreen), -#endif + #if ENABLED(PRINTCOUNTER) + DECL_SCREEN(StatisticsScreen), + #endif + #if ENABLED(BABYSTEPPING) + DECL_SCREEN(NudgeNozzleScreen), + #endif DECL_SCREEN(MoveAxisScreen), DECL_SCREEN(StepsScreen), -#if HAS_TRINAMIC_CONFIG - DECL_SCREEN(StepperCurrentScreen), - DECL_SCREEN(StepperBumpSensitivityScreen), -#endif -#if HAS_LEVELING - DECL_SCREEN(LevelingMenu), - #if HAS_BED_PROBE - DECL_SCREEN(ZOffsetScreen), - #endif - #if HAS_MESH - DECL_SCREEN(BedMeshScreen), - #endif -#endif -#if HAS_MULTI_HOTEND - DECL_SCREEN(NozzleOffsetScreen), -#endif -#if ENABLED(BACKLASH_GCODE) - DECL_SCREEN(BacklashCompensationScreen), -#endif + #if HAS_TRINAMIC_CONFIG + DECL_SCREEN(StepperCurrentScreen), + DECL_SCREEN(StepperBumpSensitivityScreen), + #endif + #if HAS_LEVELING + DECL_SCREEN(LevelingMenu), + #if HAS_BED_PROBE + DECL_SCREEN(ZOffsetScreen), + #endif + #if HAS_MESH + DECL_SCREEN(BedMeshScreen), + #endif + #endif + #if HAS_MULTI_HOTEND + DECL_SCREEN(NozzleOffsetScreen), + #endif + #if ENABLED(BACKLASH_GCODE) + DECL_SCREEN(BacklashCompensationScreen), + #endif DECL_SCREEN(FeedratePercentScreen), DECL_SCREEN(MaxVelocityScreen), DECL_SCREEN(MaxAccelerationScreen), DECL_SCREEN(DefaultAccelerationScreen), -#if HAS_JUNCTION_DEVIATION - DECL_SCREEN(JunctionDeviationScreen), -#else - DECL_SCREEN(JerkScreen), -#endif -#if ENABLED(CASE_LIGHT_ENABLE) - DECL_SCREEN(CaseLightScreen), -#endif -#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - DECL_SCREEN(FilamentMenu), -#endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - DECL_SCREEN(FilamentRunoutScreen), -#endif -#if ENABLED(LIN_ADVANCE) - DECL_SCREEN(LinearAdvanceScreen), -#endif + #if HAS_JUNCTION_DEVIATION + DECL_SCREEN(JunctionDeviationScreen), + #else + DECL_SCREEN(JerkScreen), + #endif + #if ENABLED(CASE_LIGHT_ENABLE) + DECL_SCREEN(CaseLightScreen), + #endif + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + DECL_SCREEN(FilamentMenu), + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + DECL_SCREEN(FilamentRunoutScreen), + #endif + #if ENABLED(LIN_ADVANCE) + DECL_SCREEN(LinearAdvanceScreen), + #endif DECL_SCREEN(TemperatureScreen), DECL_SCREEN(ChangeFilamentScreen), DECL_SCREEN(InterfaceSettingsScreen), DECL_SCREEN(InterfaceSoundsScreen), DECL_SCREEN(LockScreen), -#if ENABLED(SDSUPPORT) - DECL_SCREEN(FilesScreen), -#endif + #if ENABLED(SDSUPPORT) + DECL_SCREEN(FilesScreen), + #endif DECL_SCREEN(EndstopStatesScreen), -#if ENABLED(TOUCH_UI_LULZBOT_BIO) - DECL_SCREEN(BioPrintingDialogBox), - DECL_SCREEN(BioConfirmHomeXYZ), - DECL_SCREEN(BioConfirmHomeE), -#endif -#if ENABLED(TOUCH_UI_COCOA_PRESS) - DECL_SCREEN(PreheatMenu), - DECL_SCREEN(PreheatTimerScreen), - DECL_SCREEN(UnloadCartridgeScreen), - DECL_SCREEN(LoadChocolateScreen), - DECL_SCREEN(MoveXYZScreen), - DECL_SCREEN(MoveEScreen), -#endif -#if ENABLED(TOUCH_UI_DEVELOPER_MENU) - DECL_SCREEN(DeveloperMenu), - DECL_SCREEN(ConfirmEraseFlashDialogBox), - DECL_SCREEN(WidgetsScreen), - DECL_SCREEN(TouchRegistersScreen), - DECL_SCREEN(StressTestScreen), -#endif + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + DECL_SCREEN(BioPrintingDialogBox), + DECL_SCREEN(BioConfirmHomeXYZ), + DECL_SCREEN(BioConfirmHomeE), + #endif + #if ENABLED(TOUCH_UI_COCOA_PRESS) + DECL_SCREEN(PreheatMenu), + DECL_SCREEN(PreheatTimerScreen), + DECL_SCREEN(UnloadCartridgeScreen), + DECL_SCREEN(LoadChocolateScreen), + DECL_SCREEN(MoveXYZScreen), + DECL_SCREEN(MoveEScreen), + #endif + #if ENABLED(TOUCH_UI_DEVELOPER_MENU) + DECL_SCREEN(DeveloperMenu), + DECL_SCREEN(ConfirmEraseFlashDialogBox), + DECL_SCREEN(WidgetsScreen), + DECL_SCREEN(TouchRegistersScreen), + DECL_SCREEN(StressTestScreen), + #endif DECL_SCREEN(MediaPlayerScreen), DECL_SCREEN(DisplayTuningScreen) }; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 3fa18d9f67c7..265d6eb48625 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -1,3 +1,25 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + /************* * screens.h * *************/ @@ -53,59 +75,62 @@ enum { MAX_VELOCITY_SCREEN_CACHE, MAX_ACCELERATION_SCREEN_CACHE, DEFAULT_ACCELERATION_SCREEN_CACHE, -#if HAS_LEVELING - LEVELING_SCREEN_CACHE, - #if HAS_BED_PROBE - ZOFFSET_SCREEN_CACHE, + #if HAS_LEVELING + LEVELING_SCREEN_CACHE, + #if HAS_BED_PROBE + ZOFFSET_SCREEN_CACHE, + #endif + #if HAS_MESH + BED_MESH_SCREEN_CACHE, + #endif #endif - #if HAS_MESH - BED_MESH_SCREEN_CACHE, + #if ENABLED(BABYSTEPPING) + ADJUST_OFFSETS_SCREEN_CACHE, + #endif + #if HAS_TRINAMIC_CONFIG + STEPPER_CURRENT_SCREEN_CACHE, + STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE, + #endif + #if HAS_MULTI_HOTEND + NOZZLE_OFFSET_SCREEN_CACHE, + #endif + #if ENABLED(BACKLASH_GCODE) + BACKLASH_COMPENSATION_SCREEN_CACHE, + #endif + #if HAS_JUNCTION_DEVIATION + JUNC_DEV_SCREEN_CACHE, + #else + JERK_SCREEN_CACHE, + #endif + #if ENABLED(CASE_LIGHT_ENABLE) + CASE_LIGHT_SCREEN_CACHE, + #endif + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + FILAMENT_MENU_CACHE, + #endif + #if ENABLED(LIN_ADVANCE) + LINEAR_ADVANCE_SCREEN_CACHE, + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + FILAMENT_RUNOUT_SCREEN_CACHE, + #endif + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + PRINTING_SCREEN_CACHE, + #endif + #if ENABLED(TOUCH_UI_COCOA_PRESS) + PREHEAT_MENU_CACHE, + PREHEAT_TIMER_SCREEN_CACHE, + UNLOAD_CARTRIDGE_SCREEN_CACHE, + LOAD_CHOCOLATE_SCREEN_CACHE, + MOVE_XYZ_SCREEN_CACHE, + MOVE_E_SCREEN_CACHE, + #endif + #if ENABLED(SDSUPPORT) + FILES_SCREEN_CACHE, + #endif + #if ENABLED(CUSTOM_USER_MENUS) + CUSTOM_USER_MENUS_SCREEN_CACHE, #endif -#endif -#if ENABLED(BABYSTEPPING) - ADJUST_OFFSETS_SCREEN_CACHE, -#endif -#if HAS_TRINAMIC_CONFIG - STEPPER_CURRENT_SCREEN_CACHE, - STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE, -#endif -#if HAS_MULTI_HOTEND - NOZZLE_OFFSET_SCREEN_CACHE, -#endif -#if ENABLED(BACKLASH_GCODE) - BACKLASH_COMPENSATION_SCREEN_CACHE, -#endif -#if HAS_JUNCTION_DEVIATION - JUNC_DEV_SCREEN_CACHE, -#else - JERK_SCREEN_CACHE, -#endif -#if ENABLED(CASE_LIGHT_ENABLE) - CASE_LIGHT_SCREEN_CACHE, -#endif -#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - FILAMENT_MENU_CACHE, -#endif -#if ENABLED(LIN_ADVANCE) - LINEAR_ADVANCE_SCREEN_CACHE, -#endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - FILAMENT_RUNOUT_SCREEN_CACHE, -#endif -#if ENABLED(TOUCH_UI_LULZBOT_BIO) - PRINTING_SCREEN_CACHE, -#endif -#if ENABLED(TOUCH_UI_COCOA_PRESS) - PREHEAT_MENU_CACHE, - PREHEAT_TIMER_SCREEN_CACHE, - UNLOAD_CARTRIDGE_SCREEN_CACHE, - LOAD_CHOCOLATE_SCREEN_CACHE, - MOVE_XYZ_SCREEN_CACHE, - MOVE_E_SCREEN_CACHE, -#endif -#if ENABLED(SDSUPPORT) - FILES_SCREEN_CACHE, -#endif CHANGE_FILAMENT_SCREEN_CACHE, INTERFACE_SETTINGS_SCREEN_CACHE, INTERFACE_SOUNDS_SCREEN_CACHE, @@ -247,6 +272,14 @@ class ConfirmUserRequestAlertBox : public AlertDialogBox { static void show(const char*); }; +#if ENABLED(CUSTOM_USER_MENUS) + class CustomUserMenus : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif + class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -496,6 +529,7 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -511,35 +545,38 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen { - private: - enum MeshOpts { - USE_POINTS = 0x01, - USE_COLORS = 0x02, - USE_TAGS = 0x04, - USE_HIGHLIGHT = 0x08, - USE_AUTOSCALE = 0x10 - }; - - static uint8_t pointToTag(uint8_t x, uint8_t y); - static bool tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y); - static float getHightlightedValue(); - static void drawHighlightedPointValue(); - static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1); - static bool isMeshComplete(ExtUI::bed_mesh_t data); - public: - static void onMeshUpdate(const int8_t x, const int8_t y, const float val); - static void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t); - static void onEntry(); - static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); - static bool onTouchEnd(uint8_t tag); + class BedMeshScreen : public BaseScreen, public CachedScreen { + private: + enum MeshOpts { + USE_POINTS = 0x01, + USE_COLORS = 0x02, + USE_TAGS = 0x04, + USE_HIGHLIGHT = 0x08, + USE_AUTOSCALE = 0x10 + }; + + static uint8_t pointToTag(uint8_t x, uint8_t y); + static bool tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y); + static float getHightlightedValue(); + static void drawHighlightedPointValue(); + static void drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::bed_mesh_t data, uint8_t opts, float autoscale_max = 0.1); + static bool isMeshComplete(ExtUI::bed_mesh_t data); - static void startMeshProbe(); - }; - #endif -#endif + public: + static void onMeshUpdate(const int8_t x, const int8_t y, const float val); + static void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t); + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + + static void startMeshProbe(); + }; + + #endif // HAS_MESH + +#endif // HAS_LEVELING #if ENABLED(BABYSTEPPING) class NudgeNozzleScreen : public BaseNumericAdjustmentScreen, public CachedScreen { @@ -727,6 +764,7 @@ class LockScreen : public BaseScreen, public CachedScreen { }; #if ENABLED(SDSUPPORT) + class FilesScreen : public BaseScreen, public CachedScreen { private: #ifdef TOUCH_UI_PORTRAIT @@ -761,7 +799,8 @@ class LockScreen : public BaseScreen, public CachedScreen { static bool onTouchEnd(uint8_t tag); static void onIdle(); }; -#endif + +#endif // SDSUPPORT class EndstopStatesScreen : public BaseScreen, public UncachedScreen { public: @@ -779,6 +818,7 @@ class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScr }; #if ENABLED(TOUCH_UI_DEVELOPER_MENU) + class DeveloperMenu : public BaseScreen, public UncachedScreen { public: static void onRedraw(draw_mode_t); @@ -815,7 +855,8 @@ class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScr static bool onTouchEnd(uint8_t tag); static void onIdle(); }; -#endif + +#endif // TOUCH_UI_DEVELOPER_MENU class MediaPlayerScreen : public BaseScreen, public UncachedScreen { private: @@ -840,6 +881,7 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen { #endif #if ENABLED(TOUCH_UI_COCOA_PRESS) + class PreheatMenu : public BaseScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -888,4 +930,5 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen { static void onRedraw(draw_mode_t); static void onIdle(); }; -#endif \ No newline at end of file + +#endif // TOUCH_UI_COCOA_PRESS From 094e82207087fa40e0dacd6910c413543a20dfa8 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 22 Dec 2020 03:49:34 -0800 Subject: [PATCH 387/443] Improve STM32 timer conflict messages (#20544) --- Marlin/src/HAL/STM32/timers.cpp | 185 +++++++++++++++++++------------- 1 file changed, 112 insertions(+), 73 deletions(-) diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index 90f8c3dc94fa..e8e18a47d48b 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -27,7 +27,6 @@ // Local defines // ------------------------ - // Default timer priorities. Override by specifying alternate priorities in the board pins file. // The TONE timer is not present here, as it currently cannot be set programmatically. It is set // by defining TIM_IRQ_PRIO in the variant.h or platformio.ini file, which adjusts the default @@ -96,11 +95,6 @@ #define STEP_TIMER_DEV _TIMER_DEV(STEP_TIMER) #define TEMP_TIMER_DEV _TIMER_DEV(TEMP_TIMER) -#define __TIMER_IRQ_NAME(X) TIM##X##_IRQn -#define _TIMER_IRQ_NAME(X) __TIMER_IRQ_NAME(X) -#define STEP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(STEP_TIMER) -#define TEMP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(TEMP_TIMER) - // ------------------------ // Private Variables // ------------------------ @@ -197,87 +191,132 @@ void SetTimerInterruptPriorities() { TERN_(HAS_SERVOS, libServo::setInterruptPriority(SERVO_TIMER_IRQ_PRIO, 0)); } -// This is a terrible hack to replicate the behavior used in the framework's SoftwareSerial.cpp -// to choose a serial timer. It will select TIM7 on most boards used by Marlin, but this is more -// resiliant to new MCUs which may not have a TIM7. Best practice is to explicitly specify -// TIMER_SERIAL to avoid relying on framework selections which may not be predictable. -#if !defined(TIMER_SERIAL) - #if defined (TIM18_BASE) - #define TIMER_SERIAL TIM18 - #elif defined (TIM7_BASE) - #define TIMER_SERIAL TIM7 - #elif defined (TIM6_BASE) - #define TIMER_SERIAL TIM6 - #elif defined (TIM22_BASE) - #define TIMER_SERIAL TIM22 - #elif defined (TIM21_BASE) - #define TIMER_SERIAL TIM21 - #elif defined (TIM17_BASE) - #define TIMER_SERIAL TIM17 - #elif defined (TIM16_BASE) - #define TIMER_SERIAL TIM16 - #elif defined (TIM15_BASE) - #define TIMER_SERIAL TIM15 - #elif defined (TIM14_BASE) - #define TIMER_SERIAL TIM14 - #elif defined (TIM13_BASE) - #define TIMER_SERIAL TIM13 - #elif defined (TIM11_BASE) - #define TIMER_SERIAL TIM11 - #elif defined (TIM10_BASE) - #define TIMER_SERIAL TIM10 - #elif defined (TIM12_BASE) - #define TIMER_SERIAL TIM12 - #elif defined (TIM19_BASE) - #define TIMER_SERIAL TIM19 - #elif defined (TIM9_BASE) - #define TIMER_SERIAL TIM9 - #elif defined (TIM5_BASE) - #define TIMER_SERIAL TIM5 - #elif defined (TIM4_BASE) - #define TIMER_SERIAL TIM4 - #elif defined (TIM3_BASE) - #define TIMER_SERIAL TIM3 - #elif defined (TIM2_BASE) - #define TIMER_SERIAL TIM2 - #elif defined (TIM20_BASE) - #define TIMER_SERIAL TIM20 - #elif defined (TIM8_BASE) - #define TIMER_SERIAL TIM8 - #elif defined (TIM1_BASE) - #define TIMER_SERIAL TIM1 - #else - #error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h +// ------------------------ +// Detect timer conflicts +// ------------------------ + +// This list serves two purposes. Firstly, it facilitates build-time mapping between +// variant-defined timer names (such as TIM1) and timer numbers. It also replicates +// the order of timers used in the framework's SoftwareSerial.cpp. The first timer in +// this list will be automatically used by SoftwareSerial if it is not already defined +// in the board's variant or compiler options. +static constexpr struct {uintptr_t base_address; int timer_number;} stm32_timer_map[] = { + #ifdef TIM18_BASE + { uintptr_t(TIM18), 18 }, + #endif + #ifdef TIM7_BASE + { uintptr_t(TIM7), 7 }, + #endif + #ifdef TIM6_BASE + { uintptr_t(TIM6), 6 }, + #endif + #ifdef TIM22_BASE + { uintptr_t(TIM22), 22 }, + #endif + #ifdef TIM21_BASE + { uintptr_t(TIM21), 21 }, + #endif + #ifdef TIM17_BASE + { uintptr_t(TIM17), 17 }, + #endif + #ifdef TIM16_BASE + { uintptr_t(TIM16), 16 }, + #endif + #ifdef TIM15_BASE + { uintptr_t(TIM15), 15 }, + #endif + #ifdef TIM14_BASE + { uintptr_t(TIM14), 14 }, + #endif + #ifdef TIM13_BASE + { uintptr_t(TIM13), 13 }, + #endif + #ifdef TIM11_BASE + { uintptr_t(TIM11), 11 }, + #endif + #ifdef TIM10_BASE + { uintptr_t(TIM10), 10 }, #endif + #ifdef TIM12_BASE + { uintptr_t(TIM12), 12 }, + #endif + #ifdef TIM19_BASE + { uintptr_t(TIM19), 19 }, + #endif + #ifdef TIM9_BASE + { uintptr_t(TIM9), 9 }, + #endif + #ifdef TIM5_BASE + { uintptr_t(TIM5), 5 }, + #endif + #ifdef TIM4_BASE + { uintptr_t(TIM4), 4 }, + #endif + #ifdef TIM3_BASE + { uintptr_t(TIM3), 3 }, + #endif + #ifdef TIM2_BASE + { uintptr_t(TIM2), 2 }, + #endif + #ifdef TIM20_BASE + { uintptr_t(TIM20), 20 }, + #endif + #ifdef TIM8_BASE + { uintptr_t(TIM8), 8 }, + #endif + #ifdef TIM1_BASE + { uintptr_t(TIM1), 1 } + #endif +}; + +// Convert from a timer base address to its integer timer number. +static constexpr int get_timer_num_from_base_address(uintptr_t base_address) { + for (const auto &timer : stm32_timer_map) + if (timer.base_address == base_address) return timer.timer_number; + return 0; +} + +// The platform's SoftwareSerial.cpp will use the first timer from stm32_timer_map. +#if HAS_TMC_SW_SERIAL && !defined(TIMER_SERIAL) + #define TIMER_SERIAL (stm32_timer_map[0].base_address) #endif -// Place all timers used into an array, then recursively check for duplicates during compilation. -// This does not currently account for timers used for PWM, such as for fans. -// Timers are actually pointers. Convert to integers to simplify constexpr logic. -static constexpr uintptr_t timers_in_use[] = { - uintptr_t(TEMP_TIMER_DEV), // Override in pins file - uintptr_t(STEP_TIMER_DEV), // Override in pins file +// constexpr doesn't like using the base address pointers that timers evaluate to. +// We can get away with casting them to uintptr_t, if we do so inside an array. +// GCC will not currently do it directly to a uintptr_t. +IF_ENABLED(HAS_TMC_SW_SERIAL, static constexpr uintptr_t timer_serial[] = {uintptr_t(TIMER_SERIAL)}); +IF_ENABLED(SPEAKER, static constexpr uintptr_t timer_tone[] = {uintptr_t(TIMER_TONE)}); +IF_ENABLED(HAS_SERVOS, static constexpr uintptr_t timer_servo[] = {uintptr_t(TIMER_SERVO)}); + +enum TimerPurpose { TP_SERIAL, TP_TONE, TP_SERVO, TP_STEP, TP_TEMP }; + +// List of timers, to enable checking for conflicts. +// Includes the purpose of each timer to ease debugging when evaluating at build-time. +// This cannot yet account for timers used for PWM output, such as for fans. +static constexpr struct { TimerPurpose p; int t; } timers_in_use[] = { #if HAS_TMC_SW_SERIAL - uintptr_t(TIMER_SERIAL), // Set in variant.h, or as a define in platformio.h if not present in variant.h + {TP_SERIAL, get_timer_num_from_base_address(timer_serial[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif #if ENABLED(SPEAKER) - uintptr_t(TIMER_TONE), // Set in variant.h, or as a define in platformio.h if not present in variant.h + {TP_TONE, get_timer_num_from_base_address(timer_tone[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif #if HAS_SERVOS - uintptr_t(TIMER_SERVO), // Set in variant.h, or as a define in platformio.h if not present in variant.h + {TP_SERVO, get_timer_num_from_base_address(timer_servo[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif - }; + {TP_STEP, STEP_TIMER}, + {TP_TEMP, TEMP_TIMER}, +}; -static constexpr bool verify_no_duplicate_timers() { +static constexpr bool verify_no_timer_conflicts() { LOOP_L_N(i, COUNT(timers_in_use)) LOOP_S_L_N(j, i + 1, COUNT(timers_in_use)) - if (timers_in_use[i] == timers_in_use[j]) return false; + if (timers_in_use[i].t == timers_in_use[j].t) return false; return true; } -// If this assertion fails at compile time, review the timers_in_use array. If default_envs is -// defined properly in platformio.ini, VS Code can evaluate the array when hovering over it, -// making it easy to identify the conflicting timers. -static_assert(verify_no_duplicate_timers(), "One or more timer conflict detected"); +// If this assertion fails at compile time, review the timers_in_use array. +// If default_envs is defined properly in platformio.ini, VS Code can evaluate the array +// when hovering over it, making it easy to identify the conflicting timers. +static_assert(verify_no_timer_conflicts(), "One or more timer conflict detected. Examine \"timers_in_use\" to help identify conflict."); #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC From c1b900aae9d2b57c397d7687cb7ff1ed7edf9518 Mon Sep 17 00:00:00 2001 From: Chris Pepper Date: Tue, 22 Dec 2020 11:59:25 +0000 Subject: [PATCH 388/443] Fix UBL mesh inset Z position (#20538) --- Marlin/src/feature/bedlevel/ubl/ubl.h | 33 +++++++++----- .../src/feature/bedlevel/ubl/ubl_motion.cpp | 45 ++++++++----------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index c90b1f7ac155..762becfb699f 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -122,20 +122,29 @@ class unified_bed_leveling { FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } + static int8_t cell_index_x_raw(const float &x) { + return FLOOR((x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST)); + } + + static int8_t cell_index_y_raw(const float &y) { + return FLOOR((y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST)); + } + + static int8_t cell_index_x_valid(const float &x) { + return WITHIN(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X - 2)); + } + + static int8_t cell_index_y_valid(const float &y) { + return WITHIN(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y - 2)); + } + static int8_t cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); - return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. + return constrain(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X) - 2); + } + static int8_t cell_index_y(const float &y) { - const int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); - return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. + return constrain(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y) - 2); + } static inline xy_int8_t cell_indexes(const float &x, const float &y) { return { cell_index_x(x), cell_index_y(y) }; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 010b5951be5f..8b7cd15a3c6d 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -56,39 +56,32 @@ // A move within the same cell needs no splitting if (istart == iend) { - // For a move off the bed, use a constant Z raise - if (!WITHIN(iend.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iend.y, 0, GRID_MAX_POINTS_Y - 1)) { + FINAL_MOVE: - // Note: There is no Z Correction in this case. We are off the grid and don't know what - // a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH - // value, that will be used instead of a calculated (Bi-Linear interpolation) correction. + // When UBL_Z_RAISE_WHEN_OFF_MESH is disabled Z correction is extrapolated from the edge of the mesh + #ifdef UBL_Z_RAISE_WHEN_OFF_MESH + // For a move off the UBL mesh, use a constant Z raise + if (!cell_index_x_valid(end.x) || !cell_index_y_valid(end.y)) { - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - end.z += UBL_Z_RAISE_WHEN_OFF_MESH; - #endif - planner.buffer_segment(end, scaled_fr_mm_s, extruder); - current_position = destination; - return; - } + // Note: There is no Z Correction in this case. We are off the mesh and don't know what + // a reasonable correction would be, UBL_Z_RAISE_WHEN_OFF_MESH will be used instead of + // a calculated (Bi-Linear interpolation) correction. - FINAL_MOVE: + end.z += UBL_Z_RAISE_WHEN_OFF_MESH; + planner.buffer_segment(end, scaled_fr_mm_s, extruder); + current_position = destination; + return; + } + #endif // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end.x - mesh_index_to_xpos(iend.x)) * RECIPROCAL(MESH_X_DIST); - - float z1, z2; - if (iend.x >= GRID_MAX_POINTS_X - 1) - z1 = z2 = 0.0; - else { - z1 = z_values[iend.x ][iend.y ] + xratio * - (z_values[iend.x + 1][iend.y ] - z_values[iend.x][iend.y ]), - z2 = z_values[iend.x ][iend.y + 1] + xratio * - (z_values[iend.x + 1][iend.y + 1] - z_values[iend.x][iend.y + 1]); - } + const float xratio = (end.x - mesh_index_to_xpos(iend.x)) * RECIPROCAL(MESH_X_DIST), + yratio = (end.y - mesh_index_to_ypos(iend.y)) * RECIPROCAL(MESH_Y_DIST), + z1 = z_values[iend.x][iend.y ] + xratio * (z_values[iend.x + 1][iend.y ] - z_values[iend.x][iend.y ]), + z2 = z_values[iend.x][iend.y + 1] + xratio * (z_values[iend.x + 1][iend.y + 1] - z_values[iend.x][iend.y + 1]); // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end.y - mesh_index_to_ypos(iend.y)) * RECIPROCAL(MESH_Y_DIST), - z0 = iend.y < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end.z) : 0.0; + const float z0 = (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end.z); // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. From 5e3be83dbbfc0ee60a6b43246b998616c4d05ae5 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 22 Dec 2020 04:02:25 -0800 Subject: [PATCH 389/443] Overrides to prevent STM32 timer conflicts (#20545) --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 3 +++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 3 +++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 3 +++ Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 4 ++++ Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 3 +++ Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 3 +++ platformio.ini | 2 +- 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 93403b9ddda4..e980d884a7b7 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -40,6 +40,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 4b644d693b8a..c430671b2eff 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -36,6 +36,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 1816d6bd41f0..063e548a329b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -37,6 +37,9 @@ #define BOARD_NO_NATIVE_USB +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 808751d7a53d..933ee532a9c2 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -31,6 +31,10 @@ #define BOARD_WEBSITE_URL "github.com/FLYmaker/FLYF407ZG" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +// Avoid conflict with fans and TIMER_TONE +#define TEMP_TIMER 3 +#define STEP_TIMER 5 + // // EEPROM Emulation // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index 5ff29a1f1caa..c48cbc9e5650 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -31,6 +31,9 @@ #define BOARD_INFO_NAME "MKS Robin Nano V3" +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 13 + // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 48943ad973f9..40da409185e4 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -29,6 +29,9 @@ #define BOARD_INFO_NAME "MKS Robin PRO V2" +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 13 + // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation diff --git a/platformio.ini b/platformio.ini index e7f22e3f09e7..acb5990edbff 100644 --- a/platformio.ini +++ b/platformio.ini @@ -980,7 +980,7 @@ board_build.ldscript = ldscript.ld board_build.offset = 0x7000 board_build.firmware = Robin.bin build_flags = ${common_stm32.build_flags} - -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 + -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -DTIMER_SERIAL=TIM5 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC extra_scripts = ${common.extra_scripts} From 91730d71ffb448728a8187eeebf205138e846b69 Mon Sep 17 00:00:00 2001 From: X-Ryl669 Date: Tue, 22 Dec 2020 13:17:06 +0100 Subject: [PATCH 390/443] Improve Touch Calibration screen (#20524) --- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 20 +++++++++++++++---- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 13 ++++++++++++ .../lib/mks_ui/draw_touch_calibration.cpp | 4 +--- .../lib/mks_ui/tft_lvgl_configuration.cpp | 7 +------ Marlin/src/lcd/tft_io/touch_calibration.cpp | 3 +++ Marlin/src/lcd/tft_io/touch_calibration.h | 6 ++++++ 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 1fcb1bd2e21a..5c0f426292b1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -55,6 +55,11 @@ #include "../../../../feature/pause.h" #endif +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../../../tft_io/touch_calibration.h" + #include "draw_touch_calibration.h" +#endif + extern lv_group_t *g; static lv_obj_t *scr, *tempText1, *filament_bar; @@ -161,7 +166,16 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { else if (DIALOG_IS(REVERT_EEPROM_TIPS)) { TERN_(EEPROM_SETTINGS, (void)settings.reset()); clear_cur_ui(); - draw_return_ui(); + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + const bool do_draw_cal = touch_calibration.need_calibration(); + if (do_draw_cal) { + disp_state_stack._disp_index--; // We are asynchronous from the dialog, so let's remove the dialog from the stack + lv_draw_touch_calibration_screen(); + } + #else + constexpr bool do_draw_cal = false; + #endif + if (!do_draw_cal) draw_return_ui(); } else if (DIALOG_IS(WIFI_CONFIG_TIPS)) { uiCfg.configWifi = 1; @@ -181,9 +195,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { - #if ENABLED(ADVANCED_PAUSE_FEATURE) - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; - #endif + TERN_(ADVANCED_PAUSE_FEATURE, pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT); } else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT, TYPE_FILAMENT_HEAT_LOAD_COMPLETED, TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 51d8cea15e80..3cf0c2bec35b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -39,6 +39,11 @@ #include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #include "../../../tft_io/touch_calibration.h" + #include "draw_touch_calibration.h" +#endif + #include //static lv_obj_t *buttonPrint, *buttonTool, *buttonSet; @@ -215,6 +220,14 @@ void lv_draw_ready_print(void) { lv_big_button_create(scr, "F:/bmp_set.bin", main_menu.set, 180, 90, event_handler, ID_SET); lv_big_button_create(scr, "F:/bmp_printing.bin", main_menu.print, 340, 90, event_handler, ID_PRINT); } + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + // If calibration is required, let's trigger it now, handles the case when there is default value in configuration files + if (!touch_calibration.calibration_loaded()) { + lv_clear_ready_print(); + lv_draw_touch_calibration_screen(); + } + #endif } void lv_clear_ready_print() { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp index 69307a702b87..8b9371fbe79d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.cpp @@ -95,14 +95,12 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { case ID_TC_RETURN: TERN_(MKS_TEST, curent_disp_ui = 1); lv_clear_touch_calibration_screen(); - lv_draw_ready_print(); + draw_return_ui(); break; } } void lv_draw_touch_calibration_screen() { - disp_state_stack._disp_index = 0; - ZERO(disp_state_stack._disp_state); scr = lv_screen_create(TOUCH_CALIBRATION_UI, ""); status_label = lv_label_create(scr, ""); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 9e383a6abd79..f943c1d6f971 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -217,12 +217,7 @@ void tft_lvgl_init() { #endif if (ready) { - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - if (touch_calibration.need_calibration()) lv_draw_touch_calibration_screen(); - else lv_draw_ready_print(); - #else - lv_draw_ready_print(); - #endif + lv_draw_ready_print(); } if (mks_test_flag == 0x1E) diff --git a/Marlin/src/lcd/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp index e4ad8f215ba8..159f09d087ce 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.cpp +++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp @@ -28,6 +28,7 @@ TouchCalibration touch_calibration; touch_calibration_t TouchCalibration::calibration; calibrationState TouchCalibration::calibration_state = CALIBRATION_NONE; touch_calibration_point_t TouchCalibration::calibration_points[4]; +uint8_t TouchCalibration::failed_count; void TouchCalibration::validate_calibration() { const bool landscape = validate_precision_x(0, 1) && validate_precision_x(2, 3) && validate_precision_y(0, 2) && validate_precision_y(1, 3); @@ -44,6 +45,8 @@ void TouchCalibration::validate_calibration() { else { calibration_state = CALIBRATION_FAIL; calibration_reset(); + // Retry up to 5 times before reporting the failure + if (need_calibration() && failed_count++ < 5) calibration_state = CALIBRATION_TOP_LEFT; } if (calibration_state == CALIBRATION_SUCCESS) { diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h index 93ed9aa6099a..f8cbf99bf000 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.h +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -61,6 +61,7 @@ class TouchCalibration { static void validate_calibration(); static touch_calibration_t calibration; + static uint8_t failed_count; static void calibration_reset() { calibration = { TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION }; } static bool need_calibration() { return !calibration.offset_x && !calibration.offset_y && !calibration.x && !calibration.y; } @@ -75,10 +76,15 @@ class TouchCalibration { calibration_points[CALIBRATION_TOP_RIGHT].y = 30; calibration_points[CALIBRATION_BOTTOM_RIGHT].x = TFT_WIDTH - 31; calibration_points[CALIBRATION_BOTTOM_RIGHT].y = TFT_HEIGHT - 31; + failed_count = 0; return calibration_state; } static void calibration_end() { calibration_state = CALIBRATION_NONE; } static calibrationState get_calibration_state() { return calibration_state; } + static bool calibration_loaded() { + if (need_calibration()) calibration_reset(); + return !need_calibration(); + } static bool handleTouch(uint16_t x, uint16_t y); }; From 08dcd1f680423139b19d4a6f0bb9438a9aeb5fe2 Mon Sep 17 00:00:00 2001 From: Sean McGroty Date: Tue, 22 Dec 2020 07:25:12 -0500 Subject: [PATCH 391/443] Creality v4.3.1 (Ender 6) board (#20512) --- Marlin/src/core/boards.h | 15 ++++---- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V427.h | 4 -- Marlin/src/pins/stm32f1/pins_CREALITY_V431.h | 39 ++++++++++++++++++++ 4 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V431.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index ec39ad4e7188..cd3269806985 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -329,13 +329,14 @@ #define BOARD_CHITU3D_V6 4036 // Chitu3D TronXY X5SA V5 Board #define BOARD_CREALITY_V4 4037 // Creality v4.x (STM32F103RE) #define BOARD_CREALITY_V427 4038 // Creality v4.2.7 (STM32F103RE) -#define BOARD_CREALITY_V452 4039 // Creality v4.5.2 (STM32F103RE) -#define BOARD_CREALITY_V453 4040 // Creality v4.5.3 (STM32F103RE) -#define BOARD_TRIGORILLA_PRO 4041 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4042 // FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4043 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4044 // STM32F103RET6 Libmaple-based controller -#define BOARD_BTT_SKR_CR6 4045 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) +#define BOARD_CREALITY_V431 4039 // Creality v4.3.1 (STM32F103RE) +#define BOARD_CREALITY_V452 4040 // Creality v4.5.2 (STM32F103RE) +#define BOARD_CREALITY_V453 4041 // Creality v4.5.3 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4042 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4043 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4044 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4045 // STM32F103RET6 Libmaple-based controller +#define BOARD_BTT_SKR_CR6 4046 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index dbafed2d4e92..b14228cbf55a 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -530,6 +530,8 @@ #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality #elif MB(CREALITY_V427) #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality +#elif MB(CREALITY_V431) + #include "stm32f1/pins_CREALITY_V431.h" // STM32F1 env:STM32F103RET6_creality #elif MB(CREALITY_V452) #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality #elif MB(CREALITY_V453) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h index d51aaa956a8b..64ef046bd3ad 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h @@ -24,10 +24,6 @@ * CREALITY v4.2.7 (STM32F103) board pin assignments */ -#if NOT_TARGET(__STM32F1__) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - #define BOARD_INFO_NAME "Creality v4.2.7" #define DEFAULT_MACHINE_NAME "Creality3D" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h new file mode 100644 index 000000000000..ff9f76054e6e --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * CREALITY v4.3.1 (STM32F103) board pin assignments + */ + +#define BOARD_INFO_NAME "Creality v4.3.1" +#define DEFAULT_MACHINE_NAME "Creality3D" + +// +// Steppers +// +#define X_STEP_PIN PB8 +#define X_DIR_PIN PB7 + +#define Y_STEP_PIN PC2 +#define Y_DIR_PIN PB9 + +#include "pins_CREALITY_V4.h" From a0c8d348a0baa179a13bc47be6edce4bb652dac9 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 22 Dec 2020 04:51:29 -0800 Subject: [PATCH 392/443] Anet ET4 / ET4P and Anet TFT28 / TFT35 (#20280) --- Marlin/Configuration.h | 10 + Marlin/src/HAL/STM32/tft/tft_fsmc.cpp | 35 ++-- Marlin/src/HAL/STM32/tft/tft_fsmc.h | 41 +++-- Marlin/src/HAL/STM32/tft/xpt2046.h | 9 +- Marlin/src/core/boards.h | 2 + Marlin/src/core/macros.h | 4 +- Marlin/src/inc/Conditionals_LCD.h | 38 ++-- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/lcd/tft/canvas.cpp | 2 +- Marlin/src/lcd/tft/tft.h | 7 + Marlin/src/lcd/tft/tft_queue.cpp | 27 +-- Marlin/src/lcd/tft/ui_320x240.cpp | 14 +- Marlin/src/lcd/tft_io/tft_io.h | 14 +- Marlin/src/pins/pins.h | 4 + Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 223 +++++++++++++++++++++++ Marlin/src/pins/stm32f4/pins_ANET_ET4P.h | 34 ++++ platformio.ini | 23 +++ 17 files changed, 407 insertions(+), 84 deletions(-) create mode 100644 Marlin/src/pins/stm32f4/pins_ANET_ET4.h create mode 100644 Marlin/src/pins/stm32f4/pins_ANET_ET4P.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5fe746a77ff3..ce24bd211730 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2368,6 +2368,16 @@ // //#define LONGER_LK_TFT28 +// +// 320x240, 2.8", FSMC Stock Display from ET4 +// +//#define ANET_ET4_TFT28 + +// +// 480x320, 3.5", FSMC Stock Display from ET5 +// +//#define ANET_ET5_TFT35 + // // Generic TFT with detailed options // diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp index b6bc7fcd8426..2a5ad4595b71 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp @@ -48,13 +48,14 @@ void TFT_FSMC::Init() { uint32_t NSBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), PinMap_FSMC_CS); + // Perform the SRAM1 memory initialization sequence SRAMx.Instance = FSMC_NORSRAM_DEVICE; SRAMx.Extended = FSMC_NORSRAM_EXTENDED_DEVICE; - /* SRAMx.Init */ + // SRAMx.Init SRAMx.Init.NSBank = NSBank; SRAMx.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE; SRAMx.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM; - SRAMx.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_16; + SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16); SRAMx.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE; SRAMx.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW; SRAMx.Init.WrapMode = FSMC_WRAP_MODE_DISABLE; @@ -67,8 +68,8 @@ void TFT_FSMC::Init() { #ifdef STM32F4xx SRAMx.Init.PageSize = FSMC_PAGE_SIZE_NONE; #endif - /* Read Timing - relatively slow to ensure ID information is correctly read from TFT controller */ - /* Can be decreases from 15-15-24 to 4-4-8 with risk of stability loss */ + // Read Timing - relatively slow to ensure ID information is correctly read from TFT controller + // Can be decreases from 15-15-24 to 4-4-8 with risk of stability loss Timing.AddressSetupTime = 15; Timing.AddressHoldTime = 15; Timing.DataSetupTime = 24; @@ -76,8 +77,8 @@ void TFT_FSMC::Init() { Timing.CLKDivision = 16; Timing.DataLatency = 17; Timing.AccessMode = FSMC_ACCESS_MODE_A; - /* Write Timing */ - /* Can be decreases from 8-15-8 to 0-0-1 with risk of stability loss */ + // Write Timing + // Can be decreases from 8-15-8 to 0-0-1 with risk of stability loss ExtTiming.AddressSetupTime = 8; ExtTiming.AddressHoldTime = 15; ExtTiming.DataSetupTime = 8; @@ -131,7 +132,7 @@ void TFT_FSMC::Init() { uint32_t TFT_FSMC::GetID() { uint32_t id; - WriteReg(0x0000); + WriteReg(0); id = LCD->RAM; if (id == 0) @@ -141,16 +142,16 @@ uint32_t TFT_FSMC::GetID() { return id; } - uint32_t TFT_FSMC::ReadID(uint16_t Reg) { - uint32_t id; - WriteReg(Reg); - id = LCD->RAM; // dummy read - id = Reg << 24; - id |= (LCD->RAM & 0x00FF) << 16; - id |= (LCD->RAM & 0x00FF) << 8; - id |= LCD->RAM & 0x00FF; - return id; - } +uint32_t TFT_FSMC::ReadID(tft_data_t Reg) { + uint32_t id; + WriteReg(Reg); + id = LCD->RAM; // dummy read + id = Reg << 24; + id |= (LCD->RAM & 0x00FF) << 16; + id |= (LCD->RAM & 0x00FF) << 8; + id |= LCD->RAM & 0x00FF; + return id; +} bool TFT_FSMC::isBusy() { if (__IS_DMA_ENABLED(&DMAtx)) diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index e2e0128c5efc..ad39d10d632d 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.h @@ -44,9 +44,12 @@ #define DATASIZE_16BIT SPI_DATASIZE_16BIT #define TFT_IO_DRIVER TFT_FSMC +#define TFT_DATASIZE TERN(TFT_INTERFACE_FSMC_8BIT, DATASIZE_8BIT, DATASIZE_16BIT) +typedef TERN(TFT_INTERFACE_FSMC_8BIT, uint8_t, uint16_t) tft_data_t; + typedef struct { - __IO uint16_t REG; - __IO uint16_t RAM; + __IO tft_data_t REG; + __IO tft_data_t RAM; } LCD_CONTROLLER_TypeDef; class TFT_FSMC { @@ -56,8 +59,8 @@ class TFT_FSMC { static LCD_CONTROLLER_TypeDef *LCD; - static uint32_t ReadID(uint16_t Reg); - static void Transmit(uint16_t Data) { LCD->RAM = Data; __DSB(); } + static uint32_t ReadID(tft_data_t Reg); + static void Transmit(tft_data_t Data) { LCD->RAM = Data; __DSB(); } static void TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count); public: @@ -66,11 +69,11 @@ class TFT_FSMC { static bool isBusy(); static void Abort() { __HAL_DMA_DISABLE(&DMAtx); } - static void DataTransferBegin(uint16_t DataWidth = DATASIZE_16BIT) {} + static void DataTransferBegin(uint16_t DataWidth = TFT_DATASIZE) {} static void DataTransferEnd() {}; - static void WriteData(uint16_t Data) { Transmit(Data); } - static void WriteReg(uint16_t Reg) { LCD->REG = Reg; __DSB(); } + static void WriteData(uint16_t Data) { Transmit(tft_data_t(Data)); } + static void WriteReg(uint16_t Reg) { LCD->REG = tft_data_t(Reg); __DSB(); } static void WriteSequence(uint16_t *Data, uint16_t Count) { TransmitDMA(DMA_PINC_ENABLE, Data, Count); } static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_PINC_DISABLE, &Data, Count); } @@ -98,14 +101,16 @@ const PinMap PinMap_FSMC[] = { {PE_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D05 {PE_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D06 {PE_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D07 - {PE_11, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D08 - {PE_12, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D09 - {PE_13, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D10 - {PE_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D11 - {PE_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D12 - {PD_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D13 - {PD_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D14 - {PD_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D15 + #if DISABLED(TFT_INTERFACE_FSMC_8BIT) + {PE_11, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D08 + {PE_12, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D09 + {PE_13, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D10 + {PE_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D11 + {PE_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D12 + {PD_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D13 + {PD_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D14 + {PD_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D15 + #endif {PD_4, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NOE {PD_5, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NWE {NC, NP, 0} @@ -121,7 +126,11 @@ const PinMap PinMap_FSMC_CS[] = { {NC, NP, 0} }; -#define FSMC_RS(A) (void *)((2 << A) - 2) +#if ENABLED(TFT_INTERFACE_FSMC_8BIT) + #define FSMC_RS(A) (void *)((2 << (A-1)) - 1) +#else + #define FSMC_RS(A) (void *)((2 << A) - 2) +#endif const PinMap PinMap_FSMC_RS[] = { #ifdef PF0 diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 3acf3898a3b5..78cb7a4ba54a 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -23,8 +23,10 @@ #ifdef STM32F1xx #include + #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) #elif defined(STM32F4xx) #include + #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) #endif #include "../../../inc/MarlinConfig.h" @@ -60,13 +62,6 @@ enum XPTCoordinate : uint8_t { #define XPT2046_Z1_THRESHOLD 10 #endif -#ifdef STM32F1xx - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) -#elif defined(STM32F4xx) - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) -#endif - - class XPT2046 { private: static SPI_HandleTypeDef SPIx; diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index cd3269806985..0e27fc998b86 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -370,6 +370,8 @@ #define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE) #define BOARD_MKS_ROBIN_PRO_V2 4219 // MKS Robin Pro V2 (STM32F407VE) #define BOARD_MKS_ROBIN_NANO_V3 4220 // MKS Robin Nano V3 (STM32F407VG) +#define BOARD_ANET_ET4 4221 // ANET ET4 V1.x (STM32F407VGT6) +#define BOARD_ANET_ET4P 4222 // ANET ET4P V1.x (STM32F407VGT6) // // ARM Cortex M7 diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 2e38fad30ef6..76e55ad3d241 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -151,7 +151,7 @@ #endif -// Macros to chain up to 12 conditions +// Macros to chain up to 14 conditions #define _DO_1(W,C,A) (_##W##_1(A)) #define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B)) #define _DO_3(W,C,A,V...) (_##W##_1(A) C _DO_2(W,C,V)) @@ -164,6 +164,8 @@ #define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V)) #define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V)) #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V)) +#define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V)) +#define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V)) #define __DO_N(W,C,N,V...) _DO_##N(W,C,V) #define _DO_N(W,C,N,V...) __DO_N(W,C,N,V) #define DO(W,C,V...) (_DO_N(W,C,NUM_ARGS(V),V)) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c6837536001e..386482b3acd8 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1073,28 +1073,23 @@ * - TFT_COLOR * - GRAPHICAL_TFT_UPSCALE */ -#if ENABLED(MKS_TS35_V2_0) - // Most common: ST7796 +#if ENABLED(MKS_TS35_V2_0) // Most common: ST7796 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY) #define TFT_RES_480x320 #define TFT_INTERFACE_SPI -#elif ENABLED(MKS_ROBIN_TFT24) - // Most common: ST7789 +#elif ENABLED(MKS_ROBIN_TFT24) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC -#elif ENABLED(MKS_ROBIN_TFT28) - // Most common: ST7789 +#elif ENABLED(MKS_ROBIN_TFT28) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC -#elif ENABLED(MKS_ROBIN_TFT32) - // Most common: ST7789 +#elif ENABLED(MKS_ROBIN_TFT32) // Most common: ST7789 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC -#elif ENABLED(MKS_ROBIN_TFT35) - // Most common: ILI9488 +#elif ENABLED(MKS_ROBIN_TFT35) // Most common: ILI9488 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_RES_480x320 #define TFT_INTERFACE_FSMC @@ -1103,12 +1098,11 @@ #define TFT_DRIVER SSD1963 #define TFT_RES_480x272 #define TFT_INTERFACE_FSMC -#elif ENABLED(MKS_ROBIN_TFT_V1_1R) - // ILI9328 or R61505 +#elif ENABLED(MKS_ROBIN_TFT_V1_1R) // ILI9328 or R61505 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC -#elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) +#elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_DRIVER ILI9488 #define TFT_RES_480x320 @@ -1117,6 +1111,14 @@ #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC +#elif ENABLED(ANET_ET4_TFT28) // ST7789 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y) + #define TFT_RES_320x240 + #define TFT_INTERFACE_FSMC +#elif ENABLED(ANET_ET5_TFT35) // ST7796 + #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY) + #define TFT_RES_480x320 + #define TFT_INTERFACE_FSMC #elif ENABLED(TFT_GENERIC) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320) @@ -1197,11 +1199,9 @@ #define TOUCH_OFFSET_X XPT2046_X_OFFSET #define TOUCH_OFFSET_Y XPT2046_Y_OFFSET #define TOUCH_ORIENTATION TOUCH_LANDSCAPE - #else - #define TOUCH_CALIBRATION_X 0 - #define TOUCH_CALIBRATION_Y 0 - #define TOUCH_OFFSET_X 0 - #define TOUCH_OFFSET_Y 0 - #define TOUCH_ORIENTATION TOUCH_ORIENTATION_NONE #endif #endif + +#if MB(ANET_ET4, ANET_ET4P) + #define IS_ANET_ET 1 +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0ff80dc96469..a04dc786b220 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2303,7 +2303,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \ + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \ + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \ - + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R) \ + + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \ + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \ + COUNT_ENABLED(VIKI2, miniVIKI) \ + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \ @@ -2347,7 +2347,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #undef IS_EXTUI #undef IS_LEGACY_TFT -#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28) +#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35) #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one." #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI) diff --git a/Marlin/src/lcd/tft/canvas.cpp b/Marlin/src/lcd/tft/canvas.cpp index 061f078b92bd..3c2cda4fd52d 100644 --- a/Marlin/src/lcd/tft/canvas.cpp +++ b/Marlin/src/lcd/tft/canvas.cpp @@ -95,7 +95,7 @@ void CANVAS::AddImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) if (line >= startLine && line < endLine) { uint16_t *pixel = buffer + x + (line - startLine) * width; for (int16_t j = 0; j < image_width; j++) { - if ((x + j >= 0) && (x + j < width)) *pixel = *data; + if ((x + j >= 0) && (x + j < width)) *pixel = ENDIAN_COLOR(*data); pixel++; data++; } diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index ed3d5e35c157..159d0e1c196d 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -30,6 +30,13 @@ #include "../../inc/MarlinConfig.h" +#if TFT_INTERFACE_FSMC_8BIT + // When we have a 8 bit interface, we need to invert the bytes of the color + #define ENDIAN_COLOR(C) (((C) >> 8) | ((C) << 8)) +#else + #define ENDIAN_COLOR(C) (C) +#endif + #if HAS_UI_320x240 #define TFT_WIDTH 320 #define TFT_HEIGHT 240 diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index 0b538ef4a87d..ea0bf0f00af9 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -158,7 +158,7 @@ void TFT_Queue::fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, ui task_parameters->y = y; task_parameters->width = width; task_parameters->height = height; - task_parameters->color = color; + task_parameters->color = ENDIAN_COLOR(color); task_parameters->count = width * height; *end_of_queue = TASK_END_OF_QUEUE; @@ -200,7 +200,7 @@ void TFT_Queue::set_background(uint16_t color) { last_parameter = end_of_queue; parameters->type = CANVAS_SET_BACKGROUND; - parameters->color = color; + parameters->color = ENDIAN_COLOR(color); end_of_queue += sizeof(parametersCanvasBackground_t); task_parameters->count++; @@ -227,7 +227,7 @@ void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string parameters->type = CANVAS_ADD_TEXT; parameters->x = x; parameters->y = y; - parameters->color = color; + parameters->color = ENDIAN_COLOR(color); parameters->stringLength = 0; parameters->maxWidth = maxWidth; @@ -261,18 +261,19 @@ void TFT_Queue::add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *col if (color_mode == HIGHCOLOR) return; uint16_t *color = (uint16_t *)end_of_queue; - uint8_t number_of_color = 0; + uint8_t color_count = 0; switch (color_mode) { - case GREYSCALE1: number_of_color = 1; break; - case GREYSCALE2: number_of_color = 3; break; - case GREYSCALE4: number_of_color = 15; break; - default: - break; + case GREYSCALE1: color_count = 1; break; + case GREYSCALE2: color_count = 3; break; + case GREYSCALE4: color_count = 15; break; + default: break; } - while (number_of_color--) { - *color++ = *colors++; + uint16_t tmp; + while (color_count--) { + tmp = *colors++; + *color++ = ENDIAN_COLOR(tmp); } end_of_queue = (uint8_t *)color; @@ -326,7 +327,7 @@ void TFT_Queue::add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, parameters->y = y; parameters->width = width; parameters->height = height; - parameters->color = color; + parameters->color = ENDIAN_COLOR(color); end_of_queue += sizeof(parametersCanvasBar_t); task_parameters->count++; @@ -344,7 +345,7 @@ void TFT_Queue::add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t h parameters->y = y; parameters->width = width; parameters->height = height; - parameters->color = color; + parameters->color = ENDIAN_COLOR(color); end_of_queue += sizeof(parametersCanvasRectangle_t); task_parameters->count++; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index ceea4a428eb3..bcd1cb2ab95c 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -414,21 +414,21 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu extern screenFunc_t _manual_move_func_ptr; if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { - #define SLIDER_LENGHT 224 + #define SLIDER_LENGTH 224 #define SLIDER_Y_POSITION 140 - tft.canvas((TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION, SLIDER_LENGHT, 16); + tft.canvas((TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION, SLIDER_LENGTH, 16); tft.set_background(COLOR_BACKGROUND); - int16_t position = (SLIDER_LENGHT - 2) * ui.encoderPosition / maxEditValue; + int16_t position = (SLIDER_LENGTH - 2) * ui.encoderPosition / maxEditValue; tft.add_bar(0, 7, 1, 2, ui.encoderPosition == 0 ? COLOR_SLIDER_INACTIVE : COLOR_SLIDER); tft.add_bar(1, 6, position, 4, COLOR_SLIDER); - tft.add_bar(position + 1, 6, SLIDER_LENGHT - 2 - position, 4, COLOR_SLIDER_INACTIVE); - tft.add_bar(SLIDER_LENGHT - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE); + tft.add_bar(position + 1, 6, SLIDER_LENGTH - 2 - position, 4, COLOR_SLIDER_INACTIVE); + tft.add_bar(SLIDER_LENGTH - 1, 7, 1, 2, int32_t(ui.encoderPosition) == maxEditValue ? COLOR_SLIDER : COLOR_SLIDER_INACTIVE); #if ENABLED(TOUCH_SCREEN) - tft.add_image((SLIDER_LENGHT - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER); - touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGHT) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGHT, 32, maxEditValue); + tft.add_image((SLIDER_LENGTH - 8) * ui.encoderPosition / maxEditValue, 0, imgSlider, COLOR_SLIDER); + touch.add_control(SLIDER, (TFT_WIDTH - SLIDER_LENGTH) / 2, SLIDER_Y_POSITION - 8, SLIDER_LENGTH, 32, maxEditValue); #endif } diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 50b0ce446383..aa081be486bc 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -75,8 +75,20 @@ #define TOUCH_LANDSCAPE 1 #define TOUCH_PORTRAIT 2 +#ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 0 +#endif +#ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 0 +#endif +#ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 0 +#endif +#ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 0 +#endif #ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE #endif #define SSD1963 0x5761 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index b14228cbf55a..9cbbf84668ae 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -598,6 +598,10 @@ #include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2 #elif MB(MKS_ROBIN_NANO_V3) #include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3 +#elif MB(ANET_ET4) + #include "stm32f4/pins_ANET_ET4.h" // STM32F4 env:Anet_ET4_OpenBLT +#elif MB(ANET_ET4P) + #include "stm32f4/pins_ANET_ET4P.h" // STM32F4 env:Anet_ET4_OpenBLT // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h new file mode 100644 index 000000000000..c0bbe2f423f9 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -0,0 +1,223 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "Anet ET4 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Anet ET4 1.x" +#endif + +// +// EEPROM +// + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation + //#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4KB, PageSize 16B) +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#elif ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PB11 + #define IIC_EEPROM_SCL PB10 + #define EEPROM_DEVICE_ADDRESS 0xA0 + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PC13 +#define Y_STOP_PIN PE12 +#define Z_STOP_PIN PE11 + +// +// Z Probe +// +#if ENABLED(BLTOUCH) + #error "You will need to use 24V to 5V converter and remove one resistor and capacitor from the motherboard. See https://github.com/davidtgbe/Marlin/blob/bugfix-2.0.x/docs/Tutorials/bltouch-en.md for more information. Comment out this line to proceed at your own risk." + #define SERVO0_PIN PC3 +#elif !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PC3 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA2 +#endif + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PA8 +#endif + +// +// LED PIN +// +#define LED_PIN PD12 + +// +// Steppers +// +#define X_STEP_PIN PB6 +#define X_DIR_PIN PB5 +#define X_ENABLE_PIN PB7 + +#define Y_STEP_PIN PB3 +#define Y_DIR_PIN PD6 +#define Y_ENABLE_PIN PB4 + +#define Z_STEP_PIN PA12 +#define Z_DIR_PIN PA11 +#define Z_ENABLE_PIN PA15 + +#define E0_STEP_PIN PB9 +#define E0_DIR_PIN PB8 +#define E0_ENABLE_PIN PE0 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA1 +#define TEMP_BED_PIN PA4 + +// +// Heaters +// +#define HEATER_0_PIN PA0 +#define HEATER_BED_PIN PE2 + +// +// Fans +// +#define FAN_PIN PE3 // Layer fan +#define FAN1_PIN PE1 // Hotend fan + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN FAN1_PIN +#endif + +// +// LCD / Controller +// +#define TFT_RESET_PIN PE6 +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD13 +#define TFT_INTERFACE_FSMC_8BIT + +// +// Touch Screen +// https://ldm-systems.ru/f/doc/catalog/HY-TFT-2,8/XPT2046.pdf +// +#if ENABLED(TOUCH_SCREEN) + #define TOUCH_CS_PIN PB2 + #define TOUCH_SCK_PIN PB0 + #define TOUCH_MOSI_PIN PE5 + #define TOUCH_MISO_PIN PE4 + #define TOUCH_INT_PIN PB1 +#endif + +// Touchscreen calibration does not work correctly with ANET_ET5_TFT35 or ANET_ET4_TFT28 +#if ENABLED(TOUCH_SCREEN_CALIBRATION) + #undef TOUCH_SCREEN_CALIBRATION +#endif + +#if ENABLED(ANET_ET5_TFT35) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17125 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -11307 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -26 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 337 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_PORTRAIT + #endif +#elif ENABLED(ANET_ET4_TFT28) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11838 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8776 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 333 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -17 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_PORTRAIT + #endif +#endif + +// +// SD Card +// +//#define SDIO_SUPPORT + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION CUSTOM_CABLE +#endif + +#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 SCK_PIN SDIO_CK_PIN + #define MISO_PIN SDIO_D0_PIN + #define MOSI_PIN SDIO_CMD_PIN + #endif + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN PD3 + #endif + +#endif diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h new file mode 100644 index 000000000000..eecabbaf9866 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#define BOARD_INFO_NAME "Anet ET4P 1.x" + +// +// TMC2208 Configuration_adv defaults for Anet ET4P-MB_V1.x +// +#if !AXIS_DRIVER_TYPE_X(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_Y(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_Z(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_E0(TMC2208_STANDALONE) + #error "ANET_ET4P requires ([XYZ]|E0)_DRIVER_TYPE set to TMC2208_STANDALONE." +#endif + +#include "pins_ANET_ET4.h" diff --git a/platformio.ini b/platformio.ini index acb5990edbff..0b2e7c09153b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1241,6 +1241,29 @@ build_flags = ${common_stm32.build_flags} extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py +# +# Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) +# For use with with davidtgbe's OpenBLT bootloader https://github.com/davidtgbe/openblt/releases +# 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 = common_stm32 +build_flags = ${common_stm32.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED +board = genericSTM32F407VGT6 +board_build.core = stm32 +board_build.variant = MARLIN_F4x7Vx +board_build.ldscript = ldscript.ld +board_build.firmware = firmware.srec +board_build.offset = 0x10000 +board_upload.offset_address = 0x08010000 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +debug_tool = jlink +upload_protocol = jlink +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + # # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # From 0b3b4da7d0ec2015ca7b8bd346e4f6af3c6f5886 Mon Sep 17 00:00:00 2001 From: Serhiy-K <52166448+Serhiy-K@users.noreply.github.com> Date: Tue, 22 Dec 2020 14:56:00 +0200 Subject: [PATCH 393/443] STM32F1xx support for TFTGLCD (#20515) --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 6 ++++++ Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 12 ++++++------ Marlin/src/pins/stm32f1/pins_MORPHEUS.h | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 11bea18c81a9..549fd7721f19 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -972,6 +972,12 @@ MeshFlags done_flags{0}; const xy_int8_t &lpos = location.pos; + + #if IS_TFTGLCD_PANEL + lcd_mesh_edit_setup(0); // Change current screen before calling ui.ubl_plot + safe_delay(50); + #endif + do { location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index cadd693f6f9e..57146519a470 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -32,7 +32,7 @@ * and supports color output. */ -#if NONE(__AVR__, TARGET_LPC1768, __STM32F1__, STM32F4xx) +#if NONE(__AVR__, TARGET_LPC1768, STM32F1, STM32F4xx) #warning "Selected platform not yet tested. Please contribute your good pin mappings." #endif @@ -129,7 +129,7 @@ static uint8_t PanelDetected = 0; #if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__) #define SPI_SEND_ONE(V) SPI.transfer(V); #define SPI_SEND_TWO(V) SPI.transfer16(V); -#elif defined(STM32F4xx) +#elif EITHER(STM32F4xx, STM32F1xx) #define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE); #define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE); #elif defined(ARDUINO_ARCH_ESP32) @@ -139,7 +139,7 @@ static uint8_t PanelDetected = 0; #if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__) #define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L); -#elif defined(STM32F4xx) +#elif EITHER(STM32F4xx, STM32F1xx) #define SPI_SEND_SOME(V,L,Z) SPI.transfer(&V[Z], L, SPI_CONTINUE); #elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32) #define SPI_SEND_SOME(V,L,Z) do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0) @@ -276,7 +276,7 @@ uint8_t MarlinUI::read_slow_buttons(void) { Wire.endTransmission(); #ifdef __AVR__ Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1); - #elif defined(__STM32F1__) + #elif defined(STM32F1) Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2); #elif EITHER(STM32F4xx, TARGET_LPC1768) Wire.requestFrom(LCD_I2C_ADDRESS, 2); @@ -330,7 +330,7 @@ void MarlinUI::init_lcd() { Wire.endTransmission(); // send buffer #ifdef __AVR__ Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1); - #elif ANY(__STM32F1__, STM32F4xx, TARGET_LPC1768) + #elif ANY(STM32F1, STM32F4xx, TARGET_LPC1768) Wire.requestFrom(LCD_I2C_ADDRESS, 1); #endif t = (uint8_t)Wire.read(); @@ -626,7 +626,7 @@ Equal to 20x10 text LCD | ttc ttc % | ttc - current temperature | tts tts %%% | tts - setted temperature, %%% - percent for FAN | ICO ICO ICO ICO | ICO - icon 48x48, placed in 2 text lines -| ICO ICO ICO ICO | ICO / +| ICO ICO ICO ICO | ICO or diff --git a/Marlin/src/pins/stm32f1/pins_MORPHEUS.h b/Marlin/src/pins/stm32f1/pins_MORPHEUS.h index ccc92b7527d1..05e02c9e4df6 100644 --- a/Marlin/src/pins/stm32f1/pins_MORPHEUS.h +++ b/Marlin/src/pins/stm32f1/pins_MORPHEUS.h @@ -30,7 +30,7 @@ * MORPHEUS Board pin assignments */ -#if NOT_TARGET(__STM32F1__) +#if NOT_TARGET(__STM32F1__, STM32F1xx) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif @@ -90,3 +90,4 @@ #define LED_PIN PC13 #define SDSS PA3 #define TFTGLCD_CS PA4 +#define SD_DETECT_PIN PC14 From cfad5cb4356f90179eef636ec6c27db242227fff Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 22 Dec 2020 09:57:11 -0300 Subject: [PATCH 394/443] Unify FYSETC F6 1.3 / 1.4 (#20507) Co-authored-by: Scott Lahteine --- .github/workflows/test-builds.yml | 2 +- Marlin/src/pins/pins.h | 4 +-- .../share/PlatformIO/boards/fysetc_f6.json | 34 +++++++++++++++++++ .../{FYSETC_F6_13-tests => FYSETC_F6-tests} | 0 platformio.ini | 14 ++------ 5 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 buildroot/share/PlatformIO/boards/fysetc_f6.json rename buildroot/tests/{FYSETC_F6_13-tests => FYSETC_F6-tests} (100%) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 53ffbe0c08b1..7549e3defcbb 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -48,7 +48,7 @@ jobs: # Extended AVR Environments - - FYSETC_F6_13 + - FYSETC_F6 - mega1280 - rambo - sanguino1284p diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9cbbf84668ae..2218d2fe494c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -163,9 +163,9 @@ #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(FYSETC_F6_13) - #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6_13 + #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) - #include "ramps/pins_FYSETC_F6_14.h" // ATmega2560 env:FYSETC_F6_14 + #include "ramps/pins_FYSETC_F6_14.h" // ATmega2560 env:FYSETC_F6 #elif MB(DUPLICATOR_I3_PLUS) #include "ramps/pins_DUPLICATOR_I3_PLUS.h" // ATmega2560 env:mega2560 #elif MB(VORON) diff --git a/buildroot/share/PlatformIO/boards/fysetc_f6.json b/buildroot/share/PlatformIO/boards/fysetc_f6.json new file mode 100644 index 000000000000..2772f73a6539 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/fysetc_f6.json @@ -0,0 +1,34 @@ +{ + "build": { + "core": "arduino", + "extra_flags": "-DARDUINO_AVR_MEGA2560", + "f_cpu": "16000000L", + "hwids": [ + [ + "0x27b2", + "0x0002" + ] + ], + "mcu": "atmega2560", + "variant": "fysetcf6" + }, + "debug": { + "simavr_target": "atmega2560", + "avr-stub": { + "speed": 115200 + } + }, + "frameworks": [ + "arduino" + ], + "name": "FYSETC F6", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 258048, + "protocol": "wiring", + "require_upload_port": true, + "speed": 115200 + }, + "url": "https://www.fysetc.com/", + "vendor": "FYSETC" +} diff --git a/buildroot/tests/FYSETC_F6_13-tests b/buildroot/tests/FYSETC_F6-tests similarity index 100% rename from buildroot/tests/FYSETC_F6_13-tests rename to buildroot/tests/FYSETC_F6-tests diff --git a/platformio.ini b/platformio.ini index 0b2e7c09153b..bf44808b3265 100644 --- a/platformio.ini +++ b/platformio.ini @@ -505,20 +505,12 @@ extends = common_avr8 board = reprap_rambo # -# FYSETC F6 V1.3 +# FYSETC F6 V1.3 / V1.4 # -[env:FYSETC_F6_13] +[env:FYSETC_F6] platform = atmelavr extends = common_avr8 -board = fysetc_f6_13 - -# -# FYSETC F6 V1.4 -# -[env:FYSETC_F6_14] -platform = atmelavr -extends = common_avr8 -board = fysetc_f6_14 +board = fysetc_f6 # # Sanguinololu (ATmega644p) From c559fc82271e1c609b7f0211ce1075c4a1eac815 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 22 Dec 2020 14:01:24 +0100 Subject: [PATCH 395/443] Fix G28 leveling state, UBL compile (#20499) --- Marlin/src/gcode/calibrate/G28.cpp | 7 ++++--- Marlin/src/inc/Conditionals_LCD.h | 1 + Marlin/src/inc/SanityCheck.h | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 57c21df765fc..3d739c7ce8f6 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -241,8 +241,8 @@ void GcodeSuite::G28() { // Disable the leveling matrix before homing #if HAS_LEVELING - const bool leveling_restore_state = ENABLED(ENABLE_LEVELING_AFTER_G28) || TERN0(RESTORE_LEVELING_AFTER_G28, planner.leveling_active); - TERN_(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session + IF_ENABLED(RESTORE_LEVELING_AFTER_G28, const bool leveling_restore_state = planner.leveling_active); + IF_ENABLED(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session set_bed_leveling_enabled(false); #endif @@ -435,7 +435,8 @@ void GcodeSuite::G28() { do_blocking_move_to_z(delta_clip_start_height); #endif - TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_restore_state)); + IF_ENABLED(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_restore_state)); + IF_ENABLED(ENABLE_LEVELING_AFTER_G28, set_bed_leveling_enabled(true)); restore_feedrate_and_scaling(); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 386482b3acd8..7c581bef9087 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -886,6 +886,7 @@ #if !HAS_LEVELING #undef PROBE_MANUALLY #undef RESTORE_LEVELING_AFTER_G28 + #undef ENABLE_LEVELING_AFTER_G28 #endif #ifdef GRID_MAX_POINTS_X diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a04dc786b220..b56177462f35 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1455,8 +1455,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." - #elif !defined(RESTORE_LEVELING_AFTER_G28) && !defined(ENABLE_LEVELING_AFTER_G28) - #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'." #endif #elif HAS_ABL_NOT_UBL From de9c0eda3665c8db3c291bd1b756a09a1518bf53 Mon Sep 17 00:00:00 2001 From: Jan Krajdl Date: Tue, 22 Dec 2020 15:27:14 +0100 Subject: [PATCH 396/443] Support RGBW on PCA9632 (#20455) Co-authored-by: Scott Lahteine --- Marlin/src/feature/leds/leds.h | 2 +- Marlin/src/feature/leds/pca9632.cpp | 48 +++++++++++++++++++---------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 055ea0df37ad..57b21d576c54 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -34,7 +34,7 @@ #endif // A white component can be passed -#if EITHER(RGBW_LED, NEOPIXEL_LED) +#if ANY(RGBW_LED, NEOPIXEL_LED, PCA9632_RGBW) #define HAS_WHITE_LED 1 #endif diff --git a/Marlin/src/feature/leds/pca9632.cpp b/Marlin/src/feature/leds/pca9632.cpp index d8af31cb6ce4..bb30e0b48b0e 100644 --- a/Marlin/src/feature/leds/pca9632.cpp +++ b/Marlin/src/feature/leds/pca9632.cpp @@ -58,7 +58,7 @@ #define PCA9632_AUTOGLO 0xC0 #define PCA9632_AUTOGI 0xE0 -// Red=LED0 Green=LED1 Blue=LED2 +// Red=LED0 Green=LED1 Blue=LED2 White=LED3 #ifndef PCA9632_RED #define PCA9632_RED 0x00 #endif @@ -68,9 +68,12 @@ #ifndef PCA9632_BLU #define PCA9632_BLU 0x04 #endif +#if HAS_WHITE_LED && !defined(PCA9632_WHT) + #define PCA9632_WHT 0x06 +#endif // If any of the color indexes are greater than 0x04 they can't use auto increment -#if !defined(PCA9632_NO_AUTO_INC) && (PCA9632_RED > 0x04 || PCA9632_GRN > 0x04 || PCA9632_BLU > 0x04) +#if !defined(PCA9632_NO_AUTO_INC) && (PCA9632_RED > 0x04 || PCA9632_GRN > 0x04 || PCA9632_BLU > 0x04 || PCA9632_WHT > 0x04) #define PCA9632_NO_AUTO_INC #endif @@ -89,25 +92,28 @@ static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte Wire.endTransmission(); } -static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte vr, const byte vg, const byte vb) { +static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte vr, const byte vg, const byte vb + #if ENABLED(PCA9632_RGBW) + , const byte vw + #endif +) { #if DISABLED(PCA9632_NO_AUTO_INC) - uint8_t data[4], len = 4; + uint8_t data[4]; data[0] = PCA9632_AUTO_IND | regadd; data[1 + (PCA9632_RED >> 1)] = vr; data[1 + (PCA9632_GRN >> 1)] = vg; data[1 + (PCA9632_BLU >> 1)] = vb; + Wire.beginTransmission(I2C_ADDRESS(addr)); + Wire.write(data, sizeof(data)); + Wire.endTransmission(); #else - uint8_t data[6], len = 6; - data[0] = regadd + (PCA9632_RED >> 1); - data[1] = vr; - data[2] = regadd + (PCA9632_GRN >> 1); - data[3] = vg; - data[4] = regadd + (PCA9632_BLU >> 1); - data[5] = vb; + PCA9632_WriteRegister(addr, regadd + (PCA9632_RED >> 1), vr); + PCA9632_WriteRegister(addr, regadd + (PCA9632_GRN >> 1), vg); + PCA9632_WriteRegister(addr, regadd + (PCA9632_BLU >> 1), vb); + #if ENABLED(PCA9632_RGBW) + PCA9632_WriteRegister(addr, regadd + (PCA9632_WHT >> 1), vw); + #endif #endif - Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(data, len); - Wire.endTransmission(); } #if 0 @@ -130,9 +136,17 @@ void PCA9632_set_led_color(const LEDColor &color) { const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0) | (color.g ? LED_PWM << PCA9632_GRN : 0) - | (color.b ? LED_PWM << PCA9632_BLU : 0); - - PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b); + | (color.b ? LED_PWM << PCA9632_BLU : 0) + #if ENABLED(PCA9632_RGBW) + | (color.w ? LED_PWM << PCA9632_WHT : 0) + #endif + ; + + PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b + #if ENABLED(PCA9632_RGBW) + , color.w + #endif + ); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); } From 56fac55a39a1c869a8561068120989cfd9ea6a31 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 23 Dec 2020 00:20:43 +0000 Subject: [PATCH 397/443] [cron] Bump distribution date (2020-12-23) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index c51cfee706b2..4e5f2b3d4158 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-22" + #define STRING_DISTRIBUTION_DATE "2020-12-23" #endif /** From c87c354403342ea12fce220116665e22efbe8194 Mon Sep 17 00:00:00 2001 From: wmariz <11435639+wmariz@users.noreply.github.com> Date: Wed, 23 Dec 2020 03:10:56 -0300 Subject: [PATCH 398/443] Refactor 'Level Corners with Probe' (#20460) Co-authored-by: Scott Lahteine --- Marlin/src/feature/bltouch.h | 4 + Marlin/src/lcd/menu/menu_bed_corners.cpp | 261 ++++++++++++----------- Marlin/src/module/motion.cpp | 4 +- Marlin/src/module/probe.cpp | 12 +- 4 files changed, 142 insertions(+), 139 deletions(-) diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index 40685af1b357..5880bdce75f0 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -23,6 +23,10 @@ #include "../inc/MarlinConfigPre.h" +#if DISABLED(BLTOUCH_HS_MODE) + #define BLTOUCH_SLOW_MODE 1 +#endif + // BLTouch commands are sent as servo angles typedef unsigned char BLTCommand; diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index acd19d69e41b..56a97b5706a4 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -51,18 +51,11 @@ #include "../../feature/bltouch.h" #endif #ifndef LEVEL_CORNERS_PROBE_TOLERANCE - #define LEVEL_CORNERS_PROBE_TOLERANCE 0.1 + #define LEVEL_CORNERS_PROBE_TOLERANCE 0.2 #endif - #if ENABLED(LEVEL_CORNERS_AUDIO_FEEDBACK) - #include "../../libs/buzzer.h" - #define PROBE_BUZZ() BUZZ(200, 600) - #else - #define PROBE_BUZZ() NOOP - #endif - static float last_z; - static bool corner_probing_done; - static bool verify_corner; - static int good_points; + float last_z; + int good_points; + bool corner_probing_done, wait_for_probe; #endif static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); @@ -75,115 +68,130 @@ extern const char G28_STR[]; static int8_t bed_corner; +constexpr float inset_lfrb[4] = LEVEL_CORNERS_INSET_LFRB; +constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1] }, + rb { (X_MAX_BED) - inset_lfrb[2], (Y_MAX_BED) - inset_lfrb[3] }; + /** * Level corners, starting in the front-left corner. */ #if ENABLED(LEVEL_CORNERS_USE_PROBE) - static inline void _lcd_level_bed_corners_probing() { - ui.goto_screen([]{ MenuItem_static::draw((LCD_HEIGHT - 1) / 2, GET_TEXT(MSG_PROBING_MESH)); }); + void _lcd_draw_probing() { + if (ui.should_draw()) MenuItem_static::draw((LCD_HEIGHT - 1) / 2, GET_TEXT(MSG_PROBING_MESH)); + } - float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; - xy_pos_t lf { (X_MIN_BED) + lfrb[0] - probe.offset_xy.x , (Y_MIN_BED) + lfrb[1] - probe.offset_xy.y }, - rb { (X_MAX_BED) - lfrb[2] - probe.offset_xy.x , (Y_MAX_BED) - lfrb[3] - probe.offset_xy.y }; + void _lcd_draw_raise() { + if (!ui.should_draw()) return; + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP) + , []{ corner_probing_done = true; wait_for_probe = false; } + , []{ wait_for_probe = false; } + , GET_TEXT(MSG_LEVEL_CORNERS_RAISE) + , (const char*)nullptr, PSTR("") + ); + } - do_blocking_move_to_z(LEVEL_CORNERS_Z_HOP - probe.offset.z); + void _lcd_draw_level_prompt() { + if (!ui.should_draw()) return; + MenuItem_confirm::confirm_screen( + []{ queue.inject_P(TERN(HAS_LEVELING, PSTR("G28\nG29"), G28_STR)); + ui.return_to_status(); + } + , []{ ui.goto_previous_screen_no_defer(); } + , GET_TEXT(MSG_LEVEL_CORNERS_IN_RANGE) + , (const char*)nullptr, PSTR("?") + ); + } - switch (bed_corner) { - case 0: current_position = lf; break; // copy xy - case 1: current_position.x = rb.x; break; - case 2: current_position.y = rb.y; break; - case 3: current_position.x = lf.x; break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: current_position.set(X_CENTER - probe.offset_xy.x, Y_CENTER - probe.offset_xy.y); good_points--; break; - #endif + bool _lcd_level_bed_corners_probe(bool verify=false) { + if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed + TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action + do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, manual_feedrate_mm_s.z); // Move down to lower tolerance + if (TEST(endstops.trigger_state(), TERN(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_MIN, Z_MIN_PROBE))) { // check if probe triggered + endstops.hit_on_purpose(); + set_current_from_steppers_for_axis(Z_AXIS); + sync_plan_position(); + TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger + // Triggered outside tolerance range? + if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { + last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners. + good_points = 0; // ...and start over + } + return true; // probe triggered } + do_blocking_move_to_z(last_z); // go back to tolerance middle point before raise + return false; // probe not triggered + } - do_blocking_move_to_xy(current_position); - - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - bltouch.deploy(); // DEPLOY in LOW SPEED MODE on every probe action - #endif - TERN_(HAS_QUIET_PROBING, probe.set_probing_paused(true)); - - // Move down until the probe is triggered - do_blocking_move_to_z(last_z - (LEVEL_CORNERS_PROBE_TOLERANCE), manual_feedrate_mm_s.z); - - // Check to see if the probe was triggered - bool probe_triggered = TEST(endstops.trigger_state(), TERN(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_MIN, Z_MIN_PROBE)); - if (!probe_triggered) { - - static bool wait_for_probe; - - ui.goto_screen([]{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP) - , []{ corner_probing_done = true; - wait_for_probe = false; - TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); - ui.goto_previous_screen_no_defer(); - } - , []{ wait_for_probe = false; } - , GET_TEXT(MSG_LEVEL_CORNERS_RAISE) - , (const char*)nullptr, PSTR("") - ); - }); - ui.set_selection(true); - - wait_for_probe = true; - while (wait_for_probe && !probe_triggered) { - probe_triggered = PROBE_TRIGGERED(); - if (probe_triggered) PROBE_BUZZ(); - idle(); + bool _lcd_level_bed_corners_raise() { + bool probe_triggered = false; + corner_probing_done = false; + wait_for_probe = true; + ui.goto_screen(_lcd_draw_raise); // show raise screen + ui.set_selection(true); + while (wait_for_probe && !probe_triggered) { //loop while waiting to bed raise and probe trigger + probe_triggered = PROBE_TRIGGERED(); + if (probe_triggered) { + endstops.hit_on_purpose(); + TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, ui.buzz(200, 600)); } - wait_for_probe = false; - - TERN_(LEVEL_CORNERS_VERIFY_RAISED, verify_corner = true); + idle(); } + TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); + ui.goto_screen(_lcd_draw_probing); + return (probe_triggered); + } - TERN_(HAS_QUIET_PROBING, probe.set_probing_paused(false)); - - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - bltouch.stow(); - #endif + void _lcd_test_corners() { + ui.goto_screen(_lcd_draw_probing); + bed_corner = TERN(LEVEL_CENTER_TOO, 4, 0); + last_z = LEVEL_CORNERS_HEIGHT; + endstops.enable_z_probe(true); + good_points = 0; - if (probe_triggered) { - endstops.hit_on_purpose(); - if (!WITHIN(current_position.z, last_z - (LEVEL_CORNERS_PROBE_TOLERANCE), last_z + (LEVEL_CORNERS_PROBE_TOLERANCE))) { - last_z = current_position.z; - good_points = 0; + do { + do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // clearance + // Select next corner coordinates + xy_pos_t plf = lf - probe.offset_xy, prb = rb - probe.offset_xy; + switch (bed_corner) { + case 0: current_position = plf; break; // copy xy + case 1: current_position.x = prb.x; break; + case 2: current_position.y = prb.y; break; + case 3: current_position.x = plf.x; break; + #if ENABLED(LEVEL_CENTER_TOO) + case 4: current_position.set(X_CENTER - probe.offset_xy.x, Y_CENTER - probe.offset_xy.y); break; + #endif } - if (!verify_corner) good_points++; - } - - if (!corner_probing_done) { - if (!verify_corner) bed_corner++; - if (bed_corner > 3) bed_corner = 0; - verify_corner = false; - if (good_points < 4) - _lcd_level_bed_corners_probing(); - else { - ui.goto_screen([]{ - MenuItem_confirm::confirm_screen( - []{ ui.goto_previous_screen_no_defer(); - queue.inject_P(TERN(HAS_LEVELING, PSTR("G28\nG29"), G28_STR)); + do_blocking_move_to_xy(current_position); // Goto corner + + if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance + if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed + #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify + while (!_lcd_level_bed_corners_probe(true)) { // Loop while corner verified + if (!_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed + if (corner_probing_done) return; // Done was selected + break; // Skip was selected } - , []{ ui.goto_previous_screen_no_defer(); } - , GET_TEXT(MSG_LEVEL_CORNERS_IN_RANGE) - , (const char*)nullptr, PSTR("?") - ); - }); - ui.set_selection(true); + } + #endif + } + else if (corner_probing_done) // Done was selected + return; } - } + + if (bed_corner != 4) good_points++; // ignore center + if (++bed_corner > 3) bed_corner = 0; + + } while (good_points < 4); // loop until all corners whitin tolerance + + ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling + ui.set_selection(true); } -#else +#else // !LEVEL_CORNERS_USE_PROBE static inline void _lcd_goto_next_corner() { - constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; - constexpr xy_pos_t lf { (X_MIN_BED) + lfrb[0], (Y_MIN_BED) + lfrb[1] }, - rb { (X_MAX_BED) - lfrb[2], (Y_MAX_BED) - lfrb[3] }; line_to_z(LEVEL_CORNERS_Z_HOP); switch (bed_corner) { case 0: current_position = lf; break; // copy xy @@ -199,33 +207,33 @@ static int8_t bed_corner; if (++bed_corner > 3 + ENABLED(LEVEL_CENTER_TOO)) bed_corner = 0; } -#endif +#endif // !LEVEL_CORNERS_USE_PROBE static inline void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); - if (all_axes_homed()) { - #if ENABLED(LEVEL_CORNERS_USE_PROBE) - TERN_(LEVEL_CENTER_TOO, bed_corner = 4); - endstops.enable_z_probe(true); - ui.goto_screen(_lcd_level_bed_corners_probing); - #else - bed_corner = 0; - ui.goto_screen([]{ - MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) - , _lcd_goto_next_corner - , []{ - TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); - ui.goto_previous_screen_no_defer(); - } - , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) - , (const char*)nullptr, PSTR("?") - ); - }); - ui.set_selection(true); - _lcd_goto_next_corner(); - #endif - } + if (!all_axes_homed()) return; + #if ENABLED(LEVEL_CORNERS_USE_PROBE) + _lcd_test_corners(); + if (corner_probing_done) ui.goto_previous_screen_no_defer(); + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + endstops.enable_z_probe(false); + #else + bed_corner = 0; + ui.goto_screen([]{ + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) + , _lcd_goto_next_corner + , []{ + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + ui.goto_previous_screen_no_defer(); + } + , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , (const char*)nullptr, PSTR("?") + ); + }); + ui.set_selection(true); + _lcd_goto_next_corner(); + #endif } void _lcd_level_bed_corners() { @@ -241,13 +249,6 @@ void _lcd_level_bed_corners() { set_bed_leveling_enabled(false); #endif - #if ENABLED(LEVEL_CORNERS_USE_PROBE) - last_z = LEVEL_CORNERS_HEIGHT; - corner_probing_done = false; - verify_corner = false; - good_points = 0; - #endif - ui.goto_screen(_lcd_level_bed_corners_homing); } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 3800bc6b0a94..9b6a0d913b0b 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1604,7 +1604,7 @@ void homeaxis(const AxisEnum axis) { do_homing_move(axis, 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir); - #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) + #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE) if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE) #endif @@ -1642,7 +1642,7 @@ void homeaxis(const AxisEnum axis) { // Slow move towards endstop until triggered if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 2 Slow:"); - #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) + #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE) if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE) #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 261fde491314..02c1f55f4a8a 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -455,9 +455,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { thermalManager.wait_for_bed_heating(); #endif - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (bltouch.deploy()) return true; // DEPLOY in LOW SPEED MODE on every probe action - #endif + if (TERN0(BLTOUCH_SLOW_MODE, bltouch.deploy())) return true; // Deploy in LOW SPEED MODE on every probe action // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) @@ -496,9 +494,8 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { tmc_disable_stallguard(stepperZ, stealth_states.z); #endif - #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE) - if (probe_triggered && bltouch.stow()) return true; // STOW in LOW SPEED MODE on trigger on every probe action - #endif + if (probe_triggered && TERN0(BLTOUCH_SLOW_MODE, bltouch.stow())) // Stow in LOW SPEED MODE on every trigger + return true; // Clear endstop flags endstops.hit_on_purpose(); @@ -578,9 +575,10 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { // Double-probing does a fast probe followed by a slow probe #if TOTAL_PROBING == 2 - // Do a first probe at the fast speed + // Attempt to tare the probe if (TERN0(PROBE_TARE, tare())) return NAN; + // Do a first probe at the fast speed if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s, sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; From 6ec4e744c07f4035312ab4f8d377c9c2d2154d5e Mon Sep 17 00:00:00 2001 From: yysh12 Date: Wed, 23 Dec 2020 00:12:20 -0600 Subject: [PATCH 399/443] Improve plan_arc circle detection (#20440) Co-authored-by: Scott Lahteine --- Marlin/src/gcode/motion/G2_G3.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 9c6710a08de4..61e50247f3f7 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -41,13 +41,12 @@ #endif /** - * Plan an arc in 2 dimensions + * Plan an arc in 2 dimensions, with optional linear motion in a 3rd dimension * - * The arc is approximated by generating many small linear segments. - * The length of each segment is configured in MM_PER_ARC_SEGMENT (Default 1mm) - * Arcs should only be made relatively large (over 5mm), as larger arcs with - * larger segments will tend to be more efficient. Your slicer should have - * options for G2/G3 arc generation. In future these options may be GCode tunable. + * The arc is traced by generating many small linear segments, as configured by + * MM_PER_ARC_SEGMENT (Default 1mm). In the future we hope more slicers will include + * an option to generate G2/G3 arcs for curved surfaces, as this will allow faster + * boards to produce much smoother curved surfaces. */ void plan_arc( const xyze_pos_t &cart, // Destination position @@ -77,26 +76,33 @@ void plan_arc( rt_Y = cart[q_axis] - center_Q, start_L = current_position[l_axis]; - // Angle of rotation between position and target from the circle center. - float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); - #ifdef MIN_ARC_SEGMENTS uint16_t min_segments = MIN_ARC_SEGMENTS; #else constexpr uint16_t min_segments = 1; #endif - // Do a full circle if angular rotation is near 0 and the target is current position - if (!angular_travel || (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis]))) { + // Angle of rotation between position and target from the circle center. + float angular_travel; + + // Do a full circle if starting and ending positions are "identical" + if (NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) { // Preserve direction for circles angular_travel = clockwise ? -RADIANS(360) : RADIANS(360); } else { + // Calculate the angle + angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); + + // Angular travel too small to detect? Just return. + if (!angular_travel) return; + // Make sure angular travel over 180 degrees goes the other way around. switch (((angular_travel < 0) << 1) | clockwise) { case 1: angular_travel -= RADIANS(360); break; // Positive but CW? Reverse direction. case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction. } + #ifdef MIN_ARC_SEGMENTS min_segments = CEIL(min_segments * ABS(angular_travel) / RADIANS(360)); NOLESS(min_segments, 1U); From 6af6a35d9d5b1af8cb12002fd71e986f625920ae Mon Sep 17 00:00:00 2001 From: LinFor Date: Wed, 23 Dec 2020 09:51:59 +0300 Subject: [PATCH 400/443] FTDI EVE: Cyrillic font, some minor fixes (#20517) --- Marlin/Configuration_adv.h | 3 + .../ftdi_eve_lib/basic/commands.cpp | 8 + .../ftdi_eve_lib/basic/commands.h | 1 + .../ftdi_eve_lib/extended/ftdi_extended.h | 1 + .../ftdi_eve_lib/extended/text_ellipsis.cpp | 21 +- .../extended/unicode/cyrillic_char_set.cpp | 139 + .../extended/unicode/cyrillic_char_set.h | 32 + .../unicode/cyrillic_char_set_bitmap_31.h | 2529 +++++++++++++++++ .../extended/unicode/font_bitmaps.cpp | 6 +- .../extended/unicode/font_bitmaps.h | 2 +- .../cyrillic_char_set_bitmap_31.png | Bin 0 -> 34122 bytes .../cyrillic_char_set_bitmap_31.svg | 535 ++++ .../unicode/font_bitmaps/romfont_31.png | Bin 0 -> 16643 bytes .../extended/unicode/standard_char_set.cpp | 3 +- .../extended/unicode/standard_char_set.h | 2 +- .../ftdi_eve_lib/extended/unicode/unicode.cpp | 25 +- .../ftdi_eve_lib/extended/unicode/unicode.h | 5 +- .../extended/unicode/western_char_set.cpp | 15 +- .../extended/unicode/western_char_set.h | 4 +- .../ftdi_eve_lib/extras/bitmap2cpp.py | 10 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/sd/SdBaseFile.cpp | 4 +- 22 files changed, 3318 insertions(+), 29 deletions(-) create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.cpp create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.h create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.png create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.svg create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.png diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 51c2b8f99419..446b308dfb52 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1563,6 +1563,9 @@ //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ #endif + + // Cyrillic character set, costs about 27KiB of flash + //#define TOUCH_UI_UTF8_CYRILLIC_CHARSET #endif // Use a smaller font when labels don't fit buttons diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index f64f2b5b5f0b..1db1175d3c63 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -211,6 +211,14 @@ void CLCD::mem_write_32(uint32_t reg_address, uint32_t data) { spi_ftdi_deselect(); } +// Fill area of len size with repeated data bytes +void CLCD::mem_write_fill(uint32_t reg_address, uint8_t data, uint16_t len) { + spi_ftdi_select(); + spi_write_addr(reg_address); + while (len--) spi_write_8(data); + spi_ftdi_deselect(); +} + /******************* FT800/810 Co-processor Commands *********************************/ #if FTDI_API_LEVEL == 800 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h index 74a7f298002a..376beaec44e0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -115,6 +115,7 @@ class CLCD { static void mem_write_8 (uint32_t reg_address, uint8_t w_data); static void mem_write_16 (uint32_t reg_address, uint16_t w_data); static void mem_write_32 (uint32_t reg_address, uint32_t w_data); + static void mem_write_fill (uint32_t reg_address, uint8_t w_data, uint16_t len); static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding = 0); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h index 006978babb1e..505016f5b83a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -34,6 +34,7 @@ #include "unicode/unicode.h" #include "unicode/standard_char_set.h" #include "unicode/western_char_set.h" + #include "unicode/cyrillic_char_set.h" #include "unicode/font_bitmaps.h" #include "rgb_t.h" #include "bitmap_info.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index a69280f5fc2e..cdec6e5dd20a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -37,11 +37,22 @@ namespace FTDI { // split and still allow the ellipsis to fit. int16_t lineWidth = 0; char *breakPoint = str; - for (char* c = str; *c; c++) { - lineWidth += fm.get_char_width(*c); - if (lineWidth + ellipsisWidth < w) - breakPoint = c; - } + #ifdef TOUCH_UI_USE_UTF8 + char *tstr = str; + while (*tstr) { + breakPoint = tstr; + const utf8_char_t c = get_utf8_char_and_inc(tstr); + lineWidth += fm.get_char_width(c); + if (lineWidth + ellipsisWidth < w) + break; + } + #else + for (char* c = str; *c; c++) { + lineWidth += fm.get_char_width(*c); + if (lineWidth + ellipsisWidth < w) + breakPoint = c; + } + #endif if (lineWidth > w) { *breakPoint = '\0'; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.cpp new file mode 100644 index 000000000000..1c193ade4be1 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.cpp @@ -0,0 +1,139 @@ +/************************ + * cyrillic_char_set.cpp * + ************************/ + +/**************************************************************************** + * Written By Kirill Shashlov 2020 * + * Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if ALL(FTDI_EXTENDED, TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_CYRILLIC_CHARSET) + + #include "cyrillic_char_set_bitmap_31.h" + + #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) + + #define UTF8(A) uint16_t(utf8(U##A)) + + using namespace FTDI; + + constexpr static uint8_t cyrillic_font_handle = 6; + + uint32_t FTDI::CyrillicCharSet::bitmap_addr; + + /** + * Load bitmap data into RAMG. This function is called once at the start + * of the program. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + * + * Returns: Last wrote address + */ + + uint32_t FTDI::CyrillicCharSet::load_data(uint32_t addr) { + if (addr % 4 != 0) + addr += 4 - (addr % 4); + + // Load the alternative font metrics + CLCD::FontMetrics cyrillic_fm; + cyrillic_fm.ptr = addr + 148; + cyrillic_fm.format = L4; + cyrillic_fm.stride = 20; + cyrillic_fm.width = 40; + cyrillic_fm.height = 49; + LOOP_L_N(i, 127) + cyrillic_fm.char_widths[i] = 0; + + // For cyrillic characters, copy the character widths from the widths tables + LOOP_L_N(i, NUM_ELEMENTS(cyrillic_font_widths)) { + cyrillic_fm.char_widths[i] = cyrillic_font_widths[i]; + } + CLCD::mem_write_bulk(addr, &cyrillic_fm, 148); + + // Decode the RLE data and load it into RAMG as a bitmap + uint32_t lastaddr = write_rle_data(addr + 148, cyrillic_font, sizeof(cyrillic_font)); + + bitmap_addr = addr; + + return lastaddr; + } + + /** + * Populates the bitmap handles for the custom into the display list. + * This function is called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::CyrillicCharSet::load_bitmaps(CommandProcessor& cmd) { + CLCD::FontMetrics cyrillic_fm; + cyrillic_fm.ptr = bitmap_addr + 148; + cyrillic_fm.format = L4; + cyrillic_fm.stride = 20; + cyrillic_fm.width = 40; + cyrillic_fm.height = 49; + set_font_bitmap(cmd, cyrillic_fm, cyrillic_font_handle); + } + + /** + * Renders a character at location x and y. The x position is incremented + * by the width of the character. + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the character. On output, + * incremented to the location of the next character. + * + * fs - A scaling object used to scale the font. The display will + * already be configured to scale bitmaps, but positions + * must be scaled using fs.scale() + * + * c - The unicode code point to draw. If the renderer does not + * support the character, it should return false. + * + * Returns: Whether the character was supported. + */ + + bool FTDI::CyrillicCharSet::render_glyph(CommandProcessor* cmd, int &x, int &y, font_size_t fs, utf8_char_t c) { + // A supported character? + if ((c < UTF8('А') || c > UTF8('я')) && (c != UTF8('Ё')) && (c != UTF8('ё'))) return false; + + uint8_t idx = (c == UTF8('Ё')) ? 64 : + (c == UTF8('ё')) ? 65 : + (c < UTF8('р')) ? c - UTF8('А') : + c - UTF8('р') + 48 + ; + + uint8_t width = cyrillic_font_widths[idx]; + + // Draw the character + if (cmd) ext_vertex2ii(*cmd, x, y, cyrillic_font_handle, idx); + + // Increment X to the next character position + x += fs.scale(width); + return true; + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 && TOUCH_UI_UTF8_WESTERN_CHARSET diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.h new file mode 100644 index 000000000000..63493b8bb977 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set.h @@ -0,0 +1,32 @@ +/********************** + * cyrillic_char_set.h * + **********************/ + +/**************************************************************************** + * Written By Kirill Shashlov 2020 * + * Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +namespace FTDI { + class CyrillicCharSet { + private: + static uint32_t bitmap_addr; + public: + static uint32_t load_data(uint32_t addr); + static void load_bitmaps(CommandProcessor&); + static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); + }; +} diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h new file mode 100644 index 000000000000..00bfe3706b15 --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h @@ -0,0 +1,2529 @@ +/******************************** + * cyrillic_char_set_bitmap_31.h * + ********************************/ + +/**************************************************************************** + * Written By Kirill Shashlov 2020 * + * Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * Used GNU FreeFont FreeSans font (licensed under the GPL) * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +const uint8_t cyrillic_font_widths[] PROGMEM = { + 27, // А (0) + 26, // Б + 26, // В + 24, // Г + 33, // Д + 25, // Е + 37, // Ж + 26, // З + + 28, // И (8) + 28, // Й + 26, // К + 25, // Л + 33, // М + 27, // Н + 31, // О + 27, // П + + 26, // Р (16) + 29, // С + 28, // Т + 26, // У + 34, // Ф + 27, // Х + 30, // Ц + 23, // Ч + + 32, // Ш (24) + 34, // Щ + 26, // Ь + 34, // Ы + 34, // Ъ + 28, // Э + 40, // Ю + 26, // Я + + 22, // а (32) + 21, // б + 20, // в + 16, // г + 24, // д + 21, // е + 31, // ж + 19, // з + + 21, // и (40) + 21, // й + 20, // к + 19, // л + 23, // м + 21, // н + 21, // о + 21, // п + + 22, // р (48) + 20, // с + 17, // т + 19, // у + 34, // ф + 19, // х + 23, // ц + 19, // ч + 26, // ш + 28, // щ + 20, // ь + 26, // ы + 26, // ъ + 20, // э + 30, // ю + 20, // я + + 26, // Ё + 21, // ё +}; + + +/* This is a dump of "font_bitmaps/cyrillic_char_set_bitmap_31.png" + * using the tool "bitmap2cpp.py". The tool converts the image into + * 16-level grayscale and packs two pixels per byte. The resulting + * bytes are then RLE compressed to yield (count, byte) pairs. + */ + +const unsigned char cyrillic_font[] PROGMEM = { + /* 0 */ + 0xb9, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0x30, 0x10, 0x00, 0x01, 0x7f, + 0x02, 0xff, 0x01, 0x90, 0x10, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xe0, + 0x0f, 0x00, 0x01, 0x03, 0x03, 0xff, 0x01, 0xf4, 0x0f, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfb, 0x01, 0xff, 0x01, 0xfa, 0x0f, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf1, 0x02, 0xff, 0x0f, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x50, 0x0e, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x40, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xb0, 0x0d, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf1, 0x0d, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfc, 0x0d, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x20, 0x0c, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x80, 0x0c, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x10, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xf3, 0x0b, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf5, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf9, 0x0b, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xe0, 0x03, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xb4, 0x04, 0x44, 0x02, 0xff, 0x01, 0x40, + 0x0a, 0x00, 0x01, 0xaf, 0x08, 0xff, 0x01, 0xa0, 0x0a, 0x00, 0x09, 0xff, + 0x01, 0xf0, 0x09, 0x00, 0x01, 0x06, 0x02, 0xff, 0x05, 0xee, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xf5, 0x09, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x90, 0x06, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x06, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xfe, 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf2, + 0x07, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xfd, 0x07, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x30, + 0x06, 0x00, 0x01, 0x8d, 0x01, 0xdd, 0x01, 0x60, 0x08, 0x00, 0x01, 0xad, + 0x01, 0xdd, 0x01, 0x70, 0xce, 0x00, + + /* 1 */ + 0xb5, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x1f, + 0x09, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf4, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd5, 0x07, 0x55, 0x01, 0x51, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xfe, + 0x04, 0xee, 0x01, 0xdb, 0x01, 0x84, 0x0b, 0x00, 0x01, 0x1f, 0x08, 0xff, + 0x01, 0xe7, 0x0a, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xd2, 0x09, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd6, 0x04, 0x66, 0x01, 0x68, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x05, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf5, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf9, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf4, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0x80, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe7, 0x04, 0x77, 0x01, 0x89, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, + 0x01, 0xe2, 0x09, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xfb, 0x01, 0x10, + 0x09, 0x00, 0x01, 0x1d, 0x06, 0xdd, 0x01, 0xdc, 0x01, 0xb7, 0x01, 0x20, + 0xd1, 0x00, + + /* 2 */ + 0xb5, 0x00, 0x01, 0x1f, 0x06, 0xff, 0x01, 0xec, 0x01, 0x94, 0x0b, 0x00, + 0x01, 0x1f, 0x08, 0xff, 0x01, 0xc3, 0x0a, 0x00, 0x01, 0x1f, 0x09, 0xff, + 0x01, 0x40, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd6, 0x03, 0x66, + 0x01, 0x67, 0x01, 0x9d, 0x02, 0xff, 0x01, 0xe1, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xf9, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x04, + 0x02, 0xff, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x20, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x08, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0x20, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfa, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xf2, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd2, 0x03, 0x22, 0x01, 0x23, + 0x01, 0x59, 0x02, 0xff, 0x01, 0x50, 0x09, 0x00, 0x01, 0x1f, 0x08, 0xff, + 0x01, 0xd3, 0x0a, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xb3, 0x0a, 0x00, + 0x01, 0x1f, 0x09, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xd4, 0x04, 0x44, 0x01, 0x45, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x10, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, + 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf9, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf7, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf5, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x05, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xe7, 0x04, 0x77, 0x01, 0x79, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x08, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xe3, 0x09, 0x00, + 0x01, 0x1f, 0x08, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x09, 0x00, 0x01, 0x1d, + 0x07, 0xdd, 0x01, 0xb7, 0x01, 0x20, 0xd1, 0x00, + + /* 3 */ + 0xb5, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x1f, + 0x09, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf4, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd5, 0x07, 0x55, 0x01, 0x51, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xb0, 0xd8, 0x00, + + /* 4 */ + 0xb8, 0x00, 0x01, 0x08, 0x09, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, + 0x09, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x09, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x66, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf4, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf2, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xa0, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x30, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xfe, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x08, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf1, + 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x05, 0x00, 0x01, 0x02, + 0x01, 0x22, 0x01, 0x28, 0x02, 0xff, 0x01, 0xc7, 0x06, 0x77, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x52, 0x01, 0x22, 0x04, 0x00, 0x01, 0x0f, 0x0f, 0xff, + 0x04, 0x00, 0x01, 0x0f, 0x0f, 0xff, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xed, 0x0b, 0xdd, 0x01, 0xef, 0x01, 0xff, 0x04, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x04, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x50, + 0x0b, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x04, 0x00, 0x01, 0x06, 0x01, 0x66, + 0x01, 0x20, 0x0b, 0x00, 0x01, 0x26, 0x01, 0x66, 0x54, 0x00, + + /* 5 */ + 0xb5, 0x00, 0x01, 0x1f, 0x0a, 0xff, 0x09, 0x00, 0x01, 0x1f, 0x0a, 0xff, + 0x09, 0x00, 0x01, 0x1f, 0x0a, 0xff, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xd6, 0x07, 0x66, 0x01, 0x65, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc1, 0x07, 0x11, 0x01, 0x10, 0x09, 0x00, + 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf5, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, + 0x01, 0xf5, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd4, 0x07, 0x44, 0x01, 0x41, 0x09, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe7, 0x08, 0x77, 0x01, 0x50, 0x08, 0x00, + 0x01, 0x1f, 0x0a, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x1f, 0x0a, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x1e, 0x0a, 0xee, 0x01, 0xa0, 0xcf, 0x00, + + /* 6 */ + 0xb5, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xf3, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xe1, + 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x0a, 0x02, 0xff, + 0x01, 0x30, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xf5, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0x50, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x1e, + 0x01, 0xff, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xf2, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfd, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x07, 0x00, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x02, 0x02, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x05, 0x02, 0xff, + 0x01, 0x40, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x1d, 0x01, 0xff, + 0x01, 0xfa, 0x0b, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xe2, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x90, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xc0, 0x0b, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x98, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x0c, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xf3, 0x0d, 0x00, + 0x01, 0x2e, 0x05, 0xff, 0x01, 0x60, 0x0d, 0x00, 0x01, 0x07, 0x04, 0xff, + 0x01, 0xfc, 0x0e, 0x00, 0x01, 0x2e, 0x05, 0xff, 0x01, 0x60, 0x0c, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xef, 0x01, 0xff, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0x9a, 0x02, 0xff, 0x01, 0x30, 0x0b, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0xe2, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0xe2, 0x0a, 0x00, 0x01, 0x09, 0x02, 0xff, + 0x01, 0x30, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x10, 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf4, + 0x01, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x01, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x50, + 0x01, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x04, + 0x02, 0xff, 0x01, 0x90, 0x06, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0x80, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xf7, 0x06, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfa, + 0x03, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x08, + 0x02, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xb0, 0x03, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xf4, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xfc, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, + 0x01, 0x0b, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xd1, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe1, 0x02, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x20, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x90, + 0x04, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, 0x01, 0x00, + 0x01, 0x5d, 0x01, 0xdd, 0x01, 0xd3, 0x05, 0x00, 0x01, 0x3d, 0x01, 0xdd, + 0x01, 0x80, 0x04, 0x00, 0x01, 0x03, 0x02, 0xdd, 0x01, 0x90, 0xc9, 0x00, + + /* 7 */ + 0xa5, 0x00, 0x01, 0x45, 0x01, 0x67, 0x01, 0x65, 0x01, 0x20, 0x0e, 0x00, + 0x01, 0x06, 0x01, 0xcf, 0x03, 0xff, 0x01, 0xfe, 0x01, 0x92, 0x0c, 0x00, + 0x01, 0x04, 0x01, 0xef, 0x06, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0x6f, + 0x02, 0xff, 0x01, 0xfd, 0x01, 0xcb, 0x01, 0xcf, 0x02, 0xff, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x04, 0x02, 0xff, 0x01, 0xd6, 0x01, 0x10, 0x02, 0x00, + 0x01, 0x39, 0x02, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf9, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf9, 0x09, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xfe, 0x09, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x07, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x09, 0x00, 0x01, 0xac, 0x01, 0xcb, 0x07, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x04, 0x02, 0xff, + 0x11, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x01, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf5, 0x10, 0x00, 0x01, 0x5d, 0x02, 0xff, + 0x01, 0xa0, 0x0d, 0x00, 0x02, 0x99, 0x01, 0xbe, 0x02, 0xff, 0x01, 0xf8, + 0x0e, 0x00, 0x05, 0xff, 0x01, 0x40, 0x0e, 0x00, 0x05, 0xff, 0x01, 0xf9, + 0x0e, 0x00, 0x02, 0xbb, 0x01, 0xcd, 0x03, 0xff, 0x01, 0xd1, 0x10, 0x00, + 0x01, 0x16, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0x60, 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x07, 0x01, 0x99, 0x01, 0x80, 0x07, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xf0, 0x07, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf0, + 0x07, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf1, 0x07, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf2, 0x07, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, + 0x07, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xe0, 0x07, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x20, + 0x06, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0xd2, 0x05, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0x30, + 0x08, 0x00, 0x01, 0x1e, 0x02, 0xff, 0x01, 0x81, 0x03, 0x00, 0x01, 0x01, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xfa, 0x09, 0x00, 0x01, 0x03, 0x01, 0xef, + 0x02, 0xff, 0x01, 0xda, 0x01, 0x98, 0x01, 0x9a, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x2d, 0x07, 0xff, 0x01, 0xfa, 0x0c, 0x00, + 0x01, 0x6d, 0x05, 0xff, 0x01, 0xfb, 0x01, 0x30, 0x0d, 0x00, 0x01, 0x27, + 0x01, 0x9b, 0x01, 0xcd, 0x01, 0xba, 0x01, 0x95, 0x01, 0x10, 0xbe, 0x00, + + /* 8 */ + 0xb5, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x06, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x06, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x06, 0x00, 0x01, 0xcf, + 0x02, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x05, 0x00, 0x01, 0x06, 0x03, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x05, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xfa, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x1e, 0x01, 0xff, + 0x01, 0xe1, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x60, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x02, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x02, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x02, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf3, 0x02, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x80, 0x02, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfd, 0x03, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x01, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, 0x04, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x10, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x99, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x03, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x02, 0xff, 0x01, 0xf7, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x01, 0xd0, 0x06, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x01, 0x30, + 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xe8, 0x07, 0x00, 0x01, 0x0e, 0x01, 0xee, 0x01, 0xa0, + 0xce, 0x00, + + /* 9 */ + 0x2c, 0x00, 0x01, 0x7f, 0x01, 0xf1, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xe0, + 0x0d, 0x00, 0x01, 0x5f, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xb0, 0x0d, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xb6, 0x01, 0x45, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, 0x0d, 0x00, 0x01, 0x05, 0x04, 0xff, + 0x01, 0xfb, 0x0f, 0x00, 0x01, 0x5e, 0x03, 0xff, 0x01, 0x90, 0x10, 0x00, + 0x01, 0x46, 0x01, 0x87, 0x01, 0x51, 0x20, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x07, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x06, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x06, 0x00, + 0x01, 0x2f, 0x02, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x06, 0x00, 0x01, 0xbf, 0x02, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x06, 0x03, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfa, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x04, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xe1, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x60, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x04, + 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x70, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf3, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x80, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x01, 0x01, 0xef, + 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0xf5, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xb0, + 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, 0x04, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x99, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xc0, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x03, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x01, 0xf7, 0x06, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x02, 0xff, + 0x01, 0xd0, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x1f, 0x02, 0xff, 0x01, 0x30, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xe8, 0x07, 0x00, + 0x01, 0x0e, 0x01, 0xee, 0x01, 0xa0, 0xce, 0x00, + + /* 10 */ + 0xb5, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0xfa, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa0, 0x09, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x04, 0x00, 0x01, 0x1d, 0x01, 0xff, + 0x01, 0xf9, 0x0a, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, + 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x90, 0x0a, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf9, + 0x0b, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x02, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x80, 0x0c, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x01, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xf8, 0x0d, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0x80, + 0x0d, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x2e, 0x01, 0xff, + 0x01, 0xf7, 0x0e, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc3, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x70, 0x0e, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xee, + 0x01, 0xff, 0x01, 0xf7, 0x0f, 0x00, 0x01, 0x1f, 0x03, 0xff, 0x01, 0x70, + 0x0f, 0x00, 0x01, 0x1f, 0x03, 0xff, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x1f, + 0x03, 0xff, 0x01, 0xe2, 0x0f, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xdd, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0e, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc1, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe2, 0x0e, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, + 0x0d, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xe2, 0x0d, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x01, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0c, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xe2, 0x0c, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x02, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0b, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xe2, 0x0b, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x03, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x30, 0x0a, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xe3, 0x0a, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x30, 0x09, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x04, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xe3, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x30, 0x08, 0x00, + 0x01, 0x1e, 0x01, 0xee, 0x01, 0xb0, 0x05, 0x00, 0x01, 0x02, 0x01, 0xde, + 0x01, 0xee, 0x01, 0xd2, 0xcf, 0x00, + + /* 11 */ + 0xb6, 0x00, 0x01, 0x08, 0x09, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, + 0x09, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x09, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x66, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf4, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf4, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf1, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x60, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xfe, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x08, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf9, 0x06, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf2, + 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x1a, + 0x02, 0xff, 0x01, 0xa0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, + 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xf4, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, + 0x01, 0x2f, 0x01, 0xfb, 0x01, 0x20, 0x07, 0x00, 0x01, 0xae, 0x01, 0xee, + 0x01, 0x30, 0x07, 0x00, 0x01, 0x03, 0x01, 0x10, 0xc6, 0x00, + + /* 12 */ + 0xb5, 0x00, 0x01, 0x1e, 0x02, 0xee, 0x01, 0x70, 0x08, 0x00, 0x02, 0xee, + 0x01, 0xe7, 0x05, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x01, 0xc0, 0x07, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x02, 0xff, + 0x01, 0xf2, 0x07, 0x00, 0x01, 0x0b, 0x02, 0xff, 0x01, 0xf8, 0x05, 0x00, + 0x01, 0x1f, 0x02, 0xff, 0x01, 0xf7, 0x07, 0x00, 0x01, 0x1f, 0x02, 0xff, + 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x01, 0xfd, 0x07, 0x00, + 0x01, 0x6f, 0x02, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x30, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xfc, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x9d, + 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf7, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x98, + 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xe2, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x92, + 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x92, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0xdf, 0x01, 0xf9, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x42, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x7f, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xfe, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xf9, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x0c, 0x01, 0xff, 0x01, 0x90, 0x03, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x07, 0x01, 0xff, 0x01, 0xe0, + 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0x80, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x01, 0x00, 0x01, 0xcf, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x30, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0xcf, 0x01, 0xf8, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xa0, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x01, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xd0, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0xff, + 0x01, 0xf6, 0x01, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x90, 0x02, 0x00, 0x01, 0xaf, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0x10, 0x01, 0x7f, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x60, 0x01, 0xdf, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xc2, + 0x01, 0xff, 0x01, 0xf2, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, 0x01, 0x04, + 0x01, 0xff, 0x01, 0xfa, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x03, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0x70, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x03, 0x00, 0x01, 0x9f, 0x02, 0xff, 0x01, 0x20, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x03, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0x80, + 0x03, 0x00, 0x01, 0x0d, 0x01, 0xee, 0x01, 0xe6, 0x03, 0x00, 0x01, 0x02, + 0x01, 0xee, 0x01, 0xe7, 0xcc, 0x00, + + /* 13 */ + 0xb5, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x0b, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x0b, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x0b, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd4, + 0x07, 0x44, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x8e, 0x01, 0xee, 0x01, 0x40, + 0xce, 0x00, + + /* 14 */ + 0xa6, 0x00, 0x01, 0x13, 0x01, 0x56, 0x01, 0x64, 0x01, 0x31, 0x0e, 0x00, + 0x01, 0x02, 0x01, 0x8d, 0x04, 0xff, 0x01, 0xc7, 0x01, 0x10, 0x0b, 0x00, + 0x01, 0x01, 0x01, 0x9f, 0x06, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x3e, + 0x08, 0xff, 0x01, 0xd2, 0x09, 0x00, 0x01, 0x04, 0x02, 0xff, 0x01, 0xfc, + 0x01, 0x72, 0x01, 0x00, 0x01, 0x01, 0x01, 0x38, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0x30, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x50, + 0x04, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xe2, 0x07, 0x00, 0x01, 0x01, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xd1, 0x06, 0x00, 0x01, 0x2e, 0x01, 0xff, + 0x01, 0xfd, 0x07, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, + 0x06, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x60, 0x06, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xf4, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, + 0x06, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf5, 0x06, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x30, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xfd, 0x0a, 0x00, 0x02, 0xff, 0x05, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x30, + 0x04, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf4, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x70, 0x04, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x80, + 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf4, 0x0a, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x60, + 0x04, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfb, + 0x0a, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x10, 0x05, 0x00, 0x02, 0xff, + 0x01, 0x10, 0x08, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfd, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf8, 0x06, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe1, 0x08, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf1, 0x06, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xfa, 0x08, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xa0, 0x06, 0x00, + 0x01, 0x04, 0x02, 0xff, 0x01, 0x80, 0x06, 0x00, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x07, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0x01, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf5, 0x08, 0x00, + 0x01, 0x0b, 0x02, 0xff, 0x01, 0xe6, 0x01, 0x10, 0x02, 0x00, 0x01, 0x02, + 0x01, 0x8f, 0x02, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0xaf, 0x02, 0xff, + 0x01, 0xfc, 0x01, 0xa8, 0x01, 0x8a, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xf6, + 0x0a, 0x00, 0x01, 0x06, 0x01, 0xef, 0x06, 0xff, 0x01, 0xfd, 0x01, 0x40, + 0x0b, 0x00, 0x01, 0x18, 0x01, 0xef, 0x04, 0xff, 0x01, 0xfd, 0x01, 0x60, + 0x0d, 0x00, 0x01, 0x03, 0x01, 0x7a, 0x01, 0xcd, 0x01, 0xdc, 0x01, 0xa7, + 0x01, 0x30, 0xbd, 0x00, + + /* 15 */ + 0xb5, 0x00, 0x01, 0x1f, 0x0b, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x0b, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x0b, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe6, 0x07, 0x66, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9e, 0x01, 0xee, 0x01, 0x40, + 0xce, 0x00, + + /* 16 */ + 0xb5, 0x00, 0x01, 0x1e, 0x06, 0xee, 0x01, 0xec, 0x01, 0x95, 0x0b, 0x00, + 0x01, 0x1f, 0x08, 0xff, 0x01, 0xe5, 0x0a, 0x00, 0x01, 0x1f, 0x09, 0xff, + 0x01, 0x80, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd6, 0x03, 0x66, + 0x01, 0x67, 0x01, 0x9d, 0x02, 0xff, 0x01, 0xf5, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xfe, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x90, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xb0, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xa0, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x1b, 0x02, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc1, 0x03, 0x11, 0x01, 0x12, 0x01, 0x48, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xf9, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xc0, + 0x09, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x09, 0x00, + 0x01, 0x1f, 0x07, 0xff, 0x01, 0xfb, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd4, 0x04, 0x44, 0x01, 0x32, 0x0c, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xb0, 0xd8, 0x00, + + /* 17 */ + 0xa6, 0x00, 0x01, 0x35, 0x01, 0x66, 0x01, 0x54, 0x01, 0x10, 0x0e, 0x00, + 0x01, 0x06, 0x01, 0xcf, 0x03, 0xff, 0x01, 0xfd, 0x01, 0x71, 0x0c, 0x00, + 0x01, 0x05, 0x01, 0xef, 0x06, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0xaf, + 0x07, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0xd7, + 0x01, 0x20, 0x01, 0x00, 0x01, 0x03, 0x01, 0x9f, 0x02, 0xff, 0x01, 0x70, + 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x01, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf2, 0x08, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x60, 0x05, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x10, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0x60, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x60, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, 0x01, 0x05, 0x01, 0x55, + 0x01, 0x40, 0x06, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfb, 0x11, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xf5, 0x11, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, 0x11, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x11, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xf2, 0x11, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, 0x11, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf4, 0x11, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf6, 0x11, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x06, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfe, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf3, 0x07, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xf0, 0x07, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xb0, 0x07, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x1e, 0x01, 0xff, + 0x01, 0xf5, 0x07, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x60, 0x07, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x05, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x08, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xe3, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, + 0x01, 0x3f, 0x02, 0xff, 0x01, 0x92, 0x03, 0x00, 0x01, 0x29, 0x02, 0xff, + 0x01, 0xc0, 0x09, 0x00, 0x01, 0x04, 0x03, 0xff, 0x01, 0xda, 0x01, 0x88, + 0x01, 0x9c, 0x02, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x0a, 0x00, 0x01, 0x3d, + 0x07, 0xff, 0x01, 0xc1, 0x0c, 0x00, 0x01, 0x7e, 0x05, 0xff, 0x01, 0xd6, + 0x0e, 0x00, 0x01, 0x37, 0x01, 0xac, 0x01, 0xdd, 0x01, 0xca, 0x01, 0x73, + 0xbe, 0x00, + + /* 18 */ + 0xb4, 0x00, 0x01, 0x2f, 0x0b, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x2f, + 0x0b, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x2f, 0x0b, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x16, 0x04, 0x66, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xd6, + 0x04, 0x66, 0x01, 0x40, 0x0c, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x2e, 0x01, 0xee, 0x01, 0xa0, 0xd4, 0x00, + + /* 19 */ + 0xb4, 0x00, 0x01, 0x8e, 0x01, 0xee, 0x01, 0xe2, 0x07, 0x00, 0x01, 0xde, + 0x01, 0xee, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xfa, + 0x06, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x08, + 0x02, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xfa, + 0x08, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf2, + 0x05, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x20, + 0x09, 0x00, 0x01, 0x08, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xfa, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x90, 0x0b, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x20, 0x0b, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0x20, 0x01, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf9, 0x0d, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, 0x01, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf1, 0x0d, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x80, 0x0d, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x05, 0x02, 0xff, 0x01, 0x10, 0x0d, 0x00, 0x01, 0x07, + 0x02, 0xff, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf8, 0x0f, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xf1, 0x0f, 0x00, 0x01, 0x7f, + 0x03, 0xff, 0x01, 0x80, 0x0f, 0x00, 0x01, 0x0e, 0x02, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x0f, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0xf7, 0x11, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xe0, 0x10, 0x00, 0x01, 0x01, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x70, 0x10, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfe, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf6, 0x11, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0xe0, 0x10, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x60, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfe, 0x11, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xf6, 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xd0, + 0x10, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xee, 0x01, 0xec, 0xd7, 0x00, + + /* 20 */ + 0xbb, 0x00, 0x01, 0x0b, 0x01, 0xee, 0x01, 0xe2, 0x11, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf2, 0x11, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x01, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x10, + 0x0d, 0x00, 0x01, 0x48, 0x01, 0xce, 0x05, 0xff, 0x01, 0xfd, 0x01, 0x96, + 0x01, 0x10, 0x09, 0x00, 0x01, 0x7d, 0x09, 0xff, 0x01, 0xfa, 0x01, 0x20, + 0x07, 0x00, 0x01, 0x2d, 0x0b, 0xff, 0x01, 0xf6, 0x06, 0x00, 0x01, 0x03, + 0x01, 0xef, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x75, 0x01, 0x4d, 0x01, 0xff, + 0x01, 0xf6, 0x01, 0x56, 0x01, 0x9d, 0x03, 0xff, 0x01, 0x80, 0x05, 0x00, + 0x01, 0x1e, 0x02, 0xff, 0x01, 0xe6, 0x02, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x02, 0x00, 0x01, 0x3b, 0x02, 0xff, 0x01, 0xf5, 0x05, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x02, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfe, + 0x05, 0x00, 0x02, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x03, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0x50, 0x03, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfc, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, 0x03, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf0, 0x03, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf0, 0x03, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfc, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, 0x03, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x30, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, + 0x02, 0xff, 0x01, 0xd1, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf2, + 0x03, 0x00, 0x01, 0x08, 0x02, 0xff, 0x01, 0x60, 0x04, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x02, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf2, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfe, 0x05, 0x00, + 0x01, 0x1e, 0x02, 0xff, 0x01, 0xf7, 0x01, 0x10, 0x01, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf2, 0x02, 0x00, 0x01, 0x4c, 0x02, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0x04, 0x03, 0xff, 0x01, 0xfb, 0x01, 0x86, 0x01, 0x5d, + 0x01, 0xff, 0x01, 0xf6, 0x01, 0x67, 0x01, 0xae, 0x03, 0xff, 0x01, 0xa0, + 0x06, 0x00, 0x01, 0x4e, 0x0b, 0xff, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x01, + 0x01, 0x8e, 0x09, 0xff, 0x01, 0xfb, 0x01, 0x30, 0x09, 0x00, 0x01, 0x48, + 0x01, 0xbe, 0x05, 0xff, 0x01, 0xed, 0x01, 0xa6, 0x01, 0x10, 0x0d, 0x00, + 0x01, 0x1c, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x10, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf2, 0x11, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf2, + 0x11, 0x00, 0x01, 0x0b, 0x01, 0xee, 0x01, 0xe2, 0xd2, 0x00, + + /* 21 */ + 0xb4, 0x00, 0x01, 0x0b, 0x01, 0xee, 0x01, 0xec, 0x07, 0x00, 0x01, 0x2e, + 0x01, 0xee, 0x01, 0xe7, 0x07, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x80, + 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x20, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xf6, 0x09, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x80, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf3, 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x0a, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfd, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf5, 0x0b, 0x00, 0x01, 0x01, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x80, 0x02, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x90, 0x0c, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, 0x0d, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf3, 0x0e, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x80, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x70, + 0x0e, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf9, 0x01, 0xff, 0x01, 0xfc, + 0x0f, 0x00, 0x01, 0x08, 0x03, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0xcf, + 0x02, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xfc, + 0x11, 0x00, 0x01, 0xaf, 0x02, 0xff, 0x01, 0x30, 0x0f, 0x00, 0x01, 0x05, + 0x03, 0xff, 0x01, 0xd0, 0x0f, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0xff, 0x01, 0xf9, 0x0f, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x91, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x50, 0x0d, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe1, 0x0d, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xfb, 0x0d, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, + 0x01, 0x01, 0x02, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xfd, 0x03, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x03, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xfc, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0x80, + 0x03, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf4, + 0x09, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x07, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x80, 0x05, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfd, 0x07, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0xf5, 0x07, 0x00, 0x01, 0x6e, 0x01, 0xee, 0x01, 0xe3, 0x07, 0x00, + 0x01, 0x0b, 0x01, 0xee, 0x01, 0xed, 0x01, 0x10, 0xce, 0x00, + + /* 22 */ + 0xb5, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x9e, + 0x01, 0xee, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, + 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x07, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xe6, 0x07, 0x66, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x51, + 0x01, 0x10, 0x06, 0x00, 0x01, 0x1f, 0x0c, 0xff, 0x01, 0xf1, 0x06, 0x00, + 0x01, 0x1f, 0x0c, 0xff, 0x01, 0xf1, 0x06, 0x00, 0x01, 0x1f, 0x0c, 0xff, + 0x01, 0xf1, 0x11, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf1, 0x11, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf1, 0x11, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf1, 0x11, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf1, 0x11, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf1, 0x11, 0x00, 0x01, 0x01, 0x01, 0x77, + 0x01, 0x70, 0x55, 0x00, + + /* 23 */ + 0xb4, 0x00, 0x01, 0x04, 0x01, 0xee, 0x01, 0xe8, 0x06, 0x00, 0x01, 0xbe, + 0x01, 0xee, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfa, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x09, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xba, 0x04, 0xaa, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0x0b, 0x09, 0xff, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0x8f, 0x08, 0xff, 0x01, 0x10, 0x0a, 0x00, + 0x01, 0x01, 0x01, 0x69, 0x05, 0xaa, 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x11, 0x00, 0x01, 0xbe, + 0x01, 0xee, 0x01, 0x10, 0xd0, 0x00, + + /* 24 */ + 0xb5, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe6, 0x03, 0x66, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xe6, 0x03, 0x66, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x0d, 0xff, 0x01, 0xd0, 0x05, 0x00, 0x01, 0x1f, + 0x0d, 0xff, 0x01, 0xd0, 0x05, 0x00, 0x01, 0x1f, 0x0d, 0xff, 0x01, 0xc0, + 0xcc, 0x00, + + /* 25 */ + 0xb5, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x1e, + 0x01, 0xee, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe6, 0x03, 0x66, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xe6, 0x03, 0x66, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd1, + 0x01, 0x10, 0x04, 0x00, 0x01, 0x1f, 0x0e, 0xff, 0x01, 0xfa, 0x04, 0x00, + 0x01, 0x1f, 0x0e, 0xff, 0x01, 0xfa, 0x04, 0x00, 0x01, 0x1f, 0x0e, 0xff, + 0x01, 0xfa, 0x12, 0x00, 0x01, 0xbf, 0x01, 0xfa, 0x12, 0x00, 0x01, 0xbf, + 0x01, 0xfa, 0x12, 0x00, 0x01, 0xbf, 0x01, 0xfa, 0x12, 0x00, 0x01, 0xbf, + 0x01, 0xfa, 0x12, 0x00, 0x01, 0xbf, 0x01, 0xfa, 0x12, 0x00, 0x01, 0x57, + 0x01, 0x74, 0x53, 0x00, + + /* 26 */ + 0xb5, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe8, + 0x03, 0x88, 0x01, 0x76, 0x01, 0x53, 0x0c, 0x00, 0x01, 0x1f, 0x07, 0xff, + 0x01, 0xfb, 0x01, 0x50, 0x0a, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xfd, + 0x01, 0x30, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xfc, 0x03, 0xcc, + 0x01, 0xcd, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf5, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x04, 0x00, 0x01, 0x01, 0x01, 0x7e, 0x02, 0xff, + 0x01, 0x20, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf9, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x06, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x05, 0x00, 0x01, 0x1a, 0x02, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd6, 0x04, 0x66, 0x01, 0x7b, 0x02, 0xff, 0x01, 0xf9, + 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x1f, + 0x08, 0xff, 0x01, 0xe6, 0x0a, 0x00, 0x01, 0x1e, 0x06, 0xee, 0x01, 0xed, + 0x01, 0xa5, 0xd2, 0x00, + + /* 27 */ + 0xb5, 0x00, 0x01, 0x1e, 0x01, 0xee, 0x01, 0xb0, 0x0a, 0x00, 0x01, 0x3e, + 0x01, 0xee, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xe8, 0x03, 0x88, 0x01, 0x76, 0x01, 0x52, 0x05, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x07, 0xff, + 0x01, 0xfb, 0x01, 0x50, 0x03, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, + 0x04, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xfd, 0x01, 0x30, 0x02, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xfd, 0x04, 0xdd, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x04, 0x00, 0x01, 0x01, 0x01, 0x7e, 0x02, 0xff, 0x01, 0x20, + 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x02, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xb0, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xf1, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xf6, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf6, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xc0, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x1a, 0x02, 0xff, + 0x01, 0x40, 0x01, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd6, 0x04, 0x66, 0x01, 0x7a, 0x02, 0xff, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, + 0x01, 0x1f, 0x09, 0xff, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1f, 0x08, 0xff, 0x01, 0xe6, 0x03, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x1e, 0x06, 0xee, + 0x01, 0xed, 0x01, 0xa5, 0x04, 0x00, 0x01, 0x3e, 0x01, 0xee, 0x01, 0xa0, + 0xcb, 0x00, + + /* 28 */ + 0xb4, 0x00, 0x01, 0x2e, 0x06, 0xee, 0x01, 0x50, 0x0c, 0x00, 0x01, 0x2f, + 0x06, 0xff, 0x01, 0x50, 0x0c, 0x00, 0x01, 0x2f, 0x06, 0xff, 0x01, 0x50, + 0x0c, 0x00, 0x01, 0x17, 0x04, 0x77, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x11, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, + 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x11, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, + 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x11, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0xb8, 0x03, 0x88, 0x01, 0x76, 0x01, 0x41, 0x0c, 0x00, + 0x01, 0x8f, 0x07, 0xff, 0x01, 0xe8, 0x01, 0x20, 0x0a, 0x00, 0x01, 0x8f, + 0x08, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xed, + 0x04, 0xdd, 0x03, 0xff, 0x01, 0xc0, 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, + 0x01, 0x50, 0x04, 0x00, 0x01, 0x03, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xfb, + 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x05, 0x00, 0x01, 0x07, + 0x02, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, + 0x06, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xe0, + 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, + 0x06, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, + 0x06, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x05, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x50, + 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x05, 0x00, 0x01, 0x4e, + 0x01, 0xff, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x96, + 0x04, 0x66, 0x01, 0x8d, 0x02, 0xff, 0x01, 0xf3, 0x09, 0x00, 0x01, 0x8f, + 0x08, 0xff, 0x01, 0xfe, 0x01, 0x40, 0x09, 0x00, 0x01, 0x8f, 0x08, 0xff, + 0x01, 0xb2, 0x0a, 0x00, 0x01, 0x7e, 0x06, 0xee, 0x01, 0xec, 0x01, 0x83, + 0xce, 0x00, + + /* 29 */ + 0xa5, 0x00, 0x01, 0x14, 0x01, 0x56, 0x01, 0x54, 0x01, 0x20, 0x0e, 0x00, + 0x01, 0x02, 0x01, 0x8e, 0x03, 0xff, 0x01, 0xfe, 0x01, 0xa4, 0x0d, 0x00, + 0x01, 0x8f, 0x06, 0xff, 0x01, 0xc2, 0x0b, 0x00, 0x01, 0x0c, 0x08, 0xff, + 0x01, 0x50, 0x0a, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x73, + 0x01, 0x00, 0x01, 0x01, 0x01, 0x49, 0x02, 0xff, 0x01, 0xf6, 0x09, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x2c, 0x02, 0xff, + 0x01, 0x30, 0x08, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xd0, 0x06, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0x60, 0x06, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xfe, 0x08, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x55, 0x01, 0x54, + 0x08, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x90, 0x11, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, + 0x11, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf4, 0x0a, 0x00, 0x01, 0xbf, + 0x08, 0xff, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0xbf, 0x08, 0xff, 0x01, 0xf6, + 0x0a, 0x00, 0x01, 0xbf, 0x08, 0xff, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0x35, + 0x06, 0x55, 0x01, 0x5a, 0x01, 0xff, 0x01, 0xf6, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf5, 0x11, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, + 0x06, 0x00, 0x01, 0x09, 0x01, 0xee, 0x01, 0xe5, 0x08, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf0, 0x06, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf8, + 0x08, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xd0, 0x06, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xfd, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, + 0x06, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x90, + 0x06, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xf3, 0x06, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf3, + 0x08, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x04, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0xe6, 0x03, 0x00, 0x01, 0x03, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xfd, + 0x0a, 0x00, 0x01, 0x5f, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x87, 0x01, 0x8a, + 0x01, 0xef, 0x02, 0xff, 0x01, 0xd1, 0x0a, 0x00, 0x01, 0x04, 0x01, 0xef, + 0x06, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x0b, 0x00, 0x01, 0x19, 0x05, 0xff, + 0x01, 0xfc, 0x01, 0x50, 0x0d, 0x00, 0x01, 0x15, 0x01, 0x9b, 0x01, 0xde, + 0x01, 0xdc, 0x01, 0xa7, 0x01, 0x20, 0xbe, 0x00, + + /* 30 */ + 0xab, 0x00, 0x01, 0x13, 0x01, 0x56, 0x01, 0x54, 0x01, 0x20, 0x06, 0x00, + 0x01, 0x1e, 0x01, 0xee, 0x01, 0xb0, 0x05, 0x00, 0x01, 0x02, 0x01, 0x8d, + 0x03, 0xff, 0x01, 0xfe, 0x01, 0x93, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x04, 0x00, 0x01, 0x01, 0x01, 0x9f, 0x06, 0xff, 0x01, 0xb2, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x04, 0x00, 0x01, 0x3e, + 0x08, 0xff, 0x01, 0x50, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, + 0x03, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0xfc, 0x01, 0x62, 0x01, 0x00, + 0x01, 0x02, 0x01, 0x6b, 0x02, 0xff, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x40, 0x04, 0x00, 0x01, 0x3d, 0x02, 0xff, 0x01, 0x30, 0x02, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0xd1, 0x05, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xd0, + 0x02, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x04, + 0x02, 0xff, 0x01, 0x10, 0x06, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf6, 0x07, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, + 0x02, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x40, + 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x80, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x90, + 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x20, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf0, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfc, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, + 0x01, 0x1f, 0x05, 0xff, 0x01, 0xfb, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf4, 0x01, 0x00, 0x01, 0x1f, 0x05, 0xff, 0x01, 0xfa, 0x09, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xf5, 0x01, 0x00, 0x01, 0x1f, 0x05, 0xff, + 0x01, 0xf9, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf5, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe5, 0x01, 0x55, 0x01, 0x57, 0x01, 0xff, + 0x01, 0xfa, 0x09, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfb, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0xff, 0x01, 0xfd, + 0x09, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, 0x01, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x10, + 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, + 0x08, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xb0, + 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, 0x01, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x07, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfe, 0x02, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x07, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x02, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x70, + 0x06, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xd0, 0x02, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf7, + 0x05, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x30, 0x02, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0xc4, + 0x03, 0x00, 0x01, 0x03, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xf6, 0x03, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x9f, 0x02, 0xff, + 0x01, 0xea, 0x01, 0x87, 0x01, 0x8a, 0x01, 0xef, 0x02, 0xff, 0x01, 0x50, + 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x06, + 0x07, 0xff, 0x01, 0xd4, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, + 0x05, 0x00, 0x01, 0x19, 0x05, 0xff, 0x01, 0xe7, 0x0e, 0x00, 0x01, 0x04, + 0x01, 0x9b, 0x01, 0xce, 0x01, 0xdc, 0x01, 0x95, 0xb9, 0x00, + + /* 31 */ + 0xb7, 0x00, 0x01, 0x04, 0x01, 0x9c, 0x01, 0xde, 0x06, 0xee, 0x01, 0xc0, + 0x09, 0x00, 0x01, 0x04, 0x01, 0xdf, 0x08, 0xff, 0x01, 0xd0, 0x09, 0x00, + 0x01, 0x6f, 0x09, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x04, 0x02, 0xff, + 0x01, 0xfb, 0x01, 0x87, 0x04, 0x77, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd0, + 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x20, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0xe1, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x60, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xd0, 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x06, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x10, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xd0, 0x08, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfa, 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xd0, 0x08, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xe8, + 0x01, 0x54, 0x04, 0x44, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xd0, 0x09, 0x00, + 0x01, 0x4f, 0x09, 0xff, 0x01, 0xd0, 0x09, 0x00, 0x01, 0x03, 0x01, 0xdf, + 0x08, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0x05, 0x01, 0xae, 0x07, 0xff, + 0x01, 0xd0, 0x0c, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x32, + 0x01, 0x22, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xd0, 0x0c, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0xe2, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, + 0x0b, 0x00, 0x01, 0x08, 0x02, 0xff, 0x01, 0x30, 0x02, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf5, + 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0x04, + 0x02, 0xff, 0x01, 0x60, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xd0, 0x09, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x90, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x09, 0x00, + 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xd0, 0x09, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x10, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, + 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xe1, 0x06, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0x20, + 0x06, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, 0x07, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xf4, 0x07, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xd0, + 0xcf, 0x00, + + /* 32 */ + 0xff, 0x00, 0x45, 0x00, 0x01, 0x01, 0x01, 0x11, 0x10, 0x00, 0x01, 0x02, + 0x01, 0x8d, 0x02, 0xff, 0x01, 0xfd, 0x01, 0x93, 0x0e, 0x00, 0x01, 0x9f, + 0x05, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x0b, 0x06, 0xff, 0x01, 0xfb, + 0x0c, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x42, 0x01, 0x12, + 0x01, 0x4a, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x30, 0x03, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xb0, + 0x0a, 0x00, 0x01, 0x02, 0x01, 0xdd, 0x01, 0xd5, 0x04, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xc0, + 0x11, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xc0, 0x0e, 0x00, 0x01, 0x02, + 0x01, 0x57, 0x01, 0xad, 0x02, 0xff, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x16, + 0x01, 0xad, 0x05, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0x09, 0x04, 0xff, + 0x01, 0xfe, 0x01, 0x9d, 0x01, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0xcf, + 0x02, 0xff, 0x01, 0xc9, 0x01, 0x64, 0x01, 0x10, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x71, + 0x03, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x70, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xc0, + 0x0a, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0x83, + 0x01, 0x12, 0x01, 0x48, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf4, 0x0b, 0x00, + 0x01, 0xcf, 0x05, 0xff, 0x01, 0x76, 0x02, 0xff, 0x01, 0xf6, 0x0a, 0x00, + 0x01, 0x1b, 0x04, 0xff, 0x01, 0xc3, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x39, 0x01, 0xce, 0x01, 0xdc, 0x01, 0x94, + 0x02, 0x00, 0x01, 0x2a, 0x01, 0xde, 0x01, 0xb3, 0xbd, 0x00, + + /* 33 */ + 0x93, 0x00, 0x01, 0x03, 0x01, 0xcc, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xd0, 0x10, 0x00, 0x01, 0x26, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xa0, 0x0d, 0x00, 0x01, 0x02, 0x01, 0x69, 0x01, 0xbe, 0x03, 0xff, + 0x01, 0x40, 0x0c, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x04, 0xff, 0x01, 0xf6, + 0x0d, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0xfe, 0x01, 0xa6, 0x01, 0x10, + 0x0d, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x85, 0x01, 0x10, + 0x0e, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, 0x11, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x40, 0x11, 0x00, 0x01, 0x7f, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x10, 0x0f, 0x00, 0x01, 0xdf, 0x01, 0xe0, 0x01, 0x3a, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xfb, 0x01, 0x71, 0x0c, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0x99, 0x04, 0xff, 0x01, 0xfe, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xdf, 0x05, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x08, + 0x02, 0xff, 0x01, 0xfe, 0x01, 0x72, 0x01, 0x11, 0x01, 0x5b, 0x02, 0xff, + 0x01, 0x50, 0x0a, 0x00, 0x01, 0x0b, 0x02, 0xff, 0x01, 0xc1, 0x03, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xe1, 0x0a, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf7, + 0x0a, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x04, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf1, + 0x05, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x50, + 0x09, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x80, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x05, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x50, + 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf1, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, + 0x04, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfd, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf6, + 0x0b, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xe3, 0x03, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xa6, + 0x01, 0x45, 0x01, 0x8e, 0x02, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x01, + 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x08, 0x04, 0xff, + 0x01, 0xfc, 0x01, 0x30, 0x0e, 0x00, 0x01, 0x16, 0x01, 0xac, 0x01, 0xed, + 0x01, 0xc8, 0x01, 0x30, 0xc0, 0x00, + + /* 34 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x04, 0x77, 0x01, 0x63, 0x0e, 0x00, + 0x01, 0xef, 0x05, 0xff, 0x01, 0xd5, 0x0d, 0x00, 0x01, 0xef, 0x06, 0xff, + 0x01, 0x60, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x02, 0x99, 0x01, 0xac, + 0x02, 0xff, 0x01, 0xf1, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, + 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf7, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xe0, + 0x0c, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x02, 0x99, 0x01, 0xac, 0x02, 0xff, + 0x01, 0x40, 0x0c, 0x00, 0x01, 0xef, 0x05, 0xff, 0x01, 0xf3, 0x0d, 0x00, + 0x01, 0xef, 0x05, 0xff, 0x01, 0xfe, 0x01, 0x60, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xfc, 0x03, 0x88, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x02, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x30, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x04, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xfa, 0x03, 0x22, 0x01, 0x4b, 0x02, 0xff, 0x01, 0x10, + 0x0b, 0x00, 0x01, 0xef, 0x06, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0xef, + 0x06, 0xff, 0x01, 0x80, 0x0c, 0x00, 0x01, 0xef, 0x04, 0xff, 0x01, 0xfd, + 0x01, 0x93, 0xd4, 0x00, + + /* 35 */ + 0xff, 0x00, 0x56, 0x00, 0x06, 0x77, 0x01, 0x70, 0x0d, 0x00, 0x01, 0xef, + 0x05, 0xff, 0x01, 0xf0, 0x0d, 0x00, 0x01, 0xef, 0x05, 0xff, 0x01, 0xf0, + 0x0d, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x04, 0x99, 0x01, 0x90, 0x0d, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0xd9, 0x00, + + /* 36 */ + 0xff, 0x00, 0x58, 0x00, 0x01, 0x57, 0x06, 0x77, 0x01, 0x20, 0x0c, 0x00, + 0x01, 0xcf, 0x06, 0xff, 0x01, 0x50, 0x0c, 0x00, 0x01, 0xdf, 0x06, 0xff, + 0x01, 0x50, 0x0c, 0x00, 0x01, 0xdf, 0x01, 0xfd, 0x03, 0x99, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x50, 0x0c, 0x00, 0x01, 0xdf, 0x01, 0xfa, 0x03, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xfa, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xfa, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0c, 0x00, + 0x01, 0xef, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, + 0x0c, 0x00, 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0x50, 0x0c, 0x00, 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, + 0x0b, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf3, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf0, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, + 0x0b, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x90, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0x30, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x50, + 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xfd, 0x04, 0x22, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x50, 0x09, 0x00, 0x01, 0x6a, 0x01, 0xae, 0x08, 0xff, + 0x01, 0xca, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x9f, 0x0a, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0x9f, 0x0a, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, + 0x01, 0xf5, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, + 0x01, 0xf5, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, + 0x01, 0xf5, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, + 0x01, 0xf5, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x8e, + 0x01, 0xe5, 0x08, 0x00, 0x01, 0xde, 0x01, 0xe0, 0x6c, 0x00, + + /* 37 */ + 0xff, 0x00, 0x58, 0x00, 0x01, 0x28, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfc, + 0x01, 0x71, 0x0e, 0x00, 0x01, 0x09, 0x05, 0xff, 0x01, 0x60, 0x0c, 0x00, + 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x73, 0x01, 0x11, 0x01, 0x5b, 0x02, 0xff, + 0x01, 0x50, 0x0b, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xc1, 0x03, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xe0, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xfe, + 0x01, 0x10, 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf5, 0x05, 0x00, 0x01, 0xdf, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x0a, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xb0, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x30, 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xc6, 0x05, 0x66, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x60, 0x09, 0x00, + 0x01, 0x1f, 0x09, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x2f, 0x09, 0xff, + 0x01, 0x80, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xb6, 0x07, 0x66, + 0x01, 0x30, 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x80, 0x11, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, 0x11, 0x00, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0xf0, 0x05, 0x00, 0x01, 0x48, 0x01, 0x88, 0x0a, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xef, 0x01, 0xfc, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd2, 0x03, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe1, 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, + 0x01, 0xa6, 0x01, 0x45, 0x01, 0x7c, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, + 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf6, 0x0d, 0x00, 0x01, 0x08, + 0x04, 0xff, 0x01, 0xfd, 0x01, 0x40, 0x0e, 0x00, 0x01, 0x16, 0x01, 0xad, + 0x01, 0xee, 0x01, 0xc9, 0x01, 0x40, 0xc0, 0x00, + + /* 38 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x03, 0x02, 0x77, 0x03, 0x00, 0x01, 0x01, + 0x01, 0x77, 0x01, 0x71, 0x03, 0x00, 0x01, 0x06, 0x01, 0x77, 0x01, 0x73, + 0x06, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xb0, 0x02, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xb0, + 0x06, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfb, 0x02, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfb, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x02, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xc0, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfa, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf4, 0x01, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x93, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xc1, + 0x0c, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfb, 0x01, 0xff, 0x01, 0xfb, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x0d, 0x00, 0x01, 0xcf, 0x04, 0xff, + 0x01, 0xd1, 0x0e, 0x00, 0x01, 0x0d, 0x03, 0xff, 0x01, 0xfd, 0x01, 0x10, + 0x0e, 0x00, 0x01, 0x5f, 0x04, 0xff, 0x01, 0x60, 0x0d, 0x00, 0x01, 0x05, + 0x05, 0xff, 0x01, 0xf6, 0x0d, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xe5, + 0x01, 0xff, 0x01, 0xf5, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x23, 0x01, 0xff, 0x01, 0xf4, + 0x01, 0x1d, 0x01, 0xff, 0x01, 0xf7, 0x0b, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0xe2, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x20, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xd1, + 0x01, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x01, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x70, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x10, 0x01, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, + 0x02, 0x00, 0x01, 0x1c, 0x01, 0xff, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xd1, 0x02, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf4, + 0x02, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, 0x02, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x1c, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd1, 0x03, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x80, 0xcc, 0x00, + + /* 39 */ + 0xff, 0x00, 0x45, 0x00, 0x01, 0x01, 0x11, 0x00, 0x01, 0x17, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0xa5, 0x0e, 0x00, 0x01, 0x06, 0x05, 0xff, + 0x01, 0xd3, 0x0d, 0x00, 0x01, 0x5f, 0x06, 0xff, 0x01, 0x30, 0x0c, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xc5, 0x01, 0x21, 0x01, 0x26, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfb, + 0x03, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, 0x0b, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf3, 0x03, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, + 0x0b, 0x00, 0x01, 0x05, 0x01, 0x88, 0x01, 0x80, 0x04, 0x00, 0x01, 0xff, + 0x01, 0xfa, 0x11, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf9, 0x11, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf4, 0x0e, 0x00, 0x01, 0x01, 0x01, 0x33, + 0x01, 0x36, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x0e, 0x00, 0x01, 0x09, + 0x03, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x09, 0x03, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x08, 0x01, 0xee, 0x03, 0xff, + 0x01, 0xe3, 0x10, 0x00, 0x01, 0x01, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfd, + 0x11, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x06, + 0x01, 0x66, 0x01, 0x30, 0x04, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x70, + 0x0a, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x80, 0x0a, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf1, + 0x04, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x60, 0x0a, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x04, 0x02, 0xff, 0x01, 0x10, + 0x0a, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0xe8, 0x01, 0x53, 0x01, 0x46, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0x7f, 0x06, 0xff, + 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xef, 0x04, 0xff, 0x01, 0xf7, + 0x0e, 0x00, 0x01, 0x05, 0x01, 0x9c, 0x01, 0xde, 0x01, 0xdc, 0x01, 0x95, + 0xc1, 0x00, + + /* 40 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x74, 0x04, 0x00, 0x01, 0x05, + 0x01, 0x77, 0x01, 0x76, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x03, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x0e, 0x02, 0xff, 0x01, 0xfe, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xcf, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xe1, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0x70, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0xcf, 0x01, 0xfd, 0x01, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x9f, 0x01, 0xfe, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xb0, 0x01, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xe0, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0xdf, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x9f, + 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf3, 0x03, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xa0, + 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x02, 0xff, + 0x01, 0x10, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xfe, + 0xd2, 0x00, + + /* 41 */ + 0xca, 0x00, 0x01, 0x2a, 0x01, 0xa2, 0x03, 0x00, 0x01, 0x3a, 0x01, 0xa2, + 0x0d, 0x00, 0x01, 0x2f, 0x01, 0xf9, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xf1, + 0x0d, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x82, 0x01, 0x00, 0x01, 0x29, + 0x01, 0xff, 0x01, 0xc0, 0x0d, 0x00, 0x01, 0x05, 0x05, 0xff, 0x01, 0x30, + 0x0e, 0x00, 0x01, 0x7f, 0x03, 0xff, 0x01, 0xf6, 0x0f, 0x00, 0x01, 0x02, + 0x01, 0x8b, 0x01, 0xdd, 0x01, 0xb8, 0x01, 0x10, 0x21, 0x00, 0x01, 0x67, + 0x01, 0x74, 0x04, 0x00, 0x01, 0x05, 0x01, 0x77, 0x01, 0x76, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xfe, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x05, + 0x02, 0xff, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, + 0x01, 0x0e, 0x02, 0xff, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xcf, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf1, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x70, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0xcf, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf4, + 0x01, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, 0x01, 0x9f, + 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xe0, 0x02, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0xdf, + 0x01, 0xfc, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, + 0x02, 0xff, 0x01, 0xf3, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, + 0x01, 0xef, 0x02, 0xff, 0x01, 0xa0, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfe, + 0x0b, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0x10, 0x03, 0x00, 0x01, 0x9f, + 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0xd2, 0x00, + + /* 42 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x74, 0x04, 0x00, 0x01, 0x67, + 0x01, 0x77, 0x01, 0x10, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x60, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf5, 0x0d, 0x00, + 0x01, 0xef, 0x01, 0xf8, 0x02, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x50, + 0x0d, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0xf5, 0x0e, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x50, 0x0e, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf4, 0x0f, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x40, 0x0f, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf4, + 0x10, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0xef, + 0x02, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xfa, + 0x10, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xb0, + 0x0f, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfb, + 0x0f, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xb0, 0x0e, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfb, 0x0e, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0xc0, 0x0d, 0x00, 0x01, 0xef, 0x01, 0xf8, + 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfc, 0x0d, 0x00, 0x01, 0xef, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xc0, 0x0c, 0x00, + 0x01, 0xef, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfc, + 0x0c, 0x00, 0x01, 0xef, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0xc1, 0xd2, 0x00, + + /* 43 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x02, 0x06, 0x77, 0x01, 0x75, 0x0c, 0x00, + 0x01, 0x05, 0x06, 0xff, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x05, 0x06, 0xff, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfb, 0x03, 0xaa, + 0x01, 0xef, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf2, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, + 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, 0x01, 0xbf, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, + 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, + 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xf0, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf0, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, + 0x0c, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0xbf, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x80, 0x03, 0x00, + 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x40, + 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x10, 0x03, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0b, 0x00, 0x01, 0x04, + 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xfc, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xfc, + 0x0b, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x70, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0xfc, 0x0b, 0x00, 0x01, 0x9f, 0x01, 0xf6, 0x05, 0x00, 0x01, 0xbf, + 0x01, 0xfc, 0x0b, 0x00, 0x01, 0x34, 0xc7, 0x00, + + /* 44 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x77, 0x01, 0x30, 0x04, 0x00, + 0x01, 0x03, 0x02, 0x77, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xd0, + 0x04, 0x00, 0x01, 0x0b, 0x02, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xf3, 0x04, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0xfa, 0x04, 0x00, 0x01, 0x9f, 0x02, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x02, 0xff, 0x01, 0x10, 0x03, 0x00, 0x03, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x02, 0xff, 0x01, 0x80, 0x02, 0x00, 0x01, 0x06, 0x03, 0xff, + 0x0a, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xe0, 0x02, 0x00, 0x01, 0x0d, + 0x03, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0xdf, 0x01, 0xfc, 0x02, 0x00, 0x01, 0xaf, + 0x01, 0xfe, 0x01, 0x8f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0x30, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf8, + 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x7f, + 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0xf1, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x7f, 0x01, 0xff, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0x40, 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0xcf, 0x01, 0xfd, 0x01, 0xcf, + 0x01, 0xfe, 0x01, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x6f, 0x02, 0xff, 0x01, 0xf7, 0x01, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, + 0x01, 0x0f, 0x02, 0xff, 0x01, 0xf1, 0x01, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x09, 0x02, 0xff, + 0x01, 0xa0, 0x01, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0xcf, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x5f, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x06, 0x01, 0x61, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x0a, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x06, 0x00, 0x01, 0x7f, 0x01, 0xff, 0xd1, 0x00, + + /* 45 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x74, 0x05, 0x00, 0x01, 0x77, + 0x01, 0x73, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x05, 0xaa, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x07, 0xff, 0x01, 0xf8, 0x0b, 0x00, + 0x01, 0xef, 0x07, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xfc, + 0x05, 0x77, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf8, 0xd2, 0x00, + + /* 46 */ + 0xff, 0x00, 0x58, 0x00, 0x01, 0x39, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xeb, + 0x01, 0x60, 0x0e, 0x00, 0x01, 0x1b, 0x04, 0xff, 0x01, 0xfe, 0x01, 0x50, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0xef, 0x05, 0xff, 0x01, 0xf8, 0x0c, 0x00, + 0x01, 0x0d, 0x02, 0xff, 0x01, 0x83, 0x01, 0x12, 0x01, 0x5c, 0x02, 0xff, + 0x01, 0x50, 0x0b, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xd1, 0x03, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xe1, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf7, + 0x0a, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf1, + 0x05, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x50, + 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, + 0x05, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x05, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x50, + 0x09, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf1, 0x05, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x10, 0x09, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, + 0x04, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfd, 0x0b, 0x00, 0x02, 0xff, + 0x01, 0x20, 0x03, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf6, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xe3, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xd0, 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xa5, 0x01, 0x34, + 0x01, 0x7e, 0x02, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xcf, + 0x05, 0xff, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x19, 0x04, 0xff, 0x01, 0xfc, + 0x01, 0x30, 0x0e, 0x00, 0x01, 0x27, 0x01, 0xbd, 0x01, 0xee, 0x01, 0xc9, + 0x01, 0x40, 0xc0, 0x00, + + /* 47 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x07, 0x77, 0x01, 0x73, 0x0b, 0x00, + 0x01, 0xef, 0x07, 0xff, 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x07, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x05, 0xaa, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0xd2, 0x00, + + /* 48 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x72, 0x01, 0x00, 0x01, 0x29, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc7, 0x01, 0x10, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf4, 0x01, 0x08, 0x04, 0xff, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf4, 0x01, 0xaf, 0x05, 0xff, 0x01, 0x80, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xfc, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x42, 0x01, 0x37, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x30, 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf3, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x70, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf2, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfe, + 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf4, + 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x70, 0x0a, 0x00, 0x01, 0xef, + 0x02, 0xff, 0x01, 0x40, 0x02, 0x00, 0x01, 0x1b, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x64, + 0x01, 0x58, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf5, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0xaf, 0x05, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x08, 0x04, 0xff, 0x01, 0xe4, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x28, 0x01, 0xce, 0x01, 0xed, 0x01, 0xa5, + 0x0d, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xde, 0x01, 0xe8, + 0x25, 0x00, + + /* 49 */ + 0xff, 0x00, 0x58, 0x00, 0x01, 0x38, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xea, + 0x01, 0x50, 0x0e, 0x00, 0x01, 0x19, 0x04, 0xff, 0x01, 0xfd, 0x01, 0x20, + 0x0c, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf2, 0x0c, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x73, 0x01, 0x12, 0x01, 0x6d, + 0x01, 0xff, 0x01, 0xfd, 0x0c, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xc1, + 0x03, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xb0, + 0x0a, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf6, 0x04, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf0, 0x0a, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf1, + 0x04, 0x00, 0x01, 0x04, 0x01, 0xbb, 0x01, 0xb1, 0x0a, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x11, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x70, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, + 0x11, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, 0x11, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x55, 0x01, 0x52, 0x0a, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf1, 0x04, 0x00, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xf4, 0x0a, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf6, 0x04, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf1, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xc0, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xd2, 0x02, 0x00, 0x01, 0x01, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0x94, + 0x01, 0x34, 0x01, 0x8e, 0x01, 0xff, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x01, + 0x01, 0xdf, 0x05, 0xff, 0x01, 0xe1, 0x0d, 0x00, 0x01, 0x19, 0x04, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x27, 0x01, 0xcd, 0x01, 0xee, + 0x01, 0xc8, 0x01, 0x20, 0xc0, 0x00, + + /* 50 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x47, 0x06, 0x77, 0x01, 0x76, 0x0c, 0x00, + 0x01, 0x9f, 0x06, 0xff, 0x01, 0xfe, 0x0c, 0x00, 0x01, 0x9f, 0x06, 0xff, + 0x01, 0xfe, 0x0c, 0x00, 0x01, 0x6a, 0x02, 0xaa, 0x01, 0xdf, 0x01, 0xff, + 0x02, 0xaa, 0x01, 0xa9, 0x0f, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, 0x01, 0x9f, 0x01, 0xfe, 0x12, 0x00, + 0x01, 0x9f, 0x01, 0xfe, 0xd7, 0x00, + + /* 51 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x67, 0x01, 0x75, 0x05, 0x00, 0x01, 0x05, + 0x01, 0x77, 0x01, 0x70, 0x0a, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0x50, 0x04, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x50, 0x0a, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x0b, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf0, 0x03, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xf9, 0x0b, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, + 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xfb, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xd0, 0x0c, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x70, + 0x0c, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, + 0x02, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf1, 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, 0x0d, 0x00, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, 0x01, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf0, 0x0e, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0x90, 0x0e, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x10, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0x40, 0x0e, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0x50, 0x01, 0xbf, 0x01, 0xfd, 0x0f, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xb1, 0x01, 0xff, 0x01, 0xf8, 0x0f, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xf7, 0x01, 0xff, 0x01, 0xf2, 0x0f, 0x00, 0x01, 0x03, 0x03, 0xff, + 0x01, 0xc0, 0x10, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0x60, 0x10, 0x00, + 0x01, 0x8f, 0x02, 0xff, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfa, + 0x11, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf4, 0x11, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x80, + 0x11, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x20, 0x11, 0x00, 0x01, 0xef, + 0x01, 0xfc, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, 0x0f, 0x00, + 0x01, 0x05, 0x01, 0x76, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x0f, 0x00, + 0x01, 0x09, 0x03, 0xff, 0x01, 0x50, 0x0f, 0x00, 0x01, 0x09, 0x02, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x05, 0x01, 0xce, 0x01, 0xda, 0x01, 0x30, + 0x24, 0x00, + + /* 52 */ + 0xe3, 0x00, 0x01, 0x05, 0x01, 0x99, 0x01, 0x80, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, + 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, + 0x0c, 0x00, 0x01, 0x01, 0x01, 0x8d, 0x01, 0xff, 0x01, 0xeb, 0x01, 0x40, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x02, 0x01, 0x9e, 0x01, 0xff, + 0x01, 0xea, 0x01, 0x50, 0x07, 0x00, 0x01, 0x6f, 0x03, 0xff, 0x01, 0xfa, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x5f, 0x03, 0xff, 0x01, 0xfc, + 0x01, 0x20, 0x05, 0x00, 0x01, 0x06, 0x05, 0xff, 0x01, 0x98, 0x01, 0xff, + 0x01, 0xe4, 0x05, 0xff, 0x01, 0xd1, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x53, 0x01, 0x36, 0x01, 0xcf, 0x01, 0xfc, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0xff, 0x01, 0x83, 0x01, 0x24, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0xfb, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x90, 0x02, 0x00, + 0x01, 0x0a, 0x03, 0xff, 0x01, 0xe2, 0x02, 0x00, 0x01, 0x03, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x40, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfc, + 0x04, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0x40, 0x03, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, + 0x04, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xfb, 0x04, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x04, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, + 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0x90, + 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf9, 0x03, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf0, 0x05, 0x00, 0x01, 0xff, 0x01, 0xfa, + 0x03, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x70, 0x04, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x03, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf0, 0x05, 0x00, 0x01, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf0, + 0x05, 0x00, 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xb0, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf3, 0x04, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x03, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf0, 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf5, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfc, 0x04, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf1, 0x03, 0x00, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xfc, 0x04, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0x40, 0x03, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xa0, 0x02, 0x00, 0x01, 0x0b, 0x03, 0xff, 0x01, 0xe3, 0x02, 0x00, + 0x01, 0x04, 0x02, 0xff, 0x01, 0x40, 0x04, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x74, 0x01, 0x47, 0x01, 0xdf, 0x01, 0xfe, 0x03, 0xff, + 0x01, 0x95, 0x01, 0x45, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, + 0x01, 0x08, 0x05, 0xff, 0x01, 0xb8, 0x01, 0xff, 0x01, 0xe6, 0x05, 0xff, + 0x01, 0xd1, 0x06, 0x00, 0x01, 0x7f, 0x03, 0xff, 0x01, 0xfa, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x01, 0x6f, 0x03, 0xff, 0x01, 0xfa, 0x01, 0x10, + 0x06, 0x00, 0x01, 0x02, 0x01, 0x8c, 0x01, 0xef, 0x01, 0xdb, 0x01, 0x50, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x02, 0x01, 0x8d, 0x01, 0xee, + 0x01, 0xd9, 0x01, 0x30, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, + 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, + 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, + 0x11, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xe0, 0x1e, 0x00, + + /* 53 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x37, 0x01, 0x77, 0x01, 0x30, 0x04, 0x00, + 0x01, 0x17, 0x01, 0x77, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xe1, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x20, 0x0a, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf6, 0x0c, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xe1, 0x02, 0x00, 0x01, 0xcf, 0x01, 0xfe, 0x01, 0x10, 0x0c, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf5, 0x0e, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x60, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x90, 0x0e, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf2, + 0x01, 0xcf, 0x01, 0xfd, 0x0f, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x6f, 0x02, 0xff, 0x01, 0x70, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfd, 0x11, 0x00, 0x01, 0x4f, 0x02, 0xff, 0x01, 0x80, + 0x0f, 0x00, 0x01, 0x01, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf3, 0x0f, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xe3, 0x01, 0xef, 0x01, 0xfd, 0x0f, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x50, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x90, + 0x0d, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf4, 0x0d, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xe1, + 0x01, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xfd, 0x0d, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x90, + 0x0b, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf4, 0x0b, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xe1, + 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x10, 0x0a, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0xa0, 0x0a, 0x00, 0x02, 0x11, 0x05, 0x00, 0x01, 0x01, 0x01, 0x11, + 0x01, 0x10, 0xbe, 0x00, + + /* 54 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x74, 0x05, 0x00, 0x01, 0x77, + 0x01, 0x73, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x00, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x05, 0x11, 0x01, 0xff, + 0x01, 0xf7, 0x0b, 0x00, 0x01, 0xef, 0x07, 0xff, 0x01, 0xfc, 0x01, 0x99, + 0x0a, 0x00, 0x01, 0xef, 0x09, 0xff, 0x0a, 0x00, 0x01, 0xef, 0x09, 0xff, + 0x12, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x12, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x12, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x12, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x12, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x6d, 0x00, + + /* 55 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x02, 0x01, 0x77, 0x01, 0x71, 0x04, 0x00, + 0x01, 0x77, 0x01, 0x73, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, + 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, + 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf6, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, + 0x02, 0xff, 0x01, 0x85, 0x03, 0x55, 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, + 0x01, 0x6f, 0x06, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0x07, 0x06, 0xff, + 0x01, 0xf8, 0x0d, 0x00, 0x01, 0x17, 0x01, 0xbc, 0x03, 0xcc, 0x01, 0xff, + 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x12, 0x00, 0x01, 0x11, 0x01, 0x10, 0xbf, 0x00, + + /* 56 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x66, 0x01, 0x64, 0x02, 0x00, 0x01, 0x01, + 0x01, 0x66, 0x01, 0x62, 0x02, 0x00, 0x01, 0x02, 0x01, 0x66, 0x01, 0x60, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x11, 0x01, 0x13, + 0x01, 0xff, 0x01, 0xf6, 0x02, 0x11, 0x01, 0x17, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x0a, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x0a, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x0a, 0xff, 0x01, 0xf1, + 0xcf, 0x00, + + /* 57 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x66, 0x01, 0x63, 0x02, 0x00, 0x01, 0x01, + 0x01, 0x66, 0x01, 0x62, 0x02, 0x00, 0x01, 0x02, 0x01, 0x66, 0x01, 0x60, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf5, 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf1, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x11, 0x01, 0x13, + 0x01, 0xff, 0x01, 0xf6, 0x02, 0x11, 0x01, 0x17, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0xef, 0x0a, 0xff, 0x01, 0xf9, 0x01, 0x95, 0x07, 0x00, + 0x01, 0xef, 0x0b, 0xff, 0x01, 0xf9, 0x07, 0x00, 0x01, 0xef, 0x0b, 0xff, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0x5f, 0x01, 0xf9, 0x12, 0x00, 0x01, 0x5f, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0x5f, 0x01, 0xf9, 0x12, 0x00, 0x01, 0x5f, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0x5f, 0x01, 0xf9, 0x6a, 0x00, + + /* 58 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x56, 0x01, 0x63, 0x12, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xff, 0x02, 0xee, 0x01, 0xed, + 0x01, 0xc9, 0x01, 0x60, 0x0d, 0x00, 0x01, 0xef, 0x06, 0xff, 0x01, 0x70, + 0x0c, 0x00, 0x01, 0xef, 0x06, 0xff, 0x01, 0xfa, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xfa, 0x02, 0x33, 0x01, 0x34, 0x01, 0x6a, 0x02, 0xff, 0x01, 0x50, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0xd0, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf1, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf3, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x04, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xe0, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x11, 0x01, 0x38, 0x02, 0xff, + 0x01, 0x70, 0x0b, 0x00, 0x01, 0xef, 0x06, 0xff, 0x01, 0xfc, 0x0c, 0x00, + 0x01, 0xef, 0x06, 0xff, 0x01, 0xc1, 0x0c, 0x00, 0x01, 0xef, 0x05, 0xff, + 0x01, 0xb5, 0x0d, 0x00, 0x05, 0x11, 0xc2, 0x00, + + /* 59 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x56, 0x01, 0x63, 0x07, 0x00, 0x01, 0x02, + 0x01, 0x66, 0x01, 0x60, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x07, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x07, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x07, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x02, 0xee, 0x01, 0xed, 0x01, 0xc9, 0x01, 0x60, 0x02, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x06, 0xff, 0x01, 0x70, + 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, + 0x06, 0xff, 0x01, 0xfa, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xfa, 0x02, 0x33, 0x01, 0x34, 0x01, 0x6b, + 0x02, 0xff, 0x01, 0x50, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xd0, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf1, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xe0, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x03, 0x11, 0x01, 0x37, 0x02, 0xff, 0x01, 0x70, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x06, 0xff, + 0x01, 0xfc, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xef, 0x06, 0xff, 0x01, 0xc1, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xef, 0x05, 0xff, 0x01, 0xb5, 0x02, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x05, 0x11, 0x05, 0x00, + 0x01, 0x11, 0x01, 0x10, 0xbb, 0x00, + + /* 60 */ + 0xff, 0x00, 0x55, 0x00, 0x01, 0x36, 0x04, 0x66, 0x01, 0x63, 0x0e, 0x00, + 0x01, 0x9f, 0x04, 0xff, 0x01, 0xf8, 0x0e, 0x00, 0x01, 0x9f, 0x04, 0xff, + 0x01, 0xf8, 0x0e, 0x00, 0x01, 0x6a, 0x03, 0xaa, 0x01, 0xff, 0x01, 0xf8, + 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, + 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x12, 0x00, 0x01, 0xff, 0x01, 0xf8, + 0x12, 0x00, 0x02, 0xff, 0x02, 0xee, 0x01, 0xed, 0x01, 0xc9, 0x01, 0x50, + 0x0d, 0x00, 0x06, 0xff, 0x01, 0xfe, 0x01, 0x60, 0x0c, 0x00, 0x07, 0xff, + 0x01, 0xf9, 0x0c, 0x00, 0x01, 0xff, 0x01, 0xfa, 0x02, 0x33, 0x01, 0x34, + 0x01, 0x6b, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf8, + 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0xff, + 0x01, 0xf8, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf1, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf3, + 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf3, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0xe0, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf9, + 0x03, 0x11, 0x01, 0x38, 0x02, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x07, 0xff, + 0x01, 0xfc, 0x0c, 0x00, 0x07, 0xff, 0x01, 0xb1, 0x0c, 0x00, 0x06, 0xff, + 0x01, 0xb5, 0x0d, 0x00, 0x05, 0x11, 0xbf, 0x00, + + /* 61 */ + 0xff, 0x00, 0x57, 0x00, 0x01, 0x02, 0x01, 0x8c, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x94, 0x0f, 0x00, 0x01, 0x9f, 0x04, 0xff, 0x01, 0xb2, 0x0d, 0x00, + 0x01, 0x0c, 0x05, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0xf8, 0x01, 0x42, 0x01, 0x36, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0xe1, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, + 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfa, 0x0b, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf5, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x20, + 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x90, 0x0a, 0x00, 0x01, 0x0a, 0x01, 0xcc, 0x01, 0x80, + 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xe0, 0x11, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf1, 0x0d, 0x00, 0x01, 0x69, 0x03, 0x99, 0x01, 0x9b, + 0x01, 0xff, 0x01, 0xf4, 0x0d, 0x00, 0x01, 0xaf, 0x05, 0xff, 0x01, 0xf5, + 0x0d, 0x00, 0x01, 0xaf, 0x05, 0xff, 0x01, 0xf6, 0x0d, 0x00, 0x01, 0x58, + 0x03, 0x88, 0x01, 0x8a, 0x01, 0xff, 0x01, 0xf5, 0x11, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf4, 0x0a, 0x00, 0x01, 0x05, 0x01, 0x55, 0x01, 0x10, + 0x04, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xe0, + 0x0a, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xa0, 0x0a, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xf5, + 0x04, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x42, + 0x01, 0x37, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xf2, 0x0c, 0x00, 0x01, 0x0b, + 0x06, 0xff, 0x01, 0x40, 0x0d, 0x00, 0x01, 0x8f, 0x04, 0xff, 0x01, 0xc2, + 0x0e, 0x00, 0x01, 0x01, 0x01, 0x8c, 0x01, 0xef, 0x01, 0xed, 0x01, 0x94, + 0xc1, 0x00, + + /* 62 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x56, 0x01, 0x63, 0x04, 0x00, 0x01, 0x05, + 0x01, 0xae, 0x01, 0xff, 0x01, 0xed, 0x01, 0x83, 0x09, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x03, 0x00, 0x01, 0x03, 0x01, 0xdf, 0x04, 0xff, 0x01, 0xa1, + 0x08, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x6f, 0x05, 0xff, + 0x01, 0xfe, 0x01, 0x20, 0x07, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x04, 0x02, 0xff, 0x01, 0xd6, 0x01, 0x32, 0x01, 0x48, 0x02, 0xff, + 0x01, 0xe0, 0x07, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x1c, 0x01, 0xff, 0x01, 0xf9, + 0x07, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xb0, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0x10, + 0x06, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x70, 0x06, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, + 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xb0, 0x06, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xe0, 0x06, 0x00, 0x01, 0xef, 0x01, 0xfd, + 0x01, 0x99, 0x01, 0x9c, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf1, 0x06, 0x00, 0x01, 0xef, 0x04, 0xff, 0x01, 0xf2, + 0x05, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf2, 0x06, 0x00, 0x01, 0xef, + 0x04, 0xff, 0x01, 0xf1, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf3, + 0x06, 0x00, 0x01, 0xef, 0x01, 0xfc, 0x01, 0x88, 0x01, 0x8c, 0x01, 0xff, + 0x01, 0xf2, 0x05, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf2, 0x06, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf3, + 0x05, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf1, 0x06, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf0, 0x06, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xb0, 0x06, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0x70, 0x06, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x10, 0x06, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf9, + 0x07, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x04, 0x02, 0xff, + 0x01, 0xd7, 0x01, 0x32, 0x01, 0x49, 0x02, 0xff, 0x01, 0xd0, 0x07, 0x00, + 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x6f, 0x05, 0xff, 0x01, 0xfd, + 0x01, 0x20, 0x07, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x03, + 0x01, 0xdf, 0x04, 0xff, 0x01, 0xa1, 0x08, 0x00, 0x01, 0x11, 0x01, 0x10, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xad, 0x01, 0xff, 0x01, 0xec, 0x01, 0x82, + 0xbc, 0x00, + + /* 63 */ + 0xff, 0x00, 0x58, 0x00, 0x01, 0x14, 0x05, 0x66, 0x01, 0x60, 0x0c, 0x00, + 0x01, 0x2b, 0x06, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x06, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xeb, + 0x02, 0xaa, 0x01, 0xac, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x0b, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x03, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, + 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x0b, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x70, 0x03, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf8, + 0x01, 0x20, 0x02, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0x08, 0x07, 0xff, 0x01, 0xf2, 0x0c, 0x00, 0x01, 0x8f, 0x06, 0xff, + 0x01, 0xf2, 0x0c, 0x00, 0x01, 0x02, 0x01, 0x9d, 0x05, 0xff, 0x01, 0xf2, + 0x0d, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x62, 0x01, 0x27, + 0x01, 0xff, 0x01, 0xf2, 0x0d, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf7, + 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x0d, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x0c, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x0c, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x0b, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xc0, 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf2, + 0x0a, 0x00, 0x02, 0x11, 0x06, 0x00, 0x01, 0x11, 0x01, 0x10, 0xbe, 0x00, + + /* 64 */ + 0x2c, 0x00, 0x01, 0xbd, 0x01, 0xdd, 0x01, 0x60, 0x01, 0x05, 0x01, 0xdd, + 0x01, 0xdc, 0x0e, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x70, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xfe, 0x0e, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x70, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, 0x0e, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x70, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, 0x0e, 0x00, 0x01, 0x67, + 0x01, 0x77, 0x01, 0x30, 0x01, 0x02, 0x01, 0x77, 0x01, 0x76, 0x33, 0x00, + 0x01, 0x1c, 0x0a, 0xcc, 0x09, 0x00, 0x01, 0x1f, 0x0a, 0xff, 0x09, 0x00, + 0x01, 0x1f, 0x0a, 0xff, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe8, + 0x08, 0x88, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xfe, 0x07, 0xee, + 0x01, 0xe4, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x1f, 0x09, 0xff, 0x01, 0xf5, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xe7, 0x07, 0x77, 0x01, 0x72, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0xd4, 0x08, 0x44, 0x01, 0x30, 0x08, 0x00, 0x01, 0x1f, 0x0a, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x1f, 0x0a, 0xff, 0x01, 0xb0, 0x08, 0x00, + 0x01, 0x1f, 0x0a, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x01, 0x0a, 0x11, + 0xbc, 0x00, + + /* 65 */ + 0xb6, 0x00, 0x01, 0x01, 0x02, 0x55, 0x01, 0x00, 0x01, 0x04, 0x01, 0x55, + 0x01, 0x52, 0x0d, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x05, 0x02, 0xff, + 0x01, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x04, + 0x02, 0xee, 0x01, 0x00, 0x01, 0x0c, 0x01, 0xee, 0x01, 0xe6, 0x4a, 0x00, + 0x01, 0x17, 0x01, 0xbe, 0x01, 0xff, 0x01, 0xdb, 0x01, 0x60, 0x0e, 0x00, + 0x01, 0x07, 0x04, 0xff, 0x01, 0xfe, 0x01, 0x50, 0x0d, 0x00, 0x01, 0xbf, + 0x05, 0xff, 0x01, 0xf7, 0x0c, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0x94, + 0x01, 0x23, 0x01, 0x6c, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xd2, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xd0, + 0x0b, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x10, 0x03, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf6, + 0x05, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x0a, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xf0, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x0a, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xb0, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x30, + 0x09, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xb5, 0x05, 0x55, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x50, 0x09, 0x00, 0x01, 0x1f, 0x09, 0xff, 0x01, 0x70, + 0x09, 0x00, 0x01, 0x2f, 0x09, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x1f, + 0x01, 0xff, 0x01, 0xb7, 0x07, 0x77, 0x01, 0x40, 0x09, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0x80, 0x11, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xb0, + 0x11, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0x37, + 0x01, 0x77, 0x0a, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf5, 0x05, 0x00, + 0x01, 0xdf, 0x01, 0xfd, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, + 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0xc1, 0x03, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf1, + 0x0b, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0x94, 0x01, 0x23, 0x01, 0x6b, + 0x02, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, + 0x01, 0xf8, 0x0d, 0x00, 0x01, 0x19, 0x04, 0xff, 0x01, 0xfe, 0x01, 0x50, + 0x0e, 0x00, 0x01, 0x27, 0x01, 0xce, 0x01, 0xff, 0x01, 0xda, 0x01, 0x50, + 0xc0, 0x00, + + /* 48 */ + 0xff, 0x00, 0x56, 0x00, 0x01, 0x67, 0x01, 0x72, 0x01, 0x00, 0x01, 0x29, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc7, 0x01, 0x10, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf4, 0x01, 0x08, 0x04, 0xff, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf4, 0x01, 0xaf, 0x05, 0xff, 0x01, 0x80, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xfc, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x42, 0x01, 0x37, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x30, 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf3, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x70, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x90, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf2, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xf9, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfb, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xfe, + 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, + 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, 0x04, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf4, + 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x70, 0x0a, 0x00, 0x01, 0xef, + 0x02, 0xff, 0x01, 0x40, 0x02, 0x00, 0x01, 0x1b, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0xef, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x64, + 0x01, 0x58, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf5, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0xaf, 0x05, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x08, 0x04, 0xff, 0x01, 0xe4, 0x0c, 0x00, 0x01, 0xef, + 0x01, 0xf9, 0x01, 0x00, 0x01, 0x28, 0x01, 0xce, 0x01, 0xed, 0x01, 0xa5, + 0x0d, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, + 0x12, 0x00, 0x01, 0xef, 0x01, 0xf9, 0x12, 0x00, 0x01, 0xde, 0x01, 0xe8, + 0x25, 0x00, +}; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp index e288d270307c..d04fe7d5b664 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -25,12 +25,14 @@ namespace FTDI { - void write_rle_data(uint16_t addr, const uint8_t *data, size_t n) { + uint32_t write_rle_data(uint32_t addr, const uint8_t *data, size_t n) { for (; n >= 2; n -= 2) { uint8_t count = pgm_read_byte(data++); uint8_t value = pgm_read_byte(data++); - while (count--) CLCD::mem_write_8(addr++, value); + CLCD::mem_write_fill(addr, value, count); + addr += count; } + return addr; } void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h index 185b53e6ff87..2b0a533084d8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h @@ -24,7 +24,7 @@ class CommandProcessor; namespace FTDI { - void write_rle_data(uint16_t addr, const uint8_t *data, size_t n); + uint32_t write_rle_data(uint32_t addr, const uint8_t *data, size_t n); void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle); void ext_vertex2ii(CommandProcessor &cmd, int x, int y, uint8_t handle, uint8_t cell); } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.png b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.png new file mode 100644 index 0000000000000000000000000000000000000000..bc46ebe6aa07459a05230f7002a6d31269475b96 GIT binary patch literal 34122 zcma%j1z1(v_U}gNMp7CCR7wc}k&tc$q(xHc4navbf*=hN(jiJpcS}p7gfvKrw15bL zZ>)3Qz3<-p{^xz~eBU_-5%ykttvSc|)tDjbcNB>5Y4K4g6p@mmtS0>b3JOJ-g^LYe z?Yl3(ga6?zZhMPxewu+7v1Fa-0nGAxOtemJVJSRc<@>~*t(jVIz8fb zbg@j{5~D?-m{CfyQd*uV8>t?86ywK7b3FUAWKpb~!3-N3VKWo9f_(8-g0!xm1mnHP z!&JlQ>h*HV6~T+FtP^~DT|6du9Et?wZvyc~_L?twt`0Cn^)55V_5?3~&bwE&PtIH8 zbMpB5VRpHB7qL>HXU1)VD!UL=%l&ib&Xv4>f5(cZfQ-#^Z%HZJrS8#OlaCNN#jB2~ zYRAhXGC_oVC$(?%j)~?7Y1Tc0Ydn zt5+GZvE-M@7#SmI!?DT83JMB_KYfZlQO#60F)~V9LR*xJ+`M_w#@4oWf2k){iq~7mWL`sX8fVm4l~NXE7a1&URQ?)1e_0J6i?Etc3r(Qsmjjx zh>@JUEtOJ1L4li-lfQ0eq3uP801X2}xIvLlnShnn&i=Pg?NVJ~7tQ(o4T?J9Q=6T{ zUcRf$VI>$!7j~ErNPe5j{nP-usW}Ba-!#aPl$qu=r~R<(o6a_e94L% zTCQD9i(MkTfaZ+De_&|HM)oTIxy(anP0b5hy1K5`mX?-I&dy{hbdikW=;Pz3s3S)_ z%a59!jrnH zEHdrmbaJ?vF=|sQaLZv@q@au%mEm)8I8^6u%gdvLr(ih=UoB2C-E@)tEbRN|^d~#d z0*ZCrioRNX@_V#Y+>cTPdInZ94tSmU<#z2vfkkq&=u@&VJ@6kTy$${>-MM>UFyL$NpZlAe}UdqLsb2ZviTT&Wq2WX;D$PD<%CeN*Nm)(@6S?9bj0Mo^V_I^Hrw5S7&9h;t~=rNvLzi%`YsNKDNAj z_wLUA{_~QO>%ozcFBrw2w)kV5Z)t6n5|x=r?)&gTS}DH;jYjV@{+un>li{T3!E#qI zG^Dq%u+St(>RasYR@7_oEbXAreg8hFp+QXK>Hd`zaj*EJLb*^Xr{jI=or8l)*1JU4 z-LY?ZY}p-Di+dkkA08k;?Hr67zY`6J!DnS?RIu?k&aVlH&EZ3Qr(_yG==Lh ztgEV`ieMDy6irjx3OGIad3i*)*ocy$mjg{kMkZUAo2%%?os7G#`~95%+EYms9o}rc zN2DSS4o+yqBl6bsIK-sij*dKsOWCNWoBbr;ym{kf?dRvWHd>Id<{5*}!Oq_5Iw-DC zn0&*QN<>ujWrX$KJ6>*XLgXohV&oSTum}rNM=;#Nu6CT`kO&P9_UF=l?_XbEZzYvX zNd;wTXR^{Z%TLN}Le^=b#56HARgLFG?)aW!ruyx2i+2pr#mC-EQe`_Hp(yEn6vYXpE@=Clwb7q*6SsE;Qg2Pq5fc+P2%n9y z=FN{5=q^mxx*9%R8_Lvj)Wx`6H>LXcvCyz{FMOIhOOmYUfp?-%A{Vx1>N%SAe0;U`uA*$siqg{38PEvo z{58|1X827%U~+SDWlIEb5D@V3@s(Kg(@Gham6VWb-n$p_N5((s{j07>CLFj2-v%=h z=N3e=imPzOuw_qB}Y|m=k*09~^E@De!cQ3!a`nS71&b<=p2;`WBPsAJf_ci)gE&BI2m}q3y$Yh|R z>hvL{pxD=YPH6h~7xUW@m)EdHz09<`DAo1E?<=9i9n~@FWOFF{JD=~}#hZM*Ia%rS zZG@fg1qLb_9TF09-Mo`fYHDk$I#O9(i;9kz#aaauk5*!8Dm6nsn`I>Y7r%5=h6C>% zhR2toj)zptJSttdsKqJw;CB|OJ9b`u;QeR00$098EmFZBH}8}*G^8lrzx9ZV2#rak zkeu-i-;`4eBAhHVozceJ+`L5SnzjV=hD;F?V>9?`}QuqDu;xm z94-0hw*Un-wd=RwVBFbYv8v8D83si`urOZf2|w9;7}ZPnQ)*~wIG*P|wzajj;beb5 z(aJ#T)D_L+D;WMXy7C31AE4BjE`N+`58}CB^?bYOWMKU~4Y5pGa%k{>Q{PTeON)YAzw9}uNWZF|Xy4&bnvgy1fAu7e z?Eu>Fpr@)n&<>}FCV4x`Y{z-me}=#XJ-%kO=T`!Kq{L>FGk=~z)GcF@sU<8UA%R-# zN1wodEzXI?j2=37UtbCD-@9F(ajeD)FN&RPlrNs2C=)!760sV}__H}eI4pCEjZJp% z{L#tDz0JY=4_5!#V*j3ePNoW8zp1HJO{ zVQ5&`bLgjMopoLH@V$-cT7lhe8bFAFfq@oG1V6Xu?rvOqsJVRg-doa>nwpyVTG!Pu z2ZG}e91=zoMMd0FSHKMYcVg^{=3i2Bc?y_s&Nfah9h%fE4od!!y?psHYj>7hC>z=D zAA^#^!^6=NXQ>{ud?$gP=-}Y{Rdx$Ly-Q0EIa{IY8f_6WicKt1jLBn>k*yA-s$jZ$ zcytx$7QehuSWwVr)cBNas-v?LKk4G=8xttIhu=QEz@;T858#aZXw#}|^dxYi6VQp{ zY=gDNKp``$nX@yWknLC)u7t~y;%A#mG!~TTJKnqry+ujSXOSOx`c$;8ww4U%*Z!xw zSa@&Wy~_raz58o5-H%uAP87453=YO?)lLRksI094IDY}?oq;nbtR`_OCQ`EP9j zP!wOTOiHGaqiG62#Cb=j$Y9rj>G;QE(VI6H(*4e^Di7GeJJfq@XEirB&+E3(2|G~m zT!vrSEgzI1XB#ijy~cS{0}W6@4&JZT(&=D*H2m_>eCzqJ;NbaF&b4=qjg27{(wQyB zey5{{=;h_*hF_)0&=a}z8h-Efiny<9nWct?62P7xd5i|A4y%iK5kZoPuU}j5OTg}b zaUPqHdFgR0;g8k;bGz7?CAaP z<0Q7WwrbcV^6CYni@@z7R zqNAgczyI(?DYoVgv9`8$iPM6#UbCFt*b-u-ncm}S9`=b>4t64Or3ihJRx&HG(&){)*d%LJ%~|_ zAr%8meC?LGxjBM<^fWa;OzFcdhHBx|8FsPZG|lhqi8a>u@86%q3BnJw0d|mjM$91E zUf`yxq!fK;=jWW?W%SRDFXT69!?j!Cfw!HYWAK{Jj=#$~xjLq(YG`ZAHR#%nyuqtv z_Q-B>|4!xc-5HqIjjLzusrCzYHgfK3*H*Rrfs-VQzGp+{-4WxMx;oK~nR;QCM4(ZW_kx0fo+)>Cccc7+G-7oN^;nLLIWAo~ zZ&2;fuSS-oekCI-OZxZ2^TEN{3XvS|rEPnk1ywlAB#DG}=GQ!D#X)5SYZ)7p=)N~3 z^TEbIiHVDc2=-t9<$^l9y#cZXHG_JQPFtnzc#WHh3A3k{S7-!IFp>RfN@{8?x3jCO zz@(8jZqTL`hguSws2AD6dxWn3VB{+{tTodvsi+W~&0c#gVEKlOo142G03&Nnax&dO zx+K%~OueO$qJsnP8Snx&7Yvls-cpa2OE9*iJ1jgj+?73xPbietY{Sh8$2mrzF)h8l z1e~0l88tODyv9w0a6eZ2#XdvH5%K*kQd3v=^3R`7rzGpHr^oJLAt9y5l`qcrpecpg z5Ze%DH?zUhJOVan?&elua`m-p5R~YICDR8?p*gQZsjq$5ZvI1j@#4j(*RSzl2Yt4= zaddR#55x#T+V}2?V*v`PP~*@sy|MLQ5Ce3ge{5JMw49urY@~IPbv68YG0q{>k#Cqe zOHjg|fi|FcLB*vN%JYX8Oukq2#gwor4R{*%M^x1B-Mgf(s)QwMH-Wl*CnbvijT@ST zQOv(16o42IUL}sXSk;|TU1O{`<&K>3LVfecjG~!}tckB)VIqJnA?>>9xiI>hnlFd; z(d_K(JCnA>&elM!*IAw(WKyLFJ2LY9nWi@OX8ATacMdxukwGTz<|Z#0kf*gb!&s2$A* zkkq(^Qt`~sc+ABaDl@gBgK=F~`WBQq`Ck)`72UV|arF}xfdc@$#NMNv1S7QX>G2m? zWhN=~lP6DPmDoi@Xe53uktZvCyQH`ir)%`Atc;(x@$sg?&hBpM>sJy~Sh2COAu%6I zOxsNQ68VJUM!E`N`=EtqJp)ugjrnkV@ZFv_CsMyvc+Q*L#nrWT-!k0?J2Nv=D1mio zG~{B0!pvJWx~y6kD3NN1BSL}Fne&HC0v2Jpb)vE1z57!9@&Bv_)szp@)tq&W)2QrWh>xyS^XcJK_<|WlIohR`eyrHov6*sG zz;fU@Adyhw0nUm|jQ@Oe{}jODFDnd{NY|?*@akZF?CE(1mru&aaVN#f?MSKM`hi8J z>*@eH{j9vay!6SBmG-ki@t^buJ2Ao7G6f-I4IbN!j^6KKOR0>B1u9?X;tCahxv6rk zk(^qnaPz;sH;uf37IvInQX3QTIb10o0wEv>TM$=H2IC0-8Y z9a!xRD;hsm2diJFXrrOFO}tSeH%rDMpqkLSQ!)=V-7|KM$FOE-#RZKCTHzCN&gP%9 zUg4~k8ap2X3B+niB#ttMm-_I9tVf;;3zt^9mP~1>`$hLWlz;cgo)D9=8k$9>-=8yS zp*VUeL_Iw|+*Hw06Qq4xRs)yWps5Tk!>Gx-R-=4kL)-h$nNQk7guSkOAY%`nP^a-p zi9!1+mBFompN^E%+;Q9meS}(wO1y4#2l|dk!(N28}?%1-#iNpJYW3C=A07!&=D&y}L6n+UVkYqWymF;zZw3 zRJ0PjXika-IvACd^f4y@jm`iZ8_t_U!h$qRav9BVhFdx@&*H4+BYZ(CJpwWnLITxn zbWJ*_n*bl*WU)PD2fpdr2A&Sc{=pPS4CN zoNPD02o4VJT4)R4>g`>2p%HOnF4QYU=eIS2(lz`k`OsPFt!5sw3`yzexV|}QX|~!- z|CiAGuV=M@85$beIzFCIU1(SvbIc4(h?JhbFSOD7mrL)hWSh5z_d$-#OS*W8)nTS? z)M^80or0&pqkAcmevDAp+S4Uav#!-QaF3Z(m6b2}_(NY2@jfb9J5|G9k9<|__0wS( z=Ll31ko6*{?_J@*I(WfX<9jOl=H0u{p-bh}w&U-0wjDLEOGq$+8Pt>0kyOP`XL|E0SkNmvoC(zJ5Iq;(y#7(u~Y({|G>-1$5umEVqw# zzshMVCs6{O2?UkN+1j?OHa9oeGnJde3j=f7V!!+*0M_xeRthC0B|{&T+qY3{92}E( z)IGeq2M1q(R7ZecnBGXvp-Os6JCJ1p;)ZiCSxi5)&>i5t7tm&8`zl#}{!G3{&veu6 zy20qFiDv~;h)&iHp@K@!I_{8JQ9%L7{h@}spK($?p_CU?0L-U{8$CJwkA47dTIhQ% zV3-8gQ+TCh-MAkfErFJf4(*HsNH)_%;+&i>pPF55MT1@Qbv>Mmi)%sh&#y=&DF(Qx z48}Cwk_^CAeC>uvG(>%q<5Jf9Ua|>fX5!Vwq|wZ>eYoY za9(;gB=7^#B0!zd9eLmfc9C*grfBioT@qlK405+R#~DCivn1?0ux-6{n}C zwIqbApQ?}w%bEr_ELWsZI{Clw&A%#YLA}lL%8E3QW*~0TKmq_)Nr4QAiHUhzRh94{ z`y2@iL!#qcQ#jo6MKu}wn(k$njiJo*0Q~8H?CrH5CUAg!sjlu1Oj9OM+Ek}+0*GE1 z+>$mR_EWfNH(jxzko76o)YoUjjs0Se@Og3Z2L`R6y?Q^Zme^tl`Q{qp6D4h{k>99_y`7n|DK7kRbGC372tot0PE!=fYRj8j64^xY;MZR z7U_h7+{9+)2(|2~R2v@cpX2Y>lrYK2s_ni=w=+t3*SMoW;$=BkVLzqA4?Z7&CO6Or z7rmZ5$uuaUswk#M1!rQTZo7Fn-V?cXi##<~o0HP8#z|_Z$ptm9c2V(@=@*KbdXLK^ zaEas<>GTqK0LU=#q7?Vl`VOKe`Wz9GEPyYnS}3**PYzmJ7Quk z^enwMYE%eC{?GqTpozu5`3KZSws=>>0 zPpBGhE-s6U@MKMNbmHevL(bX4&ByKGGw)RI866)thmRkU2tG_DCpHU0?ZM=bZSgz( zZk)9Q{*W`Yy@p?5Kx8i)foj(;JhvnsroJz6a8rti34V7Yg$8bC*cf9+rj(5K;3Q`a^AR1K!DU z>lU3BCndPbi0Nw4pCt8ym?7hCx1j87Gf-^+-0m{>G6GogugYT%vpvzoV_~JSYhn@Jxq_ zjU{Pr*iZ<&XR@tTA7VxKM;{~%4XHyv5_bP?%n(Dc9uK!dg|%CJ6jUWCfU+JImo8m0 z-CgXk81$8s!veFGiI_>kuHw=hkXKWXFLajPk*TJ(!o#|Mpyu~$nVJw6cm9!wyZepN zi?22~8TrgG>BT&wYHkA)K|vHC`z6;mdkzVSw1gaJSD7!b{_+_ru@5ut(y@&;94cw1 zx4$gigGF>=hyOZufIfzRR!A;$6Q4T|A+_+JNxxfpd8u$9T_IaOe9=N03+3eGYaQUQqBakD~POpGx!isk>+4ua^fUAy)IoB*UHh&|oM1(~cB zit6v*znLM)0gvpBaK-+)(z3D(uqQ)7kSr4^^XQG|asIWp3~hk<3xR4m`hK-T2S`i> zb5&2DJXv_FmTY%f@7}!tDCrOmff#{v&F-%st18#@jEy6a8^*xR&wpXgYg@blz{Bog zQ$qv&Jxxu-@>hV%nf2w;DU8x_g6G|ivE*`-SFhyu(3OX^wY3wlbjzsC!r zzkU05C84)=9z+b#q#U(d5SL}P@fOQX@XV|+Ve2Sk`kri7%V9MFX5@@h=8b^}OXX0k!6+R~Vgegd&rqub~$GMb<2xf+%DjF9< zZWk1i%`(eT&Uwns-x+ltwe72`qjRVSHYAQ!qO)N-$XXKr_$BcF6bi*$SHjp@->JSn z$NxI)zL4XroeybykV}d$AD5UIJy_NU#YmgqC2-%GzFA=IlykAIwG1>bMfQZaIJq$U zA}~gY8hhg`Iw9(m@+FQ-_hsJ%Hl%D&2kXIUzQ@)O$SIYG8mIuA>f_@RQeFdYoQ7p_ zT^()PhY!JebV7Edl%ZENt{FF_;I6N(zM#HlR3W+sDD*CCM0K^W1VjXkc3_`O6zU7G z)`0(_9edk;w&8WnJPHNy++4#&3@ipHM0*ysF}=$oppKQ3OFgo%SPZ?^)a|tq78&`@ zCf}~2>IXp7>lS@9+2*a44l}f(k2i1u(P2Qgu<|VdxuKz^zFb$T4}1}!Y*~XT#O2!-aNl=(uQj)W3EOH0B1t=Jbwr&8U%iE; z3qV{7fEy@0gupk^z>}q*7F~%`h6qa_?8~*09D@DzQ36n@uw821iW&67Z~a}4cTiwZnC{S8TP};VT@qZA){sk0I zsJ(yAcp%*F{_oRMxu2KwKu8BGjcoU=>T7As#Ds({+X?YUA1O3$!~zRrUj*??%1VA`l3Z2x zfZ7tc^*`L22e=i!Rj5-?3bd#F5Mntossp(u`uZ0^<{-sMz3KXPI28%l*{!av1%nV& zMJX!_GT!Tsa)=W=IbA`*KuXK1`1x9#MkJ*m8@`^f0I9cqbzop1F*f#-2)MC8`B=8O z*URo^51Sxv*5KUJ?>s%refTCJ-I%pB|E8RWTJp zObe>0*$f(sfcD*c+3xB@kg=T)(E$PMuPblkQenBexD0i41d8|ANz%0-^+9@Kka5w)ko64xfL`Bs*;9LnnMIZ!t zL^l(z*2Y=!cf!Q4IV$?=CMb<3_I5Fk3<_y0W}<+dm^s`HmzUvr7(8QHI%-)0;W5Bk zNYk^iu?Ze@adAN+cnu8=Y+fE#ho$!*R8eZ)H4hFZ5>!KE2R`A#n}!b_u!xG%in_03 zf)@N7AZsvP>X(U6-fC(@zTlEJWS&{UdZkVgbHsQPfw9;Ivi~5MW8LESy||xn{|&jmF>KMS}nQ)VF6>K zrOD@nRy-LXNaGH78od0q+s(eGeGw0=mDG**3yPaqgT%2=gaicTB6XLTg;do|Cmh~F zgOndkqLE@q_dUM4&1UzdtfOo`Qu0i3gDtk_y14kvMuZtAltd0THqsM9CW+|{2^W+< z6z&Uu5+2mKmG+c;g|-Y}N3KvntcnHb%>!%1&eYp%-rx8VtGK$ln#@onM+_uC>G77k zD-E5-=V{c8i+|9);>ZQ398ELss)gNy=<|YohlP;~SAP7TZ#1xtU%qie+pOphG$!dc zfGhjry_Zm^-QC^xk8o>`z~N;}_+%vrb_BLr>Ov_|^m!B^tsrhnN=h(^(bI42Jvfej zkn%)ee0v>ue6Qz}JY>ATw~XYdEWk6H7AnvwItSbx@j1Z`lU7!K*>m9t{PTtS?Ir=QP?j=1 zQ0rdsF*CPVVCjH;=Gb^Zl|O0|Y8lyW=JPT%bhoH_RvKc9J?#|uSj3ECG=F~oxGQBQ zUp^59hNXzpJnGHcw;uq1EkKb}*V4iSKD1Jfh4S|C$%L(or0Lcmni9rviz-Rb+RRy! zQO75>`6?Gz8xTCB;cxKJTi`3D?{RXC`a}K3Sz0mm;OQvOUijv>-H(=lyjlCja=Ad^ zf}ywnvgH2NNB$BlI?k{FdlZ|A0^-(`1c2y#f zYZ3G-n*#hxv(jjlaT@GVCCvEVWgRuMpzdwyEyPsbk}b*5Dd>RU2suu0NC?^V4;BG| z*l|hy?(a9i+9L8%Agosf)YxK13OfKvS{%}W&Iy5JYiKbLRT=1A2e8p*7X?p?^aQd# z=78raQ#1g2fb4Jq2PD87`drrBwg4B|qXn))Q12xuv+TrmpheFLl3gvA_7Aak&9f3!F}orj2{n#BS1l@L*j9L*5O3B_xH9{A`Hd-1al5Y#oG3xLlR za=_%h^K8k53a)7|<)(~VgC=Jj0(hj~Ly1Qlzf|E34z2;CEB0C!lnI`Q4inc_$Zi?s zggcaeUdhmas(&|Cv?KQWY-2so4CyewR9kZO)>v#zjG2n0DLUx9#M(80xVf5njOoC$ zsQ{akS@xHtpFlj6DH6%lNcbF+@)tKA(ylBm?O^jLDJ$D}w?;}F2PdS~jVS^~sn*An zkD7C$``g+uw+BdF0F`4<7JkW#ROXx zo(~{ROX054{bwxuzsU1Hza84MRS&@f1mq1rJHW9$XXQzjK?mEM8MWl{Y*k)&Q(sTd zs>~<;bLb5se|SaM1VYK*rLu=_L$0VxBZZoAE2n! zR@6!*5}NjF{#SghH-Ng-Ri&VKW zv>F@TaY*=YloC`XVd4^T795ln-2Bo#2xdisfdWMzQll~eNU9O@HY@p)Quu|8g@f%W z$7Ujc;W++5BOm~YorehSP?j74LLg|?fVNlheQvbTE*KSg*iG6qyR^Ezth9HW=&A4k z!cp*h3XpHBClfqA<`EXAhIhb8xMmy#ar5hCc#(*Mq@;wGFaRZUe%{2E|C30Jx7rd( z8qerOZ+?f*|L3|(y`*~bKM=lPqMqhxJy*yX_BXmHn1|5jU&sc!fezKT1sNM@JI6c) z4}gKCK0ti2@Ggi~9B{qi=|8mmzUhvH7mNS1#QoouuUxzWAdsa?*T;{_tPgZ_EFOEU zZ`Fr?k)ba_A=Ie@evv*HxNTNqe0hA8>dGf&=W})rM~$E`J^bJQQjk zYHQu$4`;CJuElbw9W&()#rHg%Us)Nm!g-&UhY>Ds?tJUc5a2}^19*7vst-)BU;quO ztVx}*J0A#!pc_JlWU8vDXH&17;$Jfg|JV$BO9-SV7tcL8`2JI* zQKV*(iuFQVAE-T%a@|q?@hM=0frDupK&J_q+8iGHdwb`Qk%YZHG{`Bpp+JE3CiPS% zZ?;7A)~&BFo8Saih~EACw#&iIZ%cc)<^h73LQiEw1Md3Y(+vZK5QS;)>`W3rf$j`` zKOsQw29``pd@Q!hm)q8cvx^3GeEy*)5uC+?@PK$wS&&A&Hg(OYLD3zXo$Pb;>(?QW z%)7LRL@Rxv7DEk+bg4}Vj!RADfhmO(6F_XH0Dar*V7&%MSjN&Fz_?I|n}x;OH9a9R zz+0C_j_q}eIylfl2Rslb%Q6Qu83aYy$(=BRfF&eXSOWCg>_NJOk8D@07Acu2Bm@j^ zaNTaxo`C|HpAj>S!zAYEk4P$~yxU+%?2D6<4L@`)fS{9*!?e|I7$vCu1_rdhLC1!; zi;TAfxYnL4uPxit#a%6<9zR(Kq%LV{N?YGxnarr6yl??M=lz4IGLbk-`o3ScQzlG3 zNQ3@{i$w>;MLW8eGYSLl#@1GO=*W_^w{?3m^gPY?Kd51A<}(Kp0cQ@uR(`2M?lxJlMJU`RL!jy#Zj?dmsoq z>eZ`l z<~)-Mz}CQ^gWDV6B%xP;H{gr=E?6pFMAg7-UY)3Rq~iRnqq% z*x6P3nJeY*gN(455ar=Mz0ouc@X##3MlMv2d^Xv^Vcz@q1K6V88* z07HgB*G?^_x?N zGY)tnE>xsIBsqVy0c89cB-CHeG;25t0QD6T18CeXs^ZQU?#qOPtfH&5zRawlp*4|` zk+nkDF|=Pu!H2t)T-cOJ%AjN=8l0nI(0A3QNKu%C=S$?i-B^`GB~M16Y={ zqH&%ZQs-pa3!A_WL0&~ZH0;c0Fv?VLX!-ZE6}Y^6lAb##Fn_TDc&O{>U^_TCAPf_- zo}`qNa{DaN6s~u*Ag^-NN#|%{WtIEoogl>7QpBF{GXe%%lgTm(!`IQ({R+8ajZAgD zQ^hafhc>t@zud%R5`X#}KCcD)l1r`r6F_^@rRFd8(cpT4wEf{0;)Wv@A^_GvsB6K& zxx-d4M?r#28>LA2h{8X6`E(#yau*@D*3$(s6d}kO`pf~mNC>BJ9J)I>wIGv;mq0}x ztf!&kHMG($febOdume3=HmEmR0iT`GkN}pQ2c7ETCbvmQem$V)| zTfqZ*(xukcolY_QZR0J{C3;C0!3u|j=iquvr{~W6v(Xbln;%Dk(x9Y5JHsI2dtc zA+YYCbmva|l0}iRsOA+4J#B6FEqR8E7xCbcPrIytzPeuSu{n8Tv1$YYcN&+bKVqOD zG;+7_%|$GuF3?u>?Lbiq?{uS>NacI1kTm>CD+~7)LG}DOUV%o zB;5!N9tEpyxKyMSWP*^NV$Lgl7YojBO_T=w++pJ&z6()sGq68G<^jD|au&dCx1IgE z2J;Hn3?fLuZd6f`fo%37ND0n>Z8VVG=t(H1N=dhw^PY;ezSaSA;Ig9Ju? zuhq%>K(#=Ce7?ZDwujMwpx7QkU^6p0IoYK2`E$(Q3on@1$Ud2tO4oz99YKHd97rer zy$RRa+Fp=IUISQ^YY#bZ~2>i3=~@-nuLmHKoo8R`=S6V z3&tkEJV3&&f{wHFz!(E@M&eGvyABpMglt0P@vjA_0V0mGVqu}70w)_6C@7v^YdT_0 z6LJ1vrmBSf4Q7_RK+J@yQgMt|0yaGi3Y*?)h2;W5P>nvG%8j4Ayu39q`}++GTtoZ) z(h3MILZ-r|0df_(7)BZz&!ARyfv`OfSSk3U{Lu-+05}_O$ou;HJ0R3OTc3hVH7rug z$cjO_x3j%{$4C!WgVH4tkeSU+Ktn*}5zL-%SHQG~`^I_)hG9c~-p;}V=&Wq_eR(+$ zXrNBdH_xLT7Qkq)f`4{U8xP?fu8)RJAk$k}OK!hm-^eyV5(9MaMa=TDvS7a*5Z!rc zh*EEPa6}X*e;is*uY>6oGtT+Ed+(G-xNRWsC3`$>?1zOSYwidV$Ag}yl6hbZ**k?d zwfUsB0z`E>?!84nI<2)vtNULF4lb7zgMnrbbkN()!bm{(*oEXU1>Byy3->FF_B)LXToh34S~qB*va+&ze$g}$ zJUpXUBw*yLU2(qds~!*X3|LPg#jBBjqvTO96>Gm5m)-h1c;*9ZgBoB*Xy}85vkQwz zOVSyH!?oq*jt)W+lGRB%10QT?UJFcrj&Krm3P!JcY#BPg+jN9WQkW)#|NfkdPAn1+ z2o44=u=eenlHDJ_KR^Al24-P(1n)h9QJP^<^mqgMpIHFeSIn%7(376rb%g}C1SnEc zW>D>6xrGA?o|*$7h8SUXmkmhCoDVm?i1ol?5p!FMQql;Q4}iTje}f~Tcll_udTy`k z9Vb_jQ6ud`{)>h8t0V3w#K&X9bS~m{u0dY<`Sa(ufndUboDAqRpl0nQeY*+s9dOmA z0FZtM45dgh00@)@udKl6$yz-8#aHOFs-5w&q-1>1W>))N%T(OIQ4P`Zd5Be))YVPe z8TNb+1sndaY1sJ|jPAa^=KvUCQvDow1h{y3&!8GggHUSH9mRr9QZB`}|1TEvuaJ+b z#He+p0X!RKFquh_K25?T@f?C^B~_?ds8S&6gn7!ClW@YKE!VT=^4SYx-{djEBO`G@)eF4|-s1ucc9rro^=Aka6&J5+Uxzh3 zZ0B{(9LD6QI6|Sos$df1;gO9_Kd_P75-Nvd3>N!9|3W0boLM*CJ2;8}wn%&3g$v_bvELvT>1+CJi&rZO=&i zWCHM}Ou=Xg4j`lxQgv!=eT#;W_XMc(izrB$cYrX5M{Fe^RcR0oq>c^U)zP7UI{#4M zuNk?YT9@BGDptdU7na97*xzr5+`a||JN0yv&#mG055vP`AUb;tW8_dhJm~nlS%!b( z>!BU9q_CsFqk!<3Klopso}P-63!hm#XI~iBx?mxio843u56rcZZ5zB&X7B9mT!hZd z$Ic$O-WW=X+X_yO_pjxIC+5tF_vIt#mBf{^nWaDyg=u3_?U~VccbSxqYm+H|LsmUF z0O8N~9UB8-k+#A7i8&}Nvo+4=;a~@UBrEM`7zsVTrwV<1-~>YlFvQ%yWhJuT0=YYI z`yV_|6U0drvQNrLJ+QovIN@rTaVQjIA4xA>?0N77c}F)KL^*=c4Iaur(Lr1J6$%A3 ztKogQ^mXB)Vy)o1udJ*H|Aw?y&f$Wo24c_v`Xd5-^Bh1>E4b0~AYD3rALB{x#h@YM z=H(4~^M*}PN$DAa=KxMW$(|JAtSiWYJb^LTa~E9n8;iJr0f*? zof25|C9>G$KE0}O4)yzF?$3%2MBUn8Td)WT9hSm~gl?Xetm7yEe*Adbu*VNv+8(2i zo3E@uzg+G&G$B|DI{y;)mzdL;>hG3gXXROB8md z{*TI<78-7H032Z=1*1it<{y-TCSn}G4%Xlr%Gc)VQ64_lJ3aRU-py%eUP`arg2=Gh zH}!t8WJvC-M9Kzm+>ikXh?wCc>K{<#A9Z@`$SULc9cJk)FOTggWO)x*8zS(2*I+Oc^`sg+9`~p8$;9KJ6<)58|*ZuyS%z=E2fkK99*ez^* z_t(fMC@2I6z6;5?y{#iVmn3BW671JRxRpRxIE?yR=Ny}0y@dj7Xc-yNOiq`&E!)@A zvw&$am=^x&-Cb(8(A}Ru6ZYkzm0Dr(Ipc&!L{!yDpCCoQXda$%7~{m?AjD>OWRScJ zl&A$DL^}`)?E+_SuL{Nn3pO!{Rt<4b5Rd4B>}~8V#EEP_gcYj?A~Ky+8;c+$dalD* z<>EllX@{`oU07vU;@l`LXXgSf>}`AT9Bj3+ZWm^jeJICuVh zNX0_UN=5hZJVRaOC&hXg3$|{HUa*e#diwMNS7A}BAO(MzLg;kK2Lrz?92U5jq}D)V zY_9q&0j`n7`vnVM2WyB4kI`R}n-Dh3pu`Ec2UBeCvgh`!cH5_y1~lXX0bYCne-Tn86fhcx z5TX+MDIo}guU6dy9U>;?9Qb`vhv$YLu!%wlto!?OM{C3Z22k4rX_MLHK!B5mAU+iz z6qmB|@gee|qrgpBfrAdv8+SmZZ-E9n4=TI5o*pi8rUL~9COqi?pr&mw7RT-rPuueM z2Kc`xnBULzfhB`AntO75EDb0Ff?ZNEd3iipUP|VLx&gK9{QM&uo`sq$2Bau;j#$Jd zwCC(@6vM~IM}y*yLIsD01|Y{0S=NDS0R$QYW_j7`G@p8U0^_RMJf6FFE1(pM)S3^KUZCPnfR*$Sh=i%6v`j+po-4#!&uk(Hy|Yg{ynd~{b|~b;0xdh@$<xkmOR4Zow!rVF(893y>Ayl&7GZ zt}88oa!et}Hu9)IqH`dlmhQ%1^Tbg0$RwXseRR;MehmlM9KkH(K{Fe@h|}#Da*N=# zJx#zl(XjP|D#Q3>2`nrv$*u1b39uPB!6%o6cOLr;XFMENLaG8e$)w=`L}sLE=~X*0 z>`Fq61W{{BLzqW>)T`n6gLV$x>#WP+w5XkM;n|Weo(jRNPi5d(1}QiK0IYIyI8@*~ zFb1krFKLtiKin`w;IeJebhJp2TUc0Ov&ya#ugLol_ooBL_3K0HPs(8mxZidrJ%xMh zvXBrJT(5<*rAoP!$}9hSFXSA zsAJi|pj{DW1TZnY`SIgN=Brngo|ZTBUCs5wCckjO1VkPA>fY||lDrHEbSO!kayz`* zrBF55>puRf1@qs6FT?o$%H?c1DkyZxNAm?~w1OhE=r`2UlQ;aFkdMp+$W=X{8J_xjD7uW7o>KRm}n{-}|3m7DuH>;>mjjn1ZaT0?ou^1ZYwf^ zD75cI-3aF$Ox+n`guQ+Rg5fnc<=$Mm2~l$?7}#*9XDA%S`8$zbH7foOgH)XIf!@lH z&{fb7Fu;37oUY4Q57709?NLg9oYeD3ESe594~5^&nW6mqCw0(kt^0 zx8Uwo>i6*#+q1;n)bfJiZr10m>thc4^#?x=G0{t0uNoHt#{s8&2qeJUt}^Vs=c+vB&nnyskvlV>d_H zcF@hpn%O|Jr*Th& zbLn3_?PNn>(F7VhGHa223uvlg{bL@OT+6c3F)-k)W!8<(9<|8?C8=G_AW!Q9cweT# zcVUoqK+PmNC4~?v^=H~Kv9YGpHO?ca+u#0>tRu<~oEf68odo{i5e!Hx`L4L_q$%a+ z=kEY0k^@OE)CEL!&;2!xBKy*!=ZP<$jBek63C|xw&$2YLBQ-KgV4!#ib5ET6egSwC^$Ag zexDt72B@L0+l64kQD_f$dr5*T845M)5;_v1#ZiKnk)HrzqQ8(hw@^ASp!l zU16wD(v>Y*Y!M>KS}MCz%91Rp6lIGD6;e`463_9i&)n}k^Ui%g_xv-HK7;G``!45s zY^Q096_2jB`!=Up$0Jx}t{tfC5{eA!v$IS#C@7e<+bp7`a02)(>Q6;W4p++k#>UjM zKqeC`IG)6W1_Hzkht@c)Urbt>6~FXar5yS2!?7q=xt`gfOuLub@%sbk4f^5>l@bJg z%)V#^INA?8K70^bp6GWeEzUO()6>TamTbwWzxu&J5JE(W`J~SXp*+7&qv9#g7zCcT z_5J_8D*8;#3AR_05BeO$MPk&m}q6&i2bSLIjiUKBcB;-TQw)L}kZk*Z(#yJ6p$nA{qBql=x13(wYy7%Eh zzG7hadg0{gI0amI>p^boY&l6u;wM|k2;bs0vQ2Sn_!L*!hHD@1+ zw!Js96mGtFv8PPKYHdN{J9HBzkJIRv*4m{k!(NPANcm_vC=z+AzBkc=3z)}UvV&f-A&B`Ea{X8|rY2g5b z=Q!G|(%I=KUK3w5UiZ>>t^rXhotKx_YgY_2I;3*Z$Hm3O9R2+_*a1O6BM2$qDm2(_ zE85^5Y#p}_xWWJdQS@?A7=*l@~Mf@vc>Ml?SVBvFVp1KF3P= z8l{Ds&8=0qu5KyeYZYPUGj;wLx_YWLTlg)*G1{G3VX`bPpUltZX77&O&gv+g)L+@2 z{8Y2$`}a$#pPUmCM{@o!5&W=!^W(%fV>xdAn^W~4si%Hz)9CyH7H6784$)A(L+E?# zE1sfIE1U$1w>CXXkRmK1Ld(0}&ghO>rTGMSZhoXb=o`w-oZKBVcl!#=;-<0$LoZx$ z+P-QKJy=^kD|T>v13TAZUt{tO6mDoTC|doibb-7QLRCrzNl=gLqq)|OjN4DxZX(w1 zCer6V*s$UWe_kvD^qhz0XBGZfYt?W$Yt6BIAoz$rEnEE1SG5%OO#R%bA@?B6@6oOkl-_}2zl~HSPGLy6$`X<=SNfaX5lQ)>Y6w)OHwruYXHuZ z2LDXWessDK^hpd3O@5OLn~iH)uzBjxU9R8DDw6hl0pE9i&EWDupB!_CFX{JQzTBHc za+$ExOe%*j(3FK80PGAY9P^zYUur-7j%q~m zyx*kf?eg1~@$l#}Mnc}<@`vdg7;N+MN@+TcTNBcP4}K&eL9z=Hd^6l6*b%b*t)6_^ z?|5N03`aHGJR}m`PbH|el?_T+ZD;445%c@q>j==e8`q;G0ukuy>+3~RHr$u1gB@f` zP>?#xvv1$(@aUyulN7QU;5sar=|$?xP+UZc-jeZ|U?P;}-}jYxX) zFr8_#uPVj1mH!GAr07~NUq%LoI`p}doRUs5ETKPUx_sYtE125>J(-=G+o;>huU&^0 z=Nv@kl2K7n4G{Q_ONg`7tq6fQlo?bG#WW@Q2u|lxH{;6iK|6MsObE#Yg>19Kmb~uU z`&|)ub=sfn-sM5$KghTq_vhhd(9zLxz%h9`fGfNy_8;HbuUC0)3ABW@kWo6oq(=~`l^b}hTXa5ghZb>gbNTtOdH#VZdlE5 z6uO+%DUY{Cy%BmGc@xd8tyHL|!%XszqlDT5gPu{k3Of;<_Z@5q>o_Ab6{aG+DeEE2 zQunfYp7ztRv40GNRc^g>44`A{kgnN>urGK`S-_M^w+l4T^%iyWkZ?)bUZTCB@p1BI zEXOHo)QW070?1ploXbgDnn{%W>UbYdXeRNiY5cBb14%i!bA5F{XLccz%2E0PYx&zz z2rW#|m*bp$_kv~;l2o-;Jx-x^*T%7<2Nq@`U!G_GKXwbAJQth$*Rc+!NHzh-5^j-t z+~z}Y*-%VXBjI#mIwh!_Fn~a!8UQ1)G_D=WF_1d#>nYWn)~ckrML!d)31Ly9cfN&` zAFhqkmL5{QwDfPCdKuyh%5L42^X`C+4RZwmZ6f_f^wxO^@@E%;KtI1aohS}_r)k!lAJ5x4WoC51}b>PT~2Hj;Om@ zbbt0RF^t^A8CHwiCab8(h*zDWaa2i?ho$>=kRr)k-2@AKg_4$ zXkJq@UqOGWYm&ZTMdCj9qDsW1-qLXipY>V-UEhwyfP2;FE3@cN@txcSNACFexbK=B zGAz~`wKN0`ijk=>KN;<;>X=2(9@|Q%b^P&|k`{g7##Qrk6W2$eBl+ykxn@W7AQDFl z+C8y|R_HeKh@681BolQ`oF;3`ZZHQVW#Fn!Rf4#|I=yf zt9fFBs!9eO?%!I^N?(K~h&{)N;~Sf&l3@1@Kd0kGcJ}Oz=w%U<#eBZZZw;Tq(bs735-J=g#p9e3oHG3rIpLM^Bz)le+X3 zPjV2iKW7s{2z?_col#+GL z3-xI8BGQ!^*WaF^7Ex8!SDmzZixz-5Ce6vsrhTG$jmV2(+lfm%97GV=0q_j+6(otNC0?7C7q^i9S=(G!n* zPCip#_W#xs=MPYlk;L5A$=a-WPgdewdO9m$;L`WIWsW|SdykYvT|K=M!N;&CT6-T- zsZf0tANuHMw!Rqt0R0Ffzd5X+hH#JDJl?16);MF@4T)E90*wO- zb_KE`AoN_q#KvzgmU{lY%=N){J!OTfaQ!@c_0GG-?hNYO?8>Fg%(W17w34Lr@b~ZE zJG)`;le#VaEXiZl$5Ce~R0nxWr`I+}+o6BZ8?V^^(oU!j*I{A?s6R&shl_9d)JDgCiC)b!H7#~d9^q-sqHKpK^4PDld1 z>GYcd6Yz93)2TBq!8HS(wA@b9pFR!YD$99+c>ssT3-fclG{dTSm5d*}8X7tV6-LF} zqjGE6JJ4cVO!(lcfBIZUsXEOHF=rKJaND=FwsIF?6u~k=5Eo98wiwQc_}?Lo5JXZ& zVFnT3f=lzm_C2&P9|WmZ18Si(+fLvOW@Az3K$sBiv4exd0b64z<6Z#}caB$FrmG8H z_C7e=OV(E_CHc6xjuGRTw|}(d^Y%M_!;IvF@`VoVXB)=LO9ih@^c`Sp96rB&LSzIj zn*}Z~mH&qt^Iz@4hOu$Lldc@52)^rR2c7LI$Lc6a+-4jFYrhRX*_$7G$^#@h zoVgENT{29V06r${AvH4SmHMXDN4?AZU0ibCQB7Vp{<$Il)|ZId!Q;_l))Na~! z0IUX4ZBNEjt_PLiN5ywlQkE7+AQE2Z39N%gobWH;u|-7tBO`!4PZX$;+n}aFLO+Wo z8lrnRJ9LfT36OLsXyV(M{RmoC@>V`I^?E_Z5c~!;Wb!!&3iZQdKJ*uwM z!vV1q_)6j3_$5?oQCT@8R}=f4saaWLMP4@N_U)Hyqh<}F<(~|W$IWf#BI)MAN(Nx` zoQ>{3Wa~rmAb$p|RSV~=?%nMM1}rV35DkO7s0(i{k$bo6&lGtTbiGnl1HO@?) zSNK@biB?$OynLAjVG@NK7w5X}iYAsxzMY&r1$>&ioRyW;Z=^ZC^9y|B#AK^4wViqb zifd6fD&TNPZRjXrzlgsrh%Y1Ql-Q*t&mPipdR&D{-(^m(P&KK3d?EMoAkOpCXsWW` zUh#kpni#!uWZkq(eX%M@G6Lvx9bgJq{1Jf&ot%T!2q%}U-1OwDSG2@SI7BiQab>ZA zIcGpQcnn-2GY3Z`Itvn=rn_z1@syO5@_x^gxx4|q3sqZr1!;fv2rHRj%WpB>_{DDe z!IHZrQUBOzFKUoexb(WeRJdLpym%xZkkH{o3k<*qN)qzvfPg~&%@D9LV?HuZhaIvo z5>f2w<86rJFW4T;Uy;u0q(Ow6%8Q89U(>1tDqvR~pdYH8VG@N1nGGuxY|)cqojC&F zLmHics!wk?Z1p*nq&x!8+$!y!rUaqf0`DhtNWRi)Qo(bz{uGn2-(_HA>@`Y*D$?gO z9A1H$A@9|{(F0F3thkQ~L2svuN#Hn6x{Vno{@TivT7WezRlS&YK>VF%+rkh4X6jIe ztD-mKaj#f(G?2=5vQKbCwAdVDaDi91Vr3vaG&w#rTieV}t9m@mIc5=VmX^ny5_s>9 zkc4qmFVJkk?Rxw!D0&OTV`5^+A1d2oK91IPZ~To2FblNS~a>y-mY1~JHO*v|>?0`9aYP_G|qwA&$HugUnkQlkS?e!wz| z4e!0R2R^t-Ywz66yH6$(uLzN2a5v+|XN2+>R?P_X-pH_I!3nL?yT6FCDX!r^;y1s} z!2)C(PTF}qCEBI7G-X4_b;}4`)8(H0@si*0{ZfvVYZe&ZkM1JT#1KvH|8fS45k6QP zkf0DqhuEW%_n^9!nwzKmK6qO|?z(?};L6;Og^2qmyVXV0FnB|B8reuk|8Gw8zkE4+ zpxk2_*nV0q+xjjT2CM=`aq#G1#bRpBSp#AZ!Kv%P4rqA0MF(>C0UGP-t+}u%hziS2 z>EqKoP12N3G=oEEfFwY-rUdkml(x6GcTo=eHi`A?^Q|3`h?+gn1F=9sss`D2<-)=u zCaD`5ukFKxA0g#6TfO}!=d$Q2@{_OO4{!Cnf?%T*0|#N7ue6lZEdvE+YoCf>msQSP zLm|>!dDXfiK}n%VawIc?Toe|n5Zmvl$}6(2Fi=s~y%fTG@4zRNqs=c_B53nWGNg`F z2|CGxJIdX_z#Ld+lHY*azw{yUft-CbbrU_jum+spKsW2^@dw^l;rspyuM{T+V}=7C z28?~YZzmkXQRCgTIhMLHgM-Le@1d`5UW7>R$>Yao=0AY`IcxjK2qI6IT&VrGAwIku zhz#-cNG{|-+_qO;ah>J~+)7rZ=F!}p6EhYnNpM^{pjSCteyA~KIY<059waK1yK}`u zfK^9a6lnoz>FIsNRNU&zo;|#O#f@039EefY%$I?W@@=|xcm1pV+`~IA&>$|RE`81D zJ-IscHLz&L?`&rCde{fb?s5nO(31t3>vsR>@i=_O6LtDfs#|7!MM-$E#34xFXBWPI z&{tPcv7BbO-DvN31|(!|t78Y7{%O;@_{dJ!lPzxh!Iqp}c*{j^Gqrbdj<3R#%+olY z_FyH02q}05fzlI|CQ_iopzKJHybc~aE+c~-TZi2#IvPpQ_8&ukkei^cy33J|uJebm zHDaT1f@|dE${dR(Dj^U=_i&^+p_lWWpZ$0U^a`VoI^Fzzp}#ewj(!)P6k z%5tLNI&6UG+6fvVaw%YdlfF)&sYJp27@YRbE?{zJk)S$+6%a*aX5=t~tmX-Tpx`44 z7nMZZZx^dl1_9>Mf3gMNz1FrUfv?CI6N?W^DxA%nNtMlyq53#89*#?QF} z0lN~UM8o9=Iy47^dhQnRd;vh@dZ7?l$nK;p55^EL=^`l_3gW!BaA@G7VyNi-qIVjY zA({~L$0uw%p9e_vSW}%{pt$|nM}SNg_Y~jK7jw1mq7IX(1WyhLP<%km6R0u%w8Ms+ zi6i@=VSY04A}Bc6ybs-&6~HaK-u`~u@~o(+Z8hUG?S&7oqKHaSeBmy}IP5c7$Yh%0 z-4|AoyesYXguJa;m*9PYF&uz;>pASKtd_uQljAMx7X1`^bzCTf_rxL)(IUh*&5Z9H zkC8woPASQ>LY)yW9y&Y3R8Ux0auWm)_xKb&CA+I1f)J&hNN3L=Gqlx*SI8Kx23T1SIReXjND5B1UgDq}0=(Ua zYYZHuQlAy-cVFnB4!yd!gv5wkgEPldeb_e@E)|&VaVc|RDG#Bzp8^Y42Yu+t)2CH# zovR2;S+x#+diy%sC%ZZU$2X9er&9O;E*;_ZEJElNE zpdvj`9moo#Xj?0YT<$ijhejSAlFCt%Fpr}tvkz3;a=mL9c!d5cRP2QNaTb`P{LED{ zFLAU<%t9rmd&&~C3-o!_MG!UfI(@&n#t(2{^wJ}vqh?iXkUzI6bQ}b`U5pCcxruby zD8)RTNNvZoG;cFUW%A=BBhC`J;>q{#P3TdY8dN;O0xz`Od}u1Gh}0L+m@RQpl&!3m zWCWf%j|n0VrjV^C3$Qxr+|y`da=#X%^Vrwp&|U_tSdfHvQIzTGR1doddoF zB*%q=lv(K4R*6NqJDm(h1(LJ}XO6dFv333UO%PYFEpF!IgpX}433g~9Xe_l#T^6lS zJiEk;MnC{0dwG11*Q^cZfgpvbfd%_LbK|9Xh{G+!Vxf6aec|8=h=}@T1c%d(#~6jt z^^pqjrPKUb-Y#Y6K}L?^CPgaHVU4RE6V{n9NA#8!FN!LA5j&Xp!i_oSeZrJ zfqSK7mHWc}4Z4)t(FZApLd{~|0(iANi&JYF}KMk&d zKEC;Fp?dArl>p*-8y*wl*|iHSN9tG|4Bx&B7RSbcC_q143kNZ-Ge9={5D zwVJF(f!_PE%_|@Q%5BBvLhTc{?*I5?`|^s;rJ;KLadC%WJBsjD9Y>novye)e|Bj__ zp7nv4%R=irxKfoqSmgLOL$_p3M9i{`TpPSEP`NxOzFH~x}Oc6jP z3S=5e7WlyFT+S-K1_^UuE&>tQP?j}x?dHRuZQFh>YPA|+fqoVa4l(Ji7?_lL>IUGo zKLh2UB_XjzXpNQv9hw#tJgs`aNxNhzdNQKof*Gdg^l>9?CEO8SN zl@?W?#9>C(O(a@}dNhcIix9c9IyyP6o3Nsqvc{-C^LcqE!?O_(ed|-|%mOdUEbx>0e0#6m)g@8Z8+&kAeDu#0?e%Xv(2D8>)+~iPXB;yNV z|4EUxw!Y5$d1j^&zwR)ABo~cF0pa{=R3m1F!Khj_0@S^PjQ)dc;9u~Y^Ah*H02~Oi z+p6f=R&daNqZMs0ij7N*>APt)|HS%YI#^jE*Bp4)O+zw4Gj|kPWIb^gM${{e5nE_` z(cn!BvaDii+>G&@r08&MQqNcCKv`A?O*-rzmX$n(R9kP!EL-T=2u?$uHJV8MOc>1{ zJ7CP=qvh=j2x!MD&d81(e)Z~*){4Q!s;~ncI^qw`|*9nkZ9uD`|6)@pZEw2P-B`m2->+b7IKUks+1&7ME-H6#4M0-LJ z-gE(B--)SxxKyK{ZqR}LBj8h}_mSKPQ2w;VxeGS z*?;?EWRD8&2B?@;sbTsNKKjYIy`G*@ph0^2%jiR_P22o@(VAEDqP>$#!F{q12vdaAl zEpDQnAG*qoJst2iQyS z%!WV`tz4@HR^9UrkiN^5-#odRr7un}&nD~G9MWTgfRJNt6wjlp=B z;}1l4$sJv%)&JHVshU~9!{kXio6H9&4_qu%U*7y<+vUi$ zK%8J=W8a{tc=gUrP@_9WF=MOc6O9eeCiET<-Pc~@3xSomEKV{ZGZsj3?qPLG@lz^- z9V!HzZiRf6JB;x892rAetK_A=fP!b%=^Gj*j^ENY{Viyk9@U;nI1;buFnWS><~3Tg zt!Epbm&M{?j)#2*)D;_g@aXrxm)kYb##?do(TO+$oNYOc6F}thD_rH6mzEF=OgZ5J zmv)DAD)b9i&VCNo3=F2H%s)Q5u=c_rNW&Ny)vMD=0y1{l+MdFJlQqJ~#xLAryOo4{ zVPJ#H0ZlcxM=LjB!4V)7@vQ23&^jDpVm819w^bm0W< znVXw4@2kM>!#f>aMwkfP#XB_Mdu;-#T*pTY7LgGVsXpt|iA}aJ1C3$p>l>c|&mko% ztkVw>*JOZXTOBcHkJW>_8d9aTKVVGtytmAY=95eM+2$ zkf(4lDk9><0F74vBpvxWg+iRkW@cQd7@zNz7Z+!Ov|q*&_L)*cc{R0jQm{@%^A>g8 z>>e2N$TKYLTQii&?P~e2lykHW>jCToThMZi; z{O^AkOuFJ5uT2OuqK)Wsh~iPJBo=b+ykNCeGu+&`7K?A4F6H5WQ4kXtrKuw;N3yMT8wg9FV(f} zII|#91i8s@DY&8BceUSlpfa+svKGD&LSKuQAB__TdA@Fyt=DuIuo+A6yCu~U&9u*O zwBm^@d+^|p4xa1%rt#snQ>E>3W|9E|xk%wE9Aq}dr47MT^??)$eZIb~wgs84h5_*L zy&k~88(A5nSnzC!1Gl09fe%GjuU72txkzQ@mB~7wf?-ibmoJxE_c%~Vs%6C`_$Tnw zA|AGKaLvO6QIPR@vX2iT+%lI-*U~RX`5nD=jT10m*d;0gS(w7ASMZ+NpEx};bM|oE z{=Z$e=n7tQE8%J8-1ixPRr(O_PK2BR(wrj61|vt&OB1_-y5$t$1z*fbGgrAYdIQl} z2&yq^{qiDIhWBR=P~OvsE8)`n8bB-Z-$H;07l-}`HcxhHKD~Eo>6Ypn7^@B8oyb@$ z6l_E;dd}{6fFEQA{mZPphhD$FU;b3Ec5h*<@e)vY81^b(bK_&2e~rTYf{cVjR_HJW zBic;AyfIVv7l{VxwEif8wbgdn=kQrfva?5Il+ksEj~2UZY{=+Xw_v~FZviuqb#yzj zViqeK%%l%Lzxra5#Cy-z{52ozO!%L25AwYf^#Kr(Dk_NS*s)`sQY#NQsX3-+>gNO_ zyY>79eL)`ox|nFHS9#eh9KHwkXKPN;82!68hyLgRL|jF+b}>>&H8}khF}VdHy8v`C zVm?Mvlj+<10fa}jg>DwiS5h`E^V+yX+W^!}hMnn@;@k0Y7Q{*MN`J%ozo`1COiFp) zOp7u=fE@f_wR2s<5g~-q zc@|@39~@xQRZ87pv2$kxDGWl`OdruHuTz8k(6b3e5E<4*;!NPxgJ57G8hB3w?iceu z=?ySxLU&*5!n{P+O*b$36pAa`l__K$tz|(UE zI&p!Ia?K-~ykHejEMp6D-$>1j0lgXJBDGqx$?cjN+1HlK9f{`m8sckir^6Nxf!*4u z41|331d^Os;cpOzS{s+!uI^M;R>p;HnAtuSKsdN3>+RE)sfmk6wXSGu!^OAmRBX}S zyLP>Dq4TpP0UvlNu*HcYpxk5b1MY3besA>udo9J&kco3S770lb9(*O);7@a&K24Vs zdf8q;LqQQiDJ(3cm>z7#zqmAyOyi(5VrE|3@J mRXZtzYgym@t2xi-n?D+_`bbY%DPV|#fAsZCbgyl(r~VIewtq+f literal 0 HcmV?d00001 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.svg b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.svg new file mode 100644 index 000000000000..25893f52767b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/cyrillic_char_set_bitmap_31.svg @@ -0,0 +1,535 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯабвгдежзийклмнопрстуфхцчшщьыъэюяЁё + + + + + + + + + diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.png b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.png new file mode 100644 index 0000000000000000000000000000000000000000..baafc82171ce585c4841a36d61e5c517187e9067 GIT binary patch literal 16643 zcmbV!cU+Tcx2@xVQd9_4Kzfmmbm@lBiJ;gV{Dc^2pDr6#piVtC!Cr~tmjngH#k?P z2H8E&8YbqAC*KiS&x<>upGusCA>fNW(+QjmIRyoEsh2Ksl0U=Hlntk{L*$m#p=PgZ znp}I!&6MqWr`5?s@%a}oTJkS`5zqAOB0XkG<@t7_Ci|xIhyfpO8jhxi`ytePclo|s z9E}+enqQ5D!#Yrq$~fRluZ~wFy8Prl3K|1|R`m#~(XL-G%fI_byC=-Z!UAk6rd`Id zYt9CMF~~JMgfybJQn470o@YahNJQzE{+!aK%t(FuAdx5ZQ=RO(z{yCbliSSRs(r(2 zRxvWP)`D(sq(Y-Rfxq>#L?wrG5A(}r3cGmy!g7bLst2K-zPMaKNO)OTC<4@y;1d-f z$%}Xq8!Sv~3a{bp51m9VI_PZLR^3x)s&|=xzy5*!+n0|n8a^L;Qc`5N(}R%9`ll|x z1dccK$Zl^}^*Eg@hi8i2IybaUnS0l0;d1PY3%nbbYIF;uE9-8-_=Yq5@0q`b=+^4T zBo>6Sa%L!;bPiqxYMK8nUr35nFv(+Nr;?|&u#;t{-iH^511j}y>L>DVxtjzM>utHr z;Eedjm$#J`cTry@&N=Dj)8b<~?mk-3^fl7422&^9cDuu!Ut`fN!%TI@zFcwO?@>)0-$wr zv3-U!>!lR|HE>ZROSJQWY{?yov6c8e0?_vry}}4kxfIdrI1a7y%m1Cu*%g+O0foCW zI2vHIFAU(R^o=oAJETC5J&aW}54Am8qe_ zaL7o`0<*hMEsZW6RPr7GR^Nvlj!j(9X+k~I4O(S+lbE<)q(k>xG}esUFJucd`pyWm ztH~S+(KFTdn!dkhX&|TaVn>bO*mGjK`i7ZSZzvYMbYNPtq)xj>@5z9#xne@&q=jLP z;pfd|%d;AOp+0|qG>eOyAY&pbngF4ELi#E8wZaku5H}So+XRuq(ZmhFu^AL)4BHTv z^oZ}g@YT8W(@aU{hkj0C9c-njB}FhciouHVeq^dC(d`lW%9vm*RmJB6sMB5Lr+oyF z$Y`Q0_5JPak>mreqVUN#cj=~q!%5D;-Gsii+3T->T!?(3UyDSth4 zW_MI9pSRx?X7y!B9=m^vO{X|<{@~1DJD>*oIv|I^hPuJrD4AF`<8jM%F~6uH ze>(|Z(zFdEN#31~SWhfg#7#2y?Puq;!}A)w*?XiLV?y1i~B>Ypp7(GMyqsMXU$ zxX=WP;6{7PzUq__*tx^T?$qn;xh+VL8sXK*@r1WbFnAJHP!im>d077D!2d2f@y?UY zYLdn$A+GEkbCd{dN#m1m5%y%U#6Y2(HQf@)ZnwK$ZiEh3-F4qa~SAq!*h?VMx9i7kgbkL#%s4V!uC!Td`@!at+^Bg#Rnqz-BU zmkLjX1nME!ADfE>`-}0DDZ&=L8OwhP(!agv|3)ELaVjB^ie&tmox1d`%36sr{&$A) zS9lINBI3LA*3i+Dpb_`lM68E$MvE6nm@?`UXA7xoC}+^y#u3 zkfyfQCrA_)Z+K(iu!cn9if=tdnci3>g=O#SKY7`VV z5IvUk*h^n;M(~-iEA6l4E>28Ox(OiD$&f}Yk(?vpTGHJ<*vbcQWm83)Rz-G!hPcwT zxtC47Z>srhVtjOle;e^$7HC1&oVdonNs)Y{lcQ6Z+nv2HvqrAqQ*I)m0%jO457@MN z?rb1fDSx)3$=!f{;77|Tj3z2%PUU|%3SXX;^|npjl}xYhBC&8xcPE0IKAQurBtq3K zmCF3a$HkbB?tat{^EU$`oYId=%853U;qrtww-dcm3Numdf1l;OTsgF`c0r`xPvKvP z?nzA?8nGOC5eU+`@yYCuQlAyR-t!DM zFf||`S@qwa%IyyG12LyT2Llb%?->PwVnfUZQ2*k+^VwUb{u?1Z2piM9%K=@*?Gcm% ze;9JQiFw|HqNDqBj1ZR3yWV$M#sKNcSY(-eBh$*UC2eVx5V?)@wU5_N3auvs4|6|0 zoAAMHzpS(nL>6Yi-5T_qY!S%(f2P5oyUTNn*tIYqtMFM>C7Qt0Q{MhqUT5{x4Z@yX z?NEcOdd^$pml+Iqd4^t{gBSHCf~&9}YHA<4eVq-x(Ns+8ks3JUTIN zsm7NsKdQ>Z`zcmjdJ&a`J$Wk|fiZWwzdo83`c6+=WV;GqSV)hvb8#9n0iec}4Cr^Y zd#NXSyn^o?2*cDZ7IB^LEHqvA^efxsqAp1ZZftsjYlW*jiecSY`wc^r6!|~Y9Yv;c z%+NX8O@ogwxf?8Br~a;@{T(Ppc~MO)DlyLt#>*%m73%LJJOw)&CiOZv+j}DlEi=t> zJuNlhD_(+ykgsn`sq522H#!)!7McvHIK2!U&ZgGN@ZH!PZ!R3CgL*nCIq3|aP(ric z!=I%NeukmY4oNK~ExB~YlFakQ5BCGzSEfa_r~e3UG^BqrKN`!Kknu^_Awt0A_xGxf z#}jAuLYzD0x$%8G&T8Ac*h()2R1F?uDFD$(N zr0Ou=*Dl4<42yBax|N8%Q{6f4MR#gDO<_1A-5qe304Y};Y_b0`|01|X#x8?&=VOS< z4MZQa+-iywvzig6Jr3h)45*6jqjzG_vUvs-xe|7usaOd z@0LfmKA|vc@ekL`;BIvIfDUrmdsDeoJ*c>LSt8WHwKBUtP>6Gg;=Wu+kLvHQ(7Tpp zgdJ!+j$?oJdO?l-yIIBV>c=OEeowLm^Otc>;5G3w*~klHdn{ED!t)E9m{|d&%a1nI z&SV69^+glc4HK{E+^AA9x?)}HwhzUv{Q0(t@@j-RnH23sw0lRdxT`F+wP1(E$t{t^ zQv^QNgr)yk0(I(+lc%yWL9h^SI#L=I=+D@1f`Ns-&)Uit5bY7~#6L`x4oRa3QeTaU zd4Oq1ZSGmm(K3xNkHK1{W>-aD1r9$!CdQh!Jrm5&Vnzve$N?*NMDh@gD7@lk1Fd%Y zk?FIZNzTXc8DThUbjq-`R=z}D?lyKY&ine*{3S|9mt1ghINN*ZXun;TB zkzK$UNZ$cg&W*fC-aTHsCC|xKq&>LW}C~ z@)hNI-Yxpw*>P_p=-$O;IKy`h;rBK5i>#X5#QSc^kOqg+HQs&(r^9ElTg?Pntx#%w zv$>mE-{G|*Z((GXaxiZ+cX}Y@eG`MFG_iw96O~|l!&_atXTz-$N9bS?_7Kx0Puzas z%DEoS+=U~&-s;L8XyfI2a$mWqkc0xKrwd`>OI97DI zNR93`;Ce`Fm)oe3nH|tlS~j!DwJJdsHvhizI)KkH$~bdsrlPfZxqTKCzX1P)-509^Fh^LPaW$jPl~zKxMPTpC|x%F}xHrC!}ch-gBk*jCXna zt8&K>=9Epb2_2$q{@XI(@ZI!Z&2(wHDWEFy)O_Z(d?=B{5hY!X_IfmS9J<(fb|^x$ zO%CkeXjVcfW0#rclsQSd>vl)(j7^`{O=2UcBP`_Jdzp*n+-^@mQK_2IMY7r#z?Ode zt9}I;O}po&=e}|8f3M1r#h3B+t2qzdgQ?wkXf_P`pKFgKP*n#j9(5+eGQ~9i)*){O z2kXgp5PC0rrOLSdLKb2?VPaH7HLdUR`Y)9F9)!s{O~aJAHG<139>?;6uRIJX9Q(Jc zQp-pba!JU*iog~QA@;Yvsz>2h^X>;FTM4(|uqv^fTa-fivtZKo0mbp>gbMDXB7G#e1*3|qV;H-PR&v#Q1BYThva{;V+&DnUl` zM56!ek=g0qQ%QBVJ&;ulhku+E7481;xH<^P9omL);P$14@8|bv46VAJf)Unl@C{Lk zJpIWw31}WZ!T*I)G-YM7+-9$8ef231Uxky@H|ebZGx1>I%;DFa;jFqt-W)$K&F5j- z$82RDl+n{_T1e90!}WvC{2!g81LPg)+!eB;i2JNX*vD$SZg+%9zb<{~P8GjPRvEkpILm zTY}Fq_>~N3Ir&EQe};wusXN71f?&ht6A`gCjAc20&v?!>LYz{#TY4T46F^BOo-0u& z)4RBD@)O8+U92np7}1h zCypl5YY`^{(>>o-*vg1+qA4tV$bF#vQ_+gAS^~Wvig|N+SvT^s5p={@cPx~JS3Y<{ zq5cpjW{r0Ltx5AkWqK2pStTnkKql};Zx+vA8!9}OcnZ?TKp1MHNcV~M2BowVl~^dR z^Fx6i0T=&lk404`R5iTX-r4na7hhMSm~nlHEqvRPbMwWRf0!u~N_){g zasm)}v`3bH0J1|>HenMR%<#GQgHY?*Ni+I^m&kGbopQfM9lb=@wfj@0BP)AzgA_qo zVFE6(_s86t-R|@rg#o&sl!lt?B|_?!uBY;t(5>$hExJ4@xh8bjz%o zOM72wGD$MI{?@|+vz{EfkuKuqy4%Xv*r;B0FaWwtnfdBq4s5N`?+Yvg4k5BF%X@zr z+ssf7P)Q=KUAZXBn%L=a@GQ+uhdXV1y(mQg^h^2`jJG;_7H zozLnZvPB9<8j43fg){|(eLgL+>_|4*?dpGcks|v}MR2=ebT9YqapC)?0~6O^{M(in z1V85a))X#L;nnMRua~?vUbwvCETgRkO5BfbA|wo^S`KzIz!>hyKhN{m8hev!MmpQ{ z#iPPb2x*-kBpw^c`(XW*!Pw-*^q@DB)Dv8MqQ&)MYM`Yjs@J`bLV*KSO;oT7J$`jJ zn)FY@G9eM*cjH;`JymMH2j6S4e=EIFQKYhlwKtlpa1q2FtuE{N3c+EQ`zC>6$cvN% zj8<#7NQ&LjJGhA(mP$hIyBV6oj_rqvG?qzxts9J8*hifFyC6dRCJRDz+Fy@TSyd~z z^=2_P4p^g=_&DD4ltXF_9*R~@X*x_QH3;iympM1?t2uB!nJ2yAt2)l68Xp(rXV4{+ z3W7O~uLWB2b*k8g813Lw1_1y&;IM8fvgElg>ZkZy8KpznCsE^Z^V2x2hkitG9`N8M zNb43j(OEFvuH=+K?v;AB+J+G;Wzc6`G48stk9OIqv|Gft!hw7^LrU0(c+1-wR4_7K zc{saaDMS_t_yp+woG>tbx((h_R;QT>nDmhl^gW=EP!2^79;9QdDWJlza#h=I?DmDh zO52>%B{jn8n%+(mM*{}SQRAv_a_**ct>DV^Ojhj|SE5FK9UzxOsvohGO#JSb5jnlCz1a zC&mD3kSwL@P0eThU#Ug(0^}69wmV0~omdw=aTrK_I@FwHYRP*vnB9`90JetUY7CIzf)LCFSl!G*VI4U>EV?%cY*|AqIFIeeGj zU|B*Kj#Jz!)fh?^L_R(jQ^1(RVQz~!J;&RBeQBAX03YJQ$5``qiaG_)3L=ugdgamp8~ub@8!N2u|wRz6Seuf_lFY>SfJ_ zM4tF+Lj^36LjD5U{=~GaaGbmlFqDNo=lgqt#=TjpU&J+cAqjp$OJ#?Bf4WR}tSamFI`SjwNZw z*YN>%yC6N)Lqx676C}*-#!i50)z_F0r){G^d>nBt(z(BtjFaU45{DfN86A&kB7j-9 zbjcj|TkDf!D_4T2VY0D@`v_9kfCwCq72emR4{he(~b%v(Zm#w-i zkwBoBm~$@zQeo}SlHz(dHOf=h1tJpIP*A=`Z_MQulxK}9;a++2d9uZs?L?6R)|+ip z78qj+ThT;_>P1pkYiVDw=Mx@WF{gm#OB$P|6j}h;at0~2jmbebKK$oa`ctMP^Kuu+ z9UrZtdrwVVlXw6z^jII5+c%x^M|AvOKoFi1MRL{I91k7i#X-q9BNzFE^(8Py)kp37Gdj*=&jwu>RPGX7Vn#ipF7Ypd_q4W_ObNFe=Oh4 z+O-PMRxJ*@H4071t65UcpW^9ud-Li&Mrb~$K~QAUYc@}ARTtdlq;+Bptfe8j+1|J(fgeRI`dD`ip9rguc^$zbyU2cWDD zm!EItSTJLH(~a6k8OM(j7_{avRMEs>DpRpvWqbDA-C&EBESz}>is{BU9~W(8_jS)R5?7_;~cF5r@o`4!>1QGKl&R5uDM+c8VNA6=6rDev`oN*kyNxHHioDeSh|)NzHd8WtfnI z*i)w3RLW{tLDDPJ#3E^|H1Mf9cYqtr1s|_kN-Uc&4qLRv-1cY>>x>&I916NAJvwBK_k z3xz%>51R&>^~kt9s5+cZYo}bNu1ORcG!!9+9w?$LlrD6@Vs0kW%jQ@Sxie~;fgE5B zOgXQ#Z`g`Umf9v}6suEH z+%sScGWch4k3xqi2l>OK8$8poCqkn|ZYCBD*uoc|7h|1W@4dWni|BHomfS1{EbGz_ zyw5F>SEUsslE?6r2P}rU)gR6zhgV-(sje|pLk$Y!sd`5rH5*(90CU-M6(Jj_uk-sb z%uwPC$EV7UYspcK9gUF6e!jfd=nfEo0p~K58YQ`(7$Abm!jrl{%yOwwqz}yAd2zx& zqFX2(J%P(sg5UoZnB#AluKBPpADZ*4vrpJus(84l9V1FR&`P{$alo#taP z(&7eey1@zObM6{_>&N1j-NE!v9CYt4coA;FZ@W7z=9i-J#@qB1;ymByW{{a}IsSh5s7#kuVYX zuGicpQExR4hL6umH9kmV+P3$*SEd}G2_QEnEcKnjkZER*dLFOCA@?}5!6JlA<1Nw7 z3`y|oE}sFH26IZ-^Ad~1DDlxKCu09IS-Zj9f?ft$@moQjvr7K(!;kgROYa^4F?U~d zxYT17F6SW1dSsu}p|Kv)Y51{U9*xhGQJOixb^+zxa3)bwn)#^VWEmwauiL0ldznN{ z%?{{#K4$2v z+O_9@rWT+gRpqcZgzzsGj1U*uV0p8b>eKW}smb@#$%O+dO0$RC?{V4`Pq@P1x-WMl z2;m$6c1!<+4RG)w6NB8ASp(JuHY(n^l1rdc)-dhXy+?Z-HydKs$kT{KEDZ&4rqc3p ze`IuG+@f09l?M!EsLKV>g>;x8(q%hcqoYu(|3W0nCf&)DUnX`vMM{*Ipvvt|o%_@?;Grt9aPQ3ZF{*sEnHM`|z7Rt)V?G$WW6g$m?=L$3`k2W2u z+bc=+N~8e)0&U)L_^BIIX_Ap7YAbA=eI0C+YT9ksGz^Ude|;1oey%@XR$zF0=p{#I zzO0~&iCyI7WNcP;U)E<|EWZXu_s9%$-7pSAZ`PodSRnR7VRP}!ry?vwZo9J387}NN z)0(cs$U9Mt@1qjWF*WU1goLrvzRBFV`Bq5<)Mt7^$JJKvX1f=5IRi( zk(ULA4ed(MTGlD!AWI6dD=u!C+Sox*FG8Gxba~9Yp*X-lAa3+^ zO4c+3D{qc~W{WX0OOk(m%e3R-GW$;_6`^WcQr<(!)w8nIxgTxdvV8GN$0=ChC#A(< zF-4Vab%t=Y7z`}^8qP@hj^_B?LCRio^e^UvQ5_!22%UlGny?v_NgSwW(7N|e=64ssH>;vCr!(tFgbVr57fn zWtGg$T?~S$aXzco^@b;C{B*CC-!EW8t7fS_$=j% zP2#T82#Vaq^-M9zxdAPortDP32aSff?1}I%Mbi&3{-EOghpEZ`{2iNQF5@WJ&?(Io znrVta){yn;e>imK`KpYEYp6$09hB?&rbDlWzk>SiDe}KNUg+*=ckZii!G0<#ZZW!? zw5o7aqE*Drm-{1L^pnZqU+MQ#reI2gn=UD0mSRr}$kR1R5h)dMS%giAn|*O=)maRw z>|zR|+B(hpt-bpk2$&*wFP3H>#1O$bPWGHc-5OMFSiAvHrh+_c@~!mo9$Cw(n~AZiIS<~o7WOk=tRK23wm~^h~OT>;(htB5)C+taZS35--E`j*X_=nA8 z!!L3!Wk8pPp_-;dv)izk<{K`*(sjf;m)pAD=!uJ^ANYGIv(^;$5kWnbp?=eNb(9S) z^E~tAN@5XUJ6oYT?_5& zi!%FO=wZIxA1{HYZYo(t7x9w}DKcX-=QGXT_WO9&K4%T;>a1s&cirMH6Gx~$C^sj& zjt!-nW=aKMOJSs!2tKtCvCRF`#wN0jNu<<=*Q7YfwEy|Ad7r~-UL4GU6Sb*Ub+V`{ zg{ER3aGUxK!((9OubOw5BtkY}{nUN)mz^G^NmAH&W4+hQ7a56vU{odK%QPw{k6sqO zsm|8!t-Cqk@B#Kkr14=YGxt zu>GIu)wE&97{Mk3J_p*kxEby)rcxBZ_(!tdcRj~W;;ww`7I)=KkCp1M6=#0>ac?1_)4tTcJ;lq7JVSt<=IhqO5sq{~=U*B_` z#(=qU!sa#@wk|vs>{UmcT7Fyk?(Ei=Jx^=Qfn`;nOg0O%iK@B#7gSmgh|+qMZyc4o zji%(FORKNUXbh>KaMDRyUWE7?0T(TirB4SH8qS33DzNBJb9qm zLN-Y2h{&x-~TAsxnG~Vc}FIi4To3@KOUUyvE1!cYY6@a}C@8lEm$w^?Ynocjd zTe0SjyFQn+_VFC`08(R{ejzthNKj6`I>u_6F?{PL0$E2^YIJ@-l-vdJ?Z_9In_SF{ z>X2Ep`x+O8Y>TOj$@-COPxcP?)JrFk+QG%#m5N@OWN-cUbiNSTipfW&Af4KJYJR__ z!rg*?d^+P#neup=>)Y`Ta*o0NxxV3#qsqnU6sh%zuW$A9Xi4B?PU9>s^?xsy&};$f zan8*t>*N`UuYT3TK#`$9G_OK1F%j}?nptFjp6cldMIOD+gjlDLeMZwkHNM(Qj| zCNB;SBoo8JyO9hlQKAjeu0UpA`{ZMcgF`t(vXHP3dRE9npI}^QZFI}jsrWr(RgBQI z?PP-WII}jDIH5`l^1KU$p9B;iuIlHWm){48rH9mwd$D%zC1Z$_zR?=xKPxO7sy;>$jW3q)gE^}lZ zQ}D+v|4*y=JfGJ23S%B2&(4Zhf7&5FK*dJc|nTvOWvQoIon6v5jP6z<65S|yO z=lZLZmWvAJFjtRGotoH95XrJu~9w8XWlAQZ6T(oT=QuX8_V@b6=gzM;LXlf5gc*9KZ~VXx ztSiZ`WQE8-!cpyY)*C>ryJ~2m@a0c+Pf^;E#{raP6QyA0goNJ?Upn;QgT|Cc`4?ds zJu@D{jKea4tNOtlA)}+?4MLKS#MMRIVbdWS1Vj3yzj_5OT_i>D>~-Hj$&{a*03ge0 zIzDqfLEFfu%hj*fII|OZ3|~GB`50}|@_|#N-iWbF_(l+^am9QvA5YV^GgFYb{sV2?B5nX0e1lj16|+4BNY~LYCdbI@na#99KZAUegJm@x zhv+THn#I=?o|Sp0S+WJ3ta)7li%m+RMq>1aeKjluf4e^6Fkq8Wz%3vdn+8pUJ?o~I z7j$8@8n98c!7S-l2Cvp)$7%bs#@tWsfTPU?Mns`Mf;S(~LGw!{r85YkZH?GxEq~;m z=BEamfG%I;o^sj%qzLBglS;z`#KE1fyef~))Y);ebGR&JFp>)DO6Ju+(4-e|BASG1 zt9GsFrVCr;x5*YnZ?L|XpdfY5&Qx-uGpAP>2O#>+YXii&FYC*^qOS|N8F(@98mp?) zYZ?EVx?-%Mzn{rG>{%w9T8Jrk7MxIbD!KJNt8dhV8-x2>E=SdEW}n9 zCf3JF01d`<{#a>ZkqG)G)u&7Fzr0p#nNNOvJ3h6?{>=FLk&5hbvxnRR8}-CoOTYMB z>Gjn)vsfW8wMKLtvJVR(mv{+exiWFJ>hO9SHMneld6i(9gPtrJ`CCAkp3Uj zQkJ^cqN8!?RxFDY9hB}=Se$akXoI;iU*WSTH;*wR4M2R;6i~H>OWWf5--YBQq z#XnA74nnIIcqJK!4JXZkDNnN_XQ%Tnw5(pwsMvp=%K;}fa>bwG2T8v&b~`h5Q#>K< za=pQG-VxF=nJ~;CX!N3XjSN^lsq>>;jJ11go+U62^BL0J5%O*Ra?rN^M_}61XD!9} z%MGizB%Xd`SV*EFMX!1%q0Or*H%%Il>-u*5QY(yTQK@EpUy60uAY()WLUJx*aK<^fn z5rQIoOSn_6)?Sh2&$r=bpL$^)XJZO0esLRJ4f$Z4SwaeG46JHdrVdTP7EcGFbgq1| zx?Ddgtw2b*&3hbRJY_I);3{TqJqD^>iSm^9H7&`h8*5vd>z$nEHXb_gN9)di{**RQ z`qFJUprw493mq$L+_VJ|aXXY~D)zoakV)W`jVH6%zkFRkE!%3zrq7=Olxm^(GEdG{ z6n{vxKDj)S+^Mp0KJK{F#lOLx89hnkHWJ+EAbfAQY{OpS^9&X4yVdAHyOYr2F-#3{j& z=y;qXUQNF!_OR0{JVeKEsg1d4B%j?-YEAVi310a4K^gwgH8P-C)fesj{v>gXY(auJ z3Lt)z#29Mm^y`9Hn311xatOoI`pb0{JYtb6d~Iagw=J%Y5)u;xu_0}o3oXltnQkZC z1^HlJeP|Vw#jRM>QQP)`N zAnmcN?K!(UF4Q>>A!H`5`Fp%{Xer8!ji0ym^=`2`sRUh?b>ypi^r|uK2uSKWc~U_$ zAwk__*L-^^Xn5ABH*93y$Ptt0Gt87C{Fn36HNvu&JsW&d2MZ<9nB8*ph%Vkq)+ZX6 zI{^u7u!V?T3FKjt3t8L2e$NbBS;fQ%rCHag&AYyxCI6oQ@?WS(8jsLBiK(Mm`oEnI zTnM*Pv4ZT9KHVasz0$JV6)5kYw|i+-GqpdxjZ1wK+nhcD-XEcxx=9>CWo>pGpj{bx zSE~O6-t1)@I`^xO!^0UL2Q`xiP2OR0_t4jD&y}6ZY$!!oCNKA0o_QFXkMCc*Tw-nE zei?w9xnjG3tDtGq4kcQ>{J3&+lMPYM-kL=Y!2`SS8JdZa=K64E|BCdoD}3-r;y1Tk zef#1K=>g3D=_d23?RHnu`OV2J&S%b?!GHU|0B?d;i^RLv=RnYSuaq6ta3a#voR1U; zHeq+BbpTg{B)x!2x6-6v<;+b1jU5yxWq;ktTgudloq2;O%ywy)HAJiwiTwJb6#waV i|Nnd8%O};HuN8*pyAKQtEy-7ZMqm4;R=MVF#Qy;jBQ6yH literal 0 HcmV?d00001 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp index b795e01d42d3..d12bf9711907 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp @@ -48,7 +48,8 @@ * addr - Address in RAMG where the font data is written */ - void FTDI::StandardCharSet::load_data(uint32_t) { + uint32_t FTDI::StandardCharSet::load_data(uint32_t addr) { + return addr; } /** diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h index e320bd7344f2..48794d475f85 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h @@ -23,7 +23,7 @@ namespace FTDI { class StandardCharSet { public: static uint8_t std_char_width(char); - static void load_data(uint32_t addr); + static uint32_t load_data(uint32_t addr); static void load_bitmaps(CommandProcessor&); static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); }; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index d21b7f0e7f32..39b8759204e9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -73,6 +73,13 @@ return val; } + utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) { + utf8_char_t val = *(uint8_t*)c++; + while ((*c & 0xC0) == 0x80) + val = (val << 8) | *(uint8_t*)c++; + return val; + } + /** * Helper function to draw and/or measure a UTF8 string * @@ -92,6 +99,9 @@ const int start_x = x; while (*str) { const utf8_char_t c = get_utf8_char_and_inc(str); + #ifdef TOUCH_UI_UTF8_CYRILLIC_CHARSET + CyrillicCharSet::render_glyph(cmd, x, y, fs, c) || + #endif #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET WesternCharSet::render_glyph(cmd, x, y, fs, c) || #endif @@ -108,11 +118,14 @@ * addr - Address in RAMG where the font data is written */ - void FTDI::load_utf8_data(uint16_t addr) { + void FTDI::load_utf8_data(uint32_t addr) { + #ifdef TOUCH_UI_UTF8_CYRILLIC_CHARSET + addr = CyrillicCharSet::load_data(addr); + #endif #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET - WesternCharSet::load_data(addr); + addr = WesternCharSet::load_data(addr); #endif - StandardCharSet::load_data(addr); + addr = StandardCharSet::load_data(addr); } /** @@ -125,6 +138,9 @@ */ void FTDI::load_utf8_bitmaps(CommandProcessor &cmd) { + #ifdef TOUCH_UI_UTF8_CYRILLIC_CHARSET + CyrillicCharSet::load_bitmaps(cmd); + #endif #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET WesternCharSet::load_bitmaps(cmd); #endif @@ -145,6 +161,9 @@ uint16_t FTDI::get_utf8_char_width(utf8_char_t c, font_size_t fs) { int x = 0, y = 0; + #ifdef TOUCH_UI_UTF8_CYRILLIC_CHARSET + CyrillicCharSet::render_glyph(nullptr, x, y, fs, c) || + #endif #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET WesternCharSet::render_glyph(nullptr, x, y, fs, c) || #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index 566f21218763..b615c812eb14 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -47,19 +47,20 @@ namespace FTDI { * pointer to the next character */ utf8_char_t get_utf8_char_and_inc(const char *&c); + utf8_char_t get_utf8_char_and_inc(char *&c); /* Returns the next character in a UTF8 string, without incrementing */ inline utf8_char_t get_utf8_char(const char *c) {return get_utf8_char_and_inc(c);} - void load_utf8_data(uint16_t addr); + void load_utf8_data(uint32_t addr); #else typedef char utf8_char_t; inline utf8_char_t get_utf8_char_and_inc(const char *&c) {return *c++;} inline utf8_char_t get_utf8_char(const char *c) {return *c;} - inline void load_utf8_data(uint16_t) {} + inline void load_utf8_data(uint32_t) {} #endif void load_utf8_bitmaps(CommandProcessor& cmd); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp index fc5d4de85dd2..4fb2f8fdbf24 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -32,7 +32,7 @@ constexpr static uint8_t std_font = 31; constexpr static uint8_t alt_font = 1; - static uint32_t bitmap_addr; + uint32_t FTDI::WesternCharSet::bitmap_addr; /* Glyphs in the WesternCharSet bitmap */ @@ -286,7 +286,7 @@ #if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) {UTF8('þ'), 0 , SML_THORN, 25 }, #endif - {UTF8('ÿ'), 'y', DIAERESIS, mid_y} + {UTF8('ÿ'), 'y', DIAERESIS, mid_y}, }; static_assert(UTF8('¡') == 0xC2A1, "Incorrect encoding for character"); @@ -331,7 +331,10 @@ * addr - Address in RAMG where the font data is written */ - void FTDI::WesternCharSet::load_data(uint32_t addr) { + uint32_t FTDI::WesternCharSet::load_data(uint32_t addr) { + if (addr % 4 != 0) + addr += 4 - (addr % 4); + // Load the alternative font metrics CLCD::FontMetrics alt_fm; alt_fm.ptr = addr + 148; @@ -352,9 +355,11 @@ CLCD::mem_write_bulk(addr, &alt_fm, 148); // Decode the RLE data and load it into RAMG as a bitmap - write_rle_data(addr + 148, font, sizeof(font)); + uint32_t lastaddr = write_rle_data(addr + 148, font, sizeof(font)); bitmap_addr = addr; + + return lastaddr; } /** @@ -394,7 +399,7 @@ * * c - The unicode code point to draw. If the renderer does not * support the character, it should return false. - + * * Returns: Whether the character was supported. */ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h index 652bd6b2ebed..683093d866be 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h @@ -21,8 +21,10 @@ namespace FTDI { class WesternCharSet { + private: + static uint32_t bitmap_addr; public: - static void load_data(uint32_t addr); + static uint32_t load_data(uint32_t addr); static void load_bitmaps(CommandProcessor&); static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); }; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py index a7de06d68bb3..0c4499e9aadf 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py @@ -49,19 +49,19 @@ def add_pixel(self, value): def convert_to_4bpp(self, data, chunk_size = 0): # Invert the image - data = map(lambda i: 255 - i, data) + data = list(map(lambda i: 255 - i, data)) # Quanitize 8-bit values into 4-bits - data = map(lambda i: i >> 4, data) + data = list(map(lambda i: i >> 4, data)) # Make sure there is an even number of elements if (len(data) & 1) == 1: - result.append(0) + data.append(0) # Combine each two adjacent values into one i = iter(data) - data = map(lambda a, b: a << 4 | b, i ,i) + data = list(map(lambda a, b: a << 4 | b, i ,i)) # Pack the data data = pack_rle(data) # Convert values into hex strings - return map(lambda a: "0x" + format(a, '02x'), data) + return list(map(lambda a: "0x" + format(a, '02x'), data)) def end_row(self, y): # Pad each row into even number of values diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 1877914bfb5d..3bf06a68c24f 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1016,7 +1016,7 @@ namespace ExtUI { } const char* FileList::filename() { - return IFSD(card.longFilename[0] ? card.longFilename : card.filename, ""); + return IFSD(card.longest_filename(), ""); } const char* FileList::shortFilename() { diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index db2a9e2de9c5..47875a08b13f 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1077,7 +1077,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // If we have a longFilename buffer, mark it as invalid. // If a long filename is found it will be filled automatically. - if (longFilename) longFilename[0] = '\0'; + if (longFilename) { longFilename[0] = '\0'; longFilename[1] = '\0'; } while (1) { @@ -1089,7 +1089,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { // skip deleted entry and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') { - if (longFilename) longFilename[0] = '\0'; // Invalidate erased file long name, if any + if (longFilename) { longFilename[0] = '\0'; longFilename[1] = '\0'; } // Invalidate erased file long name, if any continue; } From 34d9cb67784c3b097cb027db8445424c1b183b4a Mon Sep 17 00:00:00 2001 From: BsCmOD <64871957+BsCmOD@users.noreply.github.com> Date: Wed, 23 Dec 2020 08:01:18 +0100 Subject: [PATCH 401/443] Enhanced Italian language (#20551) --- Marlin/src/lcd/language/language_it.h | 50 +++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index ba2fef456a47..7437ae447955 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -41,12 +41,12 @@ namespace Language_it { using namespace Language_en; // Inherit undefined strings from English constexpr uint8_t CHARSIZE = 1; - PROGMEM Language_Str LANGUAGE = _UxGT("Italian"); + PROGMEM Language_Str LANGUAGE = _UxGT("Italiano"); - PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronta."); PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); - PROGMEM Language_Str MSG_YES = _UxGT("SI"); - PROGMEM Language_Str MSG_NO = _UxGT("NO"); + PROGMEM Language_Str MSG_YES = _UxGT("Si"); + PROGMEM Language_Str MSG_NO = _UxGT("No"); PROGMEM Language_Str MSG_BACK = _UxGT("Indietro"); PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Annullando..."); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media inserito"); @@ -72,8 +72,8 @@ namespace Language_it { PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); PROGMEM Language_Str MSG_ITERATION = _UxGT("Iterazione G34: %i"); - PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Precis.in calo!"); - PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precis.raggiunta"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Precisione in calo!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precisione raggiunta"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home assi XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo"); @@ -118,10 +118,10 @@ namespace Language_it { PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Muovi Asse"); PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Livella piano"); PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Livella piano"); - PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Livella spigoli"); - PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Sollevare il letto finché la sonda non viene attivata"); - PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Tutti gli angoli entro tolleranza. Livella il piano"); - PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Prossimo spigolo"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Calibra piano"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Regola la vite finche' la sonda non rileva il piano."); + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Tolleranza raggiunta su tutti gli angoli. Piano livellato!"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Prossimo punto"); PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mesh"); PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifica Mesh"); PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); @@ -447,7 +447,7 @@ namespace Language_it { PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Metti BLTouch a 5V"); PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Metti BLTouch a OD"); PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Segnala modo"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PERICOLO: Impostazioni errate possono cause danni! Procedo comunque?"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PERICOLO: impostazioni errate possono cause danni! Procedo comunque?"); PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inizializ.TouchMI"); PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z offset"); @@ -644,12 +644,12 @@ namespace Language_it { PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Ripresa...")); #endif // LCD_HEIGHT < 4 - PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Drivers TMC"); - PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver in uso"); + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Driver TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Correnti driver"); PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Soglia modo ibrido"); - PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Azzer. senza sens."); - PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo stepping"); - PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil."); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorless homing"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stealthchop"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Stealthchop"); PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Resetta"); PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" tra:"); @@ -667,16 +667,16 @@ namespace Language_it { PROGMEM Language_Str MSG_REHEAT = _UxGT("Riscalda"); PROGMEM Language_Str MSG_REHEATING = _UxGT("Riscaldando..."); - PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Proc.guid.sonda Z"); - PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Tasteggio rif.Z"); - PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Movim.a pos.tasteg."); + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Wizard Z offset"); + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Altezza di riferimento sonda"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Spostati in posizione di rilevazione"); - PROGMEM Language_Str MSG_SOUND = _UxGT("Suono"); + PROGMEM Language_Str MSG_SOUND = _UxGT("Suoni"); - PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Alto Sinistra"); - PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Basso Sinistra"); - PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Alto Destra"); - PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Basso Destra"); + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Alto sinistra"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Basso sinistra"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Alto destra"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Basso destra"); PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Calibrazione completata"); - PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibrazion fallita"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibrazione fallita"); } From 2be027f92ee040999157480517942c085809a27e Mon Sep 17 00:00:00 2001 From: Sebastiaan Dammann Date: Wed, 23 Dec 2020 08:02:27 +0100 Subject: [PATCH 402/443] Probe Activation Switch followup (#20550) --- Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V453.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index 35eea1da7891..9acbb42a88f4 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -33,6 +33,6 @@ #define HEATER_0_PIN PA1 // HEATER1 #define HEATER_BED_PIN PA2 // HOT BED #define FAN_PIN PA0 // FAN -#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe +#define PROBE_ACTIVATION_SWITCH_PIN PC6 // Optoswitch to Enable Z Probe #include "pins_CREALITY_V45x.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h index 836e5a91f1b6..f990b2f7b474 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h @@ -33,6 +33,6 @@ #define HEATER_0_PIN PB14 // HEATER1 #define HEATER_BED_PIN PB13 // HOT BED #define FAN_PIN PB15 // FAN -#define PROBE_ENABLE_PIN PB2 // Optoswitch to Enable Z Probe +#define PROBE_ACTIVATION_SWITCH_PIN PB2 // Optoswitch to Enable Z Probe #include "pins_CREALITY_V45x.h" From 28440867721b5c614db604c6c6e82c4dd7ab41cb Mon Sep 17 00:00:00 2001 From: Darren Peter Date: Wed, 23 Dec 2020 07:21:02 +0000 Subject: [PATCH 403/443] Support ANET_FULL_GRAPHICS_LCD_ALT_WIRING on BTT SKR 1.4 (#20427) --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 31 ++++++++++++++++++- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) 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 86fbd18ba28b..d599f2414f84 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -260,7 +260,36 @@ #if HAS_WIRED_LCD && !HAS_BTT_EXP_MOT #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) - #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." + #error "CAUTION! ANET_FULL_GRAPHICS_LCD_ALT_WIRING requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." + + /** + * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. + * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * + * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! + * + * The ANET_FULL_GRAPHICS_LCD_ALT_WIRING 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 open | 7 8 | BTN_ENC + * CLK | 9 10| Beeper CLK | 9 10| Beeper + * ----- ----- + * LCD LCD + */ + + #define LCD_PINS_RS EXPA1_07_PIN + + #define BTN_EN1 EXPA1_05_PIN + #define BTN_EN2 EXPA1_04_PIN + #define BTN_ENC EXPA1_10_PIN + + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN + #define BEEPER_PIN EXPA1_03_PIN #elif ENABLED(ANET_FULL_GRAPHICS_LCD) #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue." diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 279c7e810076..533c92e0672c 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -104,7 +104,7 @@ // // LCD / Controller // -#if HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER) +#if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER) #define BEEPER_PIN P1_30 // (37) not 5V tolerant #endif From 59de35e749ee6e36ca5fbf7eeae32f34d78f3cb0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 15:33:34 -0600 Subject: [PATCH 404/443] Apply ENABLED in ExiUI / FTDI --- .../ftdi_eve_lib/basic/resolutions.h | 2 +- .../extended/command_processor.cpp | 2 +- .../ftdi_eve_lib/extended/command_processor.h | 10 +++---- .../ftdi_eve_lib/extended/dl_cache.cpp | 2 +- .../ftdi_eve_lib/extended/event_loop.cpp | 2 +- .../ftdi_eve_lib/extended/ftdi_extended.h | 2 +- .../ftdi_eve_lib/extended/grid_layout.h | 2 +- .../ftdi_eve_lib/extended/polygon.h | 2 +- .../ftdi_eve_lib/extended/screen_types.cpp | 2 +- .../ftdi_eve_lib/extended/screen_types.h | 6 ++-- .../ftdi_eve_lib/extended/sound_player.cpp | 2 +- .../ftdi_eve_lib/extended/text_box.cpp | 4 +-- .../ftdi_eve_lib/extended/text_ellipsis.cpp | 4 +-- .../ftdi_eve_lib/extended/tiny_timer.cpp | 14 ++------- .../extended/unicode/font_bitmaps.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/unicode.h | 10 +++---- .../ftdi_eve_touch_ui/language/language_en.h | 2 +- .../screens/advanced_settings_menu.cpp | 2 +- .../base_numeric_adjustment_screen.cpp | 18 +++++------ .../screens/bed_mesh_screen.cpp | 2 +- .../screens/bio_status_screen.cpp | 10 +++---- .../ftdi_eve_touch_ui/screens/boot_screen.cpp | 8 ++--- .../screens/change_filament_screen.cpp | 16 +++++----- .../screens/cocoa_press_status_screen.cpp | 4 +-- .../screens/custom_user_menus.cpp | 2 +- .../screens/developer_menu.cpp | 2 +- .../screens/endstop_state_screen.cpp | 2 +- .../screens/filament_menu.cpp | 2 +- .../screens/files_screen.cpp | 4 +-- .../screens/interface_settings_screen.cpp | 6 ++-- .../screens/interface_sounds_screen.cpp | 2 +- .../screens/leveling_menu.cpp | 2 +- .../ftdi_eve_touch_ui/screens/lock_screen.cpp | 4 +-- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 30 +++---------------- .../lib/ftdi_eve_touch_ui/screens/screens.cpp | 22 -------------- .../lib/ftdi_eve_touch_ui/screens/screens.h | 24 +-------------- .../screens/status_screen.cpp | 10 +++---- .../screens/temperature_screen.cpp | 2 +- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 2 +- .../screens/widget_demo_screen.cpp | 4 +-- .../extui/lib/ftdi_eve_touch_ui/theme/fonts.h | 6 ++-- 41 files changed, 91 insertions(+), 165 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h index d90fc1e8f044..5b29816429f3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h @@ -45,7 +45,7 @@ static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \ static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv"); -#ifdef TOUCH_UI_320x240 +#if ENABLED(TOUCH_UI_320x240) namespace FTDI { constexpr uint8_t Pclk = 8; constexpr uint8_t Pclkpol = 0; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp index a7777a97fe07..e324cb978aa0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func; bool CommandProcessor::is_tracking = false; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index b27ed7f59e7d..da51ee638517 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -312,12 +312,12 @@ class CommandProcessor : public CLCD::CommandFifo { int8_t apply_fit_text(int16_t w, int16_t h, T text) { using namespace FTDI; int8_t font = _font; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) const bool is_utf8 = has_utf8_chars(text); #endif for (;font > 26;) { int16_t width, height; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (is_utf8) { width = get_utf8_text_width(text, font_size_t::from_romfont(font)); height = font_size_t::from_romfont(font).get_height(); @@ -345,7 +345,7 @@ class CommandProcessor : public CLCD::CommandFifo { template uint16_t text_width(T text) { using namespace FTDI; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) return get_utf8_text_width(text, font_size_t::from_romfont(_font)); #endif @@ -362,7 +362,7 @@ class CommandProcessor : public CLCD::CommandFifo { #else const int8_t font = _font; #endif - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options); else @@ -401,7 +401,7 @@ class CommandProcessor : public CLCD::CommandFifo { const int8_t font = _font; #endif CLCD::CommandFifo::button(x, y, w, h, font, options); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(text)) { CLCD::CommandFifo::str(F("")); apply_text_alignment(x, y, w, h, OPT_CENTER); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index 9f2b6dd35fbc..a13c36265ed8 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -22,7 +22,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) /* The Display List Cache mechanism stores the display list corresponding * to a menu into RAM_G so that on subsequent calls drawing the menu does diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp index 0808f2f4f253..6c0392c200db 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp @@ -22,7 +22,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) using namespace FTDI; enum { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h index 505016f5b83a..fd84c795f11f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -29,7 +29,7 @@ #define FTDI_EXTENDED #endif -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) #include "unicode/font_size_t.h" #include "unicode/unicode.h" #include "unicode/standard_char_set.h" diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h index 490cbd4e548f..82bb8abf7fc0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h @@ -88,7 +88,7 @@ } namespace FTDI { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint16_t display_width = Vsize; constexpr uint16_t display_height = Hsize; #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h index 202c3cd7fb79..6aa52f09c9bd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h @@ -66,7 +66,7 @@ namespace FTDI { cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); // Drawing the edge strip along scan lines // seems to yield the best performance - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) path_initiator = EDGE_STRIP_B; #else path_initiator = EDGE_STRIP_R; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp index 81a081faae7a..944237bd281d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) /********************** VIRTUAL DISPATCH DATA TYPE ******************************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h index ef923614986f..1581cbbbc74e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h @@ -158,7 +158,7 @@ class UncachedScreen { using namespace FTDI; CommandProcessor cmd; cmd.cmd(CMD_DLSTART); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif @@ -199,7 +199,7 @@ class CachedScreen { CommandProcessor cmd; cmd.cmd(CMD_DLSTART); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif current_screen.onRedraw(BACKGROUND); @@ -222,7 +222,7 @@ class CachedScreen { dlcache.append(); } else { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); #endif current_screen.onRedraw(BACKGROUND); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index 481589854bfa..f9869320ba54 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { SoundPlayer sound; // Global sound player object diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index 18e5d4bc5b00..b7422a06b1b0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { /** @@ -103,7 +103,7 @@ namespace FTDI { if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') line[line_len - 1] = 0; - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(line)) { draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY); } else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index cdec6e5dd20a..5fc89f1fa9d3 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -21,7 +21,7 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { @@ -60,7 +60,7 @@ namespace FTDI { } cmd.apply_text_alignment(x, y, w, h, options); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) if (has_utf8_chars(str)) { draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options); } else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp index 2147dd7c8fd7..5219c0d04180 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -21,15 +21,11 @@ #include "ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) bool tiny_timer_t::elapsed(tiny_time_t duration) { uint8_t now = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif + TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis()) ); uint8_t elapsed = now - _start; return elapsed >= duration._duration; @@ -37,11 +33,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) { void tiny_timer_t::start() { _start = tiny_time_t::tiny_time( - #ifdef __MARLIN_FIRMWARE__ - ExtUI::safe_millis() - #else - millis() - #endif + TERN(__MARLIN_FIRMWARE__, ExtUI::safe_millis(), millis()) ); } #endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp index d04fe7d5b664..d9acb4f67a43 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -21,7 +21,7 @@ #include "../ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) namespace FTDI { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index b615c812eb14..5bb87d96843c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -24,7 +24,7 @@ class CommandProcessor; namespace FTDI { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) typedef uint16_t utf8_char_t; /** @@ -75,14 +75,14 @@ namespace FTDI { // Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings. struct FontMetrics { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) font_size_t fs; #else CLCD::FontMetrics fm; #endif inline void load(uint8_t rom_font_size) { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) fs = font_size_t::from_romfont(rom_font_size); #else fm.load(rom_font_size); @@ -90,7 +90,7 @@ namespace FTDI { } inline uint16_t get_char_width(utf8_char_t c) const { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) return get_utf8_char_width(c, fs); #else return fm.char_widths[(uint8_t)c]; @@ -98,7 +98,7 @@ namespace FTDI { } inline uint8_t get_height() const { - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) return fs.get_height(); #else return fm.height; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h index 09ac965e4938..c898e7b73751 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -146,7 +146,7 @@ namespace Language_en { PROGMEM Language_Str MSG_LEVELING = u8"Leveling"; PROGMEM Language_Str MSG_SHOW_MESH = u8"Show Bed Mesh"; - #ifdef TOUCH_UI_LULZBOT_BIO + #if ENABLED(TOUCH_UI_LULZBOT_BIO) PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 0b2dc911f10c..9036fc144b4c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -37,7 +37,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #if EITHER(HAS_MULTI_HOTEND, SENSORLESS_HOMING) #define GRID_ROWS 9 #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp index a118d851df5e..2d11f6948f07 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 13 #define GRID_ROWS 10 #define LAYOUT_FONT font_small @@ -53,7 +53,7 @@ BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what cmd.font(font_medium); _button(cmd, 1, - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1,10), BTN_SIZE(13,1), #else BTN_POS(15,7), BTN_SIZE(4,1), @@ -129,7 +129,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { cmd.font(font_medium) .tag(0) .text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE(12,1), #else BTN_POS(5, _line), BTN_SIZE(8,1), @@ -141,7 +141,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { _line++; } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #ifdef TOUCH_UI_800x480 #undef EDGE_R #define EDGE_R 20 @@ -172,7 +172,7 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcesso const bool highlight = (_what & FOREGROUND) && (increment == tag); switch (pos) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; @@ -192,7 +192,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() { if (_what & BACKGROUND) { _button_style(cmd, TEXT_LABEL); cmd.tag(0).text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE(4,1), #else BTN_POS(15, 1), BTN_SIZE(4,1), @@ -205,7 +205,7 @@ void BaseNumericAdjustmentScreen::widgets_t::increments() { _draw_increment_btn(cmd, _line+1, 244 - _decimals); _draw_increment_btn(cmd, _line+1, 243 - _decimals); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) _line++; #endif } @@ -308,7 +308,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab _button_style(cmd, TEXT_LABEL); cmd.font(font_small) .text( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS(1, _line), BTN_SIZE( 8,1), #else BTN_POS(1, _line), BTN_SIZE(10,1), @@ -323,7 +323,7 @@ void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str lab .enabled(is_enabled) .font(font_small) .toggle2( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) BTN_POS( 9,_line), BTN_SIZE(5,1), #else BTN_POS(10,_line), BTN_SIZE(4,1), diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp index dbc4ba3b4b6f..2ed602a809d4 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace Theme; using namespace ExtUI; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 2 #define GRID_ROWS 10 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index c95d2d1dba26..fc827e83e348 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -73,7 +73,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { // The LulzBot Bio shows the temperature for // the bed. - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) // Draw touch surfaces ui.bounds(POLY(target_temp), x, y, h, v); cmd.rectangle(x, y, h, v); @@ -95,7 +95,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd(COLOR_RGB(bg_text_enabled)) .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } @@ -105,7 +105,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { cmd.cmd(COLOR_RGB(bg_text_enabled)); cmd.font(font_medium); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) format_temp(str, getTargetTemp_celsius(BED)); else @@ -204,7 +204,7 @@ void StatusScreen::draw_fine_motion(draw_mode_t what) { PolyUI ui(cmd, what); cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_medium #else font_small @@ -273,7 +273,7 @@ void StatusScreen::loadBitmaps() { CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp index 40e49672d40b..a6a870535014 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -30,14 +30,14 @@ #include "../ftdi_eve_lib/extras/poly_ui.h" #include "../archim2-flash/flash_storage.h" -#ifdef SHOW_CUSTOM_BOOTSCREEN - #ifdef TOUCH_UI_PORTRAIT +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #if ENABLED(TOUCH_UI_PORTRAIT) #include "../theme/bootscreen_logo_portrait.h" #else #include "../theme/_bootscreen_landscape.h" #endif #else - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #include "../theme/marlin_bootscreen_portrait.h" #else #include "../theme/marlin_bootscreen_landscape.h" @@ -92,7 +92,7 @@ void BootScreen::onIdle() { StatusScreen::loadBitmaps(); - #ifdef TOUCH_UI_LULZBOT_BIO + #if ENABLED(TOUCH_UI_LULZBOT_BIO) GOTO_SCREEN(BioConfirmHomeXYZ); current_screen.forget(); PUSH_SCREEN(StatusScreen); diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 3f85fc9320fd..8f073365ff0d 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -101,7 +101,7 @@ void ChangeFilamentScreen::onExit() { void ChangeFilamentScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 2 #define GRID_ROWS 11 #else @@ -114,13 +114,13 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .tag(0) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .font(font_large) #else .font(font_medium) #endif .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) #else .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) @@ -142,14 +142,14 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); cmd.cmd(COLOR_RGB(tcol)) .tag(15) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) #else .rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) #endif .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) .font(font_medium) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) #else .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) @@ -177,7 +177,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; #endif - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) cmd.font(font_large) #else cmd.font(font_medium) @@ -198,7 +198,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_large #else font_small @@ -227,7 +227,7 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { .cmd(COLOR_MASK(1,1,1,1)) .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .font(font_large) .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp index e3310abaa775..d9881d747a0b 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/cocoa_press_status_screen.cpp @@ -45,7 +45,7 @@ void StatusScreen::loadBitmaps() { constexpr uint32_t base = ftdi_memory_map::RAM_G; // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } @@ -111,7 +111,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { ui.bounds(POLY(h3_label), x, y, h, v); cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp index 4132226977d7..20f90d5a4119 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp @@ -57,7 +57,7 @@ void CustomUserMenus::onRedraw(draw_mode_t what) { #define _MORE_THAN_TEN 0 #endif - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 11 #define GRID_COLS (1 + _MORE_THAN_TEN) #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp index 89a7e1edf7eb..9df060a6c4d1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -52,7 +52,7 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { #endif cmd.cmd(COLOR_RGB(bg_text_enabled)); - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 10 #define GRID_COLS 1 cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 864ba286231f..a091197a87ae 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -53,7 +53,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); cmd.font( - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) font_large #else font_medium diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp index dfdba33b08d0..f63fc416dd4c 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp @@ -30,7 +30,7 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp index 7c0129610d6f..112d70c07401 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -67,7 +67,7 @@ uint16_t FilesScreen::getFileForTag(uint8_t tag) { return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 6 #define GRID_ROWS (files_per_page + header_h + footer_h) #else @@ -151,7 +151,7 @@ void FilesScreen::drawHeader() { void FilesScreen::drawFooter() { #undef MARGIN_T #undef MARGIN_B - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define MARGIN_T 15 #define MARGIN_B 5 #else diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp index 3f0e25f73447..f0c6539bedc7 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp @@ -58,7 +58,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { #define GRID_COLS 4 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 7 #else #define GRID_ROWS 6 @@ -86,7 +86,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint8_t w = 2; #else constexpr uint8_t w = 1; @@ -106,7 +106,7 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { #endif #undef EDGE_R #define EDGE_R 0 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .colors(normal_btn) .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_SOUNDS)) .colors(action_btn) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp index 8fb813e79f8e..3e6063930479 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp @@ -84,7 +84,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr uint8_t w = 2; #else constexpr uint8_t w = 1; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp index bf1e2d522e5d..53dd5f4fc5fa 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/leveling_menu.cpp @@ -34,7 +34,7 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp index 193bb681ecf4..a3f2d0918827 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -50,7 +50,7 @@ void LockScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 1 #define GRID_ROWS 10 #else @@ -81,7 +81,7 @@ void LockScreen::onRedraw(draw_mode_t what) { const uint8_t pressed = EventLoop::get_pressed_tag(); cmd.font(font_large) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) .text(BTN_POS(1,2), BTN_SIZE(1,1), message) .font(font_xlarge) .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp index 529daa2f83df..146b799c2062 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /***************** * main_menu.cpp * *****************/ @@ -59,7 +37,7 @@ void MainMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 8 #define GRID_COLS 2 #define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1) @@ -129,15 +107,15 @@ bool MainMenu::onTouchEnd(uint8_t tag) { case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; + case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; #endif case 4: GOTO_SCREEN(MoveAxisScreen); break; case 5: injectCommands_P(PSTR("M84")); break; case 6: GOTO_SCREEN(TemperatureScreen); break; case 7: GOTO_SCREEN(ChangeFilamentScreen); break; case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; - #ifdef HAS_LEVELING - case 9: GOTO_SCREEN(LevelingMenu); break; + #if HAS_LEVELING + case 9: GOTO_SCREEN(LevelingMenu); break; #endif case 10: GOTO_SCREEN(AboutScreen); break; #if ENABLED(CUSTOM_USER_MENUS) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp index 5b3f9a201fee..5841c38f53eb 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /*************** * screens.cpp * ***************/ diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 265d6eb48625..4a2a407bd762 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -1,25 +1,3 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - /************* * screens.h * *************/ @@ -767,7 +745,7 @@ class LockScreen : public BaseScreen, public CachedScreen { class FilesScreen : public BaseScreen, public CachedScreen { private: - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) static constexpr uint8_t header_h = 2; static constexpr uint8_t footer_h = 2; static constexpr uint8_t files_per_page = 11; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index 61f59844c04d..5764f46c82fd 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -32,7 +32,7 @@ using namespace FTDI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 8 #else #define GRID_ROWS 8 @@ -43,7 +43,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { #define GRID_COLS 3 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define X_LBL_POS BTN_POS(1,5), BTN_SIZE(1,1) #define Y_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1) #define Z_LBL_POS BTN_POS(1,7), BTN_SIZE(1,1) @@ -111,7 +111,7 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { #undef GRID_COLS } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 8 #else #define GRID_COLS 12 @@ -164,7 +164,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd (BITMAP_SIZE (Fan_Icon_Info)) .icon(ICON_POS(FAN_POS), Fan_Icon_Info, icon_scale); - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } @@ -334,7 +334,7 @@ void StatusScreen::loadBitmaps() { CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); // Load fonts for internationalization - #ifdef TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_data(base + UTF8_FONT_OFFSET); #endif } diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp index 0011306c7e9b..bdd434b5dec0 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -41,7 +41,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { w.heading(GET_TEXT_F(MSG_TEMPERATURE)); w.button(30, GET_TEXT_F(MSG_COOLDOWN)); #ifndef NO_TOOLHEAD_HEATER_GCODE - #ifdef TOUCH_UI_COCOA_PRESS + #if ENABLED(TOUCH_UI_COCOA_PRESS) w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); w.adjuster( 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1)); #if ENABLED(COCOA_PRESS_EXTRA_HEATER) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp index f9df61bf6d4d..2fce402cf06f 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -38,7 +38,7 @@ void TuneMenu::onRedraw(draw_mode_t what) { .cmd(CLEAR(true,true,true)); } - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_ROWS 9 #define GRID_COLS 2 #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp index 6a9acbf8f1dc..96887102dc2a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp @@ -51,7 +51,7 @@ void WidgetsScreen::onRedraw(draw_mode_t) { const uint16_t m = (slider_val*12*60/0xFFFFU)%60; const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 3 #define GRID_ROWS 8 cmd.font(font_large) @@ -113,7 +113,7 @@ bool WidgetsScreen::onTouchStart(uint8_t tag) { CommandProcessor cmd; switch (tag) { case 1: GOTO_PREVIOUS(); break; - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break; case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break; case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break; diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h index bdb9d492aba8..7cc4e078ada1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/fonts.h @@ -24,7 +24,7 @@ namespace Theme { #ifdef TOUCH_UI_800x480 - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 28; constexpr int16_t font_small = 29; @@ -41,7 +41,7 @@ namespace Theme { #endif constexpr float icon_scale = 1.0; #elif defined(TOUCH_UI_480x272) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 26; constexpr int16_t font_small = 26; @@ -59,7 +59,7 @@ namespace Theme { constexpr float icon_scale = 0.6; #endif #elif defined(TOUCH_UI_320x240) - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) constexpr int16_t font_tiny = 26; constexpr int16_t font_xsmall = 26; constexpr int16_t font_small = 26; From 2d88a2cfb7a85104414154ae66a92b2d63dda352 Mon Sep 17 00:00:00 2001 From: LinFor Date: Thu, 24 Dec 2020 01:37:17 +0300 Subject: [PATCH 405/443] Remaining Time for FTDI EVE, bp for ExtUI (#20549) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 30 ++-- Marlin/src/inc/SanityCheck.h | 6 +- .../lib/ftdi_eve_touch_ui/screens/screens.h | 2 +- .../screens/status_screen.cpp | 161 ++++++++++++------ Marlin/src/lcd/extui/ui_api.cpp | 6 +- Marlin/src/lcd/extui/ui_api.h | 13 +- Marlin/src/lcd/marlinui.h | 23 ++- 7 files changed, 156 insertions(+), 85 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 446b308dfb52..29d8e976cdd8 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1134,33 +1134,35 @@ #endif // HAS_LCD_MENU -// Scroll a longer status message into view -//#define STATUS_MESSAGE_SCROLLING +#if HAS_DISPLAY + // The timeout (in ms) to return to the status screen from sub-menus + //#define LCD_TIMEOUT_TO_STATUS 15000 -// On the Info Screen, display XY with one decimal place when possible -//#define LCD_DECIMAL_SMALL_XY + #if ENABLED(SHOW_BOOTSCREEN) + #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) + #endif -// The timeout (in ms) to return to the status screen from sub-menus -//#define LCD_TIMEOUT_TO_STATUS 15000 + // Scroll a longer status message into view + //#define STATUS_MESSAGE_SCROLLING -// Add an 'M73' G-code to set the current percentage -//#define LCD_SET_PROGRESS_MANUALLY + // On the Info Screen, display XY with one decimal place when possible + //#define LCD_DECIMAL_SMALL_XY -// Show the E position (filament used) during printing -//#define LCD_SHOW_E_TOTAL + // Add an 'M73' G-code to set the current percentage + //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SHOW_BOOTSCREEN) - #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) + // Show the E position (filament used) during printing + //#define LCD_SHOW_E_TOTAL #endif -#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && ANY(HAS_MARLINUI_U8GLIB, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) +#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && ANY(HAS_MARLINUI_U8GLIB, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, EXTENSIBLE_UI) //#define SHOW_REMAINING_TIME // Display estimated time to completion #if ENABLED(SHOW_REMAINING_TIME) //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time #endif - #if HAS_MARLINUI_U8GLIB + #if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b56177462f35..a975ac1461b2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3211,10 +3211,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #undef _PIN_CONFLICT #endif -#if !HAS_MARLINUI_U8GLIB - #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) - #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." - #endif +#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." #endif #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16 diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h index 4a2a407bd762..4388eebae0b1 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -277,7 +277,7 @@ class StatusScreen : public BaseScreen, public CachedScreen 0 && current_progress < progress_range + 1; + if (show_progress_bar) { + cmd.tag(0).font(font_medium) + .bgcolor(progress) + .progress(PROGRESSBAR_POS, current_progress, progress_range, OPT_FLAT); + } -#undef GRID_COLS + char progress_str[10]; + sprintf_P(progress_str, + #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + PSTR("%3d.%02d%%"), uint8_t(current_progress / 100), current_progress % 100 + #else + PSTR("%3d%%"), uint8_t(current_progress / 100) + #endif + ); + + #if ENABLED(TOUCH_UI_PORTRAIT) + const uint16_t texts_pos_h = show_progress_bar ? (BTN_H(1)) : (BTN_H(2)); + cmd.font(font_medium) + .tag(7).text(TIME_POS_X, PROGRESSZONE_FIRSTLINE_Y, TIME_POS_W, texts_pos_h, elapsed_str) + #if ENABLED(SHOW_REMAINING_TIME) + .text(REMAINING_POS_X, PROGRESSZONE_FIRSTLINE_Y, REMAINING_POS_W, texts_pos_h, remaining_str) + #endif + .text(PROGRESS_POS_X, PROGRESSZONE_FIRSTLINE_Y, PROGRESS_POS_W, texts_pos_h, progress_str); + #else + cmd.font(font_medium) + .tag(7).text(TIME_POS, elapsed_str) + #if ENABLED(SHOW_REMAINING_TIME) + .text(REMAINING_POS, remaining_str) + #endif + .text(PROGRESS_POS, progress_str); + #endif + } + #undef GRID_COLS +} void StatusScreen::draw_interaction_buttons(draw_mode_t what) { #define GRID_COLS 4 @@ -253,11 +304,11 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { using namespace ExtUI; #if ENABLED(TOUCH_UI_PORTRAIT) - #define MEDIA_BTN_POS BTN_POS(1,8), BTN_SIZE(2,1) - #define MENU_BTN_POS BTN_POS(3,8), BTN_SIZE(2,1) + #define MEDIA_BTN_POS BTN_POS(1,15), BTN_SIZE(2,2) + #define MENU_BTN_POS BTN_POS(3,15), BTN_SIZE(2,2) #else - #define MEDIA_BTN_POS BTN_POS(1,7), BTN_SIZE(2,2) - #define MENU_BTN_POS BTN_POS(3,7), BTN_SIZE(2,2) + #define MEDIA_BTN_POS BTN_POS(1,13), BTN_SIZE(2,4) + #define MENU_BTN_POS BTN_POS(3,13), BTN_SIZE(2,4) #endif const bool has_media = isMediaInserted() && !isPrintingFromMedia(); @@ -278,9 +329,9 @@ void StatusScreen::draw_status_message(draw_mode_t what, const char* message) { #define GRID_COLS 1 #if ENABLED(TOUCH_UI_PORTRAIT) - #define STATUS_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define STATUS_POS BTN_POS(1,7), BTN_SIZE(1,2) #else - #define STATUS_POS BTN_POS(1,3), BTN_SIZE(1,2) + #define STATUS_POS BTN_POS(1,5), BTN_SIZE(1,4) #endif if (what & BACKGROUND) { diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 3bf06a68c24f..7611dbb98a64 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -245,7 +245,7 @@ namespace ExtUI { } #ifdef TOUCH_UI_LCD_TEMP_SCALING - #define GET_TEMP_ADJUSTMENT(A) float(A)/TOUCH_UI_LCD_TEMP_SCALING + #define GET_TEMP_ADJUSTMENT(A) (float(A) / (TOUCH_UI_LCD_TEMP_SCALING)) #else #define GET_TEMP_ADJUSTMENT(A) A #endif @@ -807,10 +807,6 @@ namespace ExtUI { #endif #endif - uint8_t getProgress_percent() { - return ui.get_progress_percent(); - } - uint32_t getProgress_seconds_elapsed() { const duration_t elapsed = print_job_timer.duration(); return elapsed.value; diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index cdf9b4412aa9..5322ac69ce58 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -43,6 +43,7 @@ ****************************************************************************/ #include "../../inc/MarlinConfig.h" +#include "../marlinui.h" namespace ExtUI { @@ -129,9 +130,19 @@ namespace ExtUI { float getTravelAcceleration_mm_s2(); float getFeedrate_percent(); int16_t getFlowPercentage(const extruder_t); - uint8_t getProgress_percent(); + + inline uint8_t getProgress_percent() { return ui.get_progress_percent(); } + + #if HAS_PRINT_PROGRESS_PERMYRIAD + inline uint16_t getProgress_permyriad() { return ui.get_progress_permyriad(); } + #endif + uint32_t getProgress_seconds_elapsed(); + #if ENABLED(SHOW_REMAINING_TIME) + inline uint32_t getProgress_seconds_remaining() { return ui.get_remaining_time(); } + #endif + #if HAS_LEVELING bool getLevelingActive(); void setLevelingActive(const bool); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 8e968abda0af..e162dbdd2e2c 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -57,6 +57,10 @@ #define MULTI_MANUAL 1 #endif +#if HAS_DISPLAY + #include "../module/printcounter.h" +#endif + #if HAS_WIRED_LCD #include "../MarlinCore.h" @@ -357,11 +361,20 @@ class MarlinUI { static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); } 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 BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) - static uint32_t remaining_time; - FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; } - FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time; } - FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); } + #if ENABLED(SHOW_REMAINING_TIME) + static inline uint32_t _calculated_remaining_time() { + const duration_t elapsed = print_job_timer.duration(); + const progress_t progress = _get_progress(); + return elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress; + } + #if ENABLED(USE_M73_REMAINING_TIME) + static uint32_t remaining_time; + FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; } + FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); } + FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); } + #else + FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); } + #endif #endif #endif static progress_t _get_progress(); From 844a8c7074d555bda31a53ae834cee5fac020ca8 Mon Sep 17 00:00:00 2001 From: ubik2 Date: Wed, 23 Dec 2020 16:19:48 -0800 Subject: [PATCH 406/443] Add OPTIMIZED_MESH_STORAGE option (for UBL) (#20371) Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 4 +++ Marlin/src/core/macros.h | 1 + Marlin/src/feature/bedlevel/ubl/ubl.cpp | 35 ++++++++++++++++----- Marlin/src/feature/bedlevel/ubl/ubl.h | 30 +++++++++--------- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/module/settings.cpp | 35 ++++++++++++++++++--- 6 files changed, 80 insertions(+), 27 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 29d8e976cdd8..1abb48fcb405 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1739,6 +1739,10 @@ //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) #endif +#if BOTH(AUTO_BED_LEVELING_UBL, EEPROM_SETTINGS) + //#define OPTIMIZED_MESH_STORAGE // Store mesh with less precision to save EEPROM space +#endif + /** * Repeatedly attempt G29 leveling until it succeeds. * Stop after G29_MAX_RETRIES attempts. diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 76e55ad3d241..058008646f04 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -286,6 +286,7 @@ #define RSQRT(x) (1.0f / sqrtf(x)) #define CEIL(x) ceilf(x) #define FLOOR(x) floorf(x) +#define TRUNC(x) truncf(x) #define LROUND(x) lroundf(x) #define FMOD(x, y) fmodf(x, y) #define HYPOT(x,y) SQRT(HYPOT2(x,y)) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index 087fdf42b2ac..fba065fed91f 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -42,9 +42,7 @@ #include "math.h" - void unified_bed_leveling::echo_name() { - SERIAL_ECHOPGM("Unified Bed Leveling"); - } + void unified_bed_leveling::echo_name() { SERIAL_ECHOPGM("Unified Bed Leveling"); } void unified_bed_leveling::report_current_mesh() { if (!leveling_is_valid()) return; @@ -86,9 +84,7 @@ volatile int16_t unified_bed_leveling::encoder_diff; - unified_bed_leveling::unified_bed_leveling() { - reset(); - } + unified_bed_leveling::unified_bed_leveling() { reset(); } void unified_bed_leveling::reset() { const bool was_enabled = planner.leveling_active; @@ -113,6 +109,31 @@ } } + #if ENABLED(OPTIMIZED_MESH_STORAGE) + + constexpr float mesh_store_scaling = 1000; + constexpr int16_t Z_STEPS_NAN = INT16_MAX; + + void unified_bed_leveling::set_store_from_mesh(const bed_mesh_t &in_values, mesh_store_t &stored_values) { + auto z_to_store = [](const float &z) { + if (isnan(z)) return Z_STEPS_NAN; + const int32_t z_scaled = TRUNC(z * mesh_store_scaling); + if (z_scaled == Z_STEPS_NAN || !WITHIN(z_scaled, INT16_MIN, INT16_MAX)) + return Z_STEPS_NAN; // If Z is out of range, return our custom 'NaN' + return int16_t(z_scaled); + }; + GRID_LOOP(x, y) stored_values[x][y] = z_to_store(in_values[x][y]); + } + + void unified_bed_leveling::set_mesh_from_store(const mesh_store_t &stored_values, bed_mesh_t &out_values) { + auto store_to_z = [](const int16_t z_scaled) { + return z_scaled == Z_STEPS_NAN ? NAN : z_scaled / mesh_store_scaling; + }; + GRID_LOOP(x, y) out_values[x][y] = store_to_z(stored_values[x][y]); + } + + #endif // OPTIMIZED_MESH_STORAGE + static void serial_echo_xy(const uint8_t sp, const int16_t x, const int16_t y) { SERIAL_ECHO_SP(sp); SERIAL_CHAR('('); @@ -127,7 +148,7 @@ static void serial_echo_column_labels(const uint8_t sp) { SERIAL_ECHO_SP(7); - for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + LOOP_L_N(i, GRID_MAX_POINTS_X) { if (i < 10) SERIAL_CHAR(' '); SERIAL_ECHO(i); SERIAL_ECHO_SP(sp); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 762becfb699f..876063c8787c 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -41,6 +41,10 @@ struct mesh_index_pair; #define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) #define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) +#if ENABLED(OPTIMIZED_MESH_STORAGE) + typedef int16_t mesh_store_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; +#endif + class unified_bed_leveling { private: @@ -106,6 +110,10 @@ class unified_bed_leveling { static int8_t storage_slot; static bed_mesh_t z_values; + #if ENABLED(OPTIMIZED_MESH_STORAGE) + static void set_store_from_mesh(const bed_mesh_t &in_values, mesh_store_t &stored_values); + static void set_mesh_from_store(const mesh_store_t &stored_values, bed_mesh_t &out_values); + #endif static const float _mesh_index_to_xpos[GRID_MAX_POINTS_X], _mesh_index_to_ypos[GRID_MAX_POINTS_Y]; @@ -182,6 +190,12 @@ class unified_bed_leveling { return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); } + #ifdef UBL_Z_RAISE_WHEN_OFF_MESH + #define _UBL_OUTER_Z_RAISE UBL_Z_RAISE_WHEN_OFF_MESH + #else + #define _UBL_OUTER_Z_RAISE NAN + #endif + /** * 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. @@ -195,13 +209,7 @@ class unified_bed_leveling { } // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); + return _UBL_OUTER_Z_RAISE; } const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * RECIPROCAL(MESH_X_DIST), @@ -224,13 +232,7 @@ class unified_bed_leveling { } // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. - return ( - #ifdef UBL_Z_RAISE_WHEN_OFF_MESH - UBL_Z_RAISE_WHEN_OFF_MESH - #else - NAN - #endif - ); + return _UBL_OUTER_Z_RAISE; } const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * RECIPROCAL(MESH_Y_DIST), diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 549fd7721f19..598bfeee501e 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -543,7 +543,7 @@ } else { const float cvf = parser.value_float(); - switch ((int)truncf(cvf * 10.0f) - 30) { // 3.1 -> 1 + switch ((int)TRUNC(cvf * 10.0f) - 30) { // 3.1 -> 1 #if ENABLED(UBL_G29_P31) case 1: { diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index ec549ea2f66f..e66769600759 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -2385,12 +2385,14 @@ void MarlinSettings::postprocess() { // or down a little bit without disrupting the mesh data } + #define MESH_STORE_SIZE sizeof(TERN(OPTIMIZED_MESH_STORAGE, mesh_store_t, ubl.z_values)) + uint16_t MarlinSettings::calc_num_meshes() { - return (meshes_end - meshes_start_index()) / sizeof(ubl.z_values); + return (meshes_end - meshes_start_index()) / MESH_STORE_SIZE; } int MarlinSettings::mesh_slot_offset(const int8_t slot) { - return meshes_end - (slot + 1) * sizeof(ubl.z_values); + return meshes_end - (slot + 1) * MESH_STORE_SIZE; } void MarlinSettings::store_mesh(const int8_t slot) { @@ -2407,9 +2409,17 @@ void MarlinSettings::postprocess() { int pos = mesh_slot_offset(slot); uint16_t crc = 0; + #if ENABLED(OPTIMIZED_MESH_STORAGE) + int16_t z_mesh_store[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + ubl.set_store_from_mesh(ubl.z_values, z_mesh_store); + uint8_t * const src = (uint8_t*)&z_mesh_store; + #else + uint8_t * const src = (uint8_t*)&ubl.z_values; + #endif + // Write crc to MAT along with other data, or just tack on to the beginning or end persistentStore.access_start(); - const bool status = persistentStore.write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); + const bool status = persistentStore.write_data(pos, src, MESH_STORE_SIZE, &crc); persistentStore.access_finish(); if (status) SERIAL_ECHOLNPGM("?Unable to save mesh data."); @@ -2435,12 +2445,27 @@ void MarlinSettings::postprocess() { int pos = mesh_slot_offset(slot); uint16_t crc = 0; - uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; + #if ENABLED(OPTIMIZED_MESH_STORAGE) + int16_t z_mesh_store[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + uint8_t * const dest = (uint8_t*)&z_mesh_store; + #else + uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; + #endif persistentStore.access_start(); - const uint16_t status = persistentStore.read_data(pos, dest, sizeof(ubl.z_values), &crc); + const uint16_t status = persistentStore.read_data(pos, dest, MESH_STORE_SIZE, &crc); persistentStore.access_finish(); + #if ENABLED(OPTIMIZED_MESH_STORAGE) + if (into) { + float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + ubl.set_mesh_from_store(z_mesh_store, z_values); + memcpy(into, z_values, sizeof(z_values)); + } + else + ubl.set_mesh_from_store(z_mesh_store, ubl.z_values); + #endif + if (status) SERIAL_ECHOLNPGM("?Unable to load mesh data."); else DEBUG_ECHOLNPAIR("Mesh loaded from slot ", slot); From 9a60f7a79338ff65fd7779b62bd2264a6ced8510 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 24 Dec 2020 00:23:59 +0000 Subject: [PATCH 407/443] [cron] Bump distribution date (2020-12-24) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4e5f2b3d4158..8bbd3800a3a0 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-23" + #define STRING_DISTRIBUTION_DATE "2020-12-24" #endif /** From f8c6de0cdc04b9ffa311119ef12f16db63538e51 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 19:57:49 -0600 Subject: [PATCH 408/443] Move BTT_SKR_CR6 --- Marlin/src/core/boards.h | 36 ++++++++++++++++++------------------ Marlin/src/pins/pins.h | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 0e27fc998b86..ec82c3c41d54 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -319,24 +319,24 @@ #define BOARD_BTT_SKR_MINI_E3_V2_0 4026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC) #define BOARD_BTT_SKR_MINI_MZ_V1_0 4027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC) #define BOARD_BTT_SKR_E3_DIP 4028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) -#define BOARD_JGAURORA_A5S_A1 4029 // JGAurora A5S A1 (STM32F103ZET6) -#define BOARD_FYSETC_AIO_II 4030 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4031 // FYSETC Cheetah -#define BOARD_FYSETC_CHEETAH_V12 4032 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4033 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 -#define BOARD_CCROBOT_MEEB_3DP 4034 // ccrobot-online.com MEEB_3DP (STM32F103RC) -#define BOARD_CHITU3D_V5 4035 // Chitu3D TronXY X5SA V5 Board -#define BOARD_CHITU3D_V6 4036 // Chitu3D TronXY X5SA V5 Board -#define BOARD_CREALITY_V4 4037 // Creality v4.x (STM32F103RE) -#define BOARD_CREALITY_V427 4038 // Creality v4.2.7 (STM32F103RE) -#define BOARD_CREALITY_V431 4039 // Creality v4.3.1 (STM32F103RE) -#define BOARD_CREALITY_V452 4040 // Creality v4.5.2 (STM32F103RE) -#define BOARD_CREALITY_V453 4041 // Creality v4.5.3 (STM32F103RE) -#define BOARD_TRIGORILLA_PRO 4042 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4043 // FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4044 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4045 // STM32F103RET6 Libmaple-based controller -#define BOARD_BTT_SKR_CR6 4046 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) +#define BOARD_BTT_SKR_CR6 4029 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) +#define BOARD_JGAURORA_A5S_A1 4030 // JGAurora A5S A1 (STM32F103ZET6) +#define BOARD_FYSETC_AIO_II 4031 // FYSETC AIO_II +#define BOARD_FYSETC_CHEETAH 4032 // FYSETC Cheetah +#define BOARD_FYSETC_CHEETAH_V12 4033 // FYSETC Cheetah V1.2 +#define BOARD_LONGER3D_LK 4034 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 +#define BOARD_CCROBOT_MEEB_3DP 4035 // ccrobot-online.com MEEB_3DP (STM32F103RC) +#define BOARD_CHITU3D_V5 4036 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CHITU3D_V6 4037 // Chitu3D TronXY X5SA V5 Board +#define BOARD_CREALITY_V4 4038 // Creality v4.x (STM32F103RE) +#define BOARD_CREALITY_V427 4039 // Creality v4.2.7 (STM32F103RE) +#define BOARD_CREALITY_V431 4040 // Creality v4.3.1 (STM32F103RE) +#define BOARD_CREALITY_V452 4041 // Creality v4.5.2 (STM32F103RE) +#define BOARD_CREALITY_V453 4042 // Creality v4.5.3 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4043 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4044 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4045 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4046 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 2218d2fe494c..56508b9a2173 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -510,6 +510,8 @@ #include "stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB #elif MB(BTT_SKR_E3_DIP) #include "stm32f1/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB +#elif MB(BTT_SKR_CR6) + #include "stm32f1/pins_BTT_SKR_CR6.h" // STM32F1 env:STM32F103RC_btt_512K_USB #elif MB(JGAURORA_A5S_A1) #include "stm32f1/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 #elif MB(FYSETC_AIO_II) @@ -544,8 +546,6 @@ #include "stm32f1/pins_FLSUN_HISPEED.h" // STM32F1 env:flsun_hispeed #elif MB(BEAST) #include "stm32f1/pins_BEAST.h" // STM32F1 env:STM32F103RE -#elif MB(BTT_SKR_CR6) - #include "stm32f1/pins_BTT_SKR_CR6.h" // STM32F1 env:STM32F103RC_btt_512K_USB // // ARM Cortex-M4F From 4d6b6bcffc5082de84614aea0bdd2b280f503430 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 23 Dec 2020 23:01:21 -0300 Subject: [PATCH 409/443] LVGL and Classic UI for STM32 (#20552) --- Marlin/src/HAL/STM32/HAL_SPI.cpp | 1 - Marlin/src/HAL/STM32/MarlinSPI.cpp | 12 ++++--- Marlin/src/HAL/STM32/tft/tft_fsmc.cpp | 30 ++++++++-------- Marlin/src/HAL/STM32/tft/tft_fsmc.h | 9 +++-- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 10 ++++-- Marlin/src/HAL/STM32/tft/tft_spi.h | 7 ++++ Marlin/src/HAL/STM32/tft/xpt2046.cpp | 22 +----------- Marlin/src/HAL/STM32/tft/xpt2046.h | 5 +-- Marlin/src/gcode/calibrate/G34.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 17 +++++---- Marlin/src/lcd/tft/tft.h | 2 +- Marlin/src/lcd/tft_io/tft_io.h | 2 +- Marlin/src/lcd/touch/touch_buttons.cpp | 4 ++- Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 6 +++- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 24 ++----------- .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 26 ++------------ .../PlatformIO/scripts/anet_et4_openblt.py | 14 ++++++++ .../PlatformIO/scripts/stm32_bootloader.py | 10 +++--- .../variants/MARLIN_F4x7Vx/PeripheralPins.c | 4 +-- platformio.ini | 35 +++++++++++-------- 22 files changed, 113 insertions(+), 133 deletions(-) create mode 100644 buildroot/share/PlatformIO/scripts/anet_et4_openblt.py diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index f947e6ef3272..d79f72cad2b7 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -157,7 +157,6 @@ static SPISettings spiConfig; SPI.setMISO(MISO_PIN); SPI.setMOSI(MOSI_PIN); SPI.setSCLK(SCK_PIN); - SPI.setSSEL(SS_PIN); #endif SPI.begin(); diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index 399430f5eb94..5086b4178461 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -60,7 +60,6 @@ void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaH _dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; } #ifdef STM32F4xx - _dmaHandle.Init.Channel = DMA_CHANNEL_3; _dmaHandle.Init.FIFOMode = DMA_FIFOMODE_DISABLE; #endif @@ -73,7 +72,8 @@ void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaH _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel3 : DMA1_Channel2; #elif defined(STM32F4xx) __HAL_RCC_DMA2_CLK_ENABLE(); - _dmaHandle.Instance = DMA2_Stream3; + _dmaHandle.Init.Channel = DMA_CHANNEL_3; + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA2_Stream3 : DMA2_Stream0; #endif } #endif @@ -83,7 +83,9 @@ void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaH __HAL_RCC_DMA1_CLK_ENABLE(); _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel5 : DMA1_Channel4; #elif defined(STM32F4xx) - //TODO: f4 dma config + __HAL_RCC_DMA1_CLK_ENABLE(); + _dmaHandle.Init.Channel = DMA_CHANNEL_0; + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Stream4 : DMA1_Stream3; #endif } #endif @@ -93,7 +95,9 @@ void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaH __HAL_RCC_DMA2_CLK_ENABLE(); _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA2_Channel2 : DMA2_Channel1; #elif defined(STM32F4xx) - //TODO: f4 dma config + __HAL_RCC_DMA1_CLK_ENABLE(); + _dmaHandle.Init.Channel = DMA_CHANNEL_0; + _dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Stream5 : DMA1_Stream2; #endif } #endif diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp index 2a5ad4595b71..87ca2dbbe18a 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp @@ -154,29 +154,27 @@ uint32_t TFT_FSMC::ReadID(tft_data_t Reg) { } bool TFT_FSMC::isBusy() { - if (__IS_DMA_ENABLED(&DMAtx)) + #if defined(STM32F1xx) + volatile bool dmaEnabled = (DMAtx.Instance->CCR & DMA_CCR_EN) != RESET; + #elif defined(STM32F4xx) + volatile bool dmaEnabled = DMAtx.Instance->CR & DMA_SxCR_EN; + #endif + if (dmaEnabled) { if (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) != 0 || __HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) != 0) Abort(); - return __IS_DMA_ENABLED(&DMAtx); + } + else + Abort(); + return dmaEnabled; } void TFT_FSMC::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) { DMAtx.Init.PeriphInc = MemoryIncrease; HAL_DMA_Init(&DMAtx); - - __HAL_DMA_CLEAR_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)); - __HAL_DMA_CLEAR_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)); - - #ifdef STM32F1xx - DMAtx.Instance->CNDTR = Count; - DMAtx.Instance->CPAR = (uint32_t)Data; - DMAtx.Instance->CMAR = (uint32_t)&(LCD->RAM); - #elif defined(STM32F4xx) - DMAtx.Instance->NDTR = Count; - DMAtx.Instance->PAR = (uint32_t)Data; - DMAtx.Instance->M0AR = (uint32_t)&(LCD->RAM); - #endif - __HAL_DMA_ENABLE(&DMAtx); + DataTransferBegin(); + HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(LCD->RAM), Count); + HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + Abort(); } #endif // HAS_FSMC_TFT diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index ad39d10d632d..7c40151e2bdf 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.h @@ -25,10 +25,8 @@ #ifdef STM32F1xx #include "stm32f1xx_hal.h" - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) #elif defined(STM32F4xx) #include "stm32f4xx_hal.h" - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) #else #error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware." #endif @@ -77,6 +75,13 @@ class TFT_FSMC { static void WriteSequence(uint16_t *Data, uint16_t Count) { TransmitDMA(DMA_PINC_ENABLE, Data, Count); } static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_PINC_DISABLE, &Data, Count); } + static void WriteMultiple(uint16_t Color, uint32_t Count) { + static uint16_t Data; Data = Color; + while (Count > 0) { + TransmitDMA(DMA_MINC_DISABLE, &Data, Count > 0xFFFF ? 0xFFFF : Count); + Count = Count > 0xFFFF ? Count - 0xFFFF : 0; + } + } }; diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index 1c61d09529af..3cb797d5f2a9 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -88,7 +88,7 @@ void TFT_SPI::Init() { #elif defined(STM32F4xx) __HAL_RCC_DMA1_CLK_ENABLE(); DMAtx.Instance = DMA1_Stream4; - DMAtx.Init.Channel = DMA_CHANNEL_4; + DMAtx.Init.Channel = DMA_CHANNEL_0; #endif } #endif @@ -101,7 +101,7 @@ void TFT_SPI::Init() { #elif defined(STM32F4xx) __HAL_RCC_DMA1_CLK_ENABLE(); DMAtx.Instance = DMA1_Stream5; - DMAtx.Init.Channel = DMA_CHANNEL_5; + DMAtx.Init.Channel = DMA_CHANNEL_0; #endif } #endif @@ -183,6 +183,9 @@ bool TFT_SPI::isBusy() { } void TFT_SPI::Abort() { + // Wait for any running spi + while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {} + while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {} // First, abort any running dma HAL_DMA_Abort(&DMAtx); // DeInit objects @@ -223,6 +226,9 @@ void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Coun __HAL_SPI_ENABLE(&SPIx); SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */ + + HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + Abort(); } #endif // HAS_SPI_TFT diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.h b/Marlin/src/HAL/STM32/tft/tft_spi.h index d477b58c004d..667b5f366b7e 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.h +++ b/Marlin/src/HAL/STM32/tft/tft_spi.h @@ -64,4 +64,11 @@ class TFT_SPI { static void WriteSequence(uint16_t *Data, uint16_t Count) { TransmitDMA(DMA_MINC_ENABLE, Data, Count); } static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_MINC_DISABLE, &Data, Count); } + static void WriteMultiple(uint16_t Color, uint32_t Count) { + static uint16_t Data; Data = Color; + while (Count > 0) { + TransmitDMA(DMA_MINC_DISABLE, &Data, Count > 0xFFFF ? 0xFFFF : Count); + Count = Count > 0xFFFF ? Count - 0xFFFF : 0; + } + } }; diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index 7e2dbfd15adb..04294e669c55 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -23,7 +23,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_TFT_XPT2046 +#if HAS_TFT_XPT2046 || HAS_TOUCH_BUTTONS #include "xpt2046.h" #include "pinconfig.h" @@ -31,7 +31,6 @@ uint16_t delta(uint16_t a, uint16_t b) { return a > b ? a - b : b - a; } SPI_HandleTypeDef XPT2046::SPIx; -DMA_HandleTypeDef XPT2046::DMAtx; void XPT2046::Init() { SPI_TypeDef *spiInstance; @@ -71,34 +70,16 @@ void XPT2046::Init() { if (SPIx.Instance == SPI1) { __HAL_RCC_SPI1_CLK_ENABLE(); SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - #ifdef STM32F1xx - DMAtx.Instance = DMA1_Channel3; - #elif defined(STM32F4xx) - DMAtx.Instance = DMA2_Stream3; // DMA2_Stream5 - #endif - //SERIAL_ECHO_MSG(" Touch Screen on SPI1"); } #endif #ifdef SPI2_BASE if (SPIx.Instance == SPI2) { __HAL_RCC_SPI2_CLK_ENABLE(); - #ifdef STM32F1xx - DMAtx.Instance = DMA1_Channel5; - #elif defined(STM32F4xx) - DMAtx.Instance = DMA1_Stream4; - #endif - //SERIAL_ECHO_MSG(" Touch Screen on SPI2"); } #endif #ifdef SPI3_BASE if (SPIx.Instance == SPI3) { __HAL_RCC_SPI3_CLK_ENABLE(); - #ifdef STM32F1xx - DMAtx.Instance = DMA2_Channel2; - #elif defined(STM32F4xx) - DMAtx.Instance = DMA1_Stream5; // DMA1_Stream7 - #endif - //SERIAL_ECHO_MSG(" Touch Screen on SPI3"); } #endif } @@ -107,7 +88,6 @@ void XPT2046::Init() { SET_INPUT(TOUCH_MISO_PIN); SET_OUTPUT(TOUCH_MOSI_PIN); SET_OUTPUT(TOUCH_SCK_PIN); - //SERIAL_ECHO_MSG(" Touch Screen on Software SPI"); } getRawData(XPT2046_Z1); diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 78cb7a4ba54a..5b8acf4b87af 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -23,10 +23,8 @@ #ifdef STM32F1xx #include - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN) #elif defined(STM32F4xx) #include - #define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN) #endif #include "../../../inc/MarlinConfig.h" @@ -65,9 +63,8 @@ enum XPTCoordinate : uint8_t { class XPT2046 { private: static SPI_HandleTypeDef SPIx; - static DMA_HandleTypeDef DMAtx; - static bool isBusy() { return SPIx.Instance ? __IS_DMA_ENABLED(&DMAtx) : false; } + static bool isBusy() { return false; } static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index e8d48411720b..bcca00dd42b3 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -42,7 +42,7 @@ void GcodeSuite::G34() { if (!all_axes_trusted()) home_all_axes(); TERN_(HAS_LEVELING, TEMPORARY_BED_LEVELING_STATE(false)); - + SET_SOFT_ENDSTOP_LOOSE(true); TemporaryGlobalEndstopsState unlock_z(false); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 7c581bef9087..3e61eb6d4a28 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1187,7 +1187,7 @@ // This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' #if ENABLED(TOUCH_SCREEN) && !HAS_GRAPHICAL_TFT #undef TOUCH_SCREEN - #if !HAS_TFT_LVGL_UI + #if ENABLED(TFT_CLASSIC_UI) #define HAS_TOUCH_BUTTONS 1 #endif #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a975ac1461b2..0aadeef0eebc 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3242,7 +3242,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) /** * Touch Buttons */ -#if ENABLED(TOUCH_SCREEN) +#if ENABLED(TOUCH_SCREEN) && DISABLED(TOUCH_SCREEN_CALIBRATION) #ifndef TOUCH_CALIBRATION_X #error "TOUCH_CALIBRATION_X must be defined with TOUCH_SCREEN." #endif diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index cbb05bc356a7..7f88df7bc41f 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -339,6 +339,8 @@ static uint8_t page; } #endif // HAS_TOUCH_BUTTONS +static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT + uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); @@ -352,19 +354,21 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u switch (msg) { case U8G_DEV_MSG_INIT: dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, nullptr); - tftio.Init(); - tftio.InitTFT(); - TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); if (preinit) { preinit = false; return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); } + if (msgInitCount) return -1; + tftio.Init(); + tftio.InitTFT(); + TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); + // Clear Screen setWindow(u8g, dev, 0, 0, (TFT_WIDTH) - 1, (TFT_HEIGHT) - 1); #if HAS_LCD_IO - tftio.WriteMultiple(TFT_MARLINBG_COLOR, uint32_t(TFT_WIDTH) * (TFT_HEIGHT)); + tftio.WriteMultiple(TFT_MARLINBG_COLOR, (TFT_WIDTH) * (TFT_HEIGHT)); #else memset2(buffer, TFT_MARLINBG_COLOR, (TFT_WIDTH) / 2); for (uint16_t i = 0; i < (TFT_HEIGHT) * sq(GRAPHICAL_TFT_UPSCALE); i++) @@ -420,8 +424,6 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); } -static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT - uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { if (msgInitCount) { if (msg == U8G_COM_MSG_INIT) msgInitCount--; @@ -433,8 +435,6 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p switch (msg) { case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: - u8g_SetPIOutput(u8g, U8G_PI_RESET); - u8g_Delay(50); isCommand = 0; break; @@ -443,7 +443,6 @@ uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_p break; case U8G_COM_MSG_RESET: - u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val); break; case U8G_COM_MSG_WRITE_BYTE: diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 159d0e1c196d..431973b89480 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -30,7 +30,7 @@ #include "../../inc/MarlinConfig.h" -#if TFT_INTERFACE_FSMC_8BIT +#if ENABLED(TFT_INTERFACE_FSMC_8BIT) // When we have a 8 bit interface, we need to invert the bytes of the color #define ENDIAN_COLOR(C) (((C) >> 8) | ((C) << 8)) #else diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index aa081be486bc..245635857186 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -121,7 +121,7 @@ class TFT_IO { static void write_esc_sequence(const uint16_t *Sequence); // Deletaged methods - inline static void Init() { io.Init(); }; + inline static void Init() { io.Init(); io.Abort(); }; inline static bool isBusy() { return io.isBusy(); }; inline static void Abort() { io.Abort(); }; inline static uint32_t GetID() { return io.GetID(); }; diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 8e231ca9abfe..3d1cc26cd6cf 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -32,6 +32,7 @@ XPT2046 touchIO; #endif #include "../marlinui.h" // For EN_C bit mask +#include "../tft_io/tft_io.h" #define DOGM_AREA_LEFT TFT_PIXEL_OFFSET_X #define DOGM_AREA_TOP TFT_PIXEL_OFFSET_Y @@ -49,7 +50,8 @@ uint8_t TouchButtons::read_buttons() { #ifdef HAS_WIRED_LCD int16_t x, y; - if (!touchIO.getRawPoint(&x, &y)) return 0; + const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y)); + if (!is_touched) return 0; #if ENABLED(TOUCH_SCREEN_CALIBRATION) const calibrationState state = touch_calibration.get_calibration_state(); diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index c0bbe2f423f9..7f429d4497e0 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -139,11 +139,15 @@ #define TFT_RS_PIN PD13 #define TFT_INTERFACE_FSMC_8BIT +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT +#define FSMC_CS_PIN TFT_CS_PIN +#define FSMC_RS_PIN TFT_RS_PIN + // // Touch Screen // https://ldm-systems.ru/f/doc/catalog/HY-TFT-2,8/XPT2046.pdf // -#if ENABLED(TOUCH_SCREEN) +#if NEED_TOUCH_PINS #define TOUCH_CS_PIN PB2 #define TOUCH_SCK_PIN PB0 #define TOUCH_MOSI_PIN PE5 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index c48cbc9e5650..e2b3f2c317c6 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -32,7 +32,7 @@ #define BOARD_INFO_NAME "MKS Robin Nano V3" // Avoid conflict with TIMER_TONE -#define STEP_TIMER 13 +#define STEP_TIMER 10 // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation @@ -255,7 +255,7 @@ * EXP1 EXP2 */ -#if EITHER(TFT_480x320_SPI, TFT_LVGL_UI_SPI) +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X -17253 #endif @@ -345,26 +345,6 @@ #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif // !MKS_MINI_12864 - -#elif ENABLED(SPI_GRAPHICAL_TFT) - #define SPI_TFT_CS_PIN PD11 - #define SPI_TFT_SCK_PIN PA5 - #define SPI_TFT_MISO_PIN PA6 - #define SPI_TFT_MOSI_PIN PA7 - #define SPI_TFT_DC_PIN PD10 - #define SPI_TFT_RST_PIN PC6 - - #define LCD_BACKLIGHT_PIN PD13 - - #define TOUCH_CS_PIN PE14 // SPI1_NSS - #define TOUCH_SCK_PIN PA5 // SPI1_SCK - #define TOUCH_MISO_PIN PA6 // SPI1_MISO - #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI - - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 #endif // HAS_SPI_LCD #define HAS_OTG_USB_HOST_SUPPORT diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 40da409185e4..05648cf1207e 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -30,7 +30,7 @@ #define BOARD_INFO_NAME "MKS Robin PRO V2" // Avoid conflict with TIMER_TONE -#define STEP_TIMER 13 +#define STEP_TIMER 10 // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation @@ -243,7 +243,7 @@ // // LCD / Controller #define SPI_FLASH -// #define HAS_SPI_FLASH 1 +#define HAS_SPI_FLASH 1 #define SPI_DEVICE 2 #define SPI_FLASH_SIZE 0x1000000 #if ENABLED(SPI_FLASH) @@ -264,7 +264,7 @@ * EXP1 EXP2 */ -#if EITHER(TFT_480x320_SPI, TFT_LVGL_UI_SPI) +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X -17253 #endif @@ -361,24 +361,4 @@ #endif #endif // !MKS_MINI_12864 - -#elif ENABLED(SPI_GRAPHICAL_TFT) - #define SPI_TFT_CS_PIN PD11 - #define SPI_TFT_SCK_PIN PA5 - #define SPI_TFT_MISO_PIN PA6 - #define SPI_TFT_MOSI_PIN PA7 - #define SPI_TFT_DC_PIN PD10 - #define SPI_TFT_RST_PIN PC6 - - #define LCD_BACKLIGHT_PIN PD13 - - #define TOUCH_CS_PIN PE14 // SPI1_NSS - #define TOUCH_SCK_PIN PA5 // SPI1_SCK - #define TOUCH_MISO_PIN PA6 // SPI1_MISO - #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI - - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 #endif // HAS_SPI_LCD diff --git a/buildroot/share/PlatformIO/scripts/anet_et4_openblt.py b/buildroot/share/PlatformIO/scripts/anet_et4_openblt.py new file mode 100644 index 000000000000..2911a28e789d --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/anet_et4_openblt.py @@ -0,0 +1,14 @@ +# Generate the firmware as OpenBLT needs + +import os,sys +from os.path import join + +Import("env") + +env.AddPostAction( + "$BUILD_DIR/${PROGNAME}.elf", + env.VerboseAction(" ".join([ + "$OBJCOPY", "-O", "srec", + "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"$BUILD_DIR/${PROGNAME}.srec\"" + ]), "Building " + join("$BUILD_DIR","${PROGNAME}.srec")) +) diff --git a/buildroot/share/PlatformIO/scripts/stm32_bootloader.py b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py index d517f1c8d1aa..7f49ea0e66f4 100644 --- a/buildroot/share/PlatformIO/scripts/stm32_bootloader.py +++ b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py @@ -6,9 +6,7 @@ def noencrypt(source, target, env): firmware = os.path.join(target[0].dir.path, board.get("build.firmware")) - # do not overwrite encrypted firmware if present - if not os.path.isfile(firmware): - shutil.copy(target[0].path, firmware) + shutil.copy(target[0].path, firmware) if 'offset' in board.get("build").keys(): LD_FLASH_OFFSET = board.get("build.offset") @@ -26,5 +24,7 @@ def noencrypt(source, target, env): if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag: env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40) - if 'firmware' in board.get("build").keys(): - env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt); +board_keys = board.get("build").keys() +# Only copy file if there's no encryptation +if 'firmware' in board_keys and not 'encrypt' in board_keys: + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c index 0fbd848dab74..51ebf605811b 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/PeripheralPins.c @@ -254,7 +254,7 @@ WEAK const PinMap PinMap_SPI_MOSI[] = { {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - // {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {NC, NP, 0} @@ -266,7 +266,7 @@ WEAK const PinMap PinMap_SPI_MISO[] = { {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - // {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {NC, NP, 0} diff --git a/platformio.ini b/platformio.ini index bf44808b3265..a95647cf4298 100644 --- a/platformio.ini +++ b/platformio.ini @@ -970,6 +970,7 @@ board_build.core = stm32 board_build.variant = MARLIN_F103Zx board_build.ldscript = ldscript.ld board_build.offset = 0x7000 +board_build.encrypt = Yes board_build.firmware = Robin.bin build_flags = ${common_stm32.build_flags} -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -DTIMER_SERIAL=TIM5 @@ -1155,6 +1156,7 @@ board_build.variant = MARLIN_F103Vx board_build.ldscript = ldscript.ld board_build.offset = 0x7000 board_build.firmware = Robin_mini.bin +board_build.encrypt = Yes board_upload.offset_address = 0x08007000 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC extra_scripts = ${common.extra_scripts} @@ -1247,6 +1249,8 @@ board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld board_build.firmware = firmware.srec +# Just anet_et4_openblt.py generates the file, not stm32_bootloader.py +board_build.encrypt = Yes board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 @@ -1255,6 +1259,7 @@ upload_protocol = jlink extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/anet_et4_openblt.py # # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) @@ -1304,19 +1309,20 @@ extra_scripts = ${common.extra_scripts} # Lerdge base # [lerdge_common] -platform = ${common_stm32.platform} -extends = common_stm32 -board = LERDGE -board_build.offset = 0x10000 -extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py - buildroot/share/PlatformIO/scripts/stm32_bootloader.py - buildroot/share/PlatformIO/scripts/lerdge.py -build_flags = ${common_stm32.build_flags} +platform = ${common_stm32.platform} +extends = common_stm32 +board = LERDGE +board_build.offset = 0x10000 +board_build.encrypt = Yes +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/lerdge.py +build_flags = ${common_stm32.build_flags} -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DARDUINO_LERDGE -DTRANSFER_CLOCK_DIV=8 -DHAL_SRAM_MODULE_ENABLED -build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 # # Lerdge X @@ -1369,6 +1375,7 @@ board_build.core = stm32 board_build.variant = MARLIN_F103Vx board_build.ldscript = ldscript.ld board_build.offset = 0x7000 +board_build.encrypt = Yes board_build.firmware = Robin_nano35.bin board_upload.offset_address = 0x08007000 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC @@ -1385,19 +1392,18 @@ extra_scripts = ${common.extra_scripts} [env:mks_robin_pro2] platform = ${common_stm32.platform} extends = common_stm32 -build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DARDUINO_BLACK_F407VE +build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST board = genericSTM32F407VET6 board_build.core = stm32 -board_build.variant = MARLIN_F407VE +board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld -board_build.firmware = Robin_nano35.bin +board_build.firmware = firmware.bin build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py - buildroot/share/PlatformIO/scripts/mks_encrypt.py # # MKS Robin Nano V3 @@ -1419,7 +1425,6 @@ upload_protocol = jlink extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py - buildroot/share/PlatformIO/scripts/mks_encrypt.py ################################# # # From f0c29afe21f2f1b2bd6dd2c5f1f3e6d819da549f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 20:22:58 -0600 Subject: [PATCH 410/443] Add "End Repeat Loops" menu item --- Marlin/src/feature/repeat.h | 4 ++++ Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/menu/menu_main.cpp | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index e293b2bbacb4..0f4d9425b768 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -39,6 +39,10 @@ class Repeat { static uint8_t index; public: static inline void reset() { index = 0; } + static inline bool is_active() { + LOOP_L_N(i, index) if (marker[i].counter) return true; + return false; + } static bool is_command_M808(char * const cmd) { return cmd[0] == 'M' && cmd[1] == '8' && cmd[2] == '0' && cmd[3] == '8' && !NUMERIC(cmd[4]); } static void early_parse_M808(char * const cmd); static void add_marker(const uint32_t sdpos, const uint16_t count); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 194a75c6a080..25460ed4556c 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -388,6 +388,7 @@ namespace Language_en { PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resume Print"); PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Host Start"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop Print"); + PROGMEM Language_Str MSG_END_LOOPS = _UxGT("End Repeat Loops"); PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Printing Object"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancel Object ="); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 968de3d4b82b..b7cd549e6b03 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -58,6 +58,10 @@ #include "../../feature/host_actions.h" #endif +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "../../feature/repeat.h" +#endif + void menu_tune(); void menu_cancelobject(); void menu_motion(); @@ -120,6 +124,11 @@ void menu_main() { }); #endif + #if ENABLED(GCODE_REPEAT_MARKERS) + if (repeat.is_active()) + ACTION_ITEM(MSG_END_LOOPS, repeat.cancel); + #endif + SUBMENU(MSG_TUNE, menu_tune); #if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS) From e6c15eee45cfb306a4b52a7e60a61599cce3fa54 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 24 Dec 2020 00:34:09 -0300 Subject: [PATCH 411/443] Fix DOGM status message scrolling (#20557) --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 29acb869413f..751d47da55ed 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -892,6 +892,10 @@ void MarlinUI::draw_status_message(const bool blink) { } else { // String is longer than the available space + if (blink != last_blink) { + last_blink = blink; + advance_status_scroll(); + } // Get a pointer to the next valid UTF8 character // and the string remaining length @@ -911,11 +915,6 @@ void MarlinUI::draw_status_message(const bool blink) { } } } - - if (last_blink != blink) { - last_blink = blink; - advance_status_scroll(); - } } #else // !STATUS_MESSAGE_SCROLLING From 57e94fb838bfd6416b2703d08994e638b0f3f82d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 23 Dec 2020 19:35:21 -0800 Subject: [PATCH 412/443] Fix ST7920 timing for Rumba32, Fysetc S6 (#20556) --- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 2 +- Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index decf4aeb6bca..7616d744cba8 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -273,7 +273,7 @@ #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 24c32d6d818c..959e893edc06 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -180,7 +180,7 @@ #define BOARD_ST7920_DELAY_2 DELAY_NS(48) #endif #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) #endif #endif From 20073246bb0b4dec456eba55a7e02fa592d2d852 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 22:23:45 -0600 Subject: [PATCH 413/443] Fix, clean up FTDI EVE Touch UI (#20466) Co-Authored-By: Marcio T. --- .../screens/change_filament_screen.cpp | 157 ++++++++---------- .../screens/status_screen.cpp | 10 +- .../screens/touch_calibration_screen.cpp | 3 + 3 files changed, 77 insertions(+), 93 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp index 8f073365ff0d..3cb79424460e 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -31,6 +31,43 @@ using namespace ExtUI; using namespace FTDI; using namespace Theme; +#ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 2 + #define GRID_ROWS 11 + #define E_TEMP_POS BTN_POS(2,7), BTN_SIZE(1,1) + #define E_TEMP_LBL_POS BTN_POS(1,7), BTN_SIZE(1,1) + #define UNLD_LABL_POS BTN_POS(1,8), BTN_SIZE(1,1) + #define LOAD_LABL_POS BTN_POS(2,8), BTN_SIZE(1,1) + #define UNLD_MOMN_POS BTN_POS(1,9), BTN_SIZE(1,1) + #define LOAD_MOMN_POS BTN_POS(2,9), BTN_SIZE(1,1) + #define UNLD_CONT_POS BTN_POS(1,10), BTN_SIZE(1,1) + #define LOAD_CONT_POS BTN_POS(2,10), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,11), BTN_SIZE(2,1) +#else + #define GRID_COLS 4 + #define GRID_ROWS 6 + #define E_TEMP_POS BTN_POS(3,2), BTN_SIZE(2,1) + #define E_TEMP_LBL_POS BTN_POS(3,1), BTN_SIZE(2,1) + #define UNLD_LABL_POS BTN_POS(3,3), BTN_SIZE(1,1) + #define LOAD_LABL_POS BTN_POS(4,3), BTN_SIZE(1,1) + #define UNLD_MOMN_POS BTN_POS(3,4), BTN_SIZE(1,1) + #define LOAD_MOMN_POS BTN_POS(4,4), BTN_SIZE(1,1) + #define UNLD_CONT_POS BTN_POS(3,5), BTN_SIZE(1,1) + #define LOAD_CONT_POS BTN_POS(4,5), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(3,6), BTN_SIZE(2,1) +#endif +#define REMOVAL_TEMP_LBL_POS BTN_POS(1,3), BTN_SIZE(2,1) +#define GRADIENT_POS BTN_POS(1,4), BTN_SIZE(1,3) +#define LOW_TEMP_POS BTN_POS(2,6), BTN_SIZE(1,1) +#define MED_TEMP_POS BTN_POS(2,5), BTN_SIZE(1,1) +#define HIG_TEMP_POS BTN_POS(2,4), BTN_SIZE(1,1) +#define HEATING_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1) +#define CAUTION_LBL_POS BTN_POS(1,4), BTN_SIZE(1,1) +#define HOT_LBL_POS BTN_POS(1,6), BTN_SIZE(1,1) +#define E_SEL_LBL_POS BTN_POS(1,1), BTN_SIZE(2,1) +#define E1_SEL_POS BTN_POS(1,2), BTN_SIZE(1,1) +#define E2_SEL_POS BTN_POS(2,2), BTN_SIZE(1,1) + #define COOL_TEMP 40 #define LOW_TEMP 180 #define MED_TEMP 200 @@ -101,70 +138,45 @@ void ChangeFilamentScreen::onExit() { void ChangeFilamentScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; - #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_COLS 2 - #define GRID_ROWS 11 - #else - #define GRID_COLS 4 - #define GRID_ROWS 6 - #endif - if (what & BACKGROUND) { cmd.cmd(CLEAR_COLOR_RGB(bg_color)) .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .tag(0) - #if ENABLED(TOUCH_UI_PORTRAIT) - .font(font_large) - #else - .font(font_medium) - #endif - .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) - #if ENABLED(TOUCH_UI_PORTRAIT) - .text(BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) - #else - .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) - .font(font_small) - #endif - .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_REMOVAL_TEMPERATURE)); - drawTempGradient(BTN_POS(1,4), BTN_SIZE(1,3)); + .font(TERN(TOUCH_UI_PORTRAIT, font_large, font_medium)) + .text(E_SEL_LBL_POS, GET_TEXT_F(MSG_EXTRUDER_SELECTION)) + .text(E_TEMP_LBL_POS, GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) + .text(REMOVAL_TEMP_LBL_POS, GET_TEXT_F(MSG_REMOVAL_TEMPERATURE)); + drawTempGradient(GRADIENT_POS); } if (what & FOREGROUND) { + char str[15]; const extruder_t e = getExtruder(); - char e_str[15]; if (isHeaterIdle(e)) - format_temp_and_idle(e_str, getActualTemp_celsius(e)); + format_temp_and_idle(str, getActualTemp_celsius(e)); else - format_temp_and_temp(e_str, getActualTemp_celsius(e), getTargetTemp_celsius(e)); + format_temp_and_temp(str, getActualTemp_celsius(e), getTargetTemp_celsius(e)); const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); cmd.cmd(COLOR_RGB(tcol)) .tag(15) - #if ENABLED(TOUCH_UI_PORTRAIT) - .rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) - #else - .rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) - #endif + .rectangle(E_TEMP_POS) .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) .font(font_medium) - #if ENABLED(TOUCH_UI_PORTRAIT) - .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) - #else - .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) - #endif + .text(E_TEMP_POS, str) .colors(normal_btn); const bool t_ok = getActualTemp_celsius(e) > getSoftenTemp() - 10; if (screen_data.ChangeFilamentScreen.t_tag && !t_ok) { - cmd.text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING)); + cmd.text(HEATING_LBL_POS, GET_TEXT_F(MSG_HEATING)); } else if (getActualTemp_celsius(e) > 100) { cmd.cmd(COLOR_RGB(0xFF0000)) - .text(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CAUTION)) + .text(CAUTION_LBL_POS, GET_TEXT_F(MSG_CAUTION)) .colors(normal_btn) - .text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_HOT)); + .text(HOT_LBL_POS, GET_TEXT_F(MSG_HOT)); } #define TOG_STYLE(A) colors(A ? action_btn : normal_btn) @@ -177,79 +189,42 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; #endif - #if ENABLED(TOUCH_UI_PORTRAIT) - cmd.font(font_large) - #else - cmd.font(font_medium) - #endif - .TOG_STYLE(tog10) - .tag(10) .button (BTN_POS(1,2), BTN_SIZE(1,1), F("1")) + cmd.TOG_STYLE(tog10) + .tag(10).button (E1_SEL_POS, F("1")) #if HOTENDS < 2 .enabled(false) #else .TOG_STYLE(tog11) #endif - .tag(11) .button (BTN_POS(2,2), BTN_SIZE(1,1), F("2")); + .tag(11).button (E2_SEL_POS, F("2")); if (!t_ok) reset_menu_timeout(); const bool tog7 = screen_data.ChangeFilamentScreen.repeat_tag == 7; const bool tog8 = screen_data.ChangeFilamentScreen.repeat_tag == 8; - - cmd.font( - #if ENABLED(TOUCH_UI_PORTRAIT) - font_large - #else - font_small - #endif - ); - { char str[30]; - format_temp(str, LOW_TEMP); - cmd.tag(2) .TOG_STYLE(tog2) .button (BTN_POS(2,6), BTN_SIZE(1,1), str); + cmd.tag(2) .TOG_STYLE(tog2).button (LOW_TEMP_POS, str); format_temp(str, MED_TEMP); - cmd.tag(3) .TOG_STYLE(tog3) .button (BTN_POS(2,5), BTN_SIZE(1,1), str); + cmd.tag(3) .TOG_STYLE(tog3).button (MED_TEMP_POS, str); format_temp(str, HIGH_TEMP); - cmd.tag(4) .TOG_STYLE(tog4) .button (BTN_POS(2,4), BTN_SIZE(1,1), str); + cmd.tag(4) .TOG_STYLE(tog4).button (HIG_TEMP_POS, str); } - cmd.colors(normal_btn) - - // Add tags to color gradient - .cmd(COLOR_MASK(0,0,0,0)) - .tag(2) .rectangle(BTN_POS(1,6), BTN_SIZE(1,1)) - .tag(3) .rectangle(BTN_POS(1,5), BTN_SIZE(1,1)) - .tag(4) .rectangle(BTN_POS(1,4), BTN_SIZE(1,1)) - .cmd(COLOR_MASK(1,1,1,1)) - - .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) - #if ENABLED(TOUCH_UI_PORTRAIT) - .font(font_large) - .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) - .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) - .tag(5) .enabled(t_ok).button (BTN_POS(1,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(6) .enabled(t_ok).button (BTN_POS(2,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(1,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(2,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(1).colors(action_btn) .button (BTN_POS(1,11), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #else - .font(font_small) - .tag(0) .text (BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) - .text (BTN_POS(4,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) - .tag(5) .enabled(t_ok).button (BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(6) .enabled(t_ok).button (BTN_POS(4,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(4,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) - .font(font_medium) - .tag(1).colors(action_btn) .button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); - #endif + + cmd.cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) + .tag(0) .text (UNLD_LABL_POS, GET_TEXT_F(MSG_UNLOAD_FILAMENT)) + .text (LOAD_LABL_POS, GET_TEXT_F(MSG_LOAD_FILAMENT)) + .colors(normal_btn) + .tag(5) .enabled(t_ok).button (UNLD_MOMN_POS, GET_TEXT_F(MSG_MOMENTARY)) + .tag(6) .enabled(t_ok).button (LOAD_MOMN_POS, GET_TEXT_F(MSG_MOMENTARY)) + .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (UNLD_CONT_POS, GET_TEXT_F(MSG_CONTINUOUS)) + .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (LOAD_CONT_POS, GET_TEXT_F(MSG_CONTINUOUS)) + .tag(1).colors(action_btn) .button (BACK_POS, GET_TEXT_F(MSG_BACK)); } - #undef GRID_COLS - #undef GRID_ROWS } uint8_t ChangeFilamentScreen::getSoftenTemp() { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp index 8dc1c4643af5..51f50343e01a 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -352,6 +352,13 @@ void StatusScreen::setStatusMessage(progmem_str message) { } void StatusScreen::setStatusMessage(const char* message) { + if (CommandProcessor::is_processing()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Cannot update status message, command processor busy"); + #endif + return; + } + CommandProcessor cmd; cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(Theme::bg_color)) @@ -366,8 +373,7 @@ void StatusScreen::setStatusMessage(const char* message) { storeBackground(); #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("New status message: ", message); + SERIAL_ECHO_MSG("New status message: ", message); #endif if (AT_SCREEN(StatusScreen)) { diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp index 185512b57b45..b5312add5aa9 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp @@ -85,6 +85,9 @@ void TouchCalibrationScreen::onRedraw(draw_mode_t) { void TouchCalibrationScreen::onIdle() { if (!CLCD::is_touching() && !CommandProcessor::is_processing()) { GOTO_PREVIOUS(); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Calibration routine finished"); + #endif } } From 820cc69d0a5891cb365ff33e835c585d34e394e0 Mon Sep 17 00:00:00 2001 From: Vi B-P Date: Wed, 23 Dec 2020 23:43:33 -0500 Subject: [PATCH 414/443] Apply NO_MOTION_BEFORE_HOMING to joystick motion (#20462) Co-authored-by: Scott Lahteine --- Marlin/src/feature/joystick.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp index d9c5ae7c1b1c..d2041598a5c5 100644 --- a/Marlin/src/feature/joystick.cpp +++ b/Marlin/src/feature/joystick.cpp @@ -127,6 +127,11 @@ Joystick joystick; static bool injecting_now; // = false; if (injecting_now) return; + #if ENABLED(NO_MOTION_BEFORE_HOMING) + if (TERN0(HAS_JOY_ADC_X, axis_should_home(X_AXIS)) || TERN0(HAS_JOY_ADC_Y, axis_should_home(Y_AXIS)) || TERN0(HAS_JOY_ADC_Z, axis_should_home(Z_AXIS))) + return; + #endif + static constexpr int QUEUE_DEPTH = 5; // Insert up to this many movements static constexpr float target_lag = 0.25f, // Aim for 1/4 second lag seg_time = target_lag / QUEUE_DEPTH; // 0.05 seconds, short segments inserted every 1/20th of a second From 1fc0dcdc9701146d7e8b126bb3ba0517c172e484 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Wed, 23 Dec 2020 22:50:24 -0600 Subject: [PATCH 415/443] Cutter Power in percent format (#20410) Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith Co-authored-by: Luu Lac <45380455+shitcreek@users.noreply.github.com> --- Marlin/src/feature/spindle_laser_types.h | 13 +++++++++---- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 1 - Marlin/src/lcd/menu/menu_item.h | 1 + Marlin/src/libs/numtostr.cpp | 16 ++++++++++------ Marlin/src/libs/numtostr.h | 5 ++++- buildroot/tests/BIGTREE_SKR_PRO-tests | 9 +++++++++ 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Marlin/src/feature/spindle_laser_types.h b/Marlin/src/feature/spindle_laser_types.h index 181c4d73ac07..c2994fd5c957 100644 --- a/Marlin/src/feature/spindle_laser_types.h +++ b/Marlin/src/feature/spindle_laser_types.h @@ -39,12 +39,17 @@ typedef IF<(SPEED_POWER_MAX > 255), uint16_t, uint8_t>::type cutter_cpower_t; #if CUTTER_UNIT_IS(RPM) && SPEED_POWER_MAX > 255 typedef uint16_t cutter_power_t; - #define CUTTER_MENU_POWER_TYPE uint16_5 - #define cutter_power2str ui16tostr5rj + #define CUTTER_MENU_POWER_TYPE uint16_5 + #define cutter_power2str ui16tostr5rj #else typedef uint8_t cutter_power_t; - #define CUTTER_MENU_POWER_TYPE uint8 - #define cutter_power2str ui8tostr3rj + #if CUTTER_UNIT_IS(PERCENT) + #define CUTTER_MENU_POWER_TYPE percent_3 + #define cutter_power2str pcttostrpctrj + #else + #define CUTTER_MENU_POWER_TYPE uint8 + #define cutter_power2str ui8tostr3rj + #endif #endif #if ENABLED(MARLIN_DEV_MODE) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 751d47da55ed..985041ede572 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -618,7 +618,6 @@ void MarlinUI::draw_status_screen() { if (cutter.isReady && PAGE_CONTAINS(STATUS_CUTTER_TEXT_Y - INFO_FONT_ASCENT, STATUS_CUTTER_TEXT_Y - 1)) { #if CUTTER_UNIT_IS(PERCENT) lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); - lcd_put_wchar('%'); #elif CUTTER_UNIT_IS(RPM) lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr51rj(float(cutter.unitPower) / 1000)); lcd_put_wchar('K'); diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 6430021223c1..188463c6c665 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -122,6 +122,7 @@ class TMenuEditItem : MenuEditItemBase { // NAME TYPE STRFUNC SCALE +ROUND DEFINE_MENU_EDIT_ITEM_TYPE(percent ,uint8_t ,ui8tostr4pctrj , 100.f/255.f, 0.5f); // 100% right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(percent_3 ,uint8_t ,pcttostrpctrj , 1 ); // 100% right-justified DEFINE_MENU_EDIT_ITEM_TYPE(int3 ,int16_t ,i16tostr3rj , 1 ); // 123, -12 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(int4 ,int16_t ,i16tostr4signrj , 1 ); // 1234, -123 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(int8 ,int8_t ,i8tostr3rj , 1 ); // 123, -12 right-justified diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index c3efb2b25a84..90696e9ad3c4 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -34,16 +34,20 @@ char conv[8] = { 0 }; #define INTFLOAT(V,N) (((V) * 10 * pow(10, N) + ((V) < 0 ? -5: 5)) / 10) // pow10? #define UINTFLOAT(V,N) INTFLOAT((V) < 0 ? -(V) : (V), N) -// Convert a full-range unsigned 8bit int to a percentage -const char* ui8tostr4pctrj(const uint8_t i) { - const uint8_t n = ui8_to_percent(i); - conv[3] = RJDIGIT(n, 100); - conv[4] = RJDIGIT(n, 10); - conv[5] = DIGIMOD(n, 1); +// Format uint8_t (0-100) as rj string with 123% / _12% / __1% format +const char* pcttostrpctrj(const uint8_t i) { + conv[3] = RJDIGIT(i, 100); + conv[4] = RJDIGIT(i, 10); + conv[5] = DIGIMOD(i, 1); conv[6] = '%'; return &conv[3]; } +// Convert uint8_t (0-255) to a percentage, format as above +const char* ui8tostr4pctrj(const uint8_t i) { + return pcttostrpctrj(ui8_to_percent(i)); +} + // Convert unsigned 8bit int to string 123 format const char* ui8tostr3rj(const uint8_t i) { conv[4] = RJDIGIT(i, 100); diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index e7c1e67e12d5..40c298af425e 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -23,7 +23,10 @@ #include -// Convert a full-range unsigned 8bit int to a percentage +// Format uint8_t (0-100) as rj string with 123% / _12% / __1% format +const char* pcttostrpctrj(const uint8_t i); + +// Convert uint8_t (0-255) to a percentage, format as above const char* ui8tostr4pctrj(const uint8_t i); // Convert uint8_t to string with 12 format diff --git a/buildroot/tests/BIGTREE_SKR_PRO-tests b/buildroot/tests/BIGTREE_SKR_PRO-tests index ff4a8d734e73..8dc433deb27b 100755 --- a/buildroot/tests/BIGTREE_SKR_PRO-tests +++ b/buildroot/tests/BIGTREE_SKR_PRO-tests @@ -28,5 +28,14 @@ opt_set Y_DRIVER_TYPE TMC2130 opt_enable BLTOUCH EEPROM_SETTINGS AUTO_BED_LEVELING_3POINT Z_SAFE_HOMING PINS_DEBUGGING exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders, Auto-Fan, BLTOUCH, mixed TMC drivers" "$3" +restore_configs +opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 +opt_set SERIAL_PORT -1 +opt_enable LASER_FEATURE REPRAP_DISCOUNT_SMART_CONTROLLER +opt_set CUTTER_POWER_UNIT PERCENT +opt_add SPINDLE_LASER_PWM_PIN HEATER_1_PIN +opt_add SPINDLE_LASER_ENA_PIN HEATER_2_PIN +exec_test $1 $2 "Laser, LCD, PERCENT power unit" "$3" + # clean up restore_configs From 4b860f1092e04d24f02cd986ee87d07da43a783c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 25 Dec 2020 00:21:08 +0000 Subject: [PATCH 416/443] [cron] Bump distribution date (2020-12-25) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8bbd3800a3a0..06e14336ce48 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-24" + #define STRING_DISTRIBUTION_DATE "2020-12-25" #endif /** From e2480d40d138aa822f59ac1b317d539238b77a3e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 26 Dec 2020 00:19:22 +0000 Subject: [PATCH 417/443] [cron] Bump distribution date (2020-12-26) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 06e14336ce48..0c96af89dc66 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-25" + #define STRING_DISTRIBUTION_DATE "2020-12-26" #endif /** From 331ca6a800705707b07b82b94275c5287426a09a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 27 Dec 2020 00:20:30 +0000 Subject: [PATCH 418/443] [cron] Bump distribution date (2020-12-27) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0c96af89dc66..8b08344c7cac 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-26" + #define STRING_DISTRIBUTION_DATE "2020-12-27" #endif /** From 719404803b7b5967d49afda72fe17660bf5388ea Mon Sep 17 00:00:00 2001 From: Ashammaru Date: Sun, 27 Dec 2020 02:01:54 +0100 Subject: [PATCH 419/443] Fix SPINDLE_LASER_FREQUENCY (#20509) --- Marlin/src/feature/spindle_laser.cpp | 21 ++++++++++++++------- Marlin/src/feature/spindle_laser.h | 8 +++++++- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 3f6523478237..7e17f393cdb2 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -43,7 +43,7 @@ cutter_power_t SpindleLaser::menuPower, // Power s #if ENABLED(MARLIN_DEV_MODE) cutter_frequency_t SpindleLaser::frequency; // PWM frequency setting; range: 2K - 50K #endif -#define SPINDLE_LASER_PWM_OFF ((SPINDLE_LASER_PWM_INVERT) ? 255 : 0) +#define SPINDLE_LASER_PWM_OFF TERN(SPINDLE_LASER_PWM_INVERT, 255, 0) // // Init the cutter to a safe OFF state @@ -71,16 +71,23 @@ void SpindleLaser::init() { /** * Set the cutter PWM directly to the given ocr value */ - void SpindleLaser::set_ocr(const uint8_t ocr) { - WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_STATE); // Turn spindle on - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); + void SpindleLaser::_set_ocr(const uint8_t ocr) { #if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY + set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); + #else + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); #endif } + + void SpindleLaser::set_ocr(const uint8_t ocr) { + WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_STATE); // Cutter ON + _set_ocr(ocr); + } + void SpindleLaser::ocr_off() { - WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Turn spindle off - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Only write low byte + WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Cutter OFF + _set_ocr(0); } #endif @@ -97,7 +104,7 @@ void SpindleLaser::apply_power(const uint8_t opwr) { ocr_off(); isReady = false; } - else if (enabled() || ENABLED(CUTTER_POWER_RELATIVE)) { + else if (ENABLED(CUTTER_POWER_RELATIVE) || enabled()) { set_ocr(power); isReady = true; } diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 4d3c802411d7..b0b9c01ec458 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -117,6 +117,12 @@ class SpindleLaser { #if ENABLED(SPINDLE_LASER_PWM) + private: + + static void _set_ocr(const uint8_t ocr); + + public: + static void set_ocr(const uint8_t ocr); static inline void set_ocr_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } static void ocr_off(); @@ -143,7 +149,7 @@ class SpindleLaser { #elif CUTTER_UNIT_IS(RPM) 2 #else - #error "???" + #error "CUTTER_UNIT_IS(???)" #endif )); } diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index d5a291db740a..f11b23d99565 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -59,7 +59,7 @@ #endif #if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) - EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency); + EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency); #endif END_MENU(); From 198b3ae0f81f9524479741161ba88306766c3e6e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 16:26:18 -0600 Subject: [PATCH 420/443] Fix some comments --- Marlin/src/gcode/calibrate/G28.cpp | 1 + Marlin/src/module/probe.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 3d739c7ce8f6..e63f60994f88 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -246,6 +246,7 @@ void GcodeSuite::G28() { set_bed_leveling_enabled(false); #endif + // Reset to the XY plane TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); // Count this command as movement / activity diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 02c1f55f4a8a..d93eda13030b 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -548,10 +548,10 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING)); auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) -> bool { - // Do a first probe at the fast speed - + // Tare the probe, if supported if (TERN0(PROBE_TARE, tare())) return true; + // Do a first probe at the fast speed const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger? early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high? #if ENABLED(DEBUG_LEVELING_FEATURE) From d00c89946dac44326dd1eb0fd381fb404cfd654d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 16:15:15 -0600 Subject: [PATCH 421/443] Remove CREALITY_TOUCH --- Marlin/Configuration.h | 5 ----- Marlin/src/feature/bltouch.h | 13 +++---------- Marlin/src/inc/Conditionals_LCD.h | 5 ----- Marlin/src/inc/SanityCheck.h | 3 +-- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ce24bd211730..d3b350bce411 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -896,11 +896,6 @@ */ //#define BLTOUCH -/** - * Pressure sensor with a BLTouch-like interface - */ -//#define CREALITY_TOUCH - /** * Touch-MI Probe by hotends.fr * diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index 5880bdce75f0..8bd41f03e404 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -30,16 +30,9 @@ // BLTouch commands are sent as servo angles typedef unsigned char BLTCommand; -#if ENABLED(CREALITY_TOUCH) - #define STOW_ALARM false - #define BLTOUCH_DEPLOY 170 - #define BLTOUCH_STOW 20 -#else - #define STOW_ALARM true - #define BLTOUCH_DEPLOY 10 - #define BLTOUCH_STOW 90 -#endif - +#define STOW_ALARM true +#define BLTOUCH_DEPLOY 10 +#define BLTOUCH_STOW 90 #define BLTOUCH_SW_MODE 60 #define BLTOUCH_SELFTEST 120 #define BLTOUCH_MODE_STORE 130 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 3e61eb6d4a28..ed01f54a0bbd 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -653,11 +653,6 @@ #define SERIAL_CATCHALL 0 #endif -// Pressure sensor with a BLTouch-like interface -#if ENABLED(CREALITY_TOUCH) - #define BLTOUCH -#endif - /** * The BLTouch Probe emulates a servo probe * and uses "special" angles for its state. diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0aadeef0eebc..48a223d3439e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1255,8 +1255,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if 1 < 0 \ + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \ - + (ENABLED(BLTOUCH) && DISABLED(CREALITY_TOUCH)) \ - + COUNT_ENABLED(PROBE_MANUALLY, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, CREALITY_TOUCH, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING) + + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING) #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." #endif From f423edd938dcb593b58844cd7dc3b9164d792686 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 16:21:01 -0600 Subject: [PATCH 422/443] Add probe_switch_activated --- Marlin/src/module/endstops.cpp | 9 +++------ Marlin/src/module/endstops.h | 8 ++++++++ Marlin/src/module/probe.cpp | 2 +- buildroot/tests/STM32F103RET6_creality-tests | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 1467e1b70de5..b1c7c1c5851b 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -465,7 +465,7 @@ void _O2 Endstops::report_states() { ES_REPORT(Z4_MAX); #endif #if BOTH(MARLIN_DEV_MODE, PROBE_ACTIVATION_SWITCH) - print_es_state(READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE, PSTR(STR_PROBE_EN)); + print_es_state(probe_switch_activated(), PSTR(STR_PROBE_EN)); #endif #if HAS_CUSTOM_PROBE_PIN print_es_state(PROBE_TRIGGERED(), PSTR(STR_Z_PROBE)); @@ -618,11 +618,8 @@ void Endstops::update() { #if HAS_BED_PROBE // When closing the gap check the enabled probe - if (true - #if ENABLED(PROBE_ACTIVATION_SWITCH) - || READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE - #endif - ) UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN)); + if (probe_switch_activated()) + UPDATE_ENDSTOP_BIT(Z, TERN(HAS_CUSTOM_PROBE_PIN, MIN_PROBE, MIN)); #endif #if HAS_Z_MAX && !Z_SPI_SENSORLESS diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 888d25a8bdf3..05936a6bf34d 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -116,6 +116,14 @@ class Endstops { ; } + static inline bool probe_switch_activated() { + return (true + #if ENABLED(PROBE_ACTIVATION_SWITCH) + && READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE + #endif + ); + } + /** * Report endstop hits to serial. Called from loop(). */ diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index d93eda13030b..df014bdc28a7 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -519,7 +519,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { */ bool Probe::tare() { #if BOTH(PROBE_ACTIVATION_SWITCH, PROBE_TARE_ONLY_WHILE_INACTIVE) - if (READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE) { + if (endstops.probe_switch_activated()) { SERIAL_ECHOLNPGM("Cannot tare an active probe"); return true; } diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index cc3275741b5c..199bd6a9c2d8 100755 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -23,7 +23,7 @@ opt_set SERIAL_PORT 1 opt_set MOTHERBOARD BOARD_CREALITY_V452 opt_disable NOZZLE_TO_PROBE_OFFSET opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -opt_enable PROBE_ACTIVATION_SWITCH PROBE_ACTIVATION_SWITCH_PIN PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE +opt_enable PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" # clean up From 45996fd20a71e711925dd5094a6860ec70624d4b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 16:23:18 -0600 Subject: [PATCH 423/443] Init tare pin once --- Marlin/src/MarlinCore.cpp | 6 +++++- Marlin/src/module/probe.cpp | 14 ++++++++++++-- Marlin/src/module/probe.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 0171690d4e6e..9a3de3f1ac67 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -193,7 +193,7 @@ #include "feature/runout.h" #endif -#if HAS_Z_SERVO_PROBE +#if EITHER(PROBE_TARE, HAS_Z_SERVO_PROBE) #include "module/probe.h" #endif @@ -1119,6 +1119,10 @@ void setup() { SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif + #if ENABLED(PROBE_TARE) + SETUP_RUN(probe.tare_init()); + #endif + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index df014bdc28a7..53c35d69f236 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -510,6 +510,16 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { } #if ENABLED(PROBE_TARE) + + /** + * @brief Init the tare pin + * + * @details Init tare pin to ON state for a strain gauge, otherwise OFF + */ + void Probe::tare_init() { + OUT_WRITE(PROBE_TARE_PIN, !PROBE_TARE_STATE); + } + /** * @brief Tare the Z probe * @@ -526,9 +536,9 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { #endif SERIAL_ECHOLNPGM("Taring probe"); - OUT_WRITE(PROBE_TARE_PIN, PROBE_TARE_STATE); + WRITE(PROBE_TARE_PIN, PROBE_TARE_STATE); delay(PROBE_TARE_TIME); - OUT_WRITE(PROBE_TARE_PIN, !PROBE_TARE_STATE); + WRITE(PROBE_TARE_PIN, !PROBE_TARE_STATE); delay(PROBE_TARE_DELAY); endstops.hit_on_purpose(); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 49520eb3344c..527f1190fa9c 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -211,6 +211,7 @@ class Probe { #endif #if ENABLED(PROBE_TARE) + static void tare_init(); static bool tare(); #endif From 31af49e5070894b87243ac2b39d121f99bf4b8ab Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 28 Dec 2020 00:21:01 +0000 Subject: [PATCH 424/443] [cron] Bump distribution date (2020-12-28) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8b08344c7cac..dbb06b813476 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-27" + #define STRING_DISTRIBUTION_DATE "2020-12-28" #endif /** From 81d7bd8f4114a82a79933340bcd644d93d2d9715 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 27 Dec 2020 18:49:15 -0800 Subject: [PATCH 425/443] Validate defined probe points (#20572) --- Marlin/Configuration_adv.h | 6 +- Marlin/src/feature/tramming.h | 5 ++ Marlin/src/feature/z_stepper_align.cpp | 22 +----- Marlin/src/lcd/menu/menu_bed_corners.cpp | 5 ++ Marlin/src/module/probe.h | 94 ++++++++++++++++-------- 5 files changed, 79 insertions(+), 53 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1abb48fcb405..d871f822da7f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -801,10 +801,10 @@ //#define ASSISTED_TRAMMING #if ENABLED(ASSISTED_TRAMMING) - // Define positions for probing points, use the hotend as reference not the sensor. - #define TRAMMING_POINT_XY { { 20, 20 }, { 200, 20 }, { 200, 200 }, { 20, 200 } } + // Define positions for probe points. + #define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } } - // Define positions names for probing points. + // Define position names for probe points. #define TRAMMING_POINT_NAME_1 "Front-Left" #define TRAMMING_POINT_NAME_2 "Front-Right" #define TRAMMING_POINT_NAME_3 "Back-Right" diff --git a/Marlin/src/feature/tramming.h b/Marlin/src/feature/tramming.h index 79f7407716d3..e97fb2fde6f9 100644 --- a/Marlin/src/feature/tramming.h +++ b/Marlin/src/feature/tramming.h @@ -21,6 +21,7 @@ */ #include "../inc/MarlinConfigPre.h" +#include "../module/probe.h" #if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1 #error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51." @@ -31,6 +32,10 @@ constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY; #define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos) static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions."); +#define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(screws_tilt_adjust_pos[N]), \ + "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") +VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); + extern const char point_name_1[], point_name_2[], point_name_3[] #ifdef TRAMMING_POINT_NAME_4 , point_name_4[] diff --git a/Marlin/src/feature/z_stepper_align.cpp b/Marlin/src/feature/z_stepper_align.cpp index 87b1f6f25163..21fe54d0e666 100644 --- a/Marlin/src/feature/z_stepper_align.cpp +++ b/Marlin/src/feature/z_stepper_align.cpp @@ -54,25 +54,9 @@ void ZStepperAlign::reset_to_default() { #endif ); - constexpr xyz_pos_t dpo = NOZZLE_TO_PROBE_OFFSET; - - #define LTEST(N) (xy_init[N].x >= _MAX(X_MIN_BED + PROBING_MARGIN_LEFT, X_MIN_POS + dpo.x) - 0.00001f) - #define RTEST(N) (xy_init[N].x <= _MIN(X_MAX_BED - PROBING_MARGIN_RIGHT, X_MAX_POS + dpo.x) + 0.00001f) - #define FTEST(N) (xy_init[N].y >= _MAX(Y_MIN_BED + PROBING_MARGIN_FRONT, Y_MIN_POS + dpo.y) - 0.00001f) - #define BTEST(N) (xy_init[N].y <= _MIN(Y_MAX_BED - PROBING_MARGIN_BACK, Y_MAX_POS + dpo.y) + 0.00001f) - - static_assert(LTEST(0) && RTEST(0), "The 1st Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset."); - static_assert(FTEST(0) && BTEST(0), "The 1st Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset."); - static_assert(LTEST(1) && RTEST(1), "The 2nd Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset."); - static_assert(FTEST(1) && BTEST(1), "The 2nd Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset."); - #if NUM_Z_STEPPER_DRIVERS >= 3 - static_assert(LTEST(2) && RTEST(2), "The 3rd Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset."); - static_assert(FTEST(2) && BTEST(2), "The 3rd Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset."); - #if NUM_Z_STEPPER_DRIVERS >= 4 - static_assert(LTEST(3) && RTEST(3), "The 4th Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset."); - static_assert(FTEST(3) && BTEST(3), "The 4th Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset."); - #endif - #endif + #define VALIDATE_ALIGN_POINT(N) static_assert(N >= NUM_Z_STEPPER_DRIVERS || Probe::build_time::can_reach(xy_init[N]), \ + "Z_STEPPER_ALIGN_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") + VALIDATE_ALIGN_POINT(0); VALIDATE_ALIGN_POINT(1); VALIDATE_ALIGN_POINT(2); VALIDATE_ALIGN_POINT(3); #else // !defined(Z_STEPPER_ALIGN_XY) diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 56a97b5706a4..2252cbc49fa0 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -77,6 +77,11 @@ constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1] */ #if ENABLED(LEVEL_CORNERS_USE_PROBE) + #define VALIDATE_POINT(X, Y, STR) static_assert(Probe::build_time::can_reach((X), (Y)), \ + "LEVEL_CORNERS_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") + VALIDATE_POINT(lf.x, Y_CENTER, "left"); VALIDATE_POINT(X_CENTER, lf.y, "front"); + VALIDATE_POINT(rb.x, Y_CENTER, "right"); VALIDATE_POINT(X_CENTER, rb.y, "back"); + void _lcd_draw_probing() { if (ui.should_draw()) MenuItem_static::draw((LCD_HEIGHT - 1) / 2, GET_TEXT(MSG_PROBING_MESH)); } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 527f1190fa9c..d28cdff53a8e 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -62,12 +62,12 @@ class Probe { #if HAS_PROBE_XY_OFFSET // Return true if the both nozzle and the probe can reach the given point. // Note: This won't work on SCARA since the probe offset rotates with the arm. - static inline bool can_reach(const float &rx, const float &ry) { + static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y) // The nozzle can go where it needs to go? && position_is_reachable(rx, ry, ABS(PROBING_MARGIN)); // Can the nozzle also go near there? } #else - FORCE_INLINE static bool can_reach(const float &rx, const float &ry) { + static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx, ry, PROBING_MARGIN); } #endif @@ -81,7 +81,7 @@ class Probe { * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the * nozzle must be be able to reach +10,-10. */ - static inline bool can_reach(const float &rx, const float &ry) { + static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y) && WITHIN(rx, min_x() - fslop, max_x() + fslop) && WITHIN(ry, min_y() - fslop, max_y() + fslop); @@ -89,13 +89,13 @@ class Probe { #endif - static inline void move_z_after_probing() { + static void move_z_after_probing() { #ifdef Z_AFTER_PROBING do_z_clearance(Z_AFTER_PROBING, true, true, true); // Move down still permitted #endif } static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true); - static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) { + static float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) { return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check); } @@ -105,21 +105,21 @@ class Probe { static bool set_deployed(const bool) { return false; } - FORCE_INLINE static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } + static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx, ry); } #endif - static inline void move_z_after_homing() { + static void move_z_after_homing() { #ifdef Z_AFTER_HOMING do_z_clearance(Z_AFTER_HOMING, true, true, true); - #elif BOTH(Z_AFTER_PROBING,HAS_BED_PROBE) + #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE) move_z_after_probing(); #endif } - FORCE_INLINE static bool can_reach(const xy_pos_t &pos) { return can_reach(pos.x, pos.y); } + static bool can_reach(const xy_pos_t &pos) { return can_reach(pos.x, pos.y); } - FORCE_INLINE static bool good_bounds(const xy_pos_t &lf, const xy_pos_t &rb) { + static bool good_bounds(const xy_pos_t &lf, const xy_pos_t &rb) { return ( #if IS_KINEMATIC can_reach(lf.x, 0) && can_reach(rb.x, 0) && can_reach(0, lf.y) && can_reach(0, rb.y) @@ -137,8 +137,8 @@ class Probe { static constexpr xy_pos_t offset_xy = xy_pos_t({ 0, 0 }); // See #16767 #endif - static inline bool deploy() { return set_deployed(true); } - static inline bool stow() { return set_deployed(false); } + static bool deploy() { return set_deployed(true); } + static bool stow() { return set_deployed(false); } #if HAS_BED_PROBE || HAS_LEVELING #if IS_KINEMATIC @@ -146,41 +146,73 @@ class Probe { TERN_(DELTA, DELTA_PRINTABLE_RADIUS) TERN_(IS_SCARA, SCARA_PRINTABLE_RADIUS) ); - static inline float probe_radius() { - return printable_radius - _MAX(PROBING_MARGIN, HYPOT(offset_xy.x, offset_xy.y)); + static constexpr float probe_radius(const xy_pos_t &probe_offset_xy = offset_xy) { + return printable_radius - _MAX(PROBING_MARGIN, HYPOT(probe_offset_xy.x, probe_offset_xy.y)); } #endif - static inline float min_x() { + static constexpr float _min_x(const xy_pos_t &probe_offset_xy = offset_xy) { return TERN(IS_KINEMATIC, - (X_CENTER) - probe_radius(), - _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x) - ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); + (X_CENTER) - probe_radius(probe_offset_xy), + _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + probe_offset_xy.x) + ); } - static inline float max_x() { + static constexpr float _max_x(const xy_pos_t &probe_offset_xy = offset_xy) { return TERN(IS_KINEMATIC, - (X_CENTER) + probe_radius(), - _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x) - ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); + (X_CENTER) + probe_radius(probe_offset_xy), + _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + probe_offset_xy.x) + ); } - static inline float min_y() { + static constexpr float _min_y(const xy_pos_t &probe_offset_xy = offset_xy) { return TERN(IS_KINEMATIC, - (Y_CENTER) - probe_radius(), - _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y) - ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); + (Y_CENTER) - probe_radius(probe_offset_xy), + _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + probe_offset_xy.y) + ); } - static inline float max_y() { + static constexpr float _max_y(const xy_pos_t &probe_offset_xy = offset_xy) { return TERN(IS_KINEMATIC, - (Y_CENTER) + probe_radius(), - _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y) - ) - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); + (Y_CENTER) + probe_radius(probe_offset_xy), + _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + probe_offset_xy.y) + ); } + static float min_x() { return _min_x() - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); } + static float max_x() { return _max_x() - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.x)); } + static float min_y() { return _min_y() - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); } + static float max_y() { return _max_y() - TERN0(NOZZLE_AS_PROBE, TERN0(HAS_HOME_OFFSET, home_offset.y)); } + + // constexpr helpers used in build-time static_asserts, relying on default probe offsets. + class build_time { + static constexpr xyz_pos_t default_probe_xyz_offset = + #if HAS_BED_PROBE + NOZZLE_TO_PROBE_OFFSET + #else + { 0 } + #endif + ; + static constexpr xy_pos_t default_probe_xy_offset = { default_probe_xyz_offset.x, default_probe_xyz_offset.y }; + + public: + static constexpr bool can_reach(float x, float y) { + #if IS_KINEMATIC + return HYPOT2(x, y) <= sq(probe_radius(default_probe_xy_offset)); + #else + return WITHIN(x, _min_x(default_probe_xy_offset) - fslop, _max_x(default_probe_xy_offset) + fslop) + && WITHIN(y, _min_y(default_probe_xy_offset) - fslop, _max_y(default_probe_xy_offset) + fslop); + #endif + } + + static constexpr bool can_reach(const xy_pos_t &point) { return can_reach(point.x, point.y); } + }; + #if NEEDS_THREE_PROBE_POINTS // Retrieve three points to probe the bed. Any type exposing set(X,Y) may be used. template - static inline void get_three_points(T points[3]) { + static void get_three_points(T points[3]) { #if HAS_FIXED_3POINT + #define VALIDATE_PROBE_PT(N) static_assert(Probe::build_time::can_reach(xy_pos_t{PROBE_PT_##N##_X, PROBE_PT_##N##_Y}), \ + "PROBE_PT_" STRINGIFY(N) "_(X|Y) is unreachable using default NOZZLE_TO_PROBE_OFFSET and PROBING_MARGIN"); + VALIDATE_PROBE_PT(1); VALIDATE_PROBE_PT(2); VALIDATE_PROBE_PT(3); points[0].set(PROBE_PT_1_X, PROBE_PT_1_Y); points[1].set(PROBE_PT_2_X, PROBE_PT_2_Y); points[2].set(PROBE_PT_3_X, PROBE_PT_3_Y); From e83b7edefc0153cb9385ad2511d3435768b994f3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Dec 2020 22:41:52 -0600 Subject: [PATCH 426/443] General cleanup --- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 48a223d3439e..7c4c73d1a9a5 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1878,7 +1878,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." #elif !HAS_TEMP_ADC_PROBE #error "TEMP_PROBE_PIN must be an ADC pin." - #elif !ENABLED(FIX_MOUNTED_PROBE) + #elif DISABLED(FIX_MOUNTED_PROBE) #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE." #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index d599f2414f84..829c38ec45fb 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -280,7 +280,7 @@ * ----- ----- * LCD LCD */ - + #define LCD_PINS_RS EXPA1_07_PIN #define BTN_EN1 EXPA1_05_PIN From 84a1fff30298b99f1fdfee8bba4caf6437f7d510 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 20:50:16 -0600 Subject: [PATCH 427/443] Allow define HOMING_FEEDRATE_(XY|Z) --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7c4c73d1a9a5..949828d5f800 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -190,7 +190,7 @@ #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #elif defined(HOMING_FEEDRATE) #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead." -#elif defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z) +#elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M) #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead." #elif defined(MANUAL_HOME_POSITIONS) #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." From 91c350e7932a1e0fb0a2fd82f7d5e10a36ee932a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 21:00:07 -0600 Subject: [PATCH 428/443] Remove URL scheme --- Marlin/Version.h | 4 ++-- Marlin/src/core/boards.h | 2 +- Marlin/src/core/language.h | 2 +- Marlin/src/inc/Version.h | 4 ++-- Marlin/src/libs/heatshrink/heatshrink_common.h | 2 +- Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 2 +- Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h | 2 +- Marlin/src/pins/ramps/pins_3DRAG.h | 2 +- Marlin/src/pins/ramps/pins_K8200.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAIN_2.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 2 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 2 +- Marlin/src/pins/teensy2/pins_SAV_MKI.h | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index fe0724fbfcb1..eb2f9f9a14d4 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -54,7 +54,7 @@ * has a distinct Github fork— the Source Code URL should just be the main * Marlin repository. */ -//#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" +//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin" /** * Default generic printer UUID. @@ -65,7 +65,7 @@ * The WEBSITE_URL is the location where users can get more information such as * documentation about a specific Marlin release. */ -//#define WEBSITE_URL "https://marlinfw.org" +//#define WEBSITE_URL "marlinfw.org" /** * Set the vendor info the serial USB interface, if changable diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index ec82c3c41d54..3057f12b7f38 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -189,7 +189,7 @@ #define BOARD_GEN3_PLUS 1601 // Gen3+ #define BOARD_GEN6 1602 // Gen6 #define BOARD_GEN6_DELUXE 1603 // Gen6 deluxe -#define BOARD_GEN7_CUSTOM 1604 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" +#define BOARD_GEN7_CUSTOM 1604 // Gen7 custom (Alfons3 Version) https://github.com/Alfons3/Generation_7_Electronics #define BOARD_GEN7_12 1605 // Gen7 v1.1, v1.2 #define BOARD_GEN7_13 1606 // Gen7 v1.3 #define BOARD_GEN7_14 1607 // Gen7 v1.4 diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 98d155e1d185..d6048d293c80 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -91,7 +91,7 @@ #define MACHINE_UUID DEFAULT_MACHINE_UUID #endif -#define MARLIN_WEBSITE_URL "https://marlinfw.org" +#define MARLIN_WEBSITE_URL "marlinfw.org" //#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL) // #define STRING_SPLASH_LINE3 WEBSITE_URL diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index dbb06b813476..8905b3a82e28 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -82,7 +82,7 @@ * providing the source code to your customers.) */ #ifndef SOURCE_CODE_URL - #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" + #define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin" #endif /** @@ -97,7 +97,7 @@ * documentation about a specific Marlin release. Displayed in the Info Menu. */ #ifndef WEBSITE_URL - #define WEBSITE_URL "https://marlinfw.org" + #define WEBSITE_URL "marlinfw.org" #endif /** diff --git a/Marlin/src/libs/heatshrink/heatshrink_common.h b/Marlin/src/libs/heatshrink/heatshrink_common.h index c8dc95406e90..68653e4793c1 100644 --- a/Marlin/src/libs/heatshrink/heatshrink_common.h +++ b/Marlin/src/libs/heatshrink/heatshrink_common.h @@ -4,7 +4,7 @@ #pragma once #define HEATSHRINK_AUTHOR "Scott Vokes " -#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink" +#define HEATSHRINK_URL "github.com/atomicobject/heatshrink" /* Version 0.4.1 */ #define HEATSHRINK_VERSION_MAJOR 0 diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h index b678917734cb..e9c943d4aeb4 100644 --- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h +++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h @@ -26,7 +26,7 @@ #endif #define BOARD_INFO_NAME "FLY-CDY" -#define BOARD_WEBSITE_URL "https://github.com/FLYmaker/FLY-CDY" +#define BOARD_WEBSITE_URL "github.com/FLYmaker/FLY-CDY" // // Servos diff --git a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h index 52e757c53408..0abea23a45ab 100644 --- a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h +++ b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h @@ -31,7 +31,7 @@ #define BOARD_INFO_NAME "Wanhao i3 Mini 0ne+" #define DEFAULT_MACHINE_NAME "i3 Mini" -#define BOARD_WEBSITE_URL "https://tinyurl.com/yyxw7se7" +#define BOARD_WEBSITE_URL "tinyurl.com/yyxw7se7" // // Limit Switches diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index 5a0afdc550cf..6c7f7f4db63f 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -34,7 +34,7 @@ #endif #ifndef DEFAULT_SOURCE_CODE_URL - #define DEFAULT_SOURCE_CODE_URL "https://3dprint.elettronicain.it/" + #define DEFAULT_SOURCE_CODE_URL "3dprint.elettronicain.it" #endif // diff --git a/Marlin/src/pins/ramps/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h index 5d4d2d7022a5..df685e0f0c20 100644 --- a/Marlin/src/pins/ramps/pins_K8200.h +++ b/Marlin/src/pins/ramps/pins_K8200.h @@ -28,6 +28,6 @@ #define BOARD_INFO_NAME "Velleman K8200" #define DEFAULT_MACHINE_NAME "K8200" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" +#define DEFAULT_SOURCE_CODE_URL "github.com/CONSULitAS/Marlin-K8200" #include "pins_3DRAG.h" diff --git a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h index c6251ae8175c..211caddba0ef 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h @@ -39,7 +39,7 @@ #define BOARD_INFO_NAME "Ultimaker 2.x" #define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define DEFAULT_SOURCE_CODE_URL "github.com/Ultimaker/Marlin" // // Limit Switches diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h index 116301f4d459..447138f53e26 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h @@ -39,7 +39,7 @@ #define BOARD_INFO_NAME "Ultimaker" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define DEFAULT_SOURCE_CODE_URL "github.com/Ultimaker/Marlin" // // Servos diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 9b17384aaf55..a59a000dff86 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -74,7 +74,7 @@ #define BOARD_INFO_NAME "Ultimaker 1.5.4+" #endif #define DEFAULT_MACHINE_NAME "Ultimaker" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define DEFAULT_SOURCE_CODE_URL "github.com/Ultimaker/Marlin" // // Limit Switches diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 0c79f108f71b..3cf68ac905cb 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -26,7 +26,7 @@ #endif #define BOARD_INFO_NAME "Zonestar ZMIB_V2" -#define BOARD_WEBSITE_URL "https://www.aliexpress.com/item/32957490744.html" +#define BOARD_WEBSITE_URL "www.aliexpress.com/item/32957490744.html" #define IS_ZMIB_V2 diff --git a/Marlin/src/pins/teensy2/pins_SAV_MKI.h b/Marlin/src/pins/teensy2/pins_SAV_MKI.h index 4d083ecd12e2..bcc456c16e8a 100644 --- a/Marlin/src/pins/teensy2/pins_SAV_MKI.h +++ b/Marlin/src/pins/teensy2/pins_SAV_MKI.h @@ -68,7 +68,7 @@ #define BOARD_INFO_NAME "SAV MkI" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -#define DEFAULT_SOURCE_CODE_URL "https://tinyurl.com/onru38b" +#define DEFAULT_SOURCE_CODE_URL "tinyurl.com/onru38b" // // Servos From cfcfc8047afb09bd3da8d3e7bb49f066a977e6d6 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:10:53 -0800 Subject: [PATCH 429/443] Small / Large Boot Screen option for TFT_COLOR_UI (#20578) --- Marlin/Configuration_adv.h | 4 +++- Marlin/src/lcd/tft/ui_320x240.cpp | 16 +++++++++++++--- Marlin/src/lcd/tft/ui_320x240.h | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 20 +++++++++++++------- Marlin/src/lcd/tft/ui_480x320.h | 2 +- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d871f822da7f..6b1febc8f539 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1140,6 +1140,9 @@ #if ENABLED(SHOW_BOOTSCREEN) #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) + #if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI) + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) + #endif #endif // Scroll a longer status message into view @@ -1450,7 +1453,6 @@ //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar - //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index bcd1cb2ab95c..2cc586a48a77 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -92,10 +92,20 @@ void MarlinUI::clear_lcd() { tft.queue.reset(); tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT); - tft.add_image(0, 0, imgBootScreen); // MarlinLogo320x240x16 - + #if ENABLED(BOOT_MARLIN_LOGO_SMALL) + #define BOOT_LOGO_W 195 // MarlinLogo195x59x16 + #define BOOT_LOGO_H 59 + #define SITE_URL_Y (TFT_HEIGHT - 46) + tft.set_background(COLOR_BACKGROUND); + #else + #define BOOT_LOGO_W 320 // MarlinLogo320x240x16 + #define BOOT_LOGO_H 240 + #define SITE_URL_Y (TFT_HEIGHT - 52) + #endif + tft.add_image((TFT_WIDTH - BOOT_LOGO_W) / 2, (TFT_HEIGHT - BOOT_LOGO_H) / 2, imgBootScreen); #ifdef WEBSITE_URL - tft.add_text(4, 188, COLOR_WEBSITE_URL, WEBSITE_URL); + tft_string.set(WEBSITE_URL); + tft.add_text(tft_string.center(TFT_WIDTH), SITE_URL_Y, COLOR_WEBSITE_URL, tft_string); #endif tft.queue.sync(); diff --git a/Marlin/src/lcd/tft/ui_320x240.h b/Marlin/src/lcd/tft/ui_320x240.h index c9822f11cc69..0f928eea3772 100644 --- a/Marlin/src/lcd/tft/ui_320x240.h +++ b/Marlin/src/lcd/tft/ui_320x240.h @@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false); #define ABSOLUTE_ZERO -273.15 const tImage Images[imgCount] = { - MarlinLogo320x240x16, + TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo320x240x16), HotEnd_64x64x4, Bed_64x64x4, Bed_Heated_64x64x4, diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 9e387b240215..8d05ab7df494 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -90,18 +90,24 @@ void MarlinUI::clear_lcd() { } #if ENABLED(SHOW_BOOTSCREEN) - #undef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 5000 - void MarlinUI::show_bootscreen() { tft.queue.reset(); tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT); - tft.set_background(COLOR_BACKGROUND); - tft.add_image(142, 130, imgBootScreen); // MarlinLogo195x59x16 - + #if ENABLED(BOOT_MARLIN_LOGO_SMALL) + #define BOOT_LOGO_W 195 // MarlinLogo195x59x16 + #define BOOT_LOGO_H 59 + #define SITE_URL_Y (TFT_HEIGHT - 70) + tft.set_background(COLOR_BACKGROUND); + #else + #define BOOT_LOGO_W 480 // MarlinLogo480x320x16 + #define BOOT_LOGO_H 320 + #define SITE_URL_Y (TFT_HEIGHT - 90) + #endif + tft.add_image((TFT_WIDTH - BOOT_LOGO_W) / 2, (TFT_HEIGHT - BOOT_LOGO_H) / 2, imgBootScreen); #ifdef WEBSITE_URL - tft.add_text(8, 250, COLOR_WEBSITE_URL, WEBSITE_URL); + tft_string.set(WEBSITE_URL); + tft.add_text(tft_string.center(TFT_WIDTH), SITE_URL_Y, COLOR_WEBSITE_URL, tft_string); #endif tft.queue.sync(); diff --git a/Marlin/src/lcd/tft/ui_480x320.h b/Marlin/src/lcd/tft/ui_480x320.h index 053ee78158cb..cc62ee8cce73 100644 --- a/Marlin/src/lcd/tft/ui_480x320.h +++ b/Marlin/src/lcd/tft/ui_480x320.h @@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false); #define ABSOLUTE_ZERO -273.15 const tImage Images[imgCount] = { - MarlinLogo195x59x16, + TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16), HotEnd_64x64x4, Bed_64x64x4, Bed_Heated_64x64x4, From 2ce9fa4b9c960fef703dc0d5cf31b0d312737a74 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 28 Dec 2020 02:08:06 -0300 Subject: [PATCH 430/443] Better defaults, compatibility for SDIO + STM32 (#20570) --- .../src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp | 60 ++++++++++--------- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 2 + Marlin/src/pins/stm32f4/pins_LERDGE_K.h | 1 + Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 1 + Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 1 + platformio.ini | 8 +-- 6 files changed, 42 insertions(+), 31 deletions(-) diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp index a7b1e8006f2d..e00fb9b16f7a 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp @@ -88,18 +88,37 @@ MKS Robin board seems to have stable SDIO with BusWide 1bit and ClockDiv 8 i.e. 4.8MHz SDIO clock frequency Additional testing is required as there are clearly some 4bit initialization problems - - Add -DTRANSFER_CLOCK_DIV=8 to build parameters to improve SDIO stability */ - #ifndef TRANSFER_CLOCK_DIV - #define TRANSFER_CLOCK_DIV (uint8_t(SDIO_INIT_CLK_DIV) / 40) - #endif - #ifndef USBD_OK #define USBD_OK 0 #endif + // Target Clock, configurable. Default is 18MHz, from STM32F1 + #ifndef SDIO_CLOCK + #define SDIO_CLOCK 18000000 /* 18 MHz */ + #endif + + // SDIO retries, configurable. Default is 3, from STM32F1 + #ifndef SDIO_READ_RETRIES + #define SDIO_READ_RETRIES 3 + #endif + + // SDIO Max Clock (naming from STM Manual, don't change) + #define SDIOCLK 48000000 + + static uint32_t clock_to_divider(uint32_t clk) { + // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals + // Also limited to no more than 48Mhz (SDIOCLK). + const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); + clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); + clk = min(clk, (uint32_t)SDIOCLK); + // Round up divider, so we don't run the card over the speed supported, + // and subtract by 2, because STM32 will add 2, as written in the manual: + // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] + return pclk2 / clk + (pclk2 % clk != 0) - 2; + } + void go_to_transfer_speed() { SD_InitTypeDef Init; @@ -109,7 +128,7 @@ Init.ClockPowerSave = hsd.Init.ClockPowerSave; Init.BusWide = hsd.Init.BusWide; Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; - Init.ClockDiv = TRANSFER_CLOCK_DIV; + Init.ClockDiv = clock_to_divider(SDIO_CLOCK); /* Initialize SDIO peripheral interface with default configuration */ SDIO_Init(hsd.Instance, Init); @@ -155,38 +174,25 @@ //Initialize the SDIO (with initial <400Khz Clock) tempreg = 0; //Reset value tempreg |= SDIO_CLKCR_CLKEN; // Clock enabled - tempreg |= (uint32_t)0x76; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz + tempreg |= SDIO_INIT_CLK_DIV; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz // Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable SDIO->CLKCR = tempreg; // Power up the SDIO - SDIO->POWER = 0x03; + SDIO_PowerState_ON(SDIO); } void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { // application specific init - UNUSED(hsd); /* Prevent unused argument(s) compilation warning */ + UNUSED(hsd); // Prevent unused argument(s) compilation warning __HAL_RCC_SDIO_CLK_ENABLE(); // turn on SDIO clock } - constexpr uint8_t SD_RETRY_COUNT = TERN(SD_CHECK_AND_RETRY, 3, 1); - bool SDIO_Init() { - //init SDIO and get SD card info - - uint8_t retryCnt = SD_RETRY_COUNT; + uint8_t retryCnt = SDIO_READ_RETRIES; bool status; hsd.Instance = SDIO; - hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET - - /* - hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; - hsd.Init.ClockBypass = SDIO_CLOCK_BYPASS_DISABLE; - hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; - hsd.Init.BusWide = SDIO_BUS_WIDE_1B; - hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; - hsd.Init.ClockDiv = 8; - */ + hsd.State = HAL_SD_STATE_RESET; SD_LowLevel_Init(); @@ -258,7 +264,7 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { hsd.Instance = SDIO; - uint8_t retryCnt = SD_RETRY_COUNT; + uint8_t retryCnt = SDIO_READ_RETRIES; bool status; for (;;) { @@ -307,7 +313,7 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { hsd.Instance = SDIO; - uint8_t retryCnt = SD_RETRY_COUNT; + uint8_t retryCnt = SDIO_READ_RETRIES; bool status; for (;;) { status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index ebfb00bfb668..21dad6df3ede 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -165,6 +165,8 @@ #define SPI_DEVICE 2 #define SDIO_SUPPORT +#define SDIO_CLOCK 4500000 +#define SDIO_READ_RETRIES 16 #if ENABLED(SDIO_SUPPORT) #define SCK_PIN PB13 // SPI2 #define MISO_PIN PB14 // SPI2 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index 48973688a058..ef96eecd74e8 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -142,6 +142,7 @@ // SD support // #define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 // // Misc. Functions diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index 0600ed43389f..bd4d1f661874 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -156,6 +156,7 @@ // SD support // #define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 #define SCK_PIN PC12 //confirmed working #define MISO_PIN PC8 //confirmed working diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index 6e0b3e14a786..c8f52d6987dc 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -127,6 +127,7 @@ // #define SDIO_SUPPORT #define SD_DETECT_PIN PA8 +#define SDIO_CLOCK 4800000 // // LCD / Controller diff --git a/platformio.ini b/platformio.ini index a95647cf4298..924da69a74ac 100644 --- a/platformio.ini +++ b/platformio.ini @@ -973,7 +973,7 @@ board_build.offset = 0x7000 board_build.encrypt = Yes board_build.firmware = Robin.bin build_flags = ${common_stm32.build_flags} - -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -DTIMER_SERIAL=TIM5 + -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC extra_scripts = ${common.extra_scripts} @@ -1149,7 +1149,7 @@ upload_protocol = jlink [env:flsun_hispeedv1] platform = ${common_stm32.platform} extends = common_stm32 -build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 board = genericSTM32F103VE board_build.core = stm32 board_build.variant = MARLIN_F103Vx @@ -1321,7 +1321,7 @@ extra_scripts = ${common.extra_scripts} build_flags = ${common_stm32.build_flags} -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DARDUINO_LERDGE - -DTRANSFER_CLOCK_DIV=8 -DHAL_SRAM_MODULE_ENABLED + -DHAL_SRAM_MODULE_ENABLED build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 # @@ -1369,7 +1369,7 @@ monitor_speed = 500000 [env:mks_robin_nano35_stm32] platform = ${common_stm32.platform} extends = common_stm32 -build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 board = genericSTM32F103VE board_build.core = stm32 board_build.variant = MARLIN_F103Vx From 185e31d322bb699e171d4c6a6fc5d6f34b40cfd3 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 28 Dec 2020 02:11:36 -0300 Subject: [PATCH 431/443] Fix Menu Mixer for Color UI (#20566) --- Marlin/src/lcd/menu/menu_mixer.cpp | 9 +++++++++ Marlin/src/lcd/tft/tft.h | 1 + Marlin/src/lcd/tft/ui_320x240.cpp | 21 +++++++++++++++++++++ Marlin/src/lcd/tft/ui_480x320.cpp | 21 +++++++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index 8010239336ab..d07b89c7c045 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -33,6 +33,10 @@ #include "../../feature/mixing.h" +#if HAS_GRAPHICAL_TFT + #include "../tft/tft.h" +#endif + #define CHANNEL_MIX_EDITING !HAS_DUAL_MIXING #if ENABLED(GRADIENT_MIX) @@ -67,6 +71,9 @@ mixer.refresh_gradient(); ui.goto_previous_screen(); } + else { + TERN_(HAS_GRAPHICAL_TFT, tft.draw_edit_screen_buttons()); + } } void lcd_mixer_edit_gradient_menu() { @@ -155,6 +162,8 @@ void lcd_mixer_mix_edit() { ui.goto_previous_screen(); } + TERN_(HAS_GRAPHICAL_TFT, tft.draw_edit_screen_buttons()); + #else START_MENU(); diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 431973b89480..d3ef62ec5b2e 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -93,6 +93,7 @@ class TFT { 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 draw_edit_screen_buttons(); }; extern TFT tft; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 2cc586a48a77..4c09d9803e4d 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -442,6 +442,10 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu #endif } + tft.draw_edit_screen_buttons(); +} + +void TFT::draw_edit_screen_buttons() { #if ENABLED(TOUCH_SCREEN) add_control(32, 176, DECREASE, imgDecrease); add_control(224, 176, INCREASE, imgIncrease); @@ -658,6 +662,23 @@ void menu_item(const uint8_t row, bool sel ) { #endif } +void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { + #define TFT_COL_WIDTH ((TFT_WIDTH) / (LCD_WIDTH)) + tft.canvas(col * TFT_COL_WIDTH, 4 + 45 * row, TFT_WIDTH - (col * TFT_COL_WIDTH), 43); + tft.set_background(COLOR_BACKGROUND); +} + +int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { + tft_string.set(utf8_str_P); + tft_string.trim(); + tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); + return tft_string.width(); +} + +int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { + return lcd_put_u8str_max_P(utf8_str, max_length); +} + void MarlinUI::move_axis_screen() { } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 8d05ab7df494..ddd08e4d0d79 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -445,6 +445,10 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu #endif } + tft.draw_edit_screen_buttons(); +} + +void TFT::draw_edit_screen_buttons() { #if ENABLED(TOUCH_SCREEN) add_control(64, 256, DECREASE, imgDecrease); add_control(352, 256, INCREASE, imgIncrease); @@ -661,6 +665,23 @@ void menu_item(const uint8_t row, bool sel ) { #endif } +void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { + #define TFT_COL_WIDTH ((TFT_WIDTH) / (LCD_WIDTH)) + tft.canvas(col * TFT_COL_WIDTH, 4 + 45 * row, TFT_WIDTH - (col * TFT_COL_WIDTH), 43); + tft.set_background(COLOR_BACKGROUND); +} + +int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { + tft_string.set(utf8_str_P); + tft_string.trim(); + tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); + return tft_string.width(); +} + +int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { + return lcd_put_u8str_max_P(utf8_str, max_length); +} + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) #include "../../feature/babystep.h" #endif From 28a3d95cda797bd585f8f2dce5966bbc021bfdd3 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 28 Dec 2020 02:14:08 -0300 Subject: [PATCH 432/443] Use ADC_RESOLUTION 12 for all STM32 (#20562) --- .../share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h | 4 ++-- platformio.ini | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h index 07e2cad3f977..4bd5b63dfe56 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h @@ -114,10 +114,10 @@ extern "C" { #define NUM_ANALOG_INPUTS 7 #define NUM_ANALOG_FIRST 80 -#define ADC_RESOLUTION 12 +//#define ADC_RESOLUTION 12 // PWM resolution -// #define PWM_RESOLUTION 12 +//#define PWM_RESOLUTION 12 #define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans #define PWM_MAX_DUTY_CYCLE 255 diff --git a/platformio.ini b/platformio.ini index 924da69a74ac..2aff7aad233c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -725,6 +725,7 @@ build_flags = ${common.build_flags} -std=gnu++14 -DUSBCON -DUSBD_USE_CDC -DTIM_IRQ_PRIO=13 + -DADC_RESOLUTION=12 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + + From 9eaa69874a6dedb2a2becd90bf0b3a34734dc72b Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 28 Dec 2020 02:15:01 -0300 Subject: [PATCH 433/443] Fix LVGL_UI G-code preview (#20564) --- Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp | 9 +++++---- .../src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 9014e88d75c4..96e322bbec01 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -298,8 +298,8 @@ void disp_gcode_icon(uint8_t file_num) { strcat(test_public_buf_l, list_file.file_name[i]); char *temp = strstr(test_public_buf_l, ".GCO"); if (temp) strcpy(temp, ".bin"); - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); - lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), test_public_buf_l, 0); + lv_imgbtn_set_src_both(buttonGcode[i], buttonGcode[i]->mks_pic_name); if (i < 3) { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); buttonText[i] = lv_btn_create(scr, nullptr); @@ -358,7 +358,7 @@ void disp_gcode_icon(uint8_t file_num) { uint32_t lv_open_gcode_file(char *path) { #if ENABLED(SDSUPPORT) uint32_t *ps4; - uint32_t pre_sread_cnt = 0; + uint32_t pre_sread_cnt = UINT32_MAX; char *cur_name; cur_name = strrchr(path, '/'); @@ -399,6 +399,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { char temp_test[200]; volatile uint16_t *p_index; + watchdog_refresh(); memset(public_buf, 0, 200); while (card.isFileOpen()) { @@ -418,7 +419,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { uint16_t c = card.get(); // check if we have more data or finished the line (CR) if (c == '\r') break; - card.setIndex(card.getIndex()); + card.setIndex(card.getIndex() - 1); k++; j = 0; ignore_start = false; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index f943c1d6f971..8ce317c57191 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -380,7 +380,7 @@ lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_ if (temp) strcpy(temp, ".GCO"); sd_read_base_addr = lv_open_gcode_file((char *)name_buf); sd_read_addr_offset = sd_read_base_addr; - if (sd_read_addr_offset == 0) return LV_FS_RES_NOT_EX; + if (sd_read_addr_offset == UINT32_MAX) return LV_FS_RES_NOT_EX; return LV_FS_RES_OK; } From a3fac744c7dc3b25be7f081817ffbaf2efb655a5 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Mon, 28 Dec 2020 02:39:52 -0300 Subject: [PATCH 434/443] Fix Change Filament menu actions (#20565) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_filament.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index af8a4fc2b504..2a13452dc1b6 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -90,8 +90,10 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_BACK); #if PREHEAT_COUNT + const int8_t old_index = MenuItemBase::itemIndex; LOOP_L_N(m, PREHEAT_COUNT) - ACTION_ITEM_N_S(extruder, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + MenuItemBase::itemIndex = old_index; #endif EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, From a8c361c93bdda3110d147c5f47f96f57298c0a13 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Dec 2020 23:49:15 -0600 Subject: [PATCH 435/443] Menu item index followup --- Marlin/src/lcd/menu/menu_filament.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 2a13452dc1b6..7bd12bde17b3 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -86,20 +86,20 @@ inline PGM_P change_filament_header(const PauseMode mode) { void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { _change_filament_mode = mode; _change_filament_extruder = extruder; + const int8_t old_index = MenuItemBase::itemIndex; START_MENU(); if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_BACK); #if PREHEAT_COUNT - const int8_t old_index = MenuItemBase::itemIndex; LOOP_L_N(m, PREHEAT_COUNT) ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); - MenuItemBase::itemIndex = old_index; #endif EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target, EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT, _change_filament_with_custom ); END_MENU(); + MenuItemBase::itemIndex = old_index; } /** From aa4119a849f86432ec3ed0d60384c4e195dacc6a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 29 Dec 2020 00:22:23 +0000 Subject: [PATCH 436/443] [cron] Bump distribution date (2020-12-29) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8905b3a82e28..f550fda7a29b 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-28" + #define STRING_DISTRIBUTION_DATE "2020-12-29" #endif /** From aff4fccfc33dc6b2211bb3999fc8971549b4cad4 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 28 Dec 2020 19:56:37 -0800 Subject: [PATCH 437/443] Apply SHOW_BOOTSCREEN to TFT_COLOR_UI (#20586) --- Marlin/src/inc/Conditionals_LCD.h | 4 ---- Marlin/src/lcd/tft/tft_image.cpp | 14 ++++++++------ Marlin/src/lcd/tft/tft_image.h | 16 +++++++++------- Marlin/src/lcd/tft/ui_320x240.h | 2 +- Marlin/src/lcd/tft/ui_480x320.h | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index ed01f54a0bbd..8188d55316ca 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1197,7 +1197,3 @@ #define TOUCH_ORIENTATION TOUCH_LANDSCAPE #endif #endif - -#if MB(ANET_ET4, ANET_ET4P) - #define IS_ANET_ET 1 -#endif diff --git a/Marlin/src/lcd/tft/tft_image.cpp b/Marlin/src/lcd/tft/tft_image.cpp index 8f8b6106996a..9cc6fb15e4a0 100644 --- a/Marlin/src/lcd/tft/tft_image.cpp +++ b/Marlin/src/lcd/tft/tft_image.cpp @@ -25,12 +25,14 @@ const tImage NoLogo = { nullptr, 0, 0, NOCOLORS }; -const tImage MarlinLogo112x38x1 = { (void *)marlin_logo_112x38x1, 112, 38, GREYSCALE1 }; -const tImage MarlinLogo228x255x2 = { (void *)marlin_logo_228x255x2, 228, 255, GREYSCALE2 }; -const tImage MarlinLogo228x255x4 = { (void *)marlin_logo_228x255x4, 228, 255, GREYSCALE4 }; -const tImage MarlinLogo195x59x16 = { (void *)marlin_logo_195x59x16, 195, 59, HIGHCOLOR }; -const tImage MarlinLogo320x240x16 = { (void *)marlin_logo_320x240x16, 320, 240, HIGHCOLOR }; -const tImage MarlinLogo480x320x16 = { (void *)marlin_logo_480x320x16, 480, 320, HIGHCOLOR }; +#if ENABLED(SHOW_BOOTSCREEN) + const tImage MarlinLogo112x38x1 = { (void *)marlin_logo_112x38x1, 112, 38, GREYSCALE1 }; + const tImage MarlinLogo228x255x2 = { (void *)marlin_logo_228x255x2, 228, 255, GREYSCALE2 }; + const tImage MarlinLogo228x255x4 = { (void *)marlin_logo_228x255x4, 228, 255, GREYSCALE4 }; + const tImage MarlinLogo195x59x16 = { (void *)marlin_logo_195x59x16, 195, 59, HIGHCOLOR }; + const tImage MarlinLogo320x240x16 = { (void *)marlin_logo_320x240x16, 320, 240, HIGHCOLOR }; + const tImage MarlinLogo480x320x16 = { (void *)marlin_logo_480x320x16, 480, 320, HIGHCOLOR }; +#endif const tImage Background320x30x16 = { (void *)background_320x30x16, 320, 30, HIGHCOLOR }; const tImage HotEnd_64x64x4 = { (void *)hotend_64x64x4, 64, 64, GREYSCALE4 }; diff --git a/Marlin/src/lcd/tft/tft_image.h b/Marlin/src/lcd/tft/tft_image.h index 1f13967ba248..21bd2d665fc6 100644 --- a/Marlin/src/lcd/tft/tft_image.h +++ b/Marlin/src/lcd/tft/tft_image.h @@ -22,7 +22,7 @@ #pragma once #include "stdint.h" - +#include "../../inc/MarlinConfigPre.h" extern const uint8_t marlin_logo_112x38x1[]; extern const uint8_t marlin_logo_228x255x2[]; @@ -120,12 +120,14 @@ typedef struct __attribute__((__packed__)) { extern const tImage NoLogo; -extern const tImage MarlinLogo112x38x1; -extern const tImage MarlinLogo228x255x2; -extern const tImage MarlinLogo228x255x4; -extern const tImage MarlinLogo195x59x16; -extern const tImage MarlinLogo320x240x16; -extern const tImage MarlinLogo480x320x16; +#if ENABLED(SHOW_BOOTSCREEN) + extern const tImage MarlinLogo112x38x1; + extern const tImage MarlinLogo228x255x2; + extern const tImage MarlinLogo228x255x4; + extern const tImage MarlinLogo195x59x16; + extern const tImage MarlinLogo320x240x16; + extern const tImage MarlinLogo480x320x16; +#endif extern const tImage Background320x30x16; extern const tImage HotEnd_64x64x4; diff --git a/Marlin/src/lcd/tft/ui_320x240.h b/Marlin/src/lcd/tft/ui_320x240.h index 0f928eea3772..249a21c4f106 100644 --- a/Marlin/src/lcd/tft/ui_320x240.h +++ b/Marlin/src/lcd/tft/ui_320x240.h @@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false); #define ABSOLUTE_ZERO -273.15 const tImage Images[imgCount] = { - TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo320x240x16), + TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo320x240x16), NoLogo), HotEnd_64x64x4, Bed_64x64x4, Bed_Heated_64x64x4, diff --git a/Marlin/src/lcd/tft/ui_480x320.h b/Marlin/src/lcd/tft/ui_480x320.h index cc62ee8cce73..078f35ac6834 100644 --- a/Marlin/src/lcd/tft/ui_480x320.h +++ b/Marlin/src/lcd/tft/ui_480x320.h @@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false); #define ABSOLUTE_ZERO -273.15 const tImage Images[imgCount] = { - TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16), + TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16), NoLogo), HotEnd_64x64x4, Bed_64x64x4, Bed_Heated_64x64x4, From 90a2b482e6e59079d7cad1bc04b87a82fe99816c Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 29 Dec 2020 01:07:11 -0300 Subject: [PATCH 438/443] LVGL G-code preview. Legacy MKS WiFi Cura plugin compatibility (#20589) --- Marlin/src/core/macros.h | 1 + Marlin/src/feature/e_parser.h | 1 - Marlin/src/gcode/queue.cpp | 2 -- Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp | 12 ++++++++++-- .../lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 12 +++++++++--- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 058008646f04..56e80b87dc9d 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -216,6 +216,7 @@ #define ANY_BUTTON(V...) DO(BTNEX,||,V) #define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H)) +#define ISEOL(C) ((C) == '\n' || (C) == '\r') #define NUMERIC(a) WITHIN(a, '0', '9') #define DECIMAL(a) (NUMERIC(a) || a == '.') #define HEXCHR(a) (NUMERIC(a) ? (a) - '0' : WITHIN(a, 'a', 'f') ? ((a) - 'a' + 10) : WITHIN(a, 'A', 'F') ? ((a) - 'A' + 10) : -1) diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 0bb0253149eb..a4c07de465dd 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -76,7 +76,6 @@ class EmergencyParser { FORCE_INLINE static void disable() { enabled = false; } FORCE_INLINE static void update(State &state, const uint8_t c) { - #define ISEOL(C) ((C) == '\n' || (C) == '\r') switch (state) { case EP_RESET: switch (c) { diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index d23e9ee07fc3..98fe91db4074 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -158,8 +158,6 @@ bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ return true; } -#define ISEOL(C) ((C) == '\n' || (C) == '\r') - /** * Enqueue with Serial Echo * Return true if the command was consumed diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 96e322bbec01..38b62db3b4d0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -417,12 +417,20 @@ void lv_gcode_file_read(uint8_t *data_buf) { } uint16_t c = card.get(); - // check if we have more data or finished the line (CR) - if (c == '\r') break; + // check for more data or end of line (CR or LF) + if (ISEOL(c)) { + c = card.get(); // more eol? + if (!ISEOL(c)) card.setIndex(card.getIndex() - 1); + break; + } card.setIndex(card.getIndex() - 1); k++; j = 0; ignore_start = false; + if (k > 1) { + card.closefile(); + break; + } } #if HAS_TFT_LVGL_UI_SPI for (i = 0; i < 200;) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 8ce317c57191..f13a4b36cfb5 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -369,8 +369,9 @@ lv_fs_res_t spi_flash_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p } //sd +extern uint8_t public_buf[512]; char *cur_namefff; -uint32_t sd_read_base_addr = 0,sd_read_addr_offset = 0; +uint32_t sd_read_base_addr = 0, sd_read_addr_offset = 0, small_image_size = 409; lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) { //cur_namefff = strrchr(path, '/'); char name_buf[100]; @@ -381,6 +382,11 @@ lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_ sd_read_base_addr = lv_open_gcode_file((char *)name_buf); sd_read_addr_offset = sd_read_base_addr; if (sd_read_addr_offset == UINT32_MAX) return LV_FS_RES_NOT_EX; + // find small image size + card.read(public_buf, 512); + public_buf[511] = '\0'; + char* eol = strpbrk((const char*)public_buf, "\n\r"); + small_image_size = (uintptr_t)eol - (uintptr_t)((uint32_t *)(&public_buf[0])) + 1; return LV_FS_RES_OK; } @@ -406,14 +412,14 @@ lv_fs_res_t sd_read_cb (lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t b } lv_fs_res_t sd_seek_cb(lv_fs_drv_t * drv, void * file_p, uint32_t pos) { - sd_read_addr_offset = sd_read_base_addr + (pos - 4) / 200 * 409; + sd_read_addr_offset = sd_read_base_addr + (pos - 4) / 200 * small_image_size; lv_gcode_file_seek(sd_read_addr_offset); return LV_FS_RES_OK; } lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) { if (sd_read_addr_offset) *pos_p = 0; - else *pos_p = (sd_read_addr_offset - sd_read_base_addr) / 409 * 200 + 4; + else *pos_p = (sd_read_addr_offset - sd_read_base_addr) / small_image_size * 200 + 4; return LV_FS_RES_OK; } From 624bf10ab50cc445b7f1a9480d6762e136067650 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 29 Dec 2020 05:13:56 +0100 Subject: [PATCH 439/443] Clarify sanity-check for custom status bitmap (#20588) --- Marlin/src/inc/SanityCheck.h | 2 +- buildroot/tests/STM32F103VE_longer-tests | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 949828d5f800..6121c5ed1343 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -721,7 +721,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB - #error "CUSTOM_STATUS_SCREEN_IMAGE requires a Graphical LCD." + #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD." #endif /** diff --git a/buildroot/tests/STM32F103VE_longer-tests b/buildroot/tests/STM32F103VE_longer-tests index 461f128873b8..c9ef58001523 100755 --- a/buildroot/tests/STM32F103VE_longer-tests +++ b/buildroot/tests/STM32F103VE_longer-tests @@ -8,7 +8,17 @@ set -e use_example_configs Alfawise/U20 opt_enable BAUD_RATE_GCODE -exec_test $1 $2 "Full-featured U20 config" "$3" +exec_test $1 $2 "CLASSIC_UI U20 config" "$3" + +use_example_configs Alfawise/U20 +opt_enable BAUD_RATE_GCODE +opt_enable TFT_COLOR_UI +opt_disable TFT_CLASSIC_UI +exec_test $1 $2 "COLOR_UI U20 config" "$3" + +use_example_configs Alfawise/U20-bltouch +opt_enable BAUD_RATE_GCODE +exec_test $1 $2 "BLTouch U20 config" # cleanup restore_configs From d6a56b882fb0b02724086b8af2aa123ec8725c1d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 28 Dec 2020 23:10:48 -0600 Subject: [PATCH 440/443] Pins, comment cleanup --- Marlin/src/inc/Conditionals_LCD.h | 1 + Marlin/src/inc/Conditionals_adv.h | 4 +++ Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 10 ++++--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 7 +++-- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 10 ++++--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 2 +- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 27 ++++++++++------- .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 29 ++++++++++--------- Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 5 +--- .../variants/BIGTREE_GTR_V1/hal_conf_extra.h | 2 +- .../BIGTREE_SKR_PRO_1v1/hal_conf_extra.h | 2 +- buildroot/tests/STM32F103VE_longer-tests | 5 ++-- 13 files changed, 62 insertions(+), 44 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 8188d55316ca..f1192cea12d9 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -833,6 +833,7 @@ #else // Clear probe pin settings when no probe is selected #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + #undef USE_PROBE_FOR_Z_HOMING #endif #if Z_HOME_DIR > 0 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index f99e363d7b64..93f912e5c5ee 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -382,6 +382,10 @@ #define POLL_JOG #endif +#ifndef HOMING_BUMP_MM + #define HOMING_BUMP_MM { 0, 0, 0 } +#endif + /** * Driver Timings (in nanoseconds) * NOTE: Driver timing order is longest-to-shortest duration. diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 68cfe65601d1..6d9d225efffc 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -189,7 +189,7 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 +#endif // HAS_TMC_UART // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 93890e9aa777..3118a521bbeb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -40,7 +40,6 @@ // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // - #define DISABLE_DEBUG // @@ -59,6 +58,11 @@ // #define SPI_DEVICE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -155,7 +159,7 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 +#endif // HAS_TMC_UART // // Temperature Sensors @@ -200,8 +204,6 @@ #define FIL_RUNOUT_PIN PA4 #endif -#define SERVO0_PIN PA8 // Enable BLTOUCH - //#define LED_PIN PB2 // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index c430671b2eff..ea3a7a1eea8e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -56,6 +56,11 @@ #define SPI_DEVICE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -148,8 +153,6 @@ #define FIL_RUNOUT2_PIN PE6 #endif -#define SERVO0_PIN PA8 // Enable BLTOUCH support - //#define LED_PIN PB2 // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 063e548a329b..6ef3a0804384 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -43,7 +43,6 @@ // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // - #define DISABLE_DEBUG // @@ -62,6 +61,11 @@ // #define SPI_DEVICE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -163,7 +167,7 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 +#endif // HAS_TMC_UART // // Temperature Sensors @@ -218,8 +222,6 @@ #define FIL_RUNOUT2_PIN PE6 #endif -#define SERVO0_PIN PA8 // Enable BLTOUCH - //#define LED_PIN PB2 // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 65aa5cc39e59..89bb41b1979b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -48,7 +48,7 @@ // // Servos // -#define SERVO0_PIN PA8 // BLTOUCH +#define SERVO0_PIN PA8 // Enable BLTOUCH // // Limit Switches diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index e2b3f2c317c6..f0fc99e0c0d1 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -31,8 +31,11 @@ #define BOARD_INFO_NAME "MKS Robin Nano V3" +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + // Avoid conflict with TIMER_TONE -#define STEP_TIMER 10 +#define STEP_TIMER 10 // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation @@ -42,6 +45,12 @@ // // Release PB4 (Z_DIR_PIN) from JTAG NRST role // +//#define DISABLE_DEBUG + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH // // Limit Switches @@ -98,8 +107,8 @@ // // Software SPI pins for TMC2130 stepper drivers +// This board only supports SW SPI for stepper drivers // -// This board only support SW SPI for stepper drivers #if HAS_TMC_SPI #define TMC_USE_SW_SPI #endif @@ -179,6 +188,7 @@ #define POWER_LOSS_PIN PW_DET #define PS_ON_PIN PW_OFF + // // Enable MKSPWC support // @@ -186,14 +196,13 @@ //#define KILL_PIN PA2 //#define KILL_PIN_INVERTING true -#define SERVO0_PIN PA8 // Enable BLTOUCH support //#define LED_PIN PB2 // Random Info -#define USB_SERIAL -1 //Usb Serial -#define WIFI_SERIAL 3 //USART3 -#define MKS_WIFI_MODULE_SERIAL 1 //USART1 -#define MKS_WIFI_MODULE_SPI 2 //SPI2 +#define USB_SERIAL -1 // USB Serial +#define WIFI_SERIAL 3 // USART3 +#define MKS_WIFI_MODULE_SERIAL 1 // USART1 +#define MKS_WIFI_MODULE_SPI 2 // SPI2 #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD @@ -331,7 +340,7 @@ //#define MKS_LCD12864B //#undef SHOW_BOOTSCREEN - #else // !MKS_MINI_12864 + #else // !MKS_MINI_12864 #define LCD_PINS_D4 PE14 #if ENABLED(ULTIPANEL) @@ -346,5 +355,3 @@ #endif // !MKS_MINI_12864 #endif // HAS_SPI_LCD - -#define HAS_OTG_USB_HOST_SUPPORT diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 05648cf1207e..333634046901 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -30,7 +30,7 @@ #define BOARD_INFO_NAME "MKS Robin PRO V2" // Avoid conflict with TIMER_TONE -#define STEP_TIMER 10 +#define STEP_TIMER 10 // Use one of these or SDCard-based Emulation will be used //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation @@ -40,12 +40,18 @@ // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // +//#define DISABLE_DEBUG // // Note: MKS Robin board is using SPI2 interface. // //#define SPI_MODULE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -55,8 +61,6 @@ #define E0_DIAG_PIN PC4 #define E1_DIAG_PIN PE7 -// - #define X_STOP_PIN PA15 #define Y_STOP_PIN PA12 #define Z_MIN_PIN PA11 @@ -159,7 +163,7 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 +#endif // HAS_TMC_UART // // Temperature Sensors @@ -186,19 +190,18 @@ // // Misc. Functions // -// #define POWER_LOSS_PIN PA2 // PW_DET -// #define PS_ON_PIN PA3 // PW_OFF -// #define SUICIDE_PIN PB2 // Enable MKSPWC support -// #define KILL_PIN PA2 // Enable MKSPWC support -// #define KILL_PIN_INVERTING true // Enable MKSPWC support -#define SERVO0_PIN PA8 // Enable BLTOUCH support +//#define POWER_LOSS_PIN PA2 // PW_DET +//#define PS_ON_PIN PA3 // PW_OFF +//#define SUICIDE_PIN PB2 // Enable MKSPWC support +//#define KILL_PIN PA2 // Enable MKSPWC support +//#define KILL_PIN_INVERTING true // Enable MKSPWC support //#define LED_PIN PB2 #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif -// #define USE_NEW_SPI_API 1 +//#define USE_NEW_SPI_API 1 // // Onboard SD card @@ -243,7 +246,7 @@ // // LCD / Controller #define SPI_FLASH -#define HAS_SPI_FLASH 1 +#define HAS_SPI_FLASH 1 #define SPI_DEVICE 2 #define SPI_FLASH_SIZE 0x1000000 #if ENABLED(SPI_FLASH) @@ -316,7 +319,7 @@ #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI - // #define TFT_DRIVER ST7796 + //#define TFT_DRIVER ST7796 #define TFT_BUFFER_SIZE 14400 #elif HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 90dcfc46e424..466cce565df1 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -36,7 +36,7 @@ // Decrease delays and flash wear by spreading writes across the // 128 kB sector allocated for EEPROM emulation. // Not yet supported on F7 hardware - // #define FLASH_EEPROM_LEVELING + //#define FLASH_EEPROM_LEVELING #endif /** @@ -188,9 +188,6 @@ #define LCD_PINS_RS PF12 // LCD_RS #define LCD_PINS_ENABLE PD15 // LCD_EN #define LCD_PINS_D4 PB13 // LCD_D4 - // #define LCD_PINS_D5 - // #define LCD_PINS_D6 - // #define LCD_PINS_D7 #define BTN_EN1 PF13 // BTN_EN1 #define BTN_EN2 PE9 // BTN_EN2 diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h index e0e8239aac08..f7f9e23e99e7 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h @@ -44,7 +44,7 @@ #undef HAL_IRDA_MODULE_ENABLED #undef HAL_SMARTCARD_MODULE_ENABLED #undef HAL_WWDG_MODULE_ENABLED -#undef HAL_HCD_MODULE_ENABLED +//#undef HAL_HCD_MODULE_ENABLED #undef HAL_FMPI2C_MODULE_ENABLED #undef HAL_SPDIFRX_MODULE_ENABLED #undef HAL_DFSDM_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h index e0e8239aac08..f7f9e23e99e7 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h @@ -44,7 +44,7 @@ #undef HAL_IRDA_MODULE_ENABLED #undef HAL_SMARTCARD_MODULE_ENABLED #undef HAL_WWDG_MODULE_ENABLED -#undef HAL_HCD_MODULE_ENABLED +//#undef HAL_HCD_MODULE_ENABLED #undef HAL_FMPI2C_MODULE_ENABLED #undef HAL_SPDIFRX_MODULE_ENABLED #undef HAL_DFSDM_MODULE_ENABLED diff --git a/buildroot/tests/STM32F103VE_longer-tests b/buildroot/tests/STM32F103VE_longer-tests index c9ef58001523..1c90744c0110 100755 --- a/buildroot/tests/STM32F103VE_longer-tests +++ b/buildroot/tests/STM32F103VE_longer-tests @@ -11,9 +11,8 @@ opt_enable BAUD_RATE_GCODE exec_test $1 $2 "CLASSIC_UI U20 config" "$3" use_example_configs Alfawise/U20 -opt_enable BAUD_RATE_GCODE -opt_enable TFT_COLOR_UI -opt_disable TFT_CLASSIC_UI +opt_enable BAUD_RATE_GCODE TFT_COLOR_UI +opt_disable TFT_CLASSIC_UI CUSTOM_STATUS_SCREEN_IMAGE exec_test $1 $2 "COLOR_UI U20 config" "$3" use_example_configs Alfawise/U20-bltouch From 84ab088b4093c997d3a3e005ca90bfd756839299 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 29 Dec 2020 02:16:38 -0300 Subject: [PATCH 441/443] USB FD via native USB Host + MSC (#20571) --- Marlin/Configuration_adv.h | 14 ++- Marlin/src/HAL/STM32/usb_host.cpp | 117 ++++++++++++++++++ Marlin/src/HAL/STM32/usb_host.h | 60 +++++++++ Marlin/src/inc/Conditionals_adv.h | 4 + Marlin/src/inc/SanityCheck.h | 6 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 12 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 3 + .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 3 + .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 1 + .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 4 + .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 18 ++- .../sd/usb_flashdrive/Sd2Card_FlashDrive.h | 41 +++--- platformio.ini | 50 +++++++- 13 files changed, 300 insertions(+), 33 deletions(-) create mode 100644 Marlin/src/HAL/STM32/usb_host.cpp create mode 100644 Marlin/src/HAL/STM32/usb_host.h diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6b1febc8f539..990eb051449e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1326,9 +1326,6 @@ */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN - /** * USB Host Shield Library * @@ -1339,7 +1336,18 @@ * is less tested and is known to interfere with Servos. * [1] This requires USB_INTR_PIN to be interrupt-capable. */ + //#define USE_UHS2_USB //#define USE_UHS3_USB + + /** + * Native USB Host supported by some boards (USB OTG) + */ + //#define USE_OTG_USB_HOST + + #if DISABLED(USE_OTG_USB_HOST) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + #endif #endif /** diff --git a/Marlin/src/HAL/STM32/usb_host.cpp b/Marlin/src/HAL/STM32/usb_host.cpp new file mode 100644 index 000000000000..ed743361e681 --- /dev/null +++ b/Marlin/src/HAL/STM32/usb_host.cpp @@ -0,0 +1,117 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "../../inc/MarlinConfig.h" + +#if BOTH(USE_OTG_USB_HOST, USBHOST) + +#include "usb_host.h" +#include "../shared/Marduino.h" +#include "usbh_core.h" +#include "usbh_msc.h" + +USBH_HandleTypeDef hUsbHost; +USBHost usb; +BulkStorage bulk(&usb); + +static void USBH_UserProcess(USBH_HandleTypeDef *phost, uint8_t id) { + switch(id) { + case HOST_USER_SELECT_CONFIGURATION: + //SERIAL_ECHOLNPGM("APPLICATION_SELECT_CONFIGURATION"); + break; + case HOST_USER_DISCONNECTION: + //SERIAL_ECHOLNPGM("APPLICATION_DISCONNECT"); + //usb.setUsbTaskState(USB_STATE_RUNNING); + break; + case HOST_USER_CLASS_ACTIVE: + //SERIAL_ECHOLNPGM("APPLICATION_READY"); + usb.setUsbTaskState(USB_STATE_RUNNING); + break; + case HOST_USER_CONNECTION: + break; + default: + break; + } +} + +bool USBHost::start() { + if (USBH_Init(&hUsbHost, USBH_UserProcess, TERN(USE_USB_HS_IN_FS, HOST_HS, HOST_FS)) != USBH_OK) { + SERIAL_ECHOLNPGM("Error: USBH_Init"); + return false; + } + if (USBH_RegisterClass(&hUsbHost, USBH_MSC_CLASS) != USBH_OK) { + SERIAL_ECHOLNPGM("Error: USBH_RegisterClass"); + return false; + } + if (USBH_Start(&hUsbHost) != USBH_OK) { + SERIAL_ECHOLNPGM("Error: USBH_Start"); + return false; + } + return true; +} + +void USBHost::Task() { + USBH_Process(&hUsbHost); +} + +uint8_t USBHost::getUsbTaskState() { + return usb_task_state; +} + +void USBHost::setUsbTaskState(uint8_t state) { + usb_task_state = state; + if (usb_task_state == USB_STATE_RUNNING) { + MSC_LUNTypeDef info; + USBH_MSC_GetLUNInfo(&hUsbHost, usb.lun, &info); + capacity = info.capacity.block_nbr / 2000; + block_size = info.capacity.block_size; + block_count = info.capacity.block_nbr; + // SERIAL_ECHOLNPAIR("info.capacity.block_nbr : %ld\n", info.capacity.block_nbr); + // SERIAL_ECHOLNPAIR("info.capacity.block_size: %d\n", info.capacity.block_size); + // SERIAL_ECHOLNPAIR("capacity : %d MB\n", capacity); + } +}; + +bool BulkStorage::LUNIsGood(uint8_t t) { + return USBH_MSC_IsReady(&hUsbHost) && USBH_MSC_UnitIsReady(&hUsbHost, t); +} + +uint32_t BulkStorage::GetCapacity(uint8_t lun) { + return usb->block_count; +} + +uint16_t BulkStorage::GetSectorSize(uint8_t lun) { + return usb->block_size; +} + +uint8_t BulkStorage::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) { + return USBH_MSC_Read(&hUsbHost, lun, addr, buf, blocks) != USBH_OK; +} + +uint8_t BulkStorage::Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t * buf) { + return USBH_MSC_Write(&hUsbHost, lun, addr, const_cast (buf), blocks) != USBH_OK; +} + +#endif // USE_OTG_USB_HOST && USBHOST +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/usb_host.h b/Marlin/src/HAL/STM32/usb_host.h new file mode 100644 index 000000000000..c0001c0d755b --- /dev/null +++ b/Marlin/src/HAL/STM32/usb_host.h @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +typedef enum { + USB_STATE_INIT, + USB_STATE_ERROR, + USB_STATE_RUNNING, +} usb_state_t; + +class USBHost { +public: + bool start(); + void Task(); + uint8_t getUsbTaskState(); + void setUsbTaskState(uint8_t state); + uint8_t regRd(uint8_t reg) { return 0x0; }; + uint8_t usb_task_state = USB_STATE_INIT; + uint8_t lun = 0; + uint32_t capacity = 0; + uint16_t block_size = 0; + uint32_t block_count = 0; +}; + +class BulkStorage { +public: + BulkStorage(USBHost *usb) : usb(usb) {}; + + bool LUNIsGood(uint8_t t); + uint32_t GetCapacity(uint8_t lun); + uint16_t GetSectorSize(uint8_t lun); + uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf); + uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t * buf); + + USBHost *usb; +}; + +extern USBHost usb; +extern BulkStorage bulk; diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 93f912e5c5ee..dda0298740bf 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -386,6 +386,10 @@ #define HOMING_BUMP_MM { 0, 0, 0 } #endif +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && NONE(USE_OTG_USB_HOST, USE_UHS3_USB) + #define USE_UHS2_USB +#endif + /** * Driver Timings (in nanoseconds) * NOTE: Driver timing order is longest-to-shortest duration. diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6121c5ed1343..62c954c899a9 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2912,10 +2912,14 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "PRINTCOUNTER requires EEPROM_SETTINGS." #endif -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST) #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT." #endif +#if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT) + #error "The current board does not support USE_OTG_USB_HOST." +#endif + #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__) #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board." #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index e6a1e929993b..b3cfe5b6baa7 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -52,6 +52,13 @@ #define SPI_DEVICE 2 +// +// Servos +// +#ifndef SERVO0_PIN + #define SERVO0_PIN PA8 // Enable BLTOUCH support on IO0 (WIFI connector) +#endif + // // Limit Switches // @@ -91,6 +98,7 @@ #ifndef DEFAULT_PWM_MOTOR_CURRENT #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 } #endif + // // Temperature Sensors // @@ -111,10 +119,6 @@ #define POWER_LOSS_PIN PA2 // PW_DET #define PS_ON_PIN PA3 // PW_OFF -#ifndef SERVO0_PIN - #define SERVO0_PIN PA8 // Enable BLTOUCH support on IO0 (WIFI connector) -#endif - #define MT_DET_1_PIN PA4 #define MT_DET_PIN_INVERTING false 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 bfa4007658db..d594e3ca4967 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -35,6 +35,9 @@ #define I2C_EEPROM #define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24C64 ... 64Kb = 8KB) +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + #define TP // Enable to define servo and probe pins // 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 235ed1edcc4c..be05ebcfa9cd 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -44,6 +44,9 @@ #define FLASH_EEPROM_LEVELING #endif +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + // // Servos // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index f0fc99e0c0d1..81edff6793cb 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -41,6 +41,7 @@ //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation #define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB // // Release PB4 (Z_DIR_PIN) from JTAG NRST role diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 333634046901..719f8773f56d 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -36,6 +36,10 @@ //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation #define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 539d31654265..28a18cd9d86b 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -44,8 +44,9 @@ #include "../../core/serial.h" #include "../../module/temperature.h" -static_assert(USB_CS_PIN != -1, "USB_CS_PIN must be defined"); -static_assert(USB_INTR_PIN != -1, "USB_INTR_PIN must be defined"); +#if DISABLED(USE_OTG_USB_HOST) && !PINS_EXIST(USB_CS, USB_INTR) + #error "USB_FLASH_DRIVE_SUPPORT requires USB_CS_PIN and USB_INTR_PIN to be defined." +#endif #if ENABLED(USE_UHS3_USB) #define NO_AUTO_SPEED @@ -81,6 +82,17 @@ static_assert(USB_INTR_PIN != -1, "USB_INTR_PIN must be defined"); #define UHS_START (usb.Init() == 0) #define UHS_STATE(state) UHS_USB_HOST_STATE_##state +#elif ENABLED(USE_OTG_USB_HOST) + + #if HAS_SD_HOST_DRIVE + #include HAL_PATH(../../HAL, msc_sd.h) + #endif + + #include HAL_PATH(../../HAL, usb_host.h) + + #define UHS_START usb.start() + #define rREVISION 0 + #define UHS_STATE(state) USB_STATE_##state #else #include "lib-uhs2/Usb.h" #include "lib-uhs2/masstorage.h" @@ -250,7 +262,7 @@ bool Sd2Card::isInserted() { return state == MEDIA_READY; } -bool Sd2Card::ready() { +bool Sd2Card::isReady() { return state > DO_STARTUP; } diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index 8ca95ba7061c..83245168abca 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -23,26 +23,27 @@ /** * \file - * \brief Sd2Card class for V2 SD/SDHC cards + * \brief Sd2Card class for USB Flash Drive */ - #include "../SdFatConfig.h" #include "../SdInfo.h" -/** - * Define SOFTWARE_SPI to use bit-bang SPI - */ -#if EITHER(MEGA_SOFT_SPI, USE_SOFTWARE_SPI) - #define SOFTWARE_SPI -#endif +#if DISABLED(USE_OTG_USB_HOST) + /** + * Define SOFTWARE_SPI to use bit-bang SPI + */ + #if EITHER(MEGA_SOFT_SPI, USE_SOFTWARE_SPI) + #define SOFTWARE_SPI + #endif -// SPI pin definitions - do not edit here - change in SdFatConfig.h -#if ENABLED(SOFTWARE_SPI) - #warning "Auto-assigning '10' as the SD_CHIP_SELECT_PIN." - #define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD -#else - // hardware pin defs - #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. + // SPI pin definitions - do not edit here - change in SdFatConfig.h + #if ENABLED(SOFTWARE_SPI) + #warning "Auto-assigning '10' as the SD_CHIP_SELECT_PIN." + #define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD + #else + // hardware pin defs + #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. + #endif #endif class Sd2Card { @@ -54,22 +55,24 @@ class Sd2Card { public: static bool usbStartup(); - bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=SD_CHIP_SELECT_PIN); + bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=TERN(USE_OTG_USB_HOST, 0, SD_CHIP_SELECT_PIN)); static void idle(); - inline bool readStart(const uint32_t block) { pos = block; return ready(); } + inline bool readStart(const uint32_t block) { pos = block; return isReady(); } inline bool readData(uint8_t* dst) { return readBlock(pos++, dst); } inline bool readStop() const { return true; } - inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return ready(); } + inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return isReady(); } inline bool writeData(uint8_t* src) { return writeBlock(pos++, src); } inline bool writeStop() const { return true; } bool readBlock(uint32_t block, uint8_t* dst); bool writeBlock(uint32_t blockNumber, const uint8_t* src); + bool readCSD(csd_t* csd) { return true; }; + uint32_t cardSize(); static bool isInserted(); - static bool ready(); + bool isReady(); }; diff --git a/platformio.ini b/platformio.ini index 2aff7aad233c..3e87968eef39 100644 --- a/platformio.ini +++ b/platformio.ini @@ -59,7 +59,7 @@ default_src_filter = + - - + - - - - - - + - - - - - @@ -272,7 +272,8 @@ HAS_DGUS_LCD = src_filter=+ + EXTUI_EXAMPLE = src_filter=+ MALYAN_LCD = src_filter=+ -USB_FLASH_DRIVE_SUPPORT = src_filter=+ +USE_UHS2_USB = src_filter=+ +USE_UHS3_USB = src_filter=+ AUTO_BED_LEVELING_BILINEAR = src_filter=+ AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+ MESH_BED_LEVELING = src_filter=+ + @@ -1278,6 +1279,23 @@ extra_scripts = ${common.extra_scripts} debug_tool = stlink debug_init_break = +# +# USB Flash Drive mix-ins for STM32 +# +[stm32_flash_drive] +platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc.zip +build_flags = ${common_stm32.build_flags} + -DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED + -DUSBHOST -DUSBH_IRQ_PRIO=3 -DUSBH_IRQ_SUBPRIO=4 + +# +# BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) with USB Flash Drive Support +# +[env:BIGTREE_SKR_PRO_usb_flash_drive] +extends = env:BIGTREE_SKR_PRO +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + # # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) # @@ -1290,6 +1308,14 @@ extra_scripts = ${common.extra_scripts} build_flags = ${common_stm32.build_flags} -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000 +# +# Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support +# +[env:BIGTREE_GTR_V1_0_usb_flash_drive] +extends = env:BIGTREE_GTR_V1_0 +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + # # BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4) # @@ -1392,13 +1418,16 @@ extra_scripts = ${common.extra_scripts} # [env:mks_robin_pro2] platform = ${common_stm32.platform} +platform_packages = ${stm32_flash_drive.platform_packages} extends = common_stm32 -build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST +build_flags = ${stm32_flash_drive.build_flags} board = genericSTM32F407VET6 board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld board_build.firmware = firmware.bin +board_build.offset = 0x0000 +board_upload.offset_address = 0x08000000 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink @@ -1427,6 +1456,21 @@ extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py +# +# MKS Robin Nano V3 with USB Flash Drive Support +# Currently, using a STM32duino fork, until USB Host get merged +# +[env:mks_robin_nano_v3_usb_flash_drive] +extends = env:mks_robin_nano_v3 +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + -DUSBCON + -DUSE_USBHOST_HS + -DUSBD_IRQ_PRIO=5 + -DUSBD_IRQ_SUBPRIO=6 + -DUSE_USB_HS_IN_FS + -DUSBD_USE_CDC + ################################# # # # Other Architectures # From 41e4124af9cba37f1e7cd598f47bf21c51d00488 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 29 Dec 2020 02:26:35 -0300 Subject: [PATCH 442/443] Support 4.3" (480x272) Color UI display (#20334) --- Marlin/Configuration.h | 1 + Marlin/src/inc/Conditionals_LCD.h | 9 +++ Marlin/src/lcd/tft/tft.h | 3 + Marlin/src/lcd/tft/ui_480x320.cpp | 67 +++++++++++---------- Marlin/src/lcd/tft/ui_480x320.h | 13 +++- Marlin/src/lcd/tft_io/ssd1963.h | 6 +- Marlin/src/lcd/tft_io/touch_calibration.cpp | 45 ++++++++++---- Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 5 -- 8 files changed, 97 insertions(+), 52 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d3b350bce411..d78657275b51 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2438,6 +2438,7 @@ //#define TOUCH_CALIBRATION_Y -8981 //#define TOUCH_OFFSET_X -43 //#define TOUCH_OFFSET_Y 257 + //#define TOUCH_ORIENTATION TOUCH_LANDSCAPE #if ENABLED(TFT_COLOR_UI) //#define SINGLE_TOUCH_NAVIGATION diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index f1192cea12d9..c94fcd0cfe38 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1169,6 +1169,12 @@ #elif ENABLED(TFT_INTERFACE_FSMC) #define TFT_480x320 #endif +#elif ENABLED(TFT_COLOR_UI) && TFT_HEIGHT == 272 + #if ENABLED(TFT_INTERFACE_SPI) + #define TFT_480x272_SPI + #elif ENABLED(TFT_INTERFACE_FSMC) + #define TFT_480x272 + #endif #endif // Fewer lines with touch buttons on-screen @@ -1178,6 +1184,9 @@ #elif EITHER(TFT_480x320, TFT_480x320_SPI) #define HAS_UI_480x320 1 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) +#elif EITHER(TFT_480x272, TFT_480x272_SPI) + #define HAS_UI_480x272 1 + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) #endif // This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index d3ef62ec5b2e..99d335d135f6 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -43,6 +43,9 @@ #elif HAS_UI_480x320 #define TFT_WIDTH 480 #define TFT_HEIGHT 320 +#elif HAS_UI_480x272 + #define TFT_WIDTH 480 + #define TFT_HEIGHT 272 #else #error "Unsupported display resolution!" #endif diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index ddd08e4d0d79..f7955fb1bd59 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_UI_480x320 +#if HAS_UI_480x320 || HAS_UI_480x272 #include "ui_480x320.h" @@ -56,9 +56,9 @@ void MarlinUI::tft_idle() { #if ENABLED(TOUCH_SCREEN) if (draw_menu_navigation) { - add_control(104, 286, PAGE_UP, imgPageUp, encoderTopLine > 0); - add_control(344, 286, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); - add_control(224, 286, BACK, imgBack); + add_control(104, TFT_HEIGHT - 34, PAGE_UP, imgPageUp, encoderTopLine > 0); + add_control(344, TFT_HEIGHT - 34, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); + add_control(224, TFT_HEIGHT - 34, BACK, imgBack); draw_menu_navigation = false; } #endif @@ -259,10 +259,12 @@ void MarlinUI::draw_status_screen() { } } + y += TERN(HAS_UI_480x272, 118, 128); + // coordinates - tft.canvas(4, 132, TFT_WIDTH - 8, 34); + tft.canvas(4, y, TFT_WIDTH - 8, FONT_LINE_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, TFT_WIDTH - 8, 34, COLOR_AXIS_HOMED); + tft.add_rectangle(0, 0, TFT_WIDTH - 8, FONT_LINE_HEIGHT, COLOR_AXIS_HOMED); tft.add_text( 16, 3, COLOR_AXIS_HOMED , "X"); tft.add_text(192, 3, COLOR_AXIS_HOMED , "Y"); @@ -290,10 +292,11 @@ void MarlinUI::draw_status_screen() { offset -= tft_string.width(); } tft.add_text(455 - tft_string.width() - offset, 3, not_homed ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 4, 132, TFT_WIDTH - 8, 34)); + TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 4, y, TFT_WIDTH - 8, FONT_LINE_HEIGHT)); + y += TERN(HAS_UI_480x272, 38, 48); // feed rate - tft.canvas(96, 180, 100, 32); + tft.canvas(96, y, 100, 32); tft.set_background(COLOR_BACKGROUND); uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFeedRate, color); @@ -303,7 +306,7 @@ void MarlinUI::draw_status_screen() { TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, 96, 176, 100, 32)); // flow rate - tft.canvas(284, 180, 100, 32); + tft.canvas(284, y, 100, 32); tft.set_background(COLOR_BACKGROUND); color = planner.flow_percentage[0] == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFlowRate, color); @@ -312,36 +315,38 @@ void MarlinUI::draw_status_screen() { tft.add_text(36, 1, color , tft_string); TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, 284, 176, 100, 32, active_extruder)); + #if ENABLED(TOUCH_SCREEN) + add_control(404, y, menu_main, imgSettings); + TERN_(SDSUPPORT, add_control(12, y, menu_media, imgSD, !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); + #endif + + y += TERN(HAS_UI_480x272, 36, 44); // print duration char buffer[14]; duration_t elapsed = print_job_timer.duration(); elapsed.toDigital(buffer); - tft.canvas((TFT_WIDTH - 128) / 2, 224, 128, 29); + tft.canvas((TFT_WIDTH - 128) / 2, y, 128, 29); tft.set_background(COLOR_BACKGROUND); tft_string.set(buffer); tft.add_text(tft_string.center(128), 0, COLOR_PRINT_TIME, tft_string); + y += TERN(HAS_UI_480x272, 28, 36); // progress bar const uint8_t progress = ui.get_progress_percent(); - tft.canvas(4, 260, TFT_WIDTH - 8, 9); + tft.canvas(4, y, TFT_WIDTH - 8, 9); tft.set_background(COLOR_PROGRESS_BG); tft.add_rectangle(0, 0, TFT_WIDTH - 8, 9, COLOR_PROGRESS_FRAME); if (progress) tft.add_bar(1, 1, ((TFT_WIDTH - 10) * progress) / 100, 7, COLOR_PROGRESS_BAR); + y += 20; // status message - tft.canvas(0, 280, TFT_WIDTH, 29); + tft.canvas(0, y, TFT_WIDTH, FONT_LINE_HEIGHT - 5); tft.set_background(COLOR_BACKGROUND); tft_string.set(status_message); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_STATUS_MESSAGE, tft_string); - - - #if ENABLED(TOUCH_SCREEN) - add_control(404, 180, menu_main, imgSettings); - TERN_(SDSUPPORT, add_control(12, 180, menu_media, imgSD, !printingIsActive(), COLOR_CONTROL_ENABLED, card.isMounted() && printingIsActive() ? COLOR_BUSY : COLOR_CONTROL_DISABLED)); - #endif } // Draw a static item with no left-right margin required. Centered by default. @@ -450,9 +455,9 @@ void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const valu void TFT::draw_edit_screen_buttons() { #if ENABLED(TOUCH_SCREEN) - add_control(64, 256, DECREASE, imgDecrease); - add_control(352, 256, INCREASE, imgIncrease); - add_control(208, 256, CLICK, imgConfirm); + add_control(64, TFT_HEIGHT - 64, DECREASE, imgDecrease); + add_control(352, TFT_HEIGHT - 64, INCREASE, imgIncrease); + add_control(208, TFT_HEIGHT - 64, CLICK, imgConfirm); #endif } @@ -481,8 +486,8 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); } #if ENABLED(TOUCH_SCREEN) - add_control(88, 256, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); - add_control(328, 256, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); + add_control(88, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); + add_control(328, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); #endif } @@ -541,7 +546,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, lpos = pos.asLogical(); - tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - 43) / 2 - 43, 120, 43); + tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2 - MENU_ITEM_HEIGHT, 120, MENU_ITEM_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(X_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -549,7 +554,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft_string.trim(); tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); - tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - 43) / 2, 120, 43); + tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2, 120, MENU_ITEM_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(Y_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -557,7 +562,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft_string.trim(); tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); - tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - 43) / 2 + 43, 120, 43); + tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2 + MENU_ITEM_HEIGHT, 120, MENU_ITEM_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(Z_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -566,13 +571,13 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); - tft.canvas(GRID_OFFSET_X + (GRID_WIDTH - 48) / 2, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET - 5, 48, 43); + tft.canvas(GRID_OFFSET_X + (GRID_WIDTH - 48) / 2, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET - 5, 48, MENU_ITEM_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(ui8tostr3rj(x_plot)); tft_string.trim(); tft.add_text(tft_string.center(48), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); - tft.canvas(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET + 16 - 24, GRID_OFFSET_Y + (GRID_HEIGHT - 43) / 2, 48, 43); + tft.canvas(GRID_OFFSET_X + GRID_WIDTH + CONTROL_OFFSET + 16 - 24, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2, 48, MENU_ITEM_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(ui8tostr3rj(y_plot)); tft_string.trim(); @@ -586,7 +591,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const add_control(GRID_OFFSET_X + CONTROL_OFFSET, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, UBL, - ENCODER_STEPS_PER_MENU_ITEM, imgLeft); add_control(GRID_OFFSET_X + GRID_WIDTH - CONTROL_OFFSET - 32, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, UBL, ENCODER_STEPS_PER_MENU_ITEM, imgRight); add_control(320, GRID_OFFSET_Y + GRID_HEIGHT + CONTROL_OFFSET, CLICK, imgLeveling); - add_control(224, 286, BACK, imgBack); + add_control(224, TFT_HEIGHT - 34, BACK, imgBack); #endif } #endif // AUTO_BED_LEVELING_UBL @@ -644,7 +649,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const #endif // TOUCH_SCREEN_CALIBRATION void menu_line(const uint8_t row, uint16_t color) { - tft.canvas(0, 4 + 45 * row, TFT_WIDTH, 43); + tft.canvas(0, 4 + (MENU_ITEM_HEIGHT + 2) * row, TFT_WIDTH, MENU_ITEM_HEIGHT); tft.set_background(color); } @@ -661,7 +666,7 @@ void menu_item(const uint8_t row, bool sel ) { menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); #if ENABLED(TOUCH_SCREEN) const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM; - touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row); + touch.add_control(tct, 0, 4 + (MENU_ITEM_HEIGHT + 2) * row, TFT_WIDTH, MENU_ITEM_HEIGHT, encoderTopLine + row); #endif } diff --git a/Marlin/src/lcd/tft/ui_480x320.h b/Marlin/src/lcd/tft/ui_480x320.h index 078f35ac6834..e3a688f112b1 100644 --- a/Marlin/src/lcd/tft/ui_480x320.h +++ b/Marlin/src/lcd/tft/ui_480x320.h @@ -38,8 +38,17 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink); void menu_line(const uint8_t row, uint16_t color = COLOR_BACKGROUND); void menu_item(const uint8_t row, bool sel = false); -#define MENU_FONT_NAME Helvetica18 -#define SYMBOLS_FONT_NAME Helvetica18_symbols +#if HAS_UI_480x320 + #define MENU_FONT_NAME Helvetica18 + #define SYMBOLS_FONT_NAME Helvetica18_symbols + #define MENU_ITEM_HEIGHT 43 + #define FONT_LINE_HEIGHT 34 +#elif HAS_UI_480x272 + #define MENU_FONT_NAME Helvetica14 + #define SYMBOLS_FONT_NAME Helvetica14_symbols + #define MENU_ITEM_HEIGHT 36 + #define FONT_LINE_HEIGHT 24 +#endif #define ABSOLUTE_ZERO -273.15 diff --git a/Marlin/src/lcd/tft_io/ssd1963.h b/Marlin/src/lcd/tft_io/ssd1963.h index af42e306c616..8564b28bfb1d 100644 --- a/Marlin/src/lcd/tft_io/ssd1963.h +++ b/Marlin/src/lcd/tft_io/ssd1963.h @@ -39,10 +39,10 @@ IF_0((TFT_ORIENTATION) & TFT_INVERT_X, SSD1963_MADCTL_FH) | \ IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, SSD1963_MADCTL_FV) -#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR - #define SSD1963_COLOR SSD1963_MADCTL_BGR -#elif TFT_COLOR == TFT_COLOR_RGB +#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_RGB #define SSD1963_COLOR SSD1963_MADCTL_RGB +#elif TFT_COLOR == TFT_COLOR_BGR + #define SSD1963_COLOR SSD1963_MADCTL_BGR #endif #define SSD1963_MADCTL_DATA (SSD1963_ORIENTATION) | (SSD1963_COLOR) diff --git a/Marlin/src/lcd/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp index 159f09d087ce..3c24d427342b 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.cpp +++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp @@ -23,6 +23,11 @@ #include "touch_calibration.h" +#define TOUCH_CALIBRATION_MAX_RETRIES 5 + +#define DEBUG_OUT ENABLED(DEBUG_TOUCH_CALIBRATION) +#include "../../core/debug_out.h" + TouchCalibration touch_calibration; touch_calibration_t TouchCalibration::calibration; @@ -31,23 +36,40 @@ touch_calibration_point_t TouchCalibration::calibration_points[4]; uint8_t TouchCalibration::failed_count; void TouchCalibration::validate_calibration() { - const bool landscape = validate_precision_x(0, 1) && validate_precision_x(2, 3) && validate_precision_y(0, 2) && validate_precision_y(1, 3); - const bool portrait = validate_precision_y(0, 1) && validate_precision_y(2, 3) && validate_precision_x(0, 2) && validate_precision_x(1, 3); + #define VALIDATE_PRECISION(XY, A, B) validate_precision_##XY(CALIBRATION_##A, CALIBRATION_##B) + const bool landscape = VALIDATE_PRECISION(x, TOP_LEFT, BOTTOM_LEFT) + && VALIDATE_PRECISION(x, TOP_RIGHT, BOTTOM_RIGHT) + && VALIDATE_PRECISION(y, TOP_LEFT, TOP_RIGHT) + && VALIDATE_PRECISION(y, BOTTOM_LEFT, BOTTOM_RIGHT); + const bool portrait = VALIDATE_PRECISION(y, TOP_LEFT, BOTTOM_LEFT) + && VALIDATE_PRECISION(y, TOP_RIGHT, BOTTOM_RIGHT) + && VALIDATE_PRECISION(x, TOP_LEFT, TOP_RIGHT) + && VALIDATE_PRECISION(x, BOTTOM_LEFT, BOTTOM_RIGHT); + #undef VALIDATE_PRECISION - if (landscape || portrait) { + #define CAL_PTS(N) calibration_points[CALIBRATION_##N] + if (landscape) { + calibration_state = CALIBRATION_SUCCESS; + calibration.x = ((CAL_PTS(TOP_RIGHT).x - CAL_PTS(TOP_LEFT).x) << 17) / (CAL_PTS(BOTTOM_RIGHT).raw_x + CAL_PTS(TOP_RIGHT).raw_x - CAL_PTS(BOTTOM_LEFT).raw_x - CAL_PTS(TOP_LEFT).raw_x); + calibration.y = ((CAL_PTS(BOTTOM_LEFT).y - CAL_PTS(TOP_LEFT).y) << 17) / (CAL_PTS(BOTTOM_RIGHT).raw_y - CAL_PTS(TOP_RIGHT).raw_y + CAL_PTS(BOTTOM_LEFT).raw_y - CAL_PTS(TOP_LEFT).raw_y); + calibration.offset_x = CAL_PTS(TOP_LEFT).x - int16_t(((CAL_PTS(TOP_LEFT).raw_x + CAL_PTS(BOTTOM_LEFT).raw_x) * calibration.x) >> 17); + calibration.offset_y = CAL_PTS(TOP_LEFT).y - int16_t(((CAL_PTS(TOP_LEFT).raw_y + CAL_PTS(TOP_RIGHT).raw_y) * calibration.y) >> 17); + calibration.orientation = TOUCH_LANDSCAPE; + } + else if (portrait) { calibration_state = CALIBRATION_SUCCESS; - calibration.x = ((calibration_points[2].x - calibration_points[0].x) << 17) / (calibration_points[3].raw_x + calibration_points[2].raw_x - calibration_points[1].raw_x - calibration_points[0].raw_x); - calibration.y = ((calibration_points[1].y - calibration_points[0].y) << 17) / (calibration_points[3].raw_y - calibration_points[2].raw_y + calibration_points[1].raw_y - calibration_points[0].raw_y); - calibration.offset_x = calibration_points[0].x - int16_t(((calibration_points[0].raw_x + calibration_points[1].raw_x) * calibration.x) >> 17); - calibration.offset_y = calibration_points[0].y - int16_t(((calibration_points[0].raw_y + calibration_points[2].raw_y) * calibration.y) >> 17); - calibration.orientation = landscape ? TOUCH_LANDSCAPE : TOUCH_PORTRAIT; + calibration.x = ((CAL_PTS(TOP_RIGHT).x - CAL_PTS(TOP_LEFT).x) << 17) / (CAL_PTS(BOTTOM_RIGHT).raw_y + CAL_PTS(TOP_RIGHT).raw_y - CAL_PTS(BOTTOM_LEFT).raw_y - CAL_PTS(TOP_LEFT).raw_y); + calibration.y = ((CAL_PTS(BOTTOM_LEFT).y - CAL_PTS(TOP_LEFT).y) << 17) / (CAL_PTS(BOTTOM_RIGHT).raw_x - CAL_PTS(TOP_RIGHT).raw_x + CAL_PTS(BOTTOM_LEFT).raw_x - CAL_PTS(TOP_LEFT).raw_x); + calibration.offset_x = CAL_PTS(TOP_LEFT).x - int16_t(((CAL_PTS(TOP_LEFT).raw_y + CAL_PTS(BOTTOM_LEFT).raw_y) * calibration.x) >> 17); + calibration.offset_y = CAL_PTS(TOP_LEFT).y - int16_t(((CAL_PTS(TOP_LEFT).raw_x + CAL_PTS(TOP_RIGHT).raw_x) * calibration.y) >> 17); + calibration.orientation = TOUCH_PORTRAIT; } else { calibration_state = CALIBRATION_FAIL; calibration_reset(); - // Retry up to 5 times before reporting the failure - if (need_calibration() && failed_count++ < 5) calibration_state = CALIBRATION_TOP_LEFT; + if (need_calibration() && failed_count++ < TOUCH_CALIBRATION_MAX_RETRIES) calibration_state = CALIBRATION_TOP_LEFT; } + #undef CAL_PTS if (calibration_state == CALIBRATION_SUCCESS) { SERIAL_ECHOLNPGM("Touch screen calibration completed"); @@ -55,7 +77,7 @@ void TouchCalibration::validate_calibration() { SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y); - SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT"); + SERIAL_ECHO_TERNARY(calibration.orientation == TOUCH_LANDSCAPE, "TOUCH_ORIENTATION ", "TOUCH_LANDSCAPE", "TOUCH_PORTRAIT", "\n"); } } @@ -68,6 +90,7 @@ bool TouchCalibration::handleTouch(uint16_t x, uint16_t y) { if (calibration_state < CALIBRATION_SUCCESS) { calibration_points[calibration_state].raw_x = x; calibration_points[calibration_state].raw_y = y; + DEBUG_ECHOLNPAIR("TouchCalibration - State: ", calibration_state, ", x: ", calibration_points[calibration_state].x, ", raw_x: ", x, ", y: ", calibration_points[calibration_state].y, ", raw_y: ", y); } switch (calibration_state) { diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index 7f429d4497e0..0721aab84407 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -155,11 +155,6 @@ #define TOUCH_INT_PIN PB1 #endif -// Touchscreen calibration does not work correctly with ANET_ET5_TFT35 or ANET_ET4_TFT28 -#if ENABLED(TOUCH_SCREEN_CALIBRATION) - #undef TOUCH_SCREEN_CALIBRATION -#endif - #if ENABLED(ANET_ET5_TFT35) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X 17125 From 4ad633bae235f0a47972d6d7873e614b8286d914 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 30 Dec 2020 00:23:46 +0000 Subject: [PATCH 443/443] [cron] Bump distribution date (2020-12-30) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f550fda7a29b..b673b83a0d37 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-12-29" + #define STRING_DISTRIBUTION_DATE "2020-12-30" #endif /**