From 34b9df8addc0bf73e7448f5414074ac907b13c5b Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Tue, 28 Jul 2020 17:58:01 +0800 Subject: [PATCH 01/33] Support MKS SGEN_L V2 board --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 364 +++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 3 files changed, 367 insertions(+) create mode 100644 Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 6e57a43747f0..f502d614e690 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -234,6 +234,7 @@ #define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard #define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0 #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) // // SAM3X8E ARM Cortex M3 diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h new file mode 100644 index 000000000000..96c0937307b0 --- /dev/null +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -0,0 +1,364 @@ +/** + * 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 SGen pin assignments + */ + +#ifndef MCU_LPC1769 + #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." +#endif + +#define BOARD_INFO_NAME "MKS SGEN_L V2" +#define BOARD_WEBSITE_URL "github.com/makerbase-mks" + +// +// EEPROM, MKS SGEN_L V2.0 hardware has 4K EEPROM on the board +// +#define FLASH_EEPROM_EMULATION +//#define SDCARD_EEPROM_EMULATION +//#define SDCARD_EEPROM_EMULATION +//#define I2C_EEPROM // AT24C32 +//#define E2END 0xFFF // 4KB + +// +// Servos +// +#define SERVO0_PIN P1_23 // SERVO P1.23 +#define SERVO1_PIN P2_00 // SERVO P2.0 + +// +// Trinamic Stallguard pins, can connect or disconnect by jumpers cap on the board +// +#define X_DIAG_PIN P1_29 // X- +#define Y_DIAG_PIN P1_27 // Y- +#define Z_DIAG_PIN P1_25 // Z- +#define E0_DIAG_PIN P1_28 // X+ +#define E1_DIAG_PIN P1_26 // Y+ + +// +// Limit Switches +// +#if X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN P1_28 // X+ + #else + #define X_MIN_PIN P1_28 // X+ + #endif +#else + #define X_MIN_PIN P1_29 // X- + #define X_MAX_PIN P1_28 // X+ +#endif + +#if Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN P1_26 // Y+ + #else + #define Y_MIN_PIN P1_26 // Y+ + #endif +#else + #define Y_MIN_PIN P1_27 // Y- + #define Y_MAX_PIN P1_26 // Y+ +#endif + +#if Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN P1_24 // Z+ + #else + #define Z_MIN_PIN P1_24 // Z+ + #endif +#else + #define Z_MIN_PIN P1_25 // Z- + #define Z_MAX_PIN P1_24 // Z+ +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN P1_24 +#endif + +// +// Steppers +// +#define X_STEP_PIN P2_02 +#define X_DIR_PIN P2_03 +#define X_ENABLE_PIN P2_01 +#ifndef X_CS_PIN + #define X_CS_PIN P1_01 +#endif + +#define Y_STEP_PIN P0_19 +#define Y_DIR_PIN P0_20 +#define Y_ENABLE_PIN P2_08 +#ifndef Y_CS_PIN + #define Y_CS_PIN P1_08 +#endif + +#define Z_STEP_PIN P0_22 +#define Z_DIR_PIN P2_11 +#define Z_ENABLE_PIN P0_21 +#ifndef Z_CS_PIN + #define Z_CS_PIN P1_10 +#endif + +#define E0_STEP_PIN P2_13 +#define E0_DIR_PIN P0_11 +#define E0_ENABLE_PIN P2_12 +#ifndef E0_CS_PIN + #define E0_CS_PIN P1_15 +#endif + +#define E1_STEP_PIN P1_09 +#define E1_DIR_PIN P1_14 +#define E1_ENABLE_PIN P0_10 +#ifndef E1_CS_PIN + #define E1_CS_PIN P1_17 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P1_16 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_05 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_04 + #endif +#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 Serial + //#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 P1_01 + #define X_SERIAL_RX_PIN P1_01 + + #define Y_SERIAL_TX_PIN P1_08 + #define Y_SERIAL_RX_PIN P1_08 + + #define Z_SERIAL_TX_PIN P1_10 + #define Z_SERIAL_RX_PIN P1_10 + + #define E0_SERIAL_TX_PIN P1_15 + #define E0_SERIAL_RX_PIN P1_15 + + #define E1_SERIAL_TX_PIN P1_17 + #define E1_SERIAL_RX_PIN P1_17 + + #define Z2_SERIAL_TX_PIN P1_17 + #define Z2_SERIAL_RX_PIN P1_17 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif // TMC2208 || TMC2209 + +// +// Temperature Sensors +// 3.3V max when defined as an analog input +// +#define TEMP_0_PIN P0_23_A0 // Analog Input A0 (TH1) +#define TEMP_BED_PIN P0_24_A1 // Analog Input A1 (TB) +#define TEMP_1_PIN P0_25_A2 // Analog Input A2 (TH2) +#define TEMP_2_PIN P0_26_A3 // Analog Input A3 (P0.26, No pull up) + +// +// Heaters / Fans +// +#define HEATER_BED_PIN P2_05 +#define HEATER_0_PIN P2_07 +#if HOTENDS == 1 + #ifndef FAN1_PIN + #define FAN1_PIN P2_06 + #endif +#else + #ifndef HEATER_1_PIN + #define HEATER_1_PIN P2_06 + #endif +#endif +#ifndef FAN_PIN + #define FAN_PIN P2_04 +#endif +#ifndef FAN2_PIN + #define FAN2_PIN P1_04 +#endif + +// +// Misc. Functions +// +#define LED_PIN P1_18 // Used as a status indicator +#define LED2_PIN P1_19 +#define LED3_PIN P1_20 +#define LED4_PIN P1_21 + +/** + * _____ _____ + * (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 + * ----- ----- + * EXP1 EXP2 + */ +#if HAS_SPI_LCD + #define BEEPER_PIN P1_31 + #define BTN_ENC P1_30 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS P1_00 + + #define BTN_EN1 P0_18 + #define BTN_EN2 P0_15 + + #define LCD_PINS_ENABLE P1_22 + #define LCD_PINS_D4 P0_17 + + #else + + #define BTN_EN1 P3_25 + #define BTN_EN2 P3_26 + + #define LCD_SDSS P0_28 + + #if ENABLED(MKS_12864OLED_SSD1306) + + #define LCD_PINS_DC P0_17 + #define DOGLCD_CS P0_16 + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_SCK P0_15 + #define DOGLCD_MOSI P0_18 + + #define LCD_PINS_RS P1_00 + #define LCD_PINS_D7 P1_22 + #define KILL_PIN -1 // NC + + #else // !MKS_12864OLED_SSD1306 + + #define LCD_PINS_RS P0_16 + + #define LCD_PINS_ENABLE P0_18 + #define LCD_PINS_D4 P0_15 + + #if ENABLED(FYSETC_MINI_12864) + + #define DOGLCD_CS P0_18 + #define DOGLCD_A0 P0_16 + #define DOGLCD_SCK P0_07 + #define DOGLCD_MOSI P1_20 + + #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 P0_15 // 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 P0_17 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN P1_00 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN P1_22 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN P0_17 + #endif + + #else // !FYSETC_MINI_12864 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS P0_17 + #define DOGLCD_A0 P1_00 + #endif + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 P0_17 + #define LCD_PINS_D6 P1_00 + #define LCD_PINS_D7 P1_22 + #endif + + #endif // !FYSETC_MINI_12864 + + #endif // !MKS_12864OLED_SSD1306 + + #endif // !CR10_STOCKDISPLAY + +#endif // HAS_SPI_LCD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card + +#if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN P0_27 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #if SD_CONNECTION_IS(ONBOARD) + #define SS_PIN ONBOARD_SD_CS_PIN + #else + #define SS_PIN P0_28 + #endif +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +// +// Other Pins +// +//#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) +//#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) +//#define PS_ON_PIN P1_23 // SERVO P1.23 \ No newline at end of file diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 1b78b0f769ad..9f8088fe4331 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -408,6 +408,8 @@ #include "lpc1769/pins_TH3D_EZBOARD.h" // LPC1769 env:LPC1769 #elif MB(BTT_SKR_V1_4_TURBO) #include "lpc1769/pins_BTT_SKR_V1_4_TURBO.h" // LPC1769 env:LPC1769 +#elif MB(MKS_SGEN_L_V2) + #include "lpc1769/pins_MKS_SGEN_L_V2.h" // LPC1769 env:LPC1769 // // Due (ATSAM) boards From a3b0f9dda4c3d3292ed5120a9ff780263de6354b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jul 2020 20:04:33 -0500 Subject: [PATCH 02/33] Update pins_MKS_SGEN_L_V2.h --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 96c0937307b0..1c6fd7dcf717 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_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 @@ -37,9 +37,8 @@ // #define FLASH_EEPROM_EMULATION //#define SDCARD_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION -//#define I2C_EEPROM // AT24C32 -//#define E2END 0xFFF // 4KB +//#define I2C_EEPROM // AT24C32 +//#define MARLIN_EEPROM_SIZE 0x1000 // 4KB // // Servos @@ -198,7 +197,7 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 -#endif // TMC2208 || TMC2209 +#endif // HAS_TMC_UART // // Temperature Sensors @@ -361,4 +360,4 @@ // //#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) //#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -//#define PS_ON_PIN P1_23 // SERVO P1.23 \ No newline at end of file +//#define PS_ON_PIN P1_23 // SERVO P1.23 From bf9ee2e185f6987137d4481f9ff739c87ae5d91b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jul 2020 20:08:33 -0500 Subject: [PATCH 03/33] Update pins_MKS_SGEN_L_V2.h --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 1c6fd7dcf717..1f46b48f6183 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -35,10 +35,12 @@ // // EEPROM, MKS SGEN_L V2.0 hardware has 4K EEPROM on the board // -#define FLASH_EEPROM_EMULATION -//#define SDCARD_EEPROM_EMULATION -//#define I2C_EEPROM // AT24C32 -//#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define SDCARD_EEPROM_EMULATION + //#define I2C_EEPROM // AT24C32 + //#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif // // Servos From 2d959198d285b47e61535cbb74c45b98c86e59d8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jul 2020 20:10:35 -0500 Subject: [PATCH 04/33] 4K size stated --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 1f46b48f6183..438a76e9f0da 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -36,10 +36,10 @@ // EEPROM, MKS SGEN_L V2.0 hardware has 4K EEPROM on the board // #if NO_EEPROM_SELECTED - #define FLASH_EEPROM_EMULATION //#define SDCARD_EEPROM_EMULATION //#define I2C_EEPROM // AT24C32 - //#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif // From 4bdaec14dbb68006ef9067307143d45ea0080996 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 1 Sep 2020 18:17:58 -0500 Subject: [PATCH 05/33] Update pins_MKS_SGEN_L_V2.h --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 8 -------- 1 file changed, 8 deletions(-) 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 438a76e9f0da..d112cc5d5080 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -178,25 +178,17 @@ // // Software serial // - #define X_SERIAL_TX_PIN P1_01 #define X_SERIAL_RX_PIN P1_01 - #define Y_SERIAL_TX_PIN P1_08 #define Y_SERIAL_RX_PIN P1_08 - #define Z_SERIAL_TX_PIN P1_10 #define Z_SERIAL_RX_PIN P1_10 - #define E0_SERIAL_TX_PIN P1_15 #define E0_SERIAL_RX_PIN P1_15 - #define E1_SERIAL_TX_PIN P1_17 #define E1_SERIAL_RX_PIN P1_17 - #define Z2_SERIAL_TX_PIN P1_17 - #define Z2_SERIAL_RX_PIN P1_17 - // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 #endif // HAS_TMC_UART From 8a8da49a7cd39abc1449a452554abe5faafa9166 Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Sat, 5 Sep 2020 19:03:29 +0800 Subject: [PATCH 06/33] Fix MKS LCD12864A/B display on MKS Robin E3/E3D and MKS SGEN_L --- Marlin/Configuration.h | 1 + Marlin/src/MarlinCore.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 52af1375a509..93f65fca86c8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2054,6 +2054,7 @@ // MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout. // https://www.aliexpress.com/item/33018110072.html // + //#define MKS_LCD12864 // diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e703eaf8d999..86e7fefebf98 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1019,9 +1019,15 @@ void setup() { #endif SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif - - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) - SETUP_RUN(card.mount()); // Mount media with settings before first_load + + #if ENABLED(MKS_LCD12864) || ENABLED(MKS_MINI_12864) + #if ENABLED(SDSUPPORT) + SETUP_RUN(card.mount()); // Mount media with settings before first_load + #endif + #else + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) + SETUP_RUN(card.mount()); // Mount media with settings before first_load + #endif #endif SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) From a96c6de3c806755488f4eb7116e501e85b02846e Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Wed, 9 Sep 2020 11:48:45 +0800 Subject: [PATCH 07/33] Add support for MKS GEN_L V2.1 --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 89 ++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e280d955b800..b807ed9f1ee6 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -107,6 +107,7 @@ #define BOARD_COPYMASTER_3D 1151 // Copymaster 3D #define BOARD_ORTUR_4 1152 // Ortur 4 #define BOARD_TENLOG_D3_HERO 1153 // Tenlog D3 Hero IDEX printer +#define BOARD_MKS_GEN_L_V21 1154 // MKS GEN L V2.1 // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 2dfb2b53b8ea..e9b93ea427dd 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -196,6 +196,8 @@ #include "ramps/pins_ORTUR_4.h" // ATmega2560 env:mega2560 #elif MB(TENLOG_D3_HERO) #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 // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h new file mode 100644 index 000000000000..52721c684e3b --- /dev/null +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.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 + +/** + * MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS GEN L V2.1 supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "MKS GEN L V2" + +// +// Heaters / Fans +// +// Power outputs EFBF or EFBE +#define MOSFET_D_PIN 7 + +// +// CS Pins wired to avoid conflict with the LCD +// See https://www.thingiverse.com/asset:66604 +// + +#ifndef X_CS_PIN + #define X_CS_PIN 63 +#endif + +#ifndef Y_CS_PIN + #define Y_CS_PIN 64 +#endif + +#ifndef Z_CS_PIN + #define Z_CS_PIN 65 +#endif + +#ifndef E0_CS_PIN + #define E0_CS_PIN 66 +#endif + +#ifndef E1_CS_PIN + #define E1_CS_PIN 12 +#endif + +// TMC2130 Diag Pins (currently just for reference) +#define X_DIAG_PIN 3 +#define Y_DIAG_PIN 14 +#define Z_DIAG_PIN 18 +#define E0_DIAG_PIN 2 +#define E1_DIAG_PIN 15 + +#ifndef SERVO1_PIN + #define SERVO1_PIN 12 +#endif +#ifndef SERVO2_PIN + #define SERVO2_PIN 39 +#endif +#ifndef SERVO3_PIN + #define SERVO3_PIN 32 +#endif + +#ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN 20 +#endif +#ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN 12 +#endif + +#include "pins_RAMPS.h" From 7c622f3711062518d6137b46a2798482450181e5 Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Wed, 9 Sep 2020 12:00:53 +0800 Subject: [PATCH 08/33] Add support for MKS Gen-L V2.1 --- Marlin/src/MarlinCore.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index bc965f79fce8..cc7f479e8201 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1020,14 +1020,8 @@ void setup() { SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif - #if ENABLED(MKS_LCD12864) || ENABLED(MKS_MINI_12864) - #if ENABLED(SDSUPPORT) - SETUP_RUN(card.mount()); // Mount media with settings before first_load - #endif - #else - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) - SETUP_RUN(card.mount()); // Mount media with settings before first_load - #endif + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) + SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) From 1c8c01882245c42998d2b174dbf5495ac5397eee Mon Sep 17 00:00:00 2001 From: makerbase <4164049@qq.com> Date: Wed, 9 Sep 2020 12:04:17 +0800 Subject: [PATCH 09/33] Update pins_MKS_GEN_L_V21.h --- Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h index 52721c684e3b..d88d97b04595 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h @@ -29,7 +29,7 @@ #error "MKS GEN L V2.1 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_INFO_NAME "MKS GEN L V2" +#define BOARD_INFO_NAME "MKS GEN L V2.1" // // Heaters / Fans From 453f220fe47365a1fe5ccc985212f12747b719cb Mon Sep 17 00:00:00 2001 From: makerbase <4164049@qq.com> Date: Wed, 9 Sep 2020 12:12:27 +0800 Subject: [PATCH 10/33] Update pins_MKS_GEN_L_V21.h --- Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h index d88d97b04595..79e1ea241e67 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h @@ -70,7 +70,7 @@ #define E1_DIAG_PIN 15 #ifndef SERVO1_PIN - #define SERVO1_PIN 12 + #define SERVO1_PIN 21 #endif #ifndef SERVO2_PIN #define SERVO2_PIN 39 From cd14a9640a7b973580d8929a9978e277a392e5cf Mon Sep 17 00:00:00 2001 From: makerbase <4164049@qq.com> Date: Wed, 9 Sep 2020 12:13:18 +0800 Subject: [PATCH 11/33] Update MarlinCore.cpp --- Marlin/src/MarlinCore.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index cc7f479e8201..8545a8801e13 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1019,7 +1019,6 @@ void setup() { #endif SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif From bc5d3164ed5d22f412206ccea60d4248458ef006 Mon Sep 17 00:00:00 2001 From: makerbase <4164049@qq.com> Date: Wed, 9 Sep 2020 12:14:18 +0800 Subject: [PATCH 12/33] Update Configuration.h --- Marlin/Configuration.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 93f65fca86c8..52af1375a509 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2054,7 +2054,6 @@ // MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout. // https://www.aliexpress.com/item/33018110072.html // - //#define MKS_LCD12864 // From 07b33a9e851075860e055a145fc630245723c70e Mon Sep 17 00:00:00 2001 From: makerbase <4164049@qq.com> Date: Wed, 9 Sep 2020 12:14:46 +0800 Subject: [PATCH 13/33] Update MarlinCore.cpp --- Marlin/src/MarlinCore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8545a8801e13..cc7f479e8201 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1019,6 +1019,7 @@ void setup() { #endif SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif From 4cb7f4abbfcd9b5220c903a2c4ddf99558ab3ef4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 9 Sep 2020 21:43:16 -0500 Subject: [PATCH 14/33] Update MarlinCore.cpp --- 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 cc7f479e8201..89791c90820b 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1019,7 +1019,7 @@ void setup() { #endif SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) #endif - + #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif From 8b08e955c8dfc9c3fcf7df7211ddf23d01cad921 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 9 Sep 2020 21:47:45 -0500 Subject: [PATCH 15/33] Add Makefile, clean up --- Marlin/Makefile | 8 +++++--- Marlin/src/core/boards.h | 8 ++++---- Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 4 ---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Marlin/Makefile b/Marlin/Makefile index 5ab0d1eefd11..9f2d18d268d7 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -268,12 +268,14 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1148) else ifeq ($(HARDWARE_MOTHERBOARD),1149) # MKS GEN L V2 else ifeq ($(HARDWARE_MOTHERBOARD),1150) -# Copymaster 3D +# MKS GEN L V2.1 else ifeq ($(HARDWARE_MOTHERBOARD),1151) -# Ortur 4 +# Copymaster 3D else ifeq ($(HARDWARE_MOTHERBOARD),1152) -# Tenlog D3 Hero +# Ortur 4 else ifeq ($(HARDWARE_MOTHERBOARD),1153) +# Tenlog D3 Hero +else ifeq ($(HARDWARE_MOTHERBOARD),1154) # # RAMBo and derivatives diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index aa42da068e56..abe5a54335c5 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -104,10 +104,10 @@ #define BOARD_HJC2560C_REV2 1148 // ADIMLab Gantry v2 #define BOARD_TANGO 1149 // BIQU Tango V1 #define BOARD_MKS_GEN_L_V2 1150 // MKS GEN L V2 -#define BOARD_COPYMASTER_3D 1151 // Copymaster 3D -#define BOARD_ORTUR_4 1152 // Ortur 4 -#define BOARD_TENLOG_D3_HERO 1153 // Tenlog D3 Hero IDEX printer -#define BOARD_MKS_GEN_L_V21 1154 // MKS GEN L V2.1 +#define BOARD_MKS_GEN_L_V21 1151 // MKS GEN L V2.1 +#define BOARD_COPYMASTER_3D 1152 // Copymaster 3D +#define BOARD_ORTUR_4 1153 // Ortur 4 +#define BOARD_TENLOG_D3_HERO 1154 // Tenlog D3 Hero IDEX printer // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h index 79e1ea241e67..24e04a39ff1f 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h @@ -45,19 +45,15 @@ #ifndef X_CS_PIN #define X_CS_PIN 63 #endif - #ifndef Y_CS_PIN #define Y_CS_PIN 64 #endif - #ifndef Z_CS_PIN #define Z_CS_PIN 65 #endif - #ifndef E0_CS_PIN #define E0_CS_PIN 66 #endif - #ifndef E1_CS_PIN #define E1_CS_PIN 12 #endif From ceb896f866fe89b11b6015b8990ec43e569ec14f Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Wed, 16 Sep 2020 15:48:29 +0800 Subject: [PATCH 16/33] fix Makefile and board file --- Marlin/Makefile | 106 +++++++++++++++++++------------------- Marlin/src/core/boards.h | 108 +++++++++++++++++++++------------------ 2 files changed, 111 insertions(+), 103 deletions(-) diff --git a/Marlin/Makefile b/Marlin/Makefile index 9f2d18d268d7..68dd05bdfbad 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -170,112 +170,114 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1100) else ifeq ($(HARDWARE_MOTHERBOARD),1101) # Velleman K8400 Controller (derived from 3Drag Controller) else ifeq ($(HARDWARE_MOTHERBOARD),1102) -# Velleman K8600 Controller (derived from 3Drag Controller) +# Velleman K8600 Controller (Vertex Nano) else ifeq ($(HARDWARE_MOTHERBOARD),1103) -# 2PrintBeta BAM&DICE with STK drivers +# Velleman K8800 Controller (Vertex Delta) else ifeq ($(HARDWARE_MOTHERBOARD),1104) -# 2PrintBeta BAM&DICE Due with STK drivers +# 2PrintBeta BAM&DICE with STK drivers else ifeq ($(HARDWARE_MOTHERBOARD),1105) -# MKS BASE v1.0 +# 2PrintBeta BAM&DICE Due with STK drivers else ifeq ($(HARDWARE_MOTHERBOARD),1106) -# MKS v1.4 with A4982 stepper drivers +# MKS BASE v1.0 else ifeq ($(HARDWARE_MOTHERBOARD),1107) -# MKS v1.5 with Allegro A4982 stepper drivers +# MKS v1.4 with A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1108) -# MKS v1.6 with Allegro A4982 stepper drivers +# MKS v1.5 with Allegro A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1109) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers +# MKS v1.6 with Allegro A4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1110) -# MKS GEN v1.3 or 1.4 +# MKS BASE 1.0 with Heroic HR4982 stepper drivers else ifeq ($(HARDWARE_MOTHERBOARD),1111) -# MKS GEN L +# MKS GEN v1.3 or 1.4 else ifeq ($(HARDWARE_MOTHERBOARD),1112) -# zrib V2.0 control board (Chinese knock off RAMPS replica) +# MKS GEN L else ifeq ($(HARDWARE_MOTHERBOARD),1113) -# BigTreeTech or BIQU KFB2.0 +# zrib V2.0 control board (Chinese knock off RAMPS replica) else ifeq ($(HARDWARE_MOTHERBOARD),1114) -# Felix 2.0+ Electronics Board (RAMPS like) +# BigTreeTech or BIQU KFB2.0 else ifeq ($(HARDWARE_MOTHERBOARD),1115) -# Invent-A-Part RigidBoard +# Felix 2.0+ Electronics Board (RAMPS like) else ifeq ($(HARDWARE_MOTHERBOARD),1116) -# Invent-A-Part RigidBoard V2 +# Invent-A-Part RigidBoard else ifeq ($(HARDWARE_MOTHERBOARD),1117) -# Sainsmart 2-in-1 board +# Invent-A-Part RigidBoard V2 else ifeq ($(HARDWARE_MOTHERBOARD),1118) -# Ultimaker +# Sainsmart 2-in-1 board else ifeq ($(HARDWARE_MOTHERBOARD),1119) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) +# Ultimaker else ifeq ($(HARDWARE_MOTHERBOARD),1120) +# Ultimaker (Older electronics. Pre 1.5.4. This is rare) +else ifeq ($(HARDWARE_MOTHERBOARD),1121) MCU ?= atmega1280 # Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),1121) -# Azteeg X3 Pro else ifeq ($(HARDWARE_MOTHERBOARD),1122) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) +# Azteeg X3 Pro else ifeq ($(HARDWARE_MOTHERBOARD),1123) -# Rumba +# Ultimainboard 2.x (Uses TEMP_SENSOR 20) else ifeq ($(HARDWARE_MOTHERBOARD),1124) -# Raise3D Rumba +# Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1125) -# Rapide Lite RL200 Rumba +# Raise3D Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1126) -# Formbot T-Rex 2 Plus +# Rapide Lite RL200 Rumba else ifeq ($(HARDWARE_MOTHERBOARD),1127) -# Formbot T-Rex 3 +# Formbot T-Rex 2 Plus else ifeq ($(HARDWARE_MOTHERBOARD),1128) -# Formbot Raptor +# Formbot T-Rex 3 else ifeq ($(HARDWARE_MOTHERBOARD),1129) -# Formbot Raptor 2 +# Formbot Raptor else ifeq ($(HARDWARE_MOTHERBOARD),1130) -# bq ZUM Mega 3D +# Formbot Raptor 2 else ifeq ($(HARDWARE_MOTHERBOARD),1131) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake +# bq ZUM Mega 3D else ifeq ($(HARDWARE_MOTHERBOARD),1132) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB +# MakeBoard Mini v2.1.2 is a control board sold by MicroMake else ifeq ($(HARDWARE_MOTHERBOARD),1133) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB +# TriGorilla Anycubic version 1.3 based on RAMPS EFB else ifeq ($(HARDWARE_MOTHERBOARD),1134) -# TriGorilla Anycubic version 1.4 Rev 1.1 +# TriGorilla Anycubic version 1.4 based on RAMPS EFB else ifeq ($(HARDWARE_MOTHERBOARD),1135) -# Creality: Ender-4, CR-8 +# TriGorilla Anycubic version 1.4 Rev 1.1 else ifeq ($(HARDWARE_MOTHERBOARD),1136) -# Creality: CR10S, CR20, CR-X +# Creality: Ender-4, CR-8 else ifeq ($(HARDWARE_MOTHERBOARD),1137) -# Dagoma F5 +# Creality: CR10S, CR20, CR-X else ifeq ($(HARDWARE_MOTHERBOARD),1138) -# FYSETC F6 1.3 +# Dagoma F5 else ifeq ($(HARDWARE_MOTHERBOARD),1139) -# FYSETC F6 1.5 +# FYSETC F6 1.3 else ifeq ($(HARDWARE_MOTHERBOARD),1140) -# Duplicator i3 Plus +# FYSETC F6 1.5 else ifeq ($(HARDWARE_MOTHERBOARD),1141) -# VORON +# Duplicator i3 Plus else ifeq ($(HARDWARE_MOTHERBOARD),1142) -# TRONXY V3 1.0 +# VORON else ifeq ($(HARDWARE_MOTHERBOARD),1143) -# Z-Bolt X Series +# TRONXY V3 1.0 else ifeq ($(HARDWARE_MOTHERBOARD),1144) -# TT OSCAR +# Z-Bolt X Series else ifeq ($(HARDWARE_MOTHERBOARD),1145) -# Overlord/Overlord Pro +# TT OSCAR else ifeq ($(HARDWARE_MOTHERBOARD),1146) -# ADIMLab Gantry v1 +# Overlord/Overlord Pro else ifeq ($(HARDWARE_MOTHERBOARD),1147) -# ADIMLab Gantry v2 +# ADIMLab Gantry v1 else ifeq ($(HARDWARE_MOTHERBOARD),1148) -# BIQU Tango V1 +# ADIMLab Gantry v2 else ifeq ($(HARDWARE_MOTHERBOARD),1149) -# MKS GEN L V2 +# BIQU Tango V1 else ifeq ($(HARDWARE_MOTHERBOARD),1150) -# MKS GEN L V2.1 +# MKS GEN L V2 else ifeq ($(HARDWARE_MOTHERBOARD),1151) -# Copymaster 3D +# MKS GEN L V2.1 else ifeq ($(HARDWARE_MOTHERBOARD),1152) -# Ortur 4 +# Copymaster 3D else ifeq ($(HARDWARE_MOTHERBOARD),1153) -# Tenlog D3 Hero +# Ortur 4 else ifeq ($(HARDWARE_MOTHERBOARD),1154) +# Tenlog D3 Hero +else ifeq ($(HARDWARE_MOTHERBOARD),1155) # # RAMBo and derivatives diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index abe5a54335c5..581c801feb88 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -57,57 +57,58 @@ #define BOARD_K8200 1101 // Velleman K8200 Controller (derived from 3Drag Controller) #define BOARD_K8400 1102 // Velleman K8400 Controller (derived from 3Drag Controller) #define BOARD_K8600 1103 // Velleman K8600 Controller (Vertex Nano) -#define BOARD_BAM_DICE 1104 // 2PrintBeta BAM&DICE with STK drivers -#define BOARD_BAM_DICE_DUE 1105 // 2PrintBeta BAM&DICE Due with STK drivers -#define BOARD_MKS_BASE 1106 // MKS BASE v1.0 -#define BOARD_MKS_BASE_14 1107 // MKS BASE v1.4 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_15 1108 // MKS BASE v1.5 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_16 1109 // MKS BASE v1.6 with Allegro A4982 stepper drivers -#define BOARD_MKS_BASE_HEROIC 1110 // MKS BASE 1.0 with Heroic HR4982 stepper drivers -#define BOARD_MKS_GEN_13 1111 // MKS GEN v1.3 or 1.4 -#define BOARD_MKS_GEN_L 1112 // MKS GEN L -#define BOARD_KFB_2 1113 // BigTreeTech or BIQU KFB2.0 -#define BOARD_ZRIB_V20 1114 // zrib V2.0 control board (Chinese knock off RAMPS replica) -#define BOARD_FELIX2 1115 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 1116 // Invent-A-Part RigidBoard -#define BOARD_RIGIDBOARD_V2 1117 // Invent-A-Part RigidBoard V2 -#define BOARD_SAINSMART_2IN1 1118 // Sainsmart 2-in-1 board -#define BOARD_ULTIMAKER 1119 // Ultimaker -#define BOARD_ULTIMAKER_OLD 1120 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) -#define BOARD_AZTEEG_X3 1121 // Azteeg X3 -#define BOARD_AZTEEG_X3_PRO 1122 // Azteeg X3 Pro -#define BOARD_ULTIMAIN_2 1123 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) -#define BOARD_RUMBA 1124 // Rumba -#define BOARD_RUMBA_RAISE3D 1125 // Raise3D N series Rumba derivative -#define BOARD_RL200 1126 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv) -#define BOARD_FORMBOT_TREX2PLUS 1127 // Formbot T-Rex 2 Plus -#define BOARD_FORMBOT_TREX3 1128 // Formbot T-Rex 3 -#define BOARD_FORMBOT_RAPTOR 1129 // Formbot Raptor -#define BOARD_FORMBOT_RAPTOR2 1130 // Formbot Raptor 2 -#define BOARD_BQ_ZUM_MEGA_3D 1131 // bq ZUM Mega 3D -#define BOARD_MAKEBOARD_MINI 1132 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake -#define BOARD_TRIGORILLA_13 1133 // TriGorilla Anycubic version 1.3-based on RAMPS EFB -#define BOARD_TRIGORILLA_14 1134 // ... Ver 1.4 -#define BOARD_TRIGORILLA_14_11 1135 // ... Rev 1.1 (new servo pin order) -#define BOARD_RAMPS_ENDER_4 1136 // Creality: Ender-4, CR-8 -#define BOARD_RAMPS_CREALITY 1137 // Creality: CR10S, CR20, CR-X -#define BOARD_RAMPS_DAGOMA 1138 // Dagoma F5 -#define BOARD_FYSETC_F6_13 1139 // FYSETC F6 1.3 -#define BOARD_FYSETC_F6_14 1140 // FYSETC F6 1.4 -#define BOARD_DUPLICATOR_I3_PLUS 1141 // Wanhao Duplicator i3 Plus -#define BOARD_VORON 1142 // VORON Design -#define BOARD_TRONXY_V3_1_0 1143 // Tronxy TRONXY-V3-1.0 -#define BOARD_Z_BOLT_X_SERIES 1144 // Z-Bolt X Series -#define BOARD_TT_OSCAR 1145 // TT OSCAR -#define BOARD_OVERLORD 1146 // Overlord/Overlord Pro -#define BOARD_HJC2560C_REV1 1147 // ADIMLab Gantry v1 -#define BOARD_HJC2560C_REV2 1148 // ADIMLab Gantry v2 -#define BOARD_TANGO 1149 // BIQU Tango V1 -#define BOARD_MKS_GEN_L_V2 1150 // MKS GEN L V2 -#define BOARD_MKS_GEN_L_V21 1151 // MKS GEN L V2.1 -#define BOARD_COPYMASTER_3D 1152 // Copymaster 3D -#define BOARD_ORTUR_4 1153 // Ortur 4 -#define BOARD_TENLOG_D3_HERO 1154 // Tenlog D3 Hero IDEX printer +#define BOARD_K8800 1104 // Velleman K8800 Controller (Vertex Delta) +#define BOARD_BAM_DICE 1105 // 2PrintBeta BAM&DICE with STK drivers +#define BOARD_BAM_DICE_DUE 1106 // 2PrintBeta BAM&DICE Due with STK drivers +#define BOARD_MKS_BASE 1107 // MKS BASE v1.0 +#define BOARD_MKS_BASE_14 1108 // MKS BASE v1.4 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_15 1109 // MKS BASE v1.5 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_16 1110 // MKS BASE v1.6 with Allegro A4982 stepper drivers +#define BOARD_MKS_BASE_HEROIC 1111 // MKS BASE 1.0 with Heroic HR4982 stepper drivers +#define BOARD_MKS_GEN_13 1112 // MKS GEN v1.3 or 1.4 +#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_RAMPS_DAGOMA 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 // // RAMBo and derivatives @@ -357,10 +358,13 @@ #define BOARD_THE_BORG 5000 // THE-BORG (Power outputs: Hotend0, Hotend1, Bed, Fan) #define BOARD_REMRAM_V1 5001 // RemRam v1 +#define BOARD_TEENSY41 5002 // Teensy4.0 and Teensy4.1 +#define BOARD_T41U5XBB 5003 // T41U5XBB Teensy4.1 breakout board // // Espressif ESP32 WiFi // + #define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32 #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) @@ -369,11 +373,13 @@ // // SAMD51 ARM Cortex M4 // + #define BOARD_AGCM4_RAMPS_144 6100 // RAMPS 1.4.4 // // Custom board // + #define BOARD_CUSTOM 9998 // Custom pins definition for development and/or rare boards // From ff8a7e2d31678b629b5197c19aea0f39d391637f Mon Sep 17 00:00:00 2001 From: makerbase-mks <4146049@qq.com> Date: Mon, 21 Sep 2020 12:02:18 +0800 Subject: [PATCH 17/33] Fix MKS SGEN_L V2 FAN pins --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 2d09fe1feae5..7ebbca5742dc 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -208,8 +208,8 @@ #define HEATER_BED_PIN P2_05 #define HEATER_0_PIN P2_07 #if HOTENDS == 1 - #ifndef FAN1_PIN - #define FAN1_PIN P2_06 + #ifndef FAN2_PIN + #define FAN2_PIN P2_06 //HE1 for FAN3 #endif #else #ifndef HEATER_1_PIN @@ -217,10 +217,10 @@ #endif #endif #ifndef FAN_PIN - #define FAN_PIN P2_04 + #define FAN_PIN P2_04 //FAN1 #endif -#ifndef FAN2_PIN - #define FAN2_PIN P1_04 +#ifndef FAN1_PIN + #define FAN1_PIN P1_04 //FAN2 #endif // From fe2f3cdbdeec0f4b7c203b141b4672877dc9be52 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Sep 2020 15:55:42 -0500 Subject: [PATCH 18/33] Update pins_MKS_SGEN_L_V2.h --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 7ebbca5742dc..b6f11a133daf 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -207,20 +207,20 @@ // #define HEATER_BED_PIN P2_05 #define HEATER_0_PIN P2_07 -#if HOTENDS == 1 - #ifndef FAN2_PIN - #define FAN2_PIN P2_06 //HE1 for FAN3 - #endif -#else +#if HAS_MULTI_HOTEND #ifndef HEATER_1_PIN #define HEATER_1_PIN P2_06 #endif +#else + #ifndef FAN2_PIN + #define FAN2_PIN P2_06 // HE1 for FAN3 + #endif #endif #ifndef FAN_PIN - #define FAN_PIN P2_04 //FAN1 + #define FAN_PIN P2_04 // FAN1 #endif #ifndef FAN1_PIN - #define FAN1_PIN P1_04 //FAN2 + #define FAN1_PIN P1_04 // FAN2 #endif // From b39f490c4f570aaae1d8c74206f92cb89618ff78 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 16 Oct 2020 09:38:49 +0800 Subject: [PATCH 19/33] Add RGB LED pin define for MKS SGEN_L V2 --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 e18f938dc45e..26cd094255df 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -227,9 +227,18 @@ // Misc. Functions // #define LED_PIN P1_18 // Used as a status indicator -#define LED2_PIN P1_19 -#define LED3_PIN P1_20 -#define LED4_PIN P1_21 +//#define LED2_PIN P1_19 +//#define LED3_PIN P1_20 +//#define LED4_PIN P1_21 + +// +// RGB LED +// +#if ENABLED(RGB_LED) + #define RGB_LED_R_PIN P1_19 + #define RGB_LED_G_PIN P1_20 + #define RGB_LED_B_PIN P1_21 +#endif /** * _____ _____ From b7ae0f9a96046124d579d9c3735ab08a5c35dd4a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Oct 2020 02:15:12 -0500 Subject: [PATCH 20/33] Update pins_MKS_SGEN_L_V2.h --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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 26cd094255df..1a558075b60e 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -227,17 +227,24 @@ // Misc. Functions // #define LED_PIN P1_18 // Used as a status indicator -//#define LED2_PIN P1_19 -//#define LED3_PIN P1_20 -//#define LED4_PIN P1_21 // // RGB LED // #if ENABLED(RGB_LED) - #define RGB_LED_R_PIN P1_19 - #define RGB_LED_G_PIN P1_20 - #define RGB_LED_B_PIN P1_21 + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN P1_19 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN P1_20 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN P1_21 + #endif +#else + #define LED2_PIN P1_19 // Initialized by HAL/LPC1768/main.cpp + #define LED3_PIN P1_20 + #define LED4_PIN P1_21 #endif /** From e64c05552adf2fe0aab799be2d45b84ddb624a36 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 20 Nov 2020 14:23:57 +0800 Subject: [PATCH 21/33] Add support for MKS Robin E3/E3D V1.1 motherboard --- Marlin/Configuration.h | 2 +- Marlin/src/core/boards.h | 2 + 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 | 187 ++++++++++++++++++ 6 files changed, 297 insertions(+), 1 deletion(-) 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/Configuration.h b/Marlin/Configuration.h index 9d2dd0b710ba..4d4decf70a6d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1743,7 +1743,7 @@ * SD Card support is disabled by default. If your controller has an SD slot, * you must uncomment the following option or it won't work. */ -//#define SDSUPPORT +#define SDSUPPORT /** * SD CARD: SPI SPEED diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e68ba196ee81..4193849df1ad 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -329,6 +329,8 @@ #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_MKS_ROBIN_E3_V1_1 4040 // MKS Robin E3 V1.1 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_E3D_V1_1 4041 // MKS Robin E3D V1.1 (STM32F103RCT6) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index af3b72475660..d6882ebe9b24 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -554,6 +554,10 @@ #include "stm32f1/pins_MKS_ROBIN_E3.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_E3_V1_1) + #include "stm32f1/pins_MKS_ROBIN_E3_V1_1.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..18b52b76203e --- /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 (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3D supports up to 1 hotends / E-steppers. 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..aef4c9956627 --- /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 (STM32F103RCT6) board pin assignments + */ + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin E3 supports up to 1 hotends / E-steppers. 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..2da5a3300442 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h @@ -0,0 +1,187 @@ +/** + * 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 & E3D (STM32F103RCT6) common board pin assignments + */ + +#if NOT_TARGET(__STM32F1__) + #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 +#define DISABLE_JTAG + +// +// EEPROM +// +// Onboard I2C EEPROM +#if NO_EEPROM_SELECTED + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x1000// 4KB + #undef NO_EEPROM_SELECTED +#endif + +// +// Servos +// +#define SERVO0_PIN PA3 + +// +// Limit Switches +// +#define X_STOP_PIN PA12 +#define Y_STOP_PIN PA11 +#define Z_MIN_PIN PC6 +#define Z_MAX_PIN PB1 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PC13 + +#define Y_STEP_PIN PC2 +#define Y_DIR_PIN PB9 +#define Y_ENABLE_PIN PB12 + +#define Z_STEP_PIN PC14 +#define Z_DIR_PIN PC15 +#define Z_ENABLE_PIN PB8 + +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB3 +#define E0_ENABLE_PIN PB5 + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL MSerial1 + //#define Y_HARDWARE_SERIAL MSerial1 + //#define Z_HARDWARE_SERIAL MSerial1 + //#define E0_HARDWARE_SERIAL MSerial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC7 + #define X_SERIAL_RX_PIN PC7 + + #define Y_SERIAL_TX_PIN PD2 + #define Y_SERIAL_RX_PIN PD2 + + #define Z_SERIAL_TX_PIN PC12 + #define Z_SERIAL_RX_PIN PC12 + + #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 +#endif + +// +// Heaters 0,1 / Fans / Bed +// +#define HEATER_0_PIN PC9 +#define FAN_PIN PA8 +#define HEATER_BED_PIN PC8 + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PA1 // TB +#define TEMP_0_PIN PA0 // TH1 + +#define FIL_RUNOUT_PIN PB10 // MT_DET + +/** + * _____ _____ _____ + * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND + * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) + * (LCD_D4) PA6 | 5 6 PA7 (LCD_D5) (BTN_EN2) PB0 | 5 6 PB15 (SD_MOSI) (LCD_D4) PA6 | 5 6 PB0 (BTN_EN2) + * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET RESET | 7 8 | PB11 (BTN_EN1) + * GND | 9 10| 5V GND | 9 10| NC (BTN_ENC) PC3 | 9 10| PC1 (BEEPER) + * ----- ----- ----- + * EXP1 EXP2 EXP3 + */ +#if HAS_WIRED_LCD + + #define BEEPER_PIN PC1 + #define BTN_ENC PC3 + #define LCD_PINS_ENABLE PA4 + #define LCD_PINS_RS PA5 + #define BTN_EN1 PB11 + #define BTN_EN2 PB0 + + // 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 PC4 + #define DOGLCD_CS PA7 + #define DOGLCD_SCK PB13 + #define DOGLCD_MOSI PB15 + + #else + + #define LCD_PINS_D4 PA6 + #if IS_ULTIPANEL + #define LCD_PINS_D5 PA7 + #define LCD_PINS_D6 PC4 + #define LCD_PINS_D7 PC5 + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_WIRED_LCD + +// +// SD Card +// +#define SPI_DEVICE 2 +#define SD_DETECT_PIN PC10 +#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 From 60a264a11a152e296157caa13ad12d520ed6c26e Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 20 Nov 2020 14:50:42 +0800 Subject: [PATCH 22/33] Update Configuration.h --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4d4decf70a6d..9d2dd0b710ba 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1743,7 +1743,7 @@ * SD Card support is disabled by default. If your controller has an SD slot, * you must uncomment the following option or it won't work. */ -#define SDSUPPORT +//#define SDSUPPORT /** * SD CARD: SPI SPEED From 0657f35bc05555a3f7a5736e2b61d63a75bd3328 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 00:52:23 -0600 Subject: [PATCH 23/33] Update pins.h --- Marlin/src/pins/pins.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 909a44491b00..676e1133102a 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -552,10 +552,10 @@ #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_E3D) - #include "stm32f1/pins_MKS_ROBIN_E3D.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) From 0a9b678b620553592b93e678328942c7d5b7783a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 01:06:24 -0600 Subject: [PATCH 24/33] Consolidate pins --- .../pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h | 2 +- .../stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h | 152 +----------------- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 10 +- 4 files changed, 11 insertions(+), 155 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h index 18b52b76203e..5739c2184018 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h @@ -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 v1.1 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_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h index aef4c9956627..bb134eb794ff 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.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 v1.1 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_V1_1_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h index 2da5a3300442..4eaf2e946939 100644 --- 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 @@ -21,21 +21,6 @@ */ #pragma once -/** - * MKS Robin E3 & E3D (STM32F103RCT6) common board pin assignments - */ - -#if NOT_TARGET(__STM32F1__) - #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 -#define DISABLE_JTAG - // // EEPROM // @@ -46,142 +31,9 @@ #undef NO_EEPROM_SELECTED #endif -// -// Servos -// -#define SERVO0_PIN PA3 - -// -// Limit Switches -// -#define X_STOP_PIN PA12 -#define Y_STOP_PIN PA11 -#define Z_MIN_PIN PC6 -#define Z_MAX_PIN PB1 - -// -// Steppers -// -#define X_STEP_PIN PC0 -#define X_DIR_PIN PB2 -#define X_ENABLE_PIN PC13 - -#define Y_STEP_PIN PC2 -#define Y_DIR_PIN PB9 -#define Y_ENABLE_PIN PB12 - #define Z_STEP_PIN PC14 #define Z_DIR_PIN PC15 -#define Z_ENABLE_PIN PB8 - -#define E0_STEP_PIN PB4 -#define E0_DIR_PIN PB3 -#define E0_ENABLE_PIN PB5 - -#if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below - */ - //#define X_HARDWARE_SERIAL MSerial1 - //#define Y_HARDWARE_SERIAL MSerial1 - //#define Z_HARDWARE_SERIAL MSerial1 - //#define E0_HARDWARE_SERIAL MSerial1 - - // - // Software serial - // - #define X_SERIAL_TX_PIN PC7 - #define X_SERIAL_RX_PIN PC7 - - #define Y_SERIAL_TX_PIN PD2 - #define Y_SERIAL_RX_PIN PD2 - - #define Z_SERIAL_TX_PIN PC12 - #define Z_SERIAL_RX_PIN PC12 - - #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 -#endif - -// -// Heaters 0,1 / Fans / Bed -// -#define HEATER_0_PIN PC9 -#define FAN_PIN PA8 -#define HEATER_BED_PIN PC8 - -// -// Temperature Sensors -// -#define TEMP_BED_PIN PA1 // TB -#define TEMP_0_PIN PA0 // TH1 - -#define FIL_RUNOUT_PIN PB10 // MT_DET - -/** - * _____ _____ _____ - * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND - * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) - * (LCD_D4) PA6 | 5 6 PA7 (LCD_D5) (BTN_EN2) PB0 | 5 6 PB15 (SD_MOSI) (LCD_D4) PA6 | 5 6 PB0 (BTN_EN2) - * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET RESET | 7 8 | PB11 (BTN_EN1) - * GND | 9 10| 5V GND | 9 10| NC (BTN_ENC) PC3 | 9 10| PC1 (BEEPER) - * ----- ----- ----- - * EXP1 EXP2 EXP3 - */ -#if HAS_WIRED_LCD - - #define BEEPER_PIN PC1 - #define BTN_ENC PC3 - #define LCD_PINS_ENABLE PA4 - #define LCD_PINS_RS PA5 - #define BTN_EN1 PB11 - #define BTN_EN2 PB0 +#define BTN_ENC_EN -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 PC4 - #define DOGLCD_CS PA7 - #define DOGLCD_SCK PB13 - #define DOGLCD_MOSI PB15 - - #else - - #define LCD_PINS_D4 PA6 - #if IS_ULTIPANEL - #define LCD_PINS_D5 PA7 - #define LCD_PINS_D6 PC4 - #define LCD_PINS_D7 PC5 - #endif - - #endif // !MKS_MINI_12864 - -#endif // HAS_WIRED_LCD - -// -// SD Card -// -#define SPI_DEVICE 2 -#define SD_DETECT_PIN PC10 -#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 +#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 9a2066358f8ee5391f77f7628a58a92aa170f8d7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 Nov 2020 01:10:18 -0600 Subject: [PATCH 25/33] Tweak comments --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h index 5739c2184018..0d927cf7cb6a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h @@ -22,7 +22,7 @@ #pragma once /** - * MKS Robin E3D (STM32F103RCT6) board pin assignments + * MKS Robin E3D v1.1 (STM32F103RCT6) board pin assignments */ #if HOTENDS > 1 || E_STEPPERS > 1 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 index bb134eb794ff..002c35fe54c1 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h @@ -22,7 +22,7 @@ #pragma once /** - * MKS Robin E3 (STM32F103RCT6) board pin assignments + * MKS Robin E3 v1.1 (STM32F103RCT6) board pin assignments */ #if HOTENDS > 1 || E_STEPPERS > 1 From c05e1ce0c8f522e157fbf80a043d1c75a9cdaf2e Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 22 Jan 2021 14:45:35 +0800 Subject: [PATCH 26/33] Update to the latest marlin --- .github/workflows/test-builds.yml | 2 +- .gitignore | 4 +- Makefile | 4 - Marlin/Configuration.h | 146 +- Marlin/Configuration_adv.h | 159 +- Marlin/Version.h | 4 +- Marlin/src/HAL/AVR/HAL.h | 7 + Marlin/src/HAL/AVR/HAL_SPI.cpp | 28 +- Marlin/src/HAL/AVR/endstop_interrupts.h | 34 +- Marlin/src/HAL/AVR/spi_pins.h | 16 +- Marlin/src/HAL/DUE/HAL.h | 18 +- Marlin/src/HAL/DUE/HAL_SPI.cpp | 88 +- .../dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp | 15 +- .../HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp | 3 - Marlin/src/HAL/DUE/fastio.h | 2 +- Marlin/src/HAL/DUE/inc/SanityCheck.h | 2 +- Marlin/src/HAL/DUE/spi_pins.h | 20 +- Marlin/src/HAL/DUE/timers.cpp | 2 +- Marlin/src/HAL/ESP32/HAL.h | 11 +- Marlin/src/HAL/ESP32/HAL_SPI.cpp | 6 +- Marlin/src/HAL/ESP32/Servo.h | 2 +- Marlin/src/HAL/ESP32/Tone.cpp | 59 + Marlin/src/HAL/ESP32/spi_pins.h | 8 +- Marlin/src/HAL/ESP32/timers.cpp | 2 +- Marlin/src/HAL/ESP32/timers.h | 9 + Marlin/src/HAL/LINUX/HAL.h | 5 - Marlin/src/HAL/LINUX/include/Arduino.h | 21 - Marlin/src/HAL/LINUX/main.cpp | 1 - Marlin/src/HAL/LINUX/spi_pins.h | 33 +- Marlin/src/HAL/LPC1768/HAL.h | 18 +- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 41 +- Marlin/src/HAL/LPC1768/eeprom_flash.cpp | 2 +- Marlin/src/HAL/LPC1768/endstop_interrupts.h | 26 +- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 10 +- Marlin/src/HAL/LPC1768/main.cpp | 6 +- Marlin/src/HAL/LPC1768/spi_pins.h | 28 +- Marlin/src/HAL/LPC1768/tft/xpt2046.h | 8 +- Marlin/src/HAL/LPC1768/timers.h | 2 +- .../u8g/u8g_com_HAL_LPC1768_hw_spi.cpp | 16 +- .../u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp | 8 +- .../u8g/u8g_com_HAL_LPC1768_sw_spi.cpp | 8 +- Marlin/src/HAL/SAMD51/HAL.h | 10 + Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp | 8 +- Marlin/src/HAL/SAMD51/fastio.h | 2 +- Marlin/src/HAL/SAMD51/spi_pins.h | 16 +- Marlin/src/HAL/SAMD51/timers.cpp | 2 +- Marlin/src/HAL/STM32/HAL.h | 37 +- Marlin/src/HAL/STM32/HAL_SPI.cpp | 27 +- Marlin/src/HAL/STM32/MarlinSPI.cpp | 13 +- Marlin/src/HAL/STM32/MarlinSerial.cpp | 5 +- .../src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp | 64 +- Marlin/src/HAL/STM32/eeprom_flash.cpp | 17 +- Marlin/src/HAL/STM32/eeprom_sdcard.cpp | 5 +- Marlin/src/HAL/STM32/fast_pwm.cpp | 2 + Marlin/src/HAL/STM32/fastio.h | 2 +- Marlin/src/HAL/STM32/inc/SanityCheck.h | 4 + Marlin/src/HAL/STM32/pinsDebug.h | 142 +- Marlin/src/HAL/STM32/spi_pins.h | 16 +- Marlin/src/HAL/STM32/tft/tft_fsmc.cpp | 67 +- Marlin/src/HAL/STM32/tft/tft_fsmc.h | 51 +- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 113 +- Marlin/src/HAL/STM32/tft/tft_spi.h | 7 + Marlin/src/HAL/STM32/tft/xpt2046.cpp | 24 +- Marlin/src/HAL/STM32/tft/xpt2046.h | 10 +- Marlin/src/HAL/STM32/timers.cpp | 185 +- Marlin/src/HAL/STM32/usb_host.cpp | 117 + Marlin/src/HAL/STM32/usb_host.h | 60 + Marlin/src/HAL/STM32/usb_serial.cpp | 3 +- Marlin/src/HAL/STM32/watchdog.cpp | 1 - Marlin/src/HAL/STM32F1/HAL.h | 45 +- Marlin/src/HAL/STM32F1/HAL_SPI.cpp | 4 +- Marlin/src/HAL/STM32F1/Servo.cpp | 2 +- .../STM32F1/dogm/u8g_com_stm32duino_swspi.cpp | 12 +- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 3 +- Marlin/src/HAL/STM32F1/eeprom_wired.cpp | 1 - Marlin/src/HAL/STM32F1/fastio.h | 6 +- Marlin/src/HAL/STM32F1/spi_pins.h | 20 +- Marlin/src/HAL/STM32F1/tft/xpt2046.h | 8 +- Marlin/src/HAL/TEENSY31_32/HAL.h | 11 - Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp | 14 +- Marlin/src/HAL/TEENSY31_32/fastio.h | 2 +- Marlin/src/HAL/TEENSY31_32/spi_pins.h | 8 +- Marlin/src/HAL/TEENSY35_36/HAL.h | 11 - Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp | 14 +- Marlin/src/HAL/TEENSY35_36/fastio.h | 2 +- Marlin/src/HAL/TEENSY35_36/spi_pins.h | 8 +- Marlin/src/HAL/TEENSY40_41/HAL.h | 11 - Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp | 14 +- Marlin/src/HAL/TEENSY40_41/spi_pins.h | 8 +- Marlin/src/HAL/shared/Marduino.h | 16 +- .../src/HAL/shared/backtrace/unwarm_arm.cpp | 5 +- .../src/HAL/shared/backtrace/unwarm_thumb.cpp | 5 +- .../src/HAL/shared/backtrace/unwarmbytab.cpp | 69 +- Marlin/src/HAL/shared/progmem.h | 189 ++ Marlin/src/MarlinCore.cpp | 157 +- Marlin/src/MarlinCore.h | 13 - Marlin/src/core/boards.h | 42 +- Marlin/src/core/language.h | 4 +- Marlin/src/core/macros.h | 14 +- Marlin/src/core/multi_language.h | 29 +- Marlin/src/core/types.h | 1 - Marlin/src/feature/backlash.cpp | 10 +- Marlin/src/feature/bedlevel/abl/abl.cpp | 2 +- Marlin/src/feature/bedlevel/bedlevel.h | 4 + .../bedlevel/mbl/mesh_bed_leveling.cpp | 4 +- Marlin/src/feature/bedlevel/ubl/ubl.cpp | 35 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 63 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 27 +- .../src/feature/bedlevel/ubl/ubl_motion.cpp | 45 +- Marlin/src/feature/bltouch.cpp | 11 +- Marlin/src/feature/bltouch.h | 17 +- Marlin/src/feature/dac/dac_dac084s085.cpp | 2 +- .../src/feature/digipot/digipot_mcp4018.cpp | 18 +- Marlin/src/feature/direct_stepping.h | 4 +- Marlin/src/feature/e_parser.h | 2 - Marlin/src/feature/encoder_i2c.cpp | 11 +- Marlin/src/feature/fwretract.cpp | 2 +- Marlin/src/feature/joystick.cpp | 6 +- Marlin/src/feature/joystick.h | 1 - Marlin/src/feature/leds/leds.h | 2 +- Marlin/src/feature/leds/neopixel.h | 3 + Marlin/src/feature/leds/pca9632.cpp | 48 +- Marlin/src/feature/mmu/mmu2.cpp | 19 +- Marlin/src/feature/pause.cpp | 69 +- Marlin/src/feature/pause.h | 6 +- Marlin/src/feature/power.cpp | 2 +- Marlin/src/feature/power_monitor.cpp | 4 +- Marlin/src/feature/power_monitor.h | 4 +- Marlin/src/feature/powerloss.cpp | 68 +- Marlin/src/feature/powerloss.h | 8 +- Marlin/src/feature/repeat.cpp | 81 + Marlin/src/feature/repeat.h | 53 + Marlin/src/feature/runout.cpp | 3 +- Marlin/src/feature/runout.h | 8 +- Marlin/src/feature/solenoid.cpp | 45 +- Marlin/src/feature/spindle_laser.cpp | 26 +- Marlin/src/feature/spindle_laser.h | 43 +- Marlin/src/feature/spindle_laser_types.h | 18 +- Marlin/src/feature/tmc_util.cpp | 8 +- Marlin/src/feature/tramming.cpp | 69 + Marlin/src/feature/tramming.h | 23 +- Marlin/src/feature/twibus.cpp | 10 + Marlin/src/feature/twibus.h | 13 + Marlin/src/feature/z_stepper_align.cpp | 26 +- Marlin/src/gcode/bedlevel/G35.cpp | 27 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 41 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 2 +- Marlin/src/gcode/calibrate/G28.cpp | 37 +- Marlin/src/gcode/calibrate/G34.cpp | 7 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 35 +- Marlin/src/gcode/calibrate/G425.cpp | 8 +- Marlin/src/gcode/calibrate/G76_M192_M871.cpp | 36 +- Marlin/src/gcode/calibrate/M48.cpp | 1 + Marlin/src/gcode/config/M220.cpp | 8 +- Marlin/src/gcode/control/M108_M112_M410.cpp | 3 +- Marlin/src/gcode/control/M226.cpp | 2 + Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/gcode/control/M42.cpp | 4 + Marlin/src/gcode/control/T.cpp | 18 +- .../src/gcode/feature/controllerfan/M710.cpp | 4 +- .../src/gcode/feature/filwidth/M404-M407.cpp | 1 - Marlin/src/gcode/feature/i2c/M260_M261.cpp | 2 +- Marlin/src/gcode/feature/pause/G61.cpp | 11 +- Marlin/src/gcode/feature/pause/M125.cpp | 9 +- Marlin/src/gcode/feature/pause/M600.cpp | 11 +- Marlin/src/gcode/feature/pause/M701_M702.cpp | 25 +- .../src/gcode/feature/power_monitor/M430.cpp | 4 +- Marlin/src/gcode/gcode.cpp | 41 +- Marlin/src/gcode/gcode.h | 12 +- Marlin/src/gcode/host/M115.cpp | 3 + Marlin/src/gcode/host/M118.cpp | 2 +- Marlin/src/gcode/lcd/M414.cpp | 44 + Marlin/src/gcode/motion/G2_G3.cpp | 45 +- Marlin/src/gcode/motion/M290.cpp | 1 - Marlin/src/gcode/probe/M401_M402.cpp | 1 + Marlin/src/gcode/queue.cpp | 35 +- Marlin/src/gcode/sd/M1001.cpp | 18 +- Marlin/src/gcode/sd/M21_M22.cpp | 6 +- Marlin/src/gcode/sd/M808.cpp | 51 + Marlin/src/gcode/temp/M104_M109.cpp | 6 +- Marlin/src/inc/Conditionals_LCD.h | 76 +- Marlin/src/inc/Conditionals_adv.h | 33 +- Marlin/src/inc/Conditionals_post.h | 80 +- Marlin/src/inc/MarlinConfig.h | 2 + Marlin/src/inc/SanityCheck.h | 104 +- Marlin/src/inc/Version.h | 6 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 20 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 39 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h | 11 +- Marlin/src/lcd/buttons.h | 234 ++ Marlin/src/lcd/dogm/HAL_LCD_class_defines.h | 13 + Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 2 + Marlin/src/lcd/dogm/dogm_Bootscreen.h | 15 + Marlin/src/lcd/dogm/fontdata/langdata_sk.h | 9 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 51 +- Marlin/src/lcd/dogm/marlinui_DOGM.h | 22 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 29 +- .../lcd/dogm/status_screen_lite_ST7920.cpp | 11 +- .../u8g_dev_ssd1306_sh1106_128x64_I2C.cpp | 3 +- Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp | 128 + .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 22 +- Marlin/src/lcd/dwin/dwin_lcd.cpp | 15 +- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 188 +- Marlin/src/lcd/dwin/e3v2/dwin.h | 4 +- Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp | 144 +- Marlin/src/lcd/dwin/e3v2/rotary_encoder.h | 24 +- 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/anycubic_chiron/FileNavigator.cpp | 2 + .../extui/lib/anycubic_chiron/chiron_tft.cpp | 29 +- .../lib/anycubic_chiron/chiron_tft_defs.h | 4 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 33 +- Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp | 2 - Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h | 5 +- .../extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp | 2 +- .../extui/lib/dgus/hiprecy/DGUSDisplayDef.h | 2 + .../extui/lib/dgus/origin/DGUSDisplayDef.cpp | 2 +- .../extui/lib/dgus/origin/DGUSDisplayDef.h | 2 + .../archim2-flash/media_file_reader.cpp | 2 +- .../ftdi_eve_lib/basic/commands.cpp | 8 + .../ftdi_eve_lib/basic/commands.h | 1 + .../ftdi_eve_lib/basic/resolutions.h | 2 +- .../ftdi_eve_lib/basic/spi.cpp | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_lib/compat.h | 4 + .../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 | 3 +- .../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 | 6 +- .../ftdi_eve_lib/extended/text_box.cpp | 4 +- .../ftdi_eve_lib/extended/text_ellipsis.cpp | 25 +- .../ftdi_eve_lib/extended/tiny_timer.cpp | 14 +- .../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 | 8 +- .../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 | 15 +- .../extended/unicode/western_char_set.cpp | 27 +- .../extended/unicode/western_char_set.h | 4 +- .../ftdi_eve_lib/extras/bitmap2cpp.py | 10 +- .../ftdi_eve_touch_ui/language/language_en.h | 26 +- .../lib/ftdi_eve_touch_ui/marlin_events.cpp | 13 +- .../screens/advanced_settings_menu.cpp | 36 +- .../screens/alert_dialog_box.cpp | 6 +- .../base_numeric_adjustment_screen.cpp | 34 +- .../screens/bed_mesh_screen.cpp | 57 +- .../screens/bio_advanced_settings.cpp | 28 +- .../screens/bio_main_menu.cpp | 18 +- .../screens/bio_printing_dialog_box.cpp | 2 +- .../screens/bio_status_screen.cpp | 187 +- .../screens/bio_tune_menu.cpp | 14 +- .../ftdi_eve_touch_ui/screens/boot_screen.cpp | 8 +- .../screens/change_filament_screen.cpp | 209 +- .../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} | 74 +- ...een.cpp => cocoa_press_preheat_screen.cpp} | 74 +- .../screens/cocoa_press_status_screen.cpp | 307 ++ .../screens/cocoa_press_ui.h | 54 + .../screens/cocoa_press_unload_cartridge.cpp | 101 + .../confirm_start_print_dialog_box.cpp | 4 +- .../confirm_user_request_alert_box.cpp | 14 +- .../screens/custom_user_menus.cpp | 215 ++ .../screens/default_acceleration_screen.cpp | 2 +- .../screens/developer_menu.cpp | 38 +- .../screens/dialog_box_base_class.cpp | 8 +- .../screens/endstop_state_screen.cpp | 4 +- .../screens/filament_menu.cpp | 2 +- .../screens/files_screen.cpp | 76 +- .../screens/interface_settings_screen.cpp | 22 +- .../screens/interface_sounds_screen.cpp | 10 +- .../screens/leveling_menu.cpp | 21 +- .../ftdi_eve_touch_ui/screens/lock_screen.cpp | 24 +- .../ftdi_eve_touch_ui/screens/main_menu.cpp | 86 +- .../screens/media_player_screen.cpp | 2 +- .../screens/move_axis_screen.cpp | 44 +- .../screens/nudge_nozzle_screen.cpp | 36 +- .../ftdi_eve_touch_ui/screens/screen_data.h | 26 +- .../lib/ftdi_eve_touch_ui/screens/screens.cpp | 135 +- .../lib/ftdi_eve_touch_ui/screens/screens.h | 265 +- .../screens/spinner_dialog_box.cpp | 8 +- .../screens/status_screen.cpp | 201 +- .../screens/stress_test_screen.cpp | 14 +- .../screens/temperature_screen.cpp | 19 +- .../screens/touch_calibration_screen.cpp | 3 + .../screens/touch_registers_screen.cpp | 26 +- .../ftdi_eve_touch_ui/screens/tune_menu.cpp | 36 +- .../screens/widget_demo_screen.cpp | 4 +- .../screens/z_offset_screen.cpp | 2 +- .../extui/lib/ftdi_eve_touch_ui/theme/fonts.h | 6 +- .../lcd/extui/lib/mks_ui/SPIFlashStorage.cpp | 2 - Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 2 - .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 11 +- Marlin/src/lcd/extui/lib/mks_ui/draw_about.h | 3 +- .../lib/mks_ui/draw_acceleration_settings.cpp | 10 +- .../lib/mks_ui/draw_acceleration_settings.h | 2 +- .../lib/mks_ui/draw_advance_settings.cpp | 2 +- .../extui/lib/mks_ui/draw_advance_settings.h | 2 +- .../draw_auto_level_offset_settings.cpp | 2 +- .../mks_ui/draw_auto_level_offset_settings.h | 2 +- .../extui/lib/mks_ui/draw_baby_stepping.cpp | 5 +- .../lcd/extui/lib/mks_ui/draw_baby_stepping.h | 3 +- .../extui/lib/mks_ui/draw_change_speed.cpp | 18 +- .../lcd/extui/lib/mks_ui/draw_change_speed.h | 3 +- .../lcd/extui/lib/mks_ui/draw_cloud_bind.cpp | 205 ++ .../extui/lib/mks_ui/draw_cloud_bind.h} | 23 +- .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 118 +- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h | 3 +- .../extui/lib/mks_ui/draw_eeprom_settings.cpp | 2 +- .../extui/lib/mks_ui/draw_eeprom_settings.h | 2 +- .../lib/mks_ui/draw_encoder_settings.cpp | 2 +- .../extui/lib/mks_ui/draw_encoder_settings.h | 2 +- .../extui/lib/mks_ui/draw_error_message.cpp | 23 - .../lcd/extui/lib/mks_ui/draw_error_message.h | 1 - .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 16 +- .../src/lcd/extui/lib/mks_ui/draw_extrusion.h | 3 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 29 +- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h | 3 +- .../extui/lib/mks_ui/draw_filament_change.cpp | 14 +- .../extui/lib/mks_ui/draw_filament_change.h | 3 +- .../lib/mks_ui/draw_filament_settings.cpp | 10 +- .../extui/lib/mks_ui/draw_filament_settings.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 22 +- Marlin/src/lcd/extui/lib/mks_ui/draw_home.h | 3 +- .../draw_homing_sensitivity_settings.cpp | 2 +- .../mks_ui/draw_homing_sensitivity_settings.h | 2 +- .../extui/lib/mks_ui/draw_jerk_settings.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_jerk_settings.h | 2 +- .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 23 +- .../lcd/extui/lib/mks_ui/draw_language.cpp | 6 +- .../src/lcd/extui/lib/mks_ui/draw_language.h | 3 +- .../extui/lib/mks_ui/draw_level_settings.cpp | 7 +- .../extui/lib/mks_ui/draw_level_settings.h | 2 +- .../extui/lib/mks_ui/draw_machine_para.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_machine_para.h | 2 +- .../lib/mks_ui/draw_machine_settings.cpp | 2 +- .../extui/lib/mks_ui/draw_machine_settings.h | 2 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 70 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.h | 3 +- .../mks_ui/draw_manual_level_pos_settings.cpp | 38 +- .../mks_ui/draw_manual_level_pos_settings.h | 2 +- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 32 +- .../lib/mks_ui/draw_max_feedrate_settings.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp | 170 ++ Marlin/src/lcd/extui/lib/mks_ui/draw_more.h | 33 + .../extui/lib/mks_ui/draw_motor_settings.cpp | 8 +- .../extui/lib/mks_ui/draw_motor_settings.h | 2 +- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 114 +- .../lcd/extui/lib/mks_ui/draw_move_motor.h | 3 +- .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 7 +- .../lcd/extui/lib/mks_ui/draw_number_key.h | 2 +- .../lcd/extui/lib/mks_ui/draw_operation.cpp | 11 +- .../src/lcd/extui/lib/mks_ui/draw_operation.h | 3 +- .../extui/lib/mks_ui/draw_pause_message.cpp | 4 - .../lcd/extui/lib/mks_ui/draw_pause_message.h | 1 - .../extui/lib/mks_ui/draw_pause_position.cpp | 13 +- .../extui/lib/mks_ui/draw_pause_position.h | 2 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 8 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.h | 3 +- .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 28 +- .../lcd/extui/lib/mks_ui/draw_print_file.h | 12 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 27 +- .../src/lcd/extui/lib/mks_ui/draw_printing.h | 3 +- .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 61 +- .../lcd/extui/lib/mks_ui/draw_ready_print.h | 3 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 40 +- Marlin/src/lcd/extui/lib/mks_ui/draw_set.h | 3 +- .../extui/lib/mks_ui/draw_step_settings.cpp | 31 +- .../lcd/extui/lib/mks_ui/draw_step_settings.h | 2 +- .../lib/mks_ui/draw_tmc_current_settings.cpp | 33 +- .../lib/mks_ui/draw_tmc_current_settings.h | 2 +- .../mks_ui/draw_tmc_step_mode_settings.cpp | 14 +- .../lib/mks_ui/draw_tmc_step_mode_settings.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 35 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h | 3 +- .../lib/mks_ui/draw_touch_calibration.cpp | 4 +- .../extui/lib/mks_ui/draw_touch_calibration.h | 1 - Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 515 +--- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 68 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 61 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.h | 2 +- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 9 +- .../src/lcd/extui/lib/mks_ui/draw_wifi_list.h | 2 +- .../extui/lib/mks_ui/draw_wifi_settings.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_wifi_settings.h | 2 +- .../lcd/extui/lib/mks_ui/draw_wifi_tips.cpp | 2 +- .../src/lcd/extui/lib/mks_ui/draw_wifi_tips.h | 2 +- .../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 10 - .../src/lcd/extui/lib/mks_ui/irq_overrid.cpp | 20 +- .../extui/lib/mks_ui/mks_hardware_test.cpp | 20 +- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 75 +- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h | 4 +- .../extui/lib/mks_ui/printer_operation.cpp | 21 +- .../lcd/extui/lib/mks_ui/tft_Language_en.h | 55 +- .../lcd/extui/lib/mks_ui/tft_Language_fr.h | 38 +- .../lcd/extui/lib/mks_ui/tft_Language_it.h | 28 +- .../lcd/extui/lib/mks_ui/tft_Language_ru.h | 200 +- .../lcd/extui/lib/mks_ui/tft_Language_s_cn.h | 123 +- .../lcd/extui/lib/mks_ui/tft_Language_sp.h | 59 +- .../lcd/extui/lib/mks_ui/tft_Language_t_cn.h | 25 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 134 +- .../extui/lib/mks_ui/tft_lvgl_configuration.h | 8 +- .../extui/lib/mks_ui/tft_multi_language.cpp | 349 ++- .../lcd/extui/lib/mks_ui/tft_multi_language.h | 53 +- .../src/lcd/extui/lib/mks_ui/wifiSerial.cpp | 29 +- Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h | 10 +- .../src/lcd/extui/lib/mks_ui/wifi_module.cpp | 745 ++--- Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h | 27 +- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 480 ++-- Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h | 8 +- Marlin/src/lcd/extui/malyan_lcd.cpp | 13 +- Marlin/src/lcd/extui/ui_api.cpp | 24 +- Marlin/src/lcd/extui/ui_api.h | 20 +- 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 | 6 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_de.h | 16 +- Marlin/src/lcd/language/language_el.h | 2 +- Marlin/src/lcd/language/language_el_gr.h | 2 +- Marlin/src/lcd/language/language_en.h | 41 +- Marlin/src/lcd/language/language_es.h | 16 +- Marlin/src/lcd/language/language_eu.h | 2 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 37 +- Marlin/src/lcd/language/language_gl.h | 16 +- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 34 +- Marlin/src/lcd/language/language_it.h | 100 +- Marlin/src/lcd/language/language_jp_kana.h | 2 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 6 +- Marlin/src/lcd/language/language_pt.h | 16 +- Marlin/src/lcd/language/language_pt_br.h | 16 +- Marlin/src/lcd/language/language_ro.h | 16 +- Marlin/src/lcd/language/language_ru.h | 93 +- Marlin/src/lcd/language/language_sk.h | 20 +- Marlin/src/lcd/language/language_sv.h | 681 +++++ Marlin/src/lcd/language/language_tr.h | 16 +- Marlin/src/lcd/language/language_uk.h | 322 ++- Marlin/src/lcd/language/language_zh_CN.h | 16 +- Marlin/src/lcd/language/language_zh_TW.h | 6 +- Marlin/src/lcd/lcdprint.cpp | 1 + Marlin/src/lcd/lcdprint.h | 18 +- Marlin/src/lcd/marlinui.cpp | 172 +- Marlin/src/lcd/marlinui.h | 229 +- Marlin/src/lcd/menu/menu.cpp | 3 +- Marlin/src/lcd/menu/menu.h | 2 + Marlin/src/lcd/menu/menu_advanced.cpp | 26 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 292 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 12 +- Marlin/src/lcd/menu/menu_configuration.cpp | 4 +- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 2 + Marlin/src/lcd/menu/menu_filament.cpp | 8 +- Marlin/src/lcd/menu/menu_item.h | 4 +- Marlin/src/lcd/menu/menu_language.cpp | 59 + Marlin/src/lcd/menu/menu_main.cpp | 23 +- Marlin/src/lcd/menu/menu_mixer.cpp | 9 + Marlin/src/lcd/menu/menu_motion.cpp | 28 +- Marlin/src/lcd/menu/menu_power_monitor.cpp | 4 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 34 +- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 32 +- Marlin/src/lcd/menu/menu_temperature.cpp | 4 +- Marlin/src/lcd/menu/menu_tmc.cpp | 2 +- Marlin/src/lcd/menu/menu_tramming.cpp | 37 +- Marlin/src/lcd/menu/menu_tune.cpp | 10 +- Marlin/src/lcd/menu/menu_ubl.cpp | 82 +- Marlin/src/lcd/tft/canvas.cpp | 2 +- Marlin/src/lcd/tft/tft.h | 11 + Marlin/src/lcd/tft/tft_image.cpp | 14 +- Marlin/src/lcd/tft/tft_image.h | 16 +- Marlin/src/lcd/tft/tft_queue.cpp | 28 +- Marlin/src/lcd/tft/ui_320x240.cpp | 88 +- Marlin/src/lcd/tft/ui_320x240.h | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 154 +- Marlin/src/lcd/tft/ui_480x320.h | 15 +- Marlin/src/lcd/tft_io/ssd1963.h | 6 +- Marlin/src/lcd/tft_io/tft_io.h | 16 +- Marlin/src/lcd/tft_io/touch_calibration.cpp | 44 +- Marlin/src/lcd/tft_io/touch_calibration.h | 6 + Marlin/src/lcd/touch/touch_buttons.cpp | 8 +- Marlin/src/libs/BL24CXX.cpp | 1 - Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 15 +- Marlin/src/libs/L64XX/README.md | 2 +- Marlin/src/libs/W25Qxx.cpp | 117 +- Marlin/src/libs/buzzer.h | 1 + .../src/libs/heatshrink/heatshrink_common.h | 2 +- Marlin/src/libs/nozzle.cpp | 17 + Marlin/src/libs/numtostr.cpp | 16 +- Marlin/src/libs/numtostr.h | 5 +- Marlin/src/libs/private_spi.h | 8 +- Marlin/src/module/endstops.cpp | 25 +- Marlin/src/module/endstops.h | 8 + Marlin/src/module/motion.cpp | 184 +- Marlin/src/module/motion.h | 74 +- Marlin/src/module/planner.cpp | 17 +- Marlin/src/module/planner.h | 4 +- Marlin/src/module/probe.cpp | 159 +- Marlin/src/module/probe.h | 111 +- Marlin/src/module/settings.cpp | 88 +- Marlin/src/module/stepper.cpp | 12 +- Marlin/src/module/stepper/indirection.h | 8 +- Marlin/src/module/temperature.cpp | 88 +- Marlin/src/module/temperature.h | 14 +- Marlin/src/module/thermistor/thermistors.h | 2 + Marlin/src/module/tool_change.cpp | 219 +- Marlin/src/module/tool_change.h | 18 +- Marlin/src/pins/esp32/pins_E4D.h | 8 +- Marlin/src/pins/esp32/pins_FYSETC_E4.h | 8 +- Marlin/src/pins/esp32/pins_MRR_ESPA.h | 8 +- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 12 +- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 14 +- Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h | 16 +- Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 10 +- Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h | 10 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 187 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 108 +- Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 16 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 39 +- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 12 +- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 39 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 34 +- .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 16 +- .../src/pins/lpc1769/pins_COHESION3D_REMIX.h | 21 +- Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 25 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 10 +- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 8 +- Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h | 8 +- Marlin/src/pins/mega/pins_CNCONTROLS_11.h | 6 +- Marlin/src/pins/mega/pins_CNCONTROLS_12.h | 6 +- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 8 +- Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 8 +- Marlin/src/pins/mega/pins_MEGATRONICS_2.h | 8 +- Marlin/src/pins/mega/pins_MEGATRONICS_3.h | 8 +- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 1 + Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h | 4 +- Marlin/src/pins/pins.h | 130 +- Marlin/src/pins/pinsDebug_list.h | 24 +- Marlin/src/pins/rambo/pins_RAMBO.h | 8 +- Marlin/src/pins/ramps/pins_3DRAG.h | 2 +- Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 2 +- .../src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h | 6 +- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 3 +- Marlin/src/pins/ramps/pins_K8200.h | 2 +- Marlin/src/pins/ramps/pins_K8600.h | 4 +- Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 118 + Marlin/src/pins/ramps/pins_RAMPS.h | 14 +- Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 2 +- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 14 +- Marlin/src/pins/ramps/pins_ULTIMAIN_2.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER.h | 10 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 10 +- Marlin/src/pins/ramps/pins_ZRIB_V20.h | 6 +- Marlin/src/pins/sam/pins_ARCHIM1.h | 6 +- Marlin/src/pins/sam/pins_ARCHIM2.h | 6 +- Marlin/src/pins/sam/pins_CNCONTROLS_15D.h | 6 +- Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h | 6 +- Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h | 6 +- Marlin/src/pins/samd/pins_RAMPS_144.h | 14 +- Marlin/src/pins/sanguino/pins_ANET_10.h | 6 - .../src/pins/sanguino/pins_MELZI_CREALITY.h | 8 +- .../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 8 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 12 +- Marlin/src/pins/stm32f0/pins_MALYAN_M300.h | 2 +- Marlin/src/pins/stm32f1/pins_BEAST.h | 146 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h | 183 ++ Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 12 +- .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h | 14 + .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h | 4 +- .../pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h | 30 +- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 16 +- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 16 +- .../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 10 +- Marlin/src/pins/stm32f1/pins_CHITU3D.h | 14 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 8 +- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 8 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 50 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 208 ++ Marlin/src/pins/stm32f1/pins_CREALITY_V427.h | 8 +- Marlin/src/pins/stm32f1/pins_CREALITY_V431.h | 39 + Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 38 + Marlin/src/pins/stm32f1/pins_CREALITY_V453.h | 38 + Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h | 113 + Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 110 +- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 10 +- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 18 +- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 24 +- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 18 +- Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 18 +- Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 18 +- Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 18 +- .../src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 4 +- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 +- Marlin/src/pins/stm32f1/pins_MALYAN_M200.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 175 +- 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 | 16 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 10 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 10 +- .../src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 8 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 14 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 17 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 13 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 10 +- Marlin/src/pins/stm32f1/pins_MORPHEUS.h | 3 +- Marlin/src/pins/stm32f1/pins_STM32F1R.h | 147 +- Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 148 +- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 20 +- Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 222 ++ Marlin/src/pins/stm32f4/pins_ANET_ET4P.h | 34 + .../src/pins/stm32f4/pins_BLACK_STM32F407VE.h | 6 +- .../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 10 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 62 +- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 9 +- Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 16 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 68 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h | 1 - Marlin/src/pins/stm32f4/pins_LERDGE_K.h | 12 +- Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 100 +- Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 14 +- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 358 +++ .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 371 +++ Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 8 +- .../src/pins/stm32f4/pins_STEVAL_3DP001V1.h | 18 +- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 14 +- Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h | 13 +- Marlin/src/pins/stm32f7/pins_REMRAM_V1.h | 2 +- Marlin/src/pins/teensy2/pins_SAV_MKI.h | 2 +- Marlin/src/pins/teensy3/pins_TEENSY35_36.h | 6 +- Marlin/src/sd/SdBaseFile.cpp | 8 +- Marlin/src/sd/cardreader.cpp | 128 +- Marlin/src/sd/cardreader.h | 17 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 20 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.h | 41 +- .../sd/usb_flashdrive/lib-uhs2/usbhost.cpp | 8 +- .../lib-uhs3/UHS_host/UHS_macros.h | 164 +- .../share/PlatformIO/boards/fysetc_f6.json | 34 + .../boards/genericSTM32F407VGT6.json | 56 + .../PlatformIO/scripts/anet_et4_openblt.py | 14 + .../PlatformIO/scripts/common-dependencies.py | 52 +- .../PlatformIO/scripts/stm32_bootloader.py | 10 +- .../variants/BIGTREE_GTR_V1/hal_conf_extra.h | 2 +- .../BIGTREE_SKR_PRO_1v1/hal_conf_extra.h | 2 +- .../variants/CHITU_F103/board/board.h | 3 - .../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 ++ .../variants/MARLIN_FYSETC_S6/variant.h | 4 +- buildroot/share/fonts/genallfont.sh | 4 +- buildroot/share/git/mftest | 11 +- buildroot/test-gcode/M808-loops.gcode | 16 + buildroot/tests/BIGTREE_GTR_V1_0-tests | 3 +- buildroot/tests/BIGTREE_SKR_PRO-tests | 9 + buildroot/tests/DUE-tests | 3 +- buildroot/tests/FYSETC_F6-tests | 80 + buildroot/tests/FYSETC_F6_13-tests | 18 - buildroot/tests/LPC1768-tests | 3 +- buildroot/tests/LPC1769-tests | 21 +- buildroot/tests/STM32F103RC_btt-tests | 4 - buildroot/tests/STM32F103RET6_creality-tests | 14 + buildroot/tests/STM32F103RE_btt_USB-tests | 12 + buildroot/tests/STM32F103VE_longer-tests | 11 +- buildroot/tests/mega2560-tests | 125 +- buildroot/tests/mks_robin-tests | 8 + buildroot/tests/mks_robin_nano35-tests | 15 +- buildroot/tests/rambo-tests | 54 +- buildroot/tests/sanguino1284p-tests | 6 +- platformio.ini | 312 +- 693 files changed, 19429 insertions(+), 8626 deletions(-) create mode 100644 Marlin/src/HAL/ESP32/Tone.cpp create mode 100644 Marlin/src/HAL/STM32/usb_host.cpp create mode 100644 Marlin/src/HAL/STM32/usb_host.h create mode 100644 Marlin/src/HAL/shared/progmem.h create mode 100644 Marlin/src/feature/repeat.cpp create mode 100644 Marlin/src/feature/repeat.h create mode 100644 Marlin/src/feature/tramming.cpp create mode 100644 Marlin/src/gcode/lcd/M414.cpp create mode 100644 Marlin/src/gcode/sd/M808.cpp create mode 100644 Marlin/src/lcd/buttons.h create mode 100644 Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp 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 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} (54%) rename Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/{preheat_timer_screen.cpp => cocoa_press_preheat_screen.cpp} (53%) 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 create mode 100644 Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/custom_user_menus.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.cpp rename Marlin/src/{pins/ramps/pins_LONGER3D_LK4PRO.h => lcd/extui/lib/mks_ui/draw_cloud_bind.h} (71%) create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp create mode 100644 Marlin/src/lcd/extui/lib/mks_ui/draw_more.h create mode 100644 Marlin/src/lcd/language/language_sv.h create mode 100644 Marlin/src/lcd/menu/menu_language.cpp create mode 100644 Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h create mode 100644 Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V431.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V452.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V453.h create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h create mode 100644 Marlin/src/pins/stm32f4/pins_ANET_ET4.h create mode 100644 Marlin/src/pins/stm32f4/pins_ANET_ET4P.h create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h create mode 100644 buildroot/share/PlatformIO/boards/fysetc_f6.json create mode 100644 buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json create mode 100644 buildroot/share/PlatformIO/scripts/anet_et4_openblt.py 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 create mode 100644 buildroot/test-gcode/M808-loops.gcode create mode 100644 buildroot/tests/FYSETC_F6-tests delete mode 100644 buildroot/tests/FYSETC_F6_13-tests 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/.gitignore b/.gitignore index 62f73a7c0d00..f7d49cc1ed28 100755 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,9 @@ # along with this program. If not, see . # -# Our automatic versioning scheme generates the following file -# NEVER put it in the repository +# Generated files _Version.h +bdf2u8g # # OS 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/Marlin/Configuration.h b/Marlin/Configuration.h index c64569d2bf91..d86c4484417c 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 @@ -896,11 +896,6 @@ */ //#define BLTOUCH -/** - * Pressure sensor with a BLTouch-like interface - */ -//#define CREALITY_TOUCH - /** * Touch-MI Probe by hotends.fr * @@ -954,10 +949,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 @@ -991,11 +996,38 @@ #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) +/** + * 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 * @@ -1057,6 +1089,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 @@ -1099,8 +1138,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, ... @@ -1274,10 +1313,21 @@ //#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 + */ +//#define PREHEAT_BEFORE_LEVELING +#if ENABLED(PREHEAT_BEFORE_LEVELING) + #define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time + #define LEVELING_BED_TEMP 50 +#endif /** * Enable detailed logging of G28, G29, M48, etc. @@ -1291,6 +1341,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 @@ -1392,6 +1445,31 @@ #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 + + /** + * Corner Leveling Order + * + * Set 2 or 4 points. When 2 points are given, the 3rd is the center of the opposite edge. + * + * LF Left-Front RF Right-Front + * LB Left-Back RB Right-Back + * + * Examples: + * + * Default {LF,RB,LB,RF} {LF,RF} {LB,LF} + * LB --------- RB LB --------- RB LB --------- RB LB --------- RB + * | 4 3 | | 3 2 | | <3> | | 1 | + * | | | | | | | <3>| + * | 1 2 | | 1 4 | | 1 2 | | 2 | + * LF --------- RF LF --------- RF LF --------- RF LF --------- RF + */ + #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, RB, LB } #endif /** @@ -1428,8 +1506,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 @@ -1637,6 +1714,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" @@ -1716,9 +1797,9 @@ * Select the language to display on the LCD. These languages are available: * * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it, - * jp_kana, ko_KR, nl, pl, pt, pt_br, ro, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * jp_kana, ko_KR, nl, pl, pt, pt_br, ro, ru, sk, sv, tr, uk, vi, zh_CN, zh_TW * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)' } */ #define LCD_LANGUAGE en @@ -1761,16 +1842,6 @@ */ //#define SDSUPPORT -/** - * SD CARD: SPI SPEED - * - * Enable one of the following items for a slower SPI transfer speed. - * This may be required to resolve "volume init" errors. - */ -//#define SPI_SPEED SPI_HALF_SPEED -//#define SPI_SPEED SPI_QUARTER_SPEED -//#define SPI_SPEED SPI_EIGHTH_SPEED - /** * SD CARD: ENABLE CRC * @@ -2301,6 +2372,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 // @@ -2333,6 +2414,10 @@ //#define TFT_COLOR_UI //#define TFT_LVGL_UI +#if ENABLED(TFT_LVGL_UI) + //#define MKS_WIFI_MODULE // MKS WiFi module +#endif + /** * TFT Rotation. Set to one of the following values: * @@ -2366,6 +2451,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/Configuration_adv.h b/Marlin/Configuration_adv.h index 7c8f2da948c6..714150d240cc 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -552,7 +552,7 @@ //#define X_DUAL_STEPPER_DRIVERS #if ENABLED(X_DUAL_STEPPER_DRIVERS) - #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define INVERT_X2_VS_X_DIR // Enable if X2 direction signal is opposite to X //#define X_DUAL_ENDSTOPS #if ENABLED(X_DUAL_ENDSTOPS) #define X2_USE_ENDSTOP _XMAX_ @@ -562,7 +562,7 @@ //#define Y_DUAL_STEPPER_DRIVERS #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define INVERT_Y2_VS_Y_DIR // Enable if Y2 direction signal is opposite to Y //#define Y_DUAL_ENDSTOPS #if ENABLED(Y_DUAL_ENDSTOPS) #define Y2_USE_ENDSTOP _YMAX_ @@ -576,6 +576,11 @@ #define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many #if NUM_Z_STEPPER_DRIVERS > 1 + // Enable if Z motor direction signals are the opposite of Z1 + //#define INVERT_Z2_VS_Z_DIR + //#define INVERT_Z3_VS_Z_DIR + //#define INVERT_Z4_VS_Z_DIR + //#define Z_MULTI_ENDSTOPS #if ENABLED(Z_MULTI_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ @@ -801,10 +806,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" @@ -813,8 +818,8 @@ #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 to run G35 Assisted Tramming (MarlinUI) - //#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu + //#define ASSISTED_TRAMMING_WIZARD // Add a Tramming Wizard to the LCD menu + //#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment /** @@ -854,8 +859,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. @@ -1024,7 +1027,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 @@ -1057,7 +1060,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 @@ -1086,7 +1089,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 @@ -1135,33 +1139,38 @@ #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) + #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 -// 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 @@ -1178,6 +1187,16 @@ #endif #if ENABLED(SDSUPPORT) + /** + * SD Card SPI Speed + * May be required to resolve "volume init" errors. + * + * Enable and set to SPI_HALF_SPEED, SPI_QUARTER_SPEED, or SPI_EIGHTH_SPEED + * otherwise full speed will be applied. + * + * :['SPI_HALF_SPEED', 'SPI_QUARTER_SPEED', 'SPI_EIGHTH_SPEED'] + */ + //#define SD_SPI_SPEED SPI_HALF_SPEED // The standard SD detect circuit reads LOW when media is inserted and HIGH when empty. // Enable this option and set to HIGH if your SD cards are incorrectly detected. @@ -1186,6 +1205,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 @@ -1197,6 +1218,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 @@ -1319,9 +1341,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 * @@ -1332,7 +1351,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 /** @@ -1358,13 +1388,16 @@ * Set this option to one of the following (or the board's defaults apply): * * LCD - Use the SD drive in the external LCD controller. - * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * ONBOARD - Use the SD drive on the control board. * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). * * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] */ //#define SDCARD_CONNECTION LCD + // Enable if SD detect is rendered useless (e.g., by using an SD extender) + //#define NO_SD_DETECT + #endif // SDSUPPORT /** @@ -1446,7 +1479,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 @@ -1494,6 +1526,16 @@ #endif #endif // HAS_DGUS_LCD +// +// Specify additional languages for the UI. Default specified by LCD_LANGUAGE. +// +#if EITHER(DOGLCD, TOUCH_UI_FTDI_EVE) + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it +#endif + // // Touch UI for the FTDI Embedded Video Engine (EVE) // @@ -1561,18 +1603,14 @@ //#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 #define TOUCH_UI_FIT_TEXT - // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) - //#define LCD_LANGUAGE_1 en - //#define LCD_LANGUAGE_2 fr - //#define LCD_LANGUAGE_3 de - //#define LCD_LANGUAGE_4 es - //#define LCD_LANGUAGE_5 it - // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE @@ -1732,6 +1770,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. @@ -2471,22 +2513,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 @@ -3019,6 +3061,10 @@ #define SPEED_POWER_MAX 100 // (%) 0-100 #define SPEED_POWER_STARTUP 80 // (%) M3/M4 speed/power default (with no arguments) + // Define the minimum and maximum test pulse time values for a laser test fire function + #define LASER_TEST_PULSE_MIN 1 // Used with Laser Control Menu + #define LASER_TEST_PULSE_MAX 999 // Caution: Menu may not show more than 3 characters + /** * Enable inline laser power to be handled in the planner / stepper routines. * Inline power is specified by the I (inline) flag in an M3 command (e.g., M3 S20 I) @@ -3301,7 +3347,7 @@ //#define USER_SCRIPT_RETURN // Return to status screen after a script #define USER_DESC_1 "Home & UBL Info" - #define USER_GCODE_1 "G28\nG29 W" + #define USER_GCODE_1 "G28\nG29W" #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) @@ -3558,10 +3604,7 @@ //#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) #define MMU2_SERIAL_PORT 2 - #define MMU2_SERIAL mmuSerial // Use hardware reset for MMU if a pin is defined for it //#define MMU2_RST_PIN 23 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/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index aa6a32132032..8b95acb0acbc 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -97,6 +97,13 @@ typedef int8_t pin_t; #endif #endif +#ifdef MMU2_SERIAL_PORT + #if !WITHIN(MMU2_SERIAL_PORT, -1, 3) + #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration." + #endif + #define MMU2_SERIAL mmuSerial +#endif + #ifdef LCD_SERIAL_PORT #if !WITHIN(LCD_SERIAL_PORT, -1, 3) #error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration." diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp index 31e589746cf2..3e5572e559fa 100644 --- a/Marlin/src/HAL/AVR/HAL_SPI.cpp +++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp @@ -34,17 +34,17 @@ #include "../../inc/MarlinConfig.h" void spiBegin() { - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); + OUT_WRITE(SD_SS_PIN, HIGH); + SET_OUTPUT(SD_SCK_PIN); + SET_INPUT(SD_MISO_PIN); + SET_OUTPUT(SD_MOSI_PIN); #if DISABLED(SOFTWARE_SPI) // SS must be in output mode even it is not chip select - //SET_OUTPUT(SS_PIN); + //SET_OUTPUT(SD_SS_PIN); // set SS high - may be chip select for another SPI device //#if SET_SPI_SS_HIGH - //WRITE(SS_PIN, HIGH); + //WRITE(SD_SS_PIN, HIGH); //#endif // set a default rate spiInit(1); @@ -195,19 +195,19 @@ void spiBegin() { // no interrupts during byte receive - about 8µs cli(); // output pin high - like sending 0xFF - WRITE(MOSI_PIN, HIGH); + WRITE(SD_MOSI_PIN, HIGH); LOOP_L_N(i, 8) { - WRITE(SCK_PIN, HIGH); + WRITE(SD_SCK_PIN, HIGH); nop; // adjust so SCK is nice nop; data <<= 1; - if (READ(MISO_PIN)) data |= 1; + if (READ(SD_MISO_PIN)) data |= 1; - WRITE(SCK_PIN, LOW); + WRITE(SD_SCK_PIN, LOW); } sei(); @@ -225,10 +225,10 @@ void spiBegin() { // no interrupts during byte send - about 8µs cli(); LOOP_L_N(i, 8) { - WRITE(SCK_PIN, LOW); - WRITE(MOSI_PIN, data & 0x80); + WRITE(SD_SCK_PIN, LOW); + WRITE(SD_MOSI_PIN, data & 0x80); data <<= 1; - WRITE(SCK_PIN, HIGH); + WRITE(SD_SCK_PIN, HIGH); } nop; // hold SCK high for a few ns @@ -236,7 +236,7 @@ void spiBegin() { nop; nop; - WRITE(SCK_PIN, LOW); + WRITE(SD_SCK_PIN, LOW); sei(); } 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/AVR/spi_pins.h b/Marlin/src/HAL/AVR/spi_pins.h index f3fa78e2bfaf..831972938a7b 100644 --- a/Marlin/src/HAL/AVR/spi_pins.h +++ b/Marlin/src/HAL/AVR/spi_pins.h @@ -51,15 +51,15 @@ #define AVR_SS_PIN 16 #endif -#ifndef SCK_PIN - #define SCK_PIN AVR_SCK_PIN +#ifndef SD_SCK_PIN + #define SD_SCK_PIN AVR_SCK_PIN #endif -#ifndef MISO_PIN - #define MISO_PIN AVR_MISO_PIN +#ifndef SD_MISO_PIN + #define SD_MISO_PIN AVR_MISO_PIN #endif -#ifndef MOSI_PIN - #define MOSI_PIN AVR_MOSI_PIN +#ifndef SD_MOSI_PIN + #define SD_MOSI_PIN AVR_MOSI_PIN #endif -#ifndef SS_PIN - #define SS_PIN AVR_SS_PIN +#ifndef SD_SS_PIN + #define SD_SS_PIN AVR_SS_PIN #endif diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 395ca4ccc971..6a4d4f61498d 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -59,6 +59,14 @@ #endif #endif +#ifdef MMU2_SERIAL_PORT + #if WITHIN(MMU2_SERIAL_PORT, 0, 3) + #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #else + #error "MMU2_SERIAL_PORT must be from 0 to 3. Please update your configuration." + #endif +#endif + #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == -1 #define LCD_SERIAL lcdSerial @@ -75,16 +83,6 @@ // 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) (*((void**)(addr))) -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - typedef int8_t pin_t; #define SHARED_SERVOS HAS_SERVOS diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 0451d8bcc4ff..342c37373538 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -69,10 +69,10 @@ // run at ~8 .. ~10Mhz - Tx version (Rx data discarded) static uint8_t spiTransferTx0(uint8_t bout) { // using Mode 0 - uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30; /* SODR of port */ - uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN); - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); + uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(SD_MOSI_PIN)) + 0x30; /* SODR of port */ + uint32_t MOSI_MASK = PIN_MASK(SD_MOSI_PIN); + uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SD_SCK_PIN)) + 0x30; /* SODR of port */ + uint32_t SCK_MASK = PIN_MASK(SD_SCK_PIN); uint32_t idx = 0; /* Negate bout, as the assembler requires a negated value */ @@ -154,9 +154,9 @@ static uint8_t spiTransferRx0(uint8_t) { // using Mode 0 uint32_t bin = 0; uint32_t work = 0; - uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */ - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); + uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(SD_MISO_PIN))+0x3C, PIN_SHIFT(SD_MISO_PIN)); /* PDSR of port in bitband area */ + uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SD_SCK_PIN)) + 0x30; /* SODR of port */ + uint32_t SCK_MASK = PIN_MASK(SD_SCK_PIN); /* The software SPI routine */ __asm__ __volatile__( @@ -225,15 +225,15 @@ static uint8_t spiTransfer1(uint8_t b) { // using Mode 0 int bits = 8; do { - WRITE(MOSI_PIN, b & 0x80); + WRITE(SD_MOSI_PIN, b & 0x80); b <<= 1; // little setup time - WRITE(SCK_PIN, HIGH); + WRITE(SD_SCK_PIN, HIGH); DELAY_NS(125); // 10 cycles @ 84mhz - b |= (READ(MISO_PIN) != 0); + b |= (READ(SD_MISO_PIN) != 0); - WRITE(SCK_PIN, LOW); + WRITE(SD_SCK_PIN, LOW); DELAY_NS(125); // 10 cycles @ 84mhz } while (--bits); return b; @@ -245,15 +245,15 @@ static uint8_t spiTransferX(uint8_t b) { // using Mode 0 int bits = 8; do { - WRITE(MOSI_PIN, b & 0x80); + WRITE(SD_MOSI_PIN, b & 0x80); b <<= 1; // little setup time - WRITE(SCK_PIN, HIGH); + WRITE(SD_SCK_PIN, HIGH); __delay_4cycles(spiDelayCyclesX4); - b |= (READ(MISO_PIN) != 0); + b |= (READ(SD_MISO_PIN) != 0); - WRITE(SCK_PIN, LOW); + WRITE(SD_SCK_PIN, LOW); __delay_4cycles(spiDelayCyclesX4); } while (--bits); return b; @@ -271,10 +271,10 @@ // Block transfers run at ~8 .. ~10Mhz - Tx version (Rx data discarded) static void spiTxBlock0(const uint8_t* ptr, uint32_t todo) { - uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(MOSI_PIN)) + 0x30; /* SODR of port */ - uint32_t MOSI_MASK = PIN_MASK(MOSI_PIN); - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); + uint32_t MOSI_PORT_PLUS30 = ((uint32_t) PORT(SD_MOSI_PIN)) + 0x30; /* SODR of port */ + uint32_t MOSI_MASK = PIN_MASK(SD_MOSI_PIN); + uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SD_SCK_PIN)) + 0x30; /* SODR of port */ + uint32_t SCK_MASK = PIN_MASK(SD_SCK_PIN); uint32_t work = 0; uint32_t txval = 0; @@ -352,9 +352,9 @@ static void spiRxBlock0(uint8_t* ptr, uint32_t todo) { uint32_t bin = 0; uint32_t work = 0; - uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */ - uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ - uint32_t SCK_MASK = PIN_MASK(SCK_PIN); + uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(SD_MISO_PIN))+0x3C, PIN_SHIFT(SD_MISO_PIN)); /* PDSR of port in bitband area */ + uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SD_SCK_PIN)) + 0x30; /* SODR of port */ + uint32_t SCK_MASK = PIN_MASK(SD_SCK_PIN); /* The software SPI routine */ __asm__ __volatile__( @@ -442,22 +442,22 @@ static pfnSpiRxBlock spiRxBlock = (pfnSpiRxBlock)spiRxBlockX; #if MB(ALLIGATOR) - #define _SS_WRITE(S) WRITE(SS_PIN, S) + #define _SS_WRITE(S) WRITE(SD_SS_PIN, S) #else #define _SS_WRITE(S) NOOP #endif void spiBegin() { - SET_OUTPUT(SS_PIN); + SET_OUTPUT(SD_SS_PIN); _SS_WRITE(HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); + SET_OUTPUT(SD_SCK_PIN); + SET_INPUT(SD_MISO_PIN); + SET_OUTPUT(SD_MOSI_PIN); } uint8_t spiRec() { _SS_WRITE(LOW); - WRITE(MOSI_PIN, HIGH); // Output 1s 1 + WRITE(SD_MOSI_PIN, HIGH); // Output 1s 1 uint8_t b = spiTransferRx(0xFF); _SS_WRITE(HIGH); return b; @@ -466,7 +466,7 @@ void spiRead(uint8_t* buf, uint16_t nbyte) { if (nbyte) { _SS_WRITE(LOW); - WRITE(MOSI_PIN, HIGH); // Output 1s 1 + WRITE(SD_MOSI_PIN, HIGH); // Output 1s 1 spiRxBlock(buf, nbyte); _SS_WRITE(HIGH); } @@ -519,8 +519,8 @@ } _SS_WRITE(HIGH); - WRITE(MOSI_PIN, HIGH); - WRITE(SCK_PIN, LOW); + WRITE(SD_MOSI_PIN, HIGH); + WRITE(SD_SCK_PIN, LOW); } /** Begin SPI transaction, set clock, bit order, data mode */ @@ -575,20 +575,20 @@ // Configure SPI pins PIO_Configure( - g_APinDescription[SCK_PIN].pPort, - g_APinDescription[SCK_PIN].ulPinType, - g_APinDescription[SCK_PIN].ulPin, - g_APinDescription[SCK_PIN].ulPinConfiguration); + g_APinDescription[SD_SCK_PIN].pPort, + g_APinDescription[SD_SCK_PIN].ulPinType, + g_APinDescription[SD_SCK_PIN].ulPin, + g_APinDescription[SD_SCK_PIN].ulPinConfiguration); PIO_Configure( - g_APinDescription[MOSI_PIN].pPort, - g_APinDescription[MOSI_PIN].ulPinType, - g_APinDescription[MOSI_PIN].ulPin, - g_APinDescription[MOSI_PIN].ulPinConfiguration); + g_APinDescription[SD_MOSI_PIN].pPort, + g_APinDescription[SD_MOSI_PIN].ulPinType, + g_APinDescription[SD_MOSI_PIN].ulPin, + g_APinDescription[SD_MOSI_PIN].ulPinConfiguration); PIO_Configure( - g_APinDescription[MISO_PIN].pPort, - g_APinDescription[MISO_PIN].ulPinType, - g_APinDescription[MISO_PIN].ulPin, - g_APinDescription[MISO_PIN].ulPinConfiguration); + g_APinDescription[SD_MISO_PIN].pPort, + g_APinDescription[SD_MISO_PIN].ulPinType, + g_APinDescription[SD_MISO_PIN].ulPin, + g_APinDescription[SD_MISO_PIN].ulPinConfiguration); // set master mode, peripheral select, fault detection SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS); @@ -606,7 +606,7 @@ WRITE(SPI_EEPROM1_CS, HIGH); WRITE(SPI_EEPROM2_CS, HIGH); WRITE(SPI_FLASH_CS, HIGH); - WRITE(SS_PIN, HIGH); + WRITE(SD_SS_PIN, HIGH); OUT_WRITE(SDSS, LOW); diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index be4b49c0f992..d07da15ad80e 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -64,12 +64,11 @@ #include "../../../MarlinCore.h" -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_QUARTER_SPEED +#endif -#include "../../shared/Marduino.h" +#include "../../shared/HAL_SPI.h" #include "../fastio.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { @@ -100,11 +99,7 @@ uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va spiBegin(); - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card - #endif - spiInit(2); - + spiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index ea7204fa366b..890546af58bb 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -59,9 +59,6 @@ #if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz - #include "u8g_com_HAL_DUE_sw_spi_shared.h" #include "../../shared/Marduino.h" diff --git a/Marlin/src/HAL/DUE/fastio.h b/Marlin/src/HAL/DUE/fastio.h index 5fb8b4d01533..f375cb6b2977 100644 --- a/Marlin/src/HAL/DUE/fastio.h +++ b/Marlin/src/HAL/DUE/fastio.h @@ -50,7 +50,7 @@ #define PWM_PIN(P) WITHIN(P, 2, 13) #ifndef MASK - #define MASK(PIN) (1 << PIN) + #define MASK(PIN) _BV(PIN) #endif /** diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index 688069650630..26fb44f3980b 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -40,7 +40,7 @@ * Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time * as the TMC2130 soft SPI the most common setup. */ -#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN)) +#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == SD_MOSI_PIN || TMC_SW_##P == SD_MISO_PIN || TMC_SW_##P == SD_SCK_PIN)) #if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130) #if ENABLED(TMC_USE_SW_SPI) diff --git a/Marlin/src/HAL/DUE/spi_pins.h b/Marlin/src/HAL/DUE/spi_pins.h index e28eaf827020..cec22c2c374a 100644 --- a/Marlin/src/HAL/DUE/spi_pins.h +++ b/Marlin/src/HAL/DUE/spi_pins.h @@ -43,22 +43,22 @@ #define SPI_PIN 87 #define SPI_CHAN 1 #endif - #define SCK_PIN 76 - #define MISO_PIN 74 - #define MOSI_PIN 75 + #define SD_SCK_PIN 76 + #define SD_MISO_PIN 74 + #define SD_MOSI_PIN 75 #else // defaults #define DUE_SOFTWARE_SPI - #ifndef SCK_PIN - #define SCK_PIN 52 + #ifndef SD_SCK_PIN + #define SD_SCK_PIN 52 #endif - #ifndef MISO_PIN - #define MISO_PIN 50 + #ifndef SD_MISO_PIN + #define SD_MISO_PIN 50 #endif - #ifndef MOSI_PIN - #define MOSI_PIN 51 + #ifndef SD_MOSI_PIN + #define SD_MOSI_PIN 51 #endif #endif /* A.28, A.29, B.21, C.26, C.29 */ -#define SS_PIN SDSS +#define SD_SS_PIN SDSS diff --git a/Marlin/src/HAL/DUE/timers.cpp b/Marlin/src/HAL/DUE/timers.cpp index 9b937d1a7c83..65073c510d7c 100644 --- a/Marlin/src/HAL/DUE/timers.cpp +++ b/Marlin/src/HAL/DUE/timers.cpp @@ -121,7 +121,7 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num) { // missing from CMSIS: Check if interrupt is enabled or not static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0; + return TEST(NVIC->ISER[uint32_t(IRQn) >> 5], uint32_t(IRQn) & 0x1F); } bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index 5ef13e0c21d4..d485b5d1d39d 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -67,10 +67,6 @@ extern portMUX_TYPE spinlock; #define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock) #define DISABLE_ISRS() portENTER_CRITICAL(&spinlock) -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - // ------------------------ // Types // ------------------------ @@ -90,6 +86,13 @@ extern uint16_t HAL_adc_result; // Public functions // ------------------------ +// +// Tone +// +void toneInit(); +void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); +void noTone(const pin_t _pin); + // clear reset reason void HAL_clear_reset_source(); diff --git a/Marlin/src/HAL/ESP32/HAL_SPI.cpp b/Marlin/src/HAL/ESP32/HAL_SPI.cpp index 8e5875fc388d..8ee837ba1567 100644 --- a/Marlin/src/HAL/ESP32/HAL_SPI.cpp +++ b/Marlin/src/HAL/ESP32/HAL_SPI.cpp @@ -53,11 +53,11 @@ static SPISettings spiConfig; // ------------------------ void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" + #if !PIN_EXISTS(SD_SS) + #error "SD_SS_PIN not defined!" #endif - OUT_WRITE(SS_PIN, HIGH); + OUT_WRITE(SD_SS_PIN, HIGH); } void spiInit(uint8_t spiRate) { diff --git a/Marlin/src/HAL/ESP32/Servo.h b/Marlin/src/HAL/ESP32/Servo.h index b0d929452732..8542092d66ea 100644 --- a/Marlin/src/HAL/ESP32/Servo.h +++ b/Marlin/src/HAL/ESP32/Servo.h @@ -30,7 +30,7 @@ class Servo { MAX_PULSE_WIDTH = 2400, // Longest pulse sent to a servo TAU_MSEC = 20, TAU_USEC = (TAU_MSEC * 1000), - MAX_COMPARE = ((1 << 16) - 1), // 65535 + MAX_COMPARE = _BV(16) - 1, // 65535 CHANNEL_MAX_NUM = 16; public: diff --git a/Marlin/src/HAL/ESP32/Tone.cpp b/Marlin/src/HAL/ESP32/Tone.cpp new file mode 100644 index 000000000000..376c0f32e129 --- /dev/null +++ b/Marlin/src/HAL/ESP32/Tone.cpp @@ -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 + * + * Copypaste of SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +/** + * Description: Tone function for ESP32 + * Derived from https://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012 + */ + +#ifdef ARDUINO_ARCH_ESP32 + +#include "../../inc/MarlinConfig.h" +#include "HAL.h" + +static pin_t tone_pin; +volatile static int32_t toggles; + +void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) { + tone_pin = _pin; + toggles = 2 * frequency * duration / 1000; + HAL_timer_start(TONE_TIMER_NUM, 2 * frequency); +} + +void noTone(const pin_t _pin) { + HAL_timer_disable_interrupt(TONE_TIMER_NUM); + WRITE(_pin, LOW); +} + +HAL_TONE_TIMER_ISR() { + HAL_timer_isr_prologue(TONE_TIMER_NUM); + + if (toggles) { + toggles--; + TOGGLE(tone_pin); + } + else noTone(tone_pin); // turn off interrupt +} + +#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/spi_pins.h b/Marlin/src/HAL/ESP32/spi_pins.h index 15f8f2ab6b07..cfe71eee4a75 100644 --- a/Marlin/src/HAL/ESP32/spi_pins.h +++ b/Marlin/src/HAL/ESP32/spi_pins.h @@ -18,7 +18,7 @@ */ #pragma once -#define SS_PIN SDSS -#define SCK_PIN 18 -#define MISO_PIN 19 -#define MOSI_PIN 23 +#define SD_SS_PIN SDSS +#define SD_SCK_PIN 18 +#define SD_MISO_PIN 19 +#define SD_MOSI_PIN 23 diff --git a/Marlin/src/HAL/ESP32/timers.cpp b/Marlin/src/HAL/ESP32/timers.cpp index 3300aea8a89c..57662a665882 100644 --- a/Marlin/src/HAL/ESP32/timers.cpp +++ b/Marlin/src/HAL/ESP32/timers.cpp @@ -45,7 +45,7 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { { TIMER_GROUP_0, TIMER_0, STEPPER_TIMER_PRESCALE, stepTC_Handler }, // 0 - Stepper { TIMER_GROUP_0, TIMER_1, TEMP_TIMER_PRESCALE, tempTC_Handler }, // 1 - Temperature { TIMER_GROUP_1, TIMER_0, PWM_TIMER_PRESCALE, pwmTC_Handler }, // 2 - PWM - { TIMER_GROUP_1, TIMER_1, 1, nullptr }, // 3 + { TIMER_GROUP_1, TIMER_1, TONE_TIMER_PRESCALE, toneTC_Handler }, // 3 - Tone }; // ------------------------ diff --git a/Marlin/src/HAL/ESP32/timers.h b/Marlin/src/HAL/ESP32/timers.h index 98386e3980b9..a47697113d5d 100644 --- a/Marlin/src/HAL/ESP32/timers.h +++ b/Marlin/src/HAL/ESP32/timers.h @@ -44,6 +44,9 @@ typedef uint64_t hal_timer_t; #ifndef PWM_TIMER_NUM #define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs #endif +#ifndef TONE_TIMER_NUM + #define TONE_TIMER_NUM 3 // index of timer for beeper tones +#endif #define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals @@ -59,6 +62,8 @@ typedef uint64_t hal_timer_t; #define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts +#define TONE_TIMER_PRESCALE 1000 // Arbitrary value, no idea what i'm doing here + #define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency @@ -90,11 +95,15 @@ typedef uint64_t hal_timer_t; #ifndef HAL_PWM_TIMER_ISR #define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() #endif +#ifndef HAL_TONE_TIMER_ISR + #define HAL_TONE_TIMER_ISR() extern "C" void toneTC_Handler() +#endif extern "C" { void tempTC_Handler(); void stepTC_Handler(); void pwmTC_Handler(); + void toneTC_Handler(); } // ------------------------ diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 729f6c856e19..8eaee44cce4b 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -113,8 +113,3 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { Clock::delayCycles(x); } - -// Add strcmp_P if missing -#ifndef strcmp_P - #define strcmp_P(a, b) strcmp((a), (b)) -#endif diff --git a/Marlin/src/HAL/LINUX/include/Arduino.h b/Marlin/src/HAL/LINUX/include/Arduino.h index 6aeb0db58335..d4086e259a2f 100644 --- a/Marlin/src/HAL/LINUX/include/Arduino.h +++ b/Marlin/src/HAL/LINUX/include/Arduino.h @@ -73,27 +73,6 @@ extern "C" { void GpioDisableInt(uint32_t port, uint32_t pin); } -// Program Memory -#define pgm_read_ptr(addr) (*((void**)(addr))) -#define pgm_read_byte_near(addr) (*((uint8_t*)(addr))) -#define pgm_read_float_near(addr) (*((float*)(addr))) -#define pgm_read_word_near(addr) (*((uint16_t*)(addr))) -#define pgm_read_dword_near(addr) (*((uint32_t*)(addr))) -#define pgm_read_byte(addr) pgm_read_byte_near(addr) -#define pgm_read_float(addr) pgm_read_float_near(addr) -#define pgm_read_word(addr) pgm_read_word_near(addr) -#define pgm_read_dword(addr) pgm_read_dword_near(addr) - -using std::memcpy; -#define memcpy_P memcpy -#define sprintf_P sprintf -#define strstr_P strstr -#define strncpy_P strncpy -#define vsnprintf_P vsnprintf -#define strcpy_P strcpy -#define snprintf_P snprintf -#define strlen_P strlen - // Time functions extern "C" void delay(const int milis); void _delay_ms(const int delay); diff --git a/Marlin/src/HAL/LINUX/main.cpp b/Marlin/src/HAL/LINUX/main.cpp index eadc409324c9..c409a83e5d55 100644 --- a/Marlin/src/HAL/LINUX/main.cpp +++ b/Marlin/src/HAL/LINUX/main.cpp @@ -1,6 +1,5 @@ /** * 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 diff --git a/Marlin/src/HAL/LINUX/spi_pins.h b/Marlin/src/HAL/LINUX/spi_pins.h index 01ba28e5b604..33136ac9dd80 100644 --- a/Marlin/src/HAL/LINUX/spi_pins.h +++ b/Marlin/src/HAL/LINUX/spi_pins.h @@ -24,31 +24,32 @@ #include "../../core/macros.h" #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) +#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use // spiBeginTransaction. #endif -/** onboard SD card */ -//#define SCK_PIN P0_07 -//#define MISO_PIN P0_08 -//#define MOSI_PIN P0_09 -//#define SS_PIN P0_06 -/** external */ -#ifndef SCK_PIN - #define SCK_PIN 50 +// Onboard SD +//#define SD_SCK_PIN P0_07 +//#define SD_MISO_PIN P0_08 +//#define SD_MOSI_PIN P0_09 +//#define SD_SS_PIN P0_06 + +// External SD +#ifndef SD_SCK_PIN + #define SD_SCK_PIN 50 #endif -#ifndef MISO_PIN - #define MISO_PIN 51 +#ifndef SD_MISO_PIN + #define SD_MISO_PIN 51 #endif -#ifndef MOSI_PIN - #define MOSI_PIN 52 +#ifndef SD_MOSI_PIN + #define SD_MOSI_PIN 52 #endif -#ifndef SS_PIN - #define SS_PIN 53 +#ifndef SD_SS_PIN + #define SD_SS_PIN 53 #endif #ifndef SDSS - #define SDSS SS_PIN + #define SDSS SD_SS_PIN #endif diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 51a13389b1e6..c65fff474797 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 // @@ -85,6 +82,16 @@ extern "C" volatile uint32_t _millis; #endif #endif +#ifdef MMU2_SERIAL_PORT + #if MMU2_SERIAL_PORT == -1 + #define MMU2_SERIAL UsbSerial + #elif WITHIN(MMU2_SERIAL_PORT, 0, 3) + #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #else + #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration." + #endif +#endif + #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == -1 #define LCD_SERIAL UsbSerial @@ -207,8 +214,3 @@ void HAL_clear_reset_source(void); uint8_t HAL_get_reset_source(void); inline void HAL_reboot() {} // reboot the board or restart the bootloader - -// Add strcmp_P if missing -#ifndef strcmp_P - #define strcmp_P(a, b) strcmp((a), (b)) -#endif diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index 16ac789fc0f3..dbc89a33f547 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -55,27 +55,33 @@ #include #include +#include "../shared/HAL_SPI.h" + // ------------------------ // Public functions // ------------------------ #if ENABLED(LPC_SOFTWARE_SPI) + // Software SPI + #include - // Software SPI + #ifndef HAL_SPI_SPEED + #define HAL_SPI_SPEED SPI_FULL_SPEED + #endif - static uint8_t SPI_speed = 0; + static uint8_t SPI_speed = HAL_SPI_SPEED; static uint8_t spiTransfer(uint8_t b) { - return swSpiTransfer(b, SPI_speed, SCK_PIN, MISO_PIN, MOSI_PIN); + return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN); } void spiBegin() { - swSpiBegin(SCK_PIN, MISO_PIN, MOSI_PIN); + swSpiBegin(SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN); } void spiInit(uint8_t spiRate) { - SPI_speed = swSpiInit(spiRate, SCK_PIN, MOSI_PIN); + SPI_speed = swSpiInit(spiRate, SD_SCK_PIN, SD_MOSI_PIN); } uint8_t spiRec() { return spiTransfer(0xFF); } @@ -100,14 +106,20 @@ #else - void spiBegin() { // setup SCK, MOSI & MISO pins for SSP0 - spiInit(SPI_SPEED); - } + #ifndef HAL_SPI_SPEED + #ifdef SD_SPI_SPEED + #define HAL_SPI_SPEED SD_SPI_SPEED + #else + #define HAL_SPI_SPEED SPI_FULL_SPEED + #endif + #endif + + void spiBegin() { spiInit(HAL_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0 void spiInit(uint8_t spiRate) { - #if MISO_PIN == BOARD_SPI1_MISO_PIN + #if SD_MISO_PIN == BOARD_SPI1_MISO_PIN SPI.setModule(1); - #elif MISO_PIN == BOARD_SPI2_MISO_PIN + #elif SD_MISO_PIN == BOARD_SPI2_MISO_PIN SPI.setModule(2); #endif SPI.setDataSize(DATA_SIZE_8BIT); @@ -150,10 +162,9 @@ (void)spiTransfer(buf[i]); } - /** Begin SPI transaction, set clock, bit order, data mode */ + // Begin SPI transaction, set clock, bit order, data mode void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - // TODO: to be implemented - + // TODO: Implement this method } #endif // LPC_SOFTWARE_SPI @@ -392,9 +403,9 @@ void SPIClass::updateSettings() { SSP_Init(_currentSetting->spi_d, &HW_SPI_init); // puts the values into the proper bits in the SSP0 registers } -#if MISO_PIN == BOARD_SPI1_MISO_PIN +#if SD_MISO_PIN == BOARD_SPI1_MISO_PIN SPIClass SPI(1); -#elif MISO_PIN == BOARD_SPI2_MISO_PIN +#elif SD_MISO_PIN == BOARD_SPI2_MISO_PIN SPIClass SPI(2); #endif diff --git a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp index 3c0c3c8ec30e..38d2705d519a 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp @@ -25,7 +25,7 @@ * Emulate EEPROM storage using Flash Memory * * Use a single 32K flash sector to store EEPROM data. To reduce the - * number of erase operations a simple "levelling" scheme is used that + * number of erase operations a simple "leveling" scheme is used that * maintains a number of EEPROM "slots" within the larger flash sector. * Each slot is used in turn and the entire sector is only erased when all * slots have been used. 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 diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 21d149fcafe6..14890bcd6ece 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 @@ -116,8 +116,8 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #elif HAS_WIRED_LCD #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1) #error "Serial port pins (1) conflict with Encoder Buttons!" - #elif ANY_TX(1, SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK) \ - || ANY_RX(1, LCD_SDSS, LCD_PINS_RS, MISO_PIN, DOGLCD_A0, SS_PIN, LCD_SDSS, DOGLCD_CS, LCD_RESET_PIN, LCD_BACKLIGHT_PIN) + #elif ANY_TX(1, SD_SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK_PIN) \ + || ANY_RX(1, LCD_SDSS, LCD_PINS_RS, SD_MISO_PIN, DOGLCD_A0, SD_SS_PIN, LCD_SDSS, DOGLCD_CS, LCD_RESET_PIN, LCD_BACKLIGHT_PIN) #error "Serial port pins (1) conflict with LCD pins!" #endif #endif @@ -205,8 +205,8 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #error "SDA0 overlaps with BEEPER_PIN!" #elif IS_SCL0(BTN_ENC) #error "SCL0 overlaps with Encoder Button!" - #elif IS_SCL0(SS_PIN) - #error "SCL0 overlaps with SS_PIN!" + #elif IS_SCL0(SD_SS_PIN) + #error "SCL0 overlaps with SD_SS_PIN!" #elif IS_SCL0(LCD_SDSS) #error "SCL0 overlaps with LCD_SDSS!" #endif diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index 96faf54d7fd2..f41a57637639 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -90,11 +90,11 @@ void HAL_init() { //debug_frmwrk_init(); //_DBG("\n\nDebug running\n"); // Initialize the SD card chip select pins as soon as possible - #if PIN_EXISTS(SS) - OUT_WRITE(SS_PIN, HIGH); + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif - #if PIN_EXISTS(ONBOARD_SD_CS) && ONBOARD_SD_CS_PIN != SS_PIN + #if PIN_EXISTS(ONBOARD_SD_CS) && ONBOARD_SD_CS_PIN != SD_SS_PIN OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); #endif diff --git a/Marlin/src/HAL/LPC1768/spi_pins.h b/Marlin/src/HAL/LPC1768/spi_pins.h index b4da5d4df234..e7d774742f42 100644 --- a/Marlin/src/HAL/LPC1768/spi_pins.h +++ b/Marlin/src/HAL/LPC1768/spi_pins.h @@ -23,7 +23,7 @@ #include "../../core/macros.h" -#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) +#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use @@ -31,24 +31,24 @@ #endif /** onboard SD card */ -//#define SCK_PIN P0_07 -//#define MISO_PIN P0_08 -//#define MOSI_PIN P0_09 -//#define SS_PIN P0_06 +//#define SD_SCK_PIN P0_07 +//#define SD_MISO_PIN P0_08 +//#define SD_MOSI_PIN P0_09 +//#define SD_SS_PIN P0_06 /** external */ -#ifndef SCK_PIN - #define SCK_PIN P0_15 +#ifndef SD_SCK_PIN + #define SD_SCK_PIN P0_15 #endif -#ifndef MISO_PIN - #define MISO_PIN P0_17 +#ifndef SD_MISO_PIN + #define SD_MISO_PIN P0_17 #endif -#ifndef MOSI_PIN - #define MOSI_PIN P0_18 +#ifndef SD_MOSI_PIN + #define SD_MOSI_PIN P0_18 #endif -#ifndef SS_PIN - #define SS_PIN P1_23 +#ifndef SD_SS_PIN + #define SD_SS_PIN P1_23 #endif #if !defined(SDSS) || SDSS == P_NC // gets defaulted in pins.h #undef SDSS - #define SDSS SS_PIN + #define SDSS SD_SS_PIN #endif diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.h b/Marlin/src/HAL/LPC1768/tft/xpt2046.h index 29db0b3fc454..65602bda0f40 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.h +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.h @@ -28,16 +28,16 @@ #endif #ifndef TOUCH_MISO_PIN - #define TOUCH_MISO_PIN MISO_PIN + #define TOUCH_MISO_PIN SD_MISO_PIN #endif #ifndef TOUCH_MOSI_PIN - #define TOUCH_MOSI_PIN MOSI_PIN + #define TOUCH_MOSI_PIN SD_MOSI_PIN #endif #ifndef TOUCH_SCK_PIN - #define TOUCH_SCK_PIN SCK_PIN + #define TOUCH_SCK_PIN SD_SCK_PIN #endif #ifndef TOUCH_CS_PIN - #define TOUCH_CS_PIN CS_PIN + #define TOUCH_CS_PIN SD_SS_PIN #endif #ifndef TOUCH_INT_PIN #define TOUCH_INT_PIN -1 diff --git a/Marlin/src/HAL/LPC1768/timers.h b/Marlin/src/HAL/LPC1768/timers.h index e6744fb005bf..4b638546856f 100644 --- a/Marlin/src/HAL/LPC1768/timers.h +++ b/Marlin/src/HAL/LPC1768/timers.h @@ -152,7 +152,7 @@ FORCE_INLINE static void HAL_timer_disable_interrupt(const uint8_t timer_num) { // This function is missing from CMSIS FORCE_INLINE static bool NVIC_GetEnableIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[((uint32_t)IRQn) >> 5] & (1 << ((uint32_t)IRQn) & 0x1F)) != 0; + return TEST(NVIC->ISER[uint32_t(IRQn) >> 5], uint32_t(IRQn) & 0x1F); } FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp index 057e10e0f545..b1eea13d5747 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp @@ -62,10 +62,13 @@ #include #include "../../shared/HAL_SPI.h" -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); +#ifndef LCD_SPI_SPEED + #ifdef SD_SPI_SPEED + #define LCD_SPI_SPEED SD_SPI_SPEED // Assume SPI speed shared with SD + #else + #define LCD_SPI_SPEED SPI_FULL_SPEED // Use full speed if SD speed is not supplied + #endif +#endif uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { switch (msg) { @@ -81,10 +84,7 @@ uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, u8g_SetPIOutput(u8g, U8G_PI_RESET); u8g_Delay(5); spiBegin(); - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card - #endif - spiInit(SPI_SPEED); + spiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index 10d84941625f..61211d9d881c 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -62,9 +62,11 @@ #include #include #include "../../shared/Delay.h" +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 3 // About 1 MHz +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_EIGHTH_SPEED // About 1 MHz +#endif static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL; static uint8_t SPI_speed = 0; @@ -92,7 +94,7 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar u8g_SetPIOutput(u8g, U8G_PI_MOSI); u8g_Delay(5); - SPI_speed = swSpiInit(SPI_SPEED, SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL); + SPI_speed = swSpiInit(LCD_SPI_SPEED, SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL); u8g_SetPILevel(u8g, U8G_PI_CS, 0); u8g_SetPILevel(u8g, U8G_PI_SCK, 0); diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index ca9d6ecfbe25..7f38ec54aff7 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -60,9 +60,11 @@ #if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) #include +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_QUARTER_SPEED // About 2 MHz +#endif #include #include @@ -145,7 +147,7 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, u8g_SetPIOutput(u8g, U8G_PI_CS); u8g_SetPIOutput(u8g, U8G_PI_A0); if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET); - SPI_speed = swSpiInit(SPI_SPEED, u8g->pin_list[U8G_PI_SCK], u8g->pin_list[U8G_PI_MOSI]); + SPI_speed = swSpiInit(LCD_SPI_SPEED, u8g->pin_list[U8G_PI_SCK], u8g->pin_list[U8G_PI_MOSI]); u8g_SetPILevel(u8g, U8G_PI_SCK, 0); u8g_SetPILevel(u8g, U8G_PI_MOSI, 0); break; diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index ff9310114641..fd2eb59475e9 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -57,6 +57,16 @@ #endif #endif + #ifdef MMU2_SERIAL_PORT + #if MMU2_SERIAL_PORT == -1 + #define MMU2_SERIAL Serial + #elif WITHIN(MMU2_SERIAL_PORT, 0, 3) + #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #else + #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration." + #endif + #endif + #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == -1 #define LCD_SERIAL Serial diff --git a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp index abc5f3acbf77..fac67cf5a3bc 100644 --- a/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp +++ b/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp @@ -21,13 +21,13 @@ #ifdef ADAFRUIT_GRAND_CENTRAL_M4 /** - * Framework doesn't define some serial to save sercom resources + * Framework doesn't define some serials to save sercom resources * hence if these are used I need to define them */ #include "../../inc/MarlinConfig.h" -#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 +#if USING_SERIAL_1 Uart Serial2(&sercom4, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX); void SERCOM4_0_Handler() { Serial2.IrqHandler(); } void SERCOM4_1_Handler() { Serial2.IrqHandler(); } @@ -35,7 +35,7 @@ void SERCOM4_3_Handler() { Serial2.IrqHandler(); } #endif -#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 +#if USING_SERIAL_2 Uart Serial3(&sercom1, PIN_SERIAL3_RX, PIN_SERIAL3_TX, PAD_SERIAL3_RX, PAD_SERIAL3_TX); void SERCOM1_0_Handler() { Serial3.IrqHandler(); } void SERCOM1_1_Handler() { Serial3.IrqHandler(); } @@ -43,7 +43,7 @@ void SERCOM1_3_Handler() { Serial3.IrqHandler(); } #endif -#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 +#if USING_SERIAL_3 Uart Serial4(&sercom5, PIN_SERIAL4_RX, PIN_SERIAL4_TX, PAD_SERIAL4_RX, PAD_SERIAL4_TX); void SERCOM5_0_Handler() { Serial4.IrqHandler(); } void SERCOM5_1_Handler() { Serial4.IrqHandler(); } diff --git a/Marlin/src/HAL/SAMD51/fastio.h b/Marlin/src/HAL/SAMD51/fastio.h index c456dfce30cb..a95b7cac0ce9 100644 --- a/Marlin/src/HAL/SAMD51/fastio.h +++ b/Marlin/src/HAL/SAMD51/fastio.h @@ -31,7 +31,7 @@ */ #ifndef MASK - #define MASK(PIN) (1 << PIN) + #define MASK(PIN) _BV(PIN) #endif /** diff --git a/Marlin/src/HAL/SAMD51/spi_pins.h b/Marlin/src/HAL/SAMD51/spi_pins.h index 5a9b1275ef88..2a667bcaa1ce 100644 --- a/Marlin/src/HAL/SAMD51/spi_pins.h +++ b/Marlin/src/HAL/SAMD51/spi_pins.h @@ -30,16 +30,16 @@ * SPI | 53 52 50 51 | * SPI1 | 83 81 80 82 | * +-------------------------+ - * Any pin can be used for Chip Select (SS_PIN) + * Any pin can be used for Chip Select (SD_SS_PIN) */ - #ifndef SCK_PIN - #define SCK_PIN 52 + #ifndef SD_SCK_PIN + #define SD_SCK_PIN 52 #endif - #ifndef MISO_PIN - #define MISO_PIN 50 + #ifndef SD_MISO_PIN + #define SD_MISO_PIN 50 #endif - #ifndef MOSI_PIN - #define MOSI_PIN 51 + #ifndef SD_MOSI_PIN + #define SD_MOSI_PIN 51 #endif #ifndef SDSS #define SDSS 53 @@ -51,4 +51,4 @@ #endif -#define SS_PIN SDSS +#define SD_SS_PIN SDSS diff --git a/Marlin/src/HAL/SAMD51/timers.cpp b/Marlin/src/HAL/SAMD51/timers.cpp index a68af2e074ae..5c55d324079a 100644 --- a/Marlin/src/HAL/SAMD51/timers.cpp +++ b/Marlin/src/HAL/SAMD51/timers.cpp @@ -157,7 +157,7 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num) { // missing from CMSIS: Check if interrupt is enabled or not static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) { - return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0; + return TEST(NVIC->ISER[uint32_t(IRQn) >> 5], uint32_t(IRQn) & 0x1F); } bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 16dc7a453994..9d0c421a1919 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" @@ -64,6 +65,16 @@ #endif #endif +#ifdef MMU2_SERIAL_PORT + #if MMU2_SERIAL_PORT == -1 + #define MMU2_SERIAL SerialUSB + #elif WITHIN(MMU2_SERIAL_PORT, 1, 6) + #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #else + #error "MMU2_SERIAL_PORT must be -1 or from 1 to 6. Please update your configuration." + #endif +#endif + #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == -1 #define LCD_SERIAL SerialUSB @@ -95,14 +106,6 @@ // 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 // ------------------------ @@ -110,6 +113,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 @@ -140,19 +145,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 @@ -160,14 +161,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/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index f947e6ef3272..eef480777bb7 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -45,10 +45,10 @@ static SPISettings spiConfig; #include "../shared/Delay.h" void spiBegin(void) { - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(SCK_PIN, HIGH); - SET_INPUT(MISO_PIN); - OUT_WRITE(MOSI_PIN, HIGH); + OUT_WRITE(SD_SS_PIN, HIGH); + OUT_WRITE(SD_SCK_PIN, HIGH); + SET_INPUT(SD_MISO_PIN); + OUT_WRITE(SD_MOSI_PIN, HIGH); } static uint16_t delay_STM32_soft_spi; @@ -72,15 +72,15 @@ static SPISettings spiConfig; uint8_t HAL_SPI_STM32_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 for (uint8_t bits = 8; bits--;) { - WRITE(SCK_PIN, LOW); - WRITE(MOSI_PIN, b & 0x80); + WRITE(SD_SCK_PIN, LOW); + WRITE(SD_MOSI_PIN, b & 0x80); DELAY_NS(delay_STM32_soft_spi); - WRITE(SCK_PIN, HIGH); + WRITE(SD_SCK_PIN, HIGH); DELAY_NS(delay_STM32_soft_spi); b <<= 1; // little setup time - b |= (READ(MISO_PIN) != 0); + b |= (READ(SD_MISO_PIN) != 0); } DELAY_NS(125); return b; @@ -132,8 +132,8 @@ static SPISettings spiConfig; * @details Only configures SS pin since stm32duino creates and initialize the SPI object */ void spiBegin() { - #if PIN_EXISTS(SS) - OUT_WRITE(SS_PIN, HIGH); + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif } @@ -154,10 +154,9 @@ static SPISettings spiConfig; spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); #if ENABLED(CUSTOM_SPI_PINS) - SPI.setMISO(MISO_PIN); - SPI.setMOSI(MOSI_PIN); - SPI.setSCLK(SCK_PIN); - SPI.setSSEL(SS_PIN); + SPI.setMISO(SD_MISO_PIN); + SPI.setMOSI(SD_MOSI_PIN); + SPI.setSCLK(SD_SCK_PIN); #endif SPI.begin(); diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index da11b88a60b1..5086b4178461 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" @@ -61,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 @@ -74,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 @@ -84,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 @@ -94,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/MarlinSerial.cpp b/Marlin/src/HAL/STM32/MarlinSerial.cpp index a146664366df..4d9177248ad6 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" @@ -49,6 +48,10 @@ DECLARE_SERIAL_PORT_EXP(SERIAL_PORT_2) #endif +#if defined(MMU2_SERIAL_PORT) && MMU2_SERIAL_PORT >= 0 + DECLARE_SERIAL_PORT_EXP(MMU2_SERIAL_PORT) +#endif + #if defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT >= 0 DECLARE_SERIAL_PORT_EXP(LCD_SERIAL_PORT) #endif diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp index 9c2666ed26f4..e00fb9b16f7a 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 @@ -87,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; @@ -108,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); @@ -154,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(); @@ -257,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 (;;) { @@ -306,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 @@ -319,3 +326,4 @@ #endif // !USBD_USE_CDC_COMPOSITE #endif // SDIO_SUPPORT +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC 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/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/fastio.h b/Marlin/src/HAL/STM32/fastio.h index ea28b8f3bfaa..17751c44dd8d 100644 --- a/Marlin/src/HAL/STM32/fastio.h +++ b/Marlin/src/HAL/STM32/fastio.h @@ -59,7 +59,7 @@ void FastIO_init(); // Must be called before using fast io macros #endif #define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->IDR, _BV32(STM_PIN(digitalPinToPinName(IO))))) -#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->ODR ^= _BV32(STM_PIN(digitalPinToPinName(IO)))) +#define _TOGGLE(IO) TBI32(FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->ODR, STM_PIN(digitalPinToPinName(IO))) #define _GET_MODE(IO) #define _SET_MODE(IO,M) pinMode(IO, M) diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index c51fecc7bdb9..4df75a050558 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_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 77c93ee41e36..048f788e3d08 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -137,32 +137,18 @@ 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 +203,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/spi_pins.h b/Marlin/src/HAL/STM32/spi_pins.h index 176e2a7b2063..e2052c5c7704 100644 --- a/Marlin/src/HAL/STM32/spi_pins.h +++ b/Marlin/src/HAL/STM32/spi_pins.h @@ -21,15 +21,15 @@ /** * Define SPI Pins: SCK, MISO, MOSI, SS */ -#ifndef SCK_PIN - #define SCK_PIN PIN_SPI_SCK +#ifndef SD_SCK_PIN + #define SD_SCK_PIN PIN_SPI_SCK #endif -#ifndef MISO_PIN - #define MISO_PIN PIN_SPI_MISO +#ifndef SD_MISO_PIN + #define SD_MISO_PIN PIN_SPI_MISO #endif -#ifndef MOSI_PIN - #define MOSI_PIN PIN_SPI_MOSI +#ifndef SD_MOSI_PIN + #define SD_MOSI_PIN PIN_SPI_MOSI #endif -#ifndef SS_PIN - #define SS_PIN PIN_SPI_SS +#ifndef SD_SS_PIN + #define SD_SS_PIN PIN_SPI_SS #endif diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp index 3a080d5e271e..87ca2dbbe18a 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" @@ -47,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; @@ -66,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; @@ -75,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; @@ -130,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) @@ -140,41 +142,40 @@ 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)) + #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 +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index e2e0128c5efc..2200abaa10e8 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 @@ -44,9 +42,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 +57,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,17 +67,23 @@ 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); } + 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; + } + } }; - #ifdef STM32F1xx #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE) #elif defined(STM32F4xx) @@ -98,14 +105,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 +130,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/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index d3eb4ba8db6a..3cb797d5f2a9 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" @@ -33,22 +34,13 @@ 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 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 @@ -56,12 +48,7 @@ void TFT_SPI::Init() { 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 + 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; @@ -73,7 +60,7 @@ 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) + #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); @@ -81,23 +68,41 @@ void TFT_SPI::Init() { #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_0; + #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_0; + #endif } #endif @@ -109,6 +114,9 @@ void TFT_SPI::Init() { DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; DMAtx.Init.Mode = DMA_NORMAL; DMAtx.Init.Priority = DMA_PRIORITY_LOW; + #ifdef STM32F4xx + DMAtx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + #endif } void TFT_SPI::DataTransferBegin(uint16_t DataSize) { @@ -127,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); @@ -155,27 +162,42 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) { DataTransferEnd(); SPIx.Init.BaudRatePrescaler = BaudRatePrescaler; - - return Data >> 7; #endif + + return Data >> 7; } 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); + // 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 + 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); @@ -184,29 +206,30 @@ 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 */ + + HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); + Abort(); } #endif // HAS_SPI_TFT +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC 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 f95bb8ca4da4..04294e669c55 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -19,10 +19,11 @@ * along with this program. If not, see . * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #include "../../../inc/MarlinConfig.h" -#if HAS_TFT_XPT2046 +#if HAS_TFT_XPT2046 || HAS_TOUCH_BUTTONS #include "xpt2046.h" #include "pinconfig.h" @@ -30,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; @@ -70,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 } @@ -106,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); @@ -186,3 +167,4 @@ uint16_t XPT2046::SoftwareIO(uint16_t data) { } #endif // HAS_TFT_XPT2046 +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 3acf3898a3b5..5b8acf4b87af 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -60,19 +60,11 @@ 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; - 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/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 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/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 diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 06f75662cffa..c7eef639a5b2 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -99,6 +99,18 @@ #endif #endif +#ifdef MMU2_SERIAL_PORT + #if MMU2_SERIAL_PORT == -1 + #define MMU2_SERIAL UsbSerial + #elif WITHIN(MMU2_SERIAL_PORT, 1, NUM_UARTS) + #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #elif NUM_UARTS == 5 + #error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration." + #else + #error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." + #endif +#endif + #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == -1 #define LCD_SERIAL UsbSerial @@ -109,6 +121,9 @@ #else #error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #endif + #if HAS_DGUS_LCD + #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() + #endif #endif // Set interrupt grouping for this MCU @@ -137,14 +152,6 @@ void HAL_idletask(); // 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)) - #define RST_POWER_ON 1 #define RST_EXTERNAL 2 #define RST_BROWN_OUT 4 @@ -189,10 +196,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" { @@ -202,22 +207,12 @@ 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 - #pragma GCC diagnostic pop -#endif +#pragma GCC diagnostic pop // // ADC diff --git a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp index 76b1c3e2468b..7e876f765fb2 100644 --- a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp @@ -61,8 +61,8 @@ * @details Only configures SS pin since libmaple creates and initialize the SPI object */ void spiBegin() { - #if PIN_EXISTS(SS) - OUT_WRITE(SS_PIN, HIGH); + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif } diff --git a/Marlin/src/HAL/STM32F1/Servo.cpp b/Marlin/src/HAL/STM32F1/Servo.cpp index e1ee83149374..36f7c6d51273 100644 --- a/Marlin/src/HAL/STM32F1/Servo.cpp +++ b/Marlin/src/HAL/STM32F1/Servo.cpp @@ -45,7 +45,7 @@ uint8_t ServoCount = 0; * * This uses the smallest prescaler that allows an overflow < 2^16. */ -#define MAX_OVERFLOW UINT16_MAX //((1 << 16) - 1) +#define MAX_OVERFLOW UINT16_MAX // _BV(16) - 1 #define CYC_MSEC (1000 * CYCLES_PER_MICROSECOND) #define TAU_MSEC 20 #define TAU_USEC (TAU_MSEC * 1000) diff --git a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index 60596054e820..784a80c29fd3 100644 --- a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -23,12 +23,14 @@ #if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI) #include +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 0 // Fastest -//#define SPI_SPEED 2 // Slower +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_FULL_SPEED // Fastest + //#define LCD_SPI_SPEED SPI_QUARTER_SPEED // Slower +#endif -static uint8_t SPI_speed = SPI_SPEED; +static uint8_t SPI_speed = LCD_SPI_SPEED; static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) { LOOP_L_N(i, 8) { @@ -104,7 +106,7 @@ static uint8_t swSpiInit(const uint8_t spi_speed) { uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { switch (msg) { case U8G_COM_MSG_INIT: - SPI_speed = swSpiInit(SPI_SPEED); + SPI_speed = swSpiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_STOP: diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 94b5e099bd58..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); - delay(2); + 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; diff --git a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp index 6e992a22a32d..16cfc24af6f6 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp @@ -1,6 +1,5 @@ /** * 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 diff --git a/Marlin/src/HAL/STM32F1/fastio.h b/Marlin/src/HAL/STM32F1/fastio.h index a618fccc578e..e75254d6929e 100644 --- a/Marlin/src/HAL/STM32F1/fastio.h +++ b/Marlin/src/HAL/STM32F1/fastio.h @@ -29,9 +29,9 @@ #include -#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & (1U << PIN_MAP[IO].gpio_bit) ? HIGH : LOW) -#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16)) -#define TOGGLE(IO) (PIN_MAP[IO].gpio_device->regs->ODR = PIN_MAP[IO].gpio_device->regs->ODR ^ (1U << PIN_MAP[IO].gpio_bit)) +#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & _BV32(PIN_MAP[IO].gpio_bit) ? HIGH : LOW) +#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = _BV32(PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16)) +#define TOGGLE(IO) TBI32(PIN_MAP[IO].gpio_device->regs->ODR, PIN_MAP[IO].gpio_bit) #define _GET_MODE(IO) gpio_get_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit) #define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M) diff --git a/Marlin/src/HAL/STM32F1/spi_pins.h b/Marlin/src/HAL/STM32F1/spi_pins.h index 59ac446410da..7d650ffe373f 100644 --- a/Marlin/src/HAL/STM32F1/spi_pins.h +++ b/Marlin/src/HAL/STM32F1/spi_pins.h @@ -31,23 +31,23 @@ * SPI2 | PB12 PB13 PB14 PB15 | * SPI3 | PA15 PB3 PB4 PB5 | * +-----------------------------+ - * Any pin can be used for Chip Select (SS_PIN) + * Any pin can be used for Chip Select (SD_SS_PIN) * SPI1 is enabled by default */ -#ifndef SCK_PIN - #define SCK_PIN PA5 +#ifndef SD_SCK_PIN + #define SD_SCK_PIN PA5 #endif -#ifndef MISO_PIN - #define MISO_PIN PA6 +#ifndef SD_MISO_PIN + #define SD_MISO_PIN PA6 #endif -#ifndef MOSI_PIN - #define MOSI_PIN PA7 +#ifndef SD_MOSI_PIN + #define SD_MOSI_PIN PA7 #endif -#ifndef SS_PIN - #define SS_PIN PA4 +#ifndef SD_SS_PIN + #define SD_SS_PIN PA4 #endif #undef SDSS -#define SDSS SS_PIN +#define SDSS SD_SS_PIN #ifndef SPI_DEVICE #define SPI_DEVICE 1 diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.h b/Marlin/src/HAL/STM32F1/tft/xpt2046.h index 29db0b3fc454..65602bda0f40 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.h @@ -28,16 +28,16 @@ #endif #ifndef TOUCH_MISO_PIN - #define TOUCH_MISO_PIN MISO_PIN + #define TOUCH_MISO_PIN SD_MISO_PIN #endif #ifndef TOUCH_MOSI_PIN - #define TOUCH_MOSI_PIN MOSI_PIN + #define TOUCH_MOSI_PIN SD_MOSI_PIN #endif #ifndef TOUCH_SCK_PIN - #define TOUCH_SCK_PIN SCK_PIN + #define TOUCH_SCK_PIN SD_SCK_PIN #endif #ifndef TOUCH_CS_PIN - #define TOUCH_CS_PIN CS_PIN + #define TOUCH_CS_PIN SD_SS_PIN #endif #ifndef TOUCH_INT_PIN #define TOUCH_INT_PIN -1 diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 9156aadb4de0..11b5564a179c 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -74,17 +74,6 @@ typedef int8_t pin_t; #define ENABLE_ISRS() __enable_irq() #define DISABLE_ISRS() __disable_irq() -#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) (*((void**)(addr))) -// Add type-checking to pgm_read_word -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - inline void HAL_init() {} // Clear the reset reason diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index cdb3f4701c03..dce236ef6bd0 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -35,18 +35,18 @@ static SPISettings spiConfig; // Initialize SPI bus void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" + #if !PIN_EXISTS(SD_SS) + #error "SD_SS_PIN not defined!" #endif - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); + OUT_WRITE(SD_SS_PIN, HIGH); + SET_OUTPUT(SD_SCK_PIN); + SET_INPUT(SD_MISO_PIN); + SET_OUTPUT(SD_MOSI_PIN); #if 0 && DISABLED(SOFTWARE_SPI) // set SS high - may be chip select for another SPI device #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); + WRITE(SD_SS_PIN, HIGH); #endif // set a default rate spiInit(SPI_HALF_SPEED); // 1 diff --git a/Marlin/src/HAL/TEENSY31_32/fastio.h b/Marlin/src/HAL/TEENSY31_32/fastio.h index 9a299de9c763..622799ec8cac 100644 --- a/Marlin/src/HAL/TEENSY31_32/fastio.h +++ b/Marlin/src/HAL/TEENSY31_32/fastio.h @@ -28,7 +28,7 @@ */ #ifndef MASK - #define MASK(PIN) (1 << PIN) + #define MASK(PIN) _BV(PIN) #endif #define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) diff --git a/Marlin/src/HAL/TEENSY31_32/spi_pins.h b/Marlin/src/HAL/TEENSY31_32/spi_pins.h index 5754fbfeed11..6d0d05f85a5d 100644 --- a/Marlin/src/HAL/TEENSY31_32/spi_pins.h +++ b/Marlin/src/HAL/TEENSY31_32/spi_pins.h @@ -21,7 +21,7 @@ */ #pragma once -#define SCK_PIN 13 -#define MISO_PIN 12 -#define MOSI_PIN 11 -#define SS_PIN 20 //SDSS // A.28, A.29, B.21, C.26, C.29 +#define SD_SCK_PIN 13 +#define SD_MISO_PIN 12 +#define SD_MOSI_PIN 11 +#define SD_SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 04151e837861..1d66fa518408 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -80,17 +80,6 @@ typedef int8_t pin_t; #undef sq #define sq(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) (*((void**)(addr))) -// Add type-checking to pgm_read_word -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - inline void HAL_init() {} // Clear reset reason diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index b36900a32195..84852cd3580d 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -35,18 +35,18 @@ static SPISettings spiConfig; void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" + #if !PIN_EXISTS(SD_SS) + #error "SD_SS_PIN not defined!" #endif - OUT_WRITE(SS_PIN, HIGH); - SET_OUTPUT(SCK_PIN); - SET_INPUT(MISO_PIN); - SET_OUTPUT(MOSI_PIN); + OUT_WRITE(SD_SS_PIN, HIGH); + SET_OUTPUT(SD_SCK_PIN); + SET_INPUT(SD_MISO_PIN); + SET_OUTPUT(SD_MOSI_PIN); #if 0 && DISABLED(SOFTWARE_SPI) // set SS high - may be chip select for another SPI device #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); + WRITE(SD_SS_PIN, HIGH); #endif // set a default rate spiInit(SPI_HALF_SPEED); // 1 diff --git a/Marlin/src/HAL/TEENSY35_36/fastio.h b/Marlin/src/HAL/TEENSY35_36/fastio.h index 9a299de9c763..622799ec8cac 100644 --- a/Marlin/src/HAL/TEENSY35_36/fastio.h +++ b/Marlin/src/HAL/TEENSY35_36/fastio.h @@ -28,7 +28,7 @@ */ #ifndef MASK - #define MASK(PIN) (1 << PIN) + #define MASK(PIN) _BV(PIN) #endif #define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) diff --git a/Marlin/src/HAL/TEENSY35_36/spi_pins.h b/Marlin/src/HAL/TEENSY35_36/spi_pins.h index c76344d07546..cfffdc932598 100644 --- a/Marlin/src/HAL/TEENSY35_36/spi_pins.h +++ b/Marlin/src/HAL/TEENSY35_36/spi_pins.h @@ -25,7 +25,7 @@ * HAL SPI Pins for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) */ -#define SCK_PIN 13 -#define MISO_PIN 12 -#define MOSI_PIN 11 -#define SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 +#define SD_SCK_PIN 13 +#define SD_MISO_PIN 12 +#define SD_MOSI_PIN 11 +#define SD_SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 28f511631eea..b191c7de5fe7 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -92,21 +92,10 @@ typedef int8_t pin_t; #undef sq #define sq(x) ((x)*(x)) -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - // Don't place string constants in PROGMEM #undef PSTR #define PSTR(str) ({static const char *data = (str); &data[0];}) -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*((void**)(addr))) -// Add type-checking to pgm_read_word -#undef pgm_read_word -#define pgm_read_word(addr) (*((uint16_t*)(addr))) - // Enable hooks into idle and setup for HAL #define HAL_IDLETASK 1 FORCE_INLINE void HAL_idletask() {} diff --git a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp index 20b472aa3515..8c93049027ab 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp @@ -50,20 +50,20 @@ static SPISettings spiConfig; // ------------------------ void spiBegin() { - #ifndef SS_PIN - #error "SS_PIN is not defined!" + #ifndef SD_SS_PIN + #error "SD_SS_PIN is not defined!" #endif - OUT_WRITE(SS_PIN, HIGH); + OUT_WRITE(SD_SS_PIN, HIGH); - //SET_OUTPUT(SCK_PIN); - //SET_INPUT(MISO_PIN); - //SET_OUTPUT(MOSI_PIN); + //SET_OUTPUT(SD_SCK_PIN); + //SET_INPUT(SD_MISO_PIN); + //SET_OUTPUT(SD_MOSI_PIN); #if 0 && DISABLED(SOFTWARE_SPI) // set SS high - may be chip select for another SPI device #if SET_SPI_SS_HIGH - WRITE(SS_PIN, HIGH); + WRITE(SD_SS_PIN, HIGH); #endif // set a default rate spiInit(SPI_HALF_SPEED); // 1 diff --git a/Marlin/src/HAL/TEENSY40_41/spi_pins.h b/Marlin/src/HAL/TEENSY40_41/spi_pins.h index d6f8d41bf6ce..ba4a2c700a4b 100644 --- a/Marlin/src/HAL/TEENSY40_41/spi_pins.h +++ b/Marlin/src/HAL/TEENSY40_41/spi_pins.h @@ -25,7 +25,7 @@ * HAL SPI Pins for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ -#define SCK_PIN 13 -#define MISO_PIN 12 -#define MOSI_PIN 11 -#define SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 +#define SD_SCK_PIN 13 +#define SD_MISO_PIN 12 +#define SD_MOSI_PIN 11 +#define SD_SS_PIN 20 // SDSS // A.28, A.29, B.21, C.26, C.29 diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index 3003f3cc2891..d0ee6ecc9d43 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -28,9 +28,9 @@ #undef DISABLED // Redefined by ESP32 #undef M_PI // Redefined by all #undef _BV // Redefined by some -#undef sq // Redefined by teensy3/wiring.h #undef SBI // Redefined by arduino/const_functions.h #undef CBI // Redefined by arduino/const_functions.h +#undef sq // Redefined by teensy3/wiring.h #undef UNUSED // Redefined by stm32f4xx_hal_def.h #include // NOTE: If included earlier then this line is a NOOP @@ -40,18 +40,16 @@ #undef _BV #define _BV(b) (1UL << (b)) - -#undef sq -#define sq(x) ((x)*(x)) - #ifndef SBI - #define SBI(A,B) (A |= (1 << (B))) + #define SBI(A,B) (A |= _BV(B)) #endif - #ifndef CBI - #define CBI(A,B) (A &= ~(1 << (B))) + #define CBI(A,B) (A &= ~_BV(B)) #endif +#undef sq +#define sq(x) ((x)*(x)) + #ifndef __AVR__ #ifndef strchr_P // Some platforms define a macro (DUE, teensy35) inline const char* strchr_P(const char *s, int c) { return strchr(s,c); } @@ -83,3 +81,5 @@ #ifndef UNUSED #define UNUSED(x) ((void)(x)) #endif + +#include "progmem.h" diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp index 59734bfbfe1e..decf74e6e9c5 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp @@ -43,10 +43,9 @@ static bool isDataProc(uint32_t instr) { } UnwResult UnwStartArm(UnwState * const state) { - bool found = false; uint16_t t = UNW_MAX_INSTR_COUNT; - do { + for (;;) { uint32_t instr; /* Attempt to read the instruction */ @@ -527,7 +526,7 @@ UnwResult UnwStartArm(UnwState * const state) { if (--t == 0) return UNWIND_EXHAUSTED; - } while (!found); + } return UNWIND_UNSUPPORTED; } diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp index be4abd090fa8..0c6a70649d82 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp @@ -30,12 +30,11 @@ static int32_t signExtend11(const uint16_t value) { } UnwResult UnwStartThumb(UnwState * const state) { - bool found = false; uint16_t t = UNW_MAX_INSTR_COUNT; uint32_t lastJumpAddr = 0; // Last JUMP address, to try to detect infinite loops bool loopDetected = false; // If a loop was detected - do { + for (;;) { uint16_t instr; /* Attempt to read the instruction */ @@ -1059,7 +1058,7 @@ UnwResult UnwStartThumb(UnwState * const state) { if (--t == 0) return UNWIND_EXHAUSTED; - } while (!found); + } return UNWIND_SUCCESS; } diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index bfc062af2090..f1ee81ed4acb 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -128,11 +128,8 @@ static UnwResult UnwTabStateInit(const UnwindCallbacks *cb, UnwTabState *ucb, ui * Execute unwinding instructions */ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabState *ucb) { - int instruction; - uint32_t mask; - uint32_t reg; - uint32_t vsp; + uint32_t mask, reg, vsp; /* Consume all instruction byte */ while ((instruction = UnwTabGetNextInstruction(cb, ucb)) != -1) { @@ -140,12 +137,12 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat if ((instruction & 0xC0) == 0x00) { // ARM_EXIDX_CMD_DATA_POP /* vsp = vsp + (xxxxxx << 2) + 4 */ ucb->vrs[13] += ((instruction & 0x3F) << 2) + 4; - } else - if ((instruction & 0xC0) == 0x40) { // ARM_EXIDX_CMD_DATA_PUSH + } + else if ((instruction & 0xC0) == 0x40) { // ARM_EXIDX_CMD_DATA_PUSH /* vsp = vsp - (xxxxxx << 2) - 4 */ ucb->vrs[13] -= ((instruction & 0x3F) << 2) - 4; - } else - if ((instruction & 0xF0) == 0x80) { + } + else if ((instruction & 0xF0) == 0x80) { /* pop under mask {r15-r12},{r11-r4} or refuse to unwind */ instruction = instruction << 8 | UnwTabGetNextInstruction(cb, ucb); @@ -171,17 +168,17 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat } /* Patch up the vrs sp if it was in the mask */ - if ((instruction & (1 << (13 - 4))) != 0) + if (instruction & (1 << (13 - 4))) ucb->vrs[13] = vsp; - - } else - if ((instruction & 0xF0) == 0x90 && // ARM_EXIDX_CMD_REG_TO_SP - instruction != 0x9D && - instruction != 0x9F) { + } + else if ((instruction & 0xF0) == 0x90 // ARM_EXIDX_CMD_REG_TO_SP + && instruction != 0x9D + && instruction != 0x9F + ) { /* vsp = r[nnnn] */ ucb->vrs[13] = ucb->vrs[instruction & 0x0F]; - } else - if ((instruction & 0xF0) == 0xA0) { // ARM_EXIDX_CMD_REG_POP + } + else if ((instruction & 0xF0) == 0xA0) { // ARM_EXIDX_CMD_REG_POP /* pop r4-r[4+nnn] or pop r4-r[4+nnn], r14*/ vsp = ucb->vrs[13]; @@ -204,8 +201,8 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat ucb->vrs[13] = vsp; - } else - if (instruction == 0xB0) { // ARM_EXIDX_CMD_FINISH + } + else if (instruction == 0xB0) { // ARM_EXIDX_CMD_FINISH /* finished */ if (ucb->vrs[15] == 0) ucb->vrs[15] = ucb->vrs[14]; @@ -213,8 +210,8 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat /* All done unwinding */ return UNWIND_SUCCESS; - } else - if (instruction == 0xB1) { // ARM_EXIDX_CMD_REG_POP + } + else if (instruction == 0xB1) { // ARM_EXIDX_CMD_REG_POP /* pop register under mask {r3,r2,r1,r0} */ vsp = ucb->vrs[13]; mask = UnwTabGetNextInstruction(cb, ucb); @@ -234,16 +231,15 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat } ucb->vrs[13] = (uint32_t)vsp; - } else - if (instruction == 0xB2) { // ARM_EXIDX_CMD_DATA_POP + } + else if (instruction == 0xB2) { // ARM_EXIDX_CMD_DATA_POP /* vps = vsp + 0x204 + (uleb128 << 2) */ ucb->vrs[13] += 0x204 + (UnwTabGetNextInstruction(cb, ucb) << 2); - - } else - if (instruction == 0xB3 || // ARM_EXIDX_CMD_VFP_POP - instruction == 0xC8 || - instruction == 0xC9) { - + } + else if (instruction == 0xB3 // ARM_EXIDX_CMD_VFP_POP + || instruction == 0xC8 + || instruction == 0xC9 + ) { /* pop VFP double-precision registers */ vsp = ucb->vrs[13]; @@ -266,27 +262,20 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat } ucb->vrs[13] = vsp; - - } else - if ((instruction & 0xF8) == 0xB8 || - (instruction & 0xF8) == 0xD0) { - + } + else if ((instruction & 0xF8) == 0xB8 || (instruction & 0xF8) == 0xD0) { /* Pop VFP double precision registers D[8]-D[8+nnn] */ ucb->vrs[14] = 0x80 | (instruction & 0x07); - - if ((instruction & 0xF8) == 0xD0) { + if ((instruction & 0xF8) == 0xD0) ucb->vrs[14] = 1 << 17; - } - - } else + } + else return UNWIND_UNSUPPORTED_DWARF_INSTR; } - return UNWIND_SUCCESS; } static inline __attribute__((always_inline)) uint32_t read_psp() { - /* Read the current PSP and return its value as a pointer */ uint32_t psp; diff --git a/Marlin/src/HAL/shared/progmem.h b/Marlin/src/HAL/shared/progmem.h new file mode 100644 index 000000000000..539d02705e97 --- /dev/null +++ b/Marlin/src/HAL/shared/progmem.h @@ -0,0 +1,189 @@ +/** + * 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 + +#ifndef __AVR__ +#ifndef __PGMSPACE_H_ +// This define should prevent reading the system pgmspace.h if included elsewhere +// This is not normally needed. +#define __PGMSPACE_H_ 1 +#endif + +#ifndef PROGMEM +#define PROGMEM +#endif +#ifndef PGM_P +#define PGM_P const char * +#endif +#ifndef PSTR +#define PSTR(str) (str) +#endif +#ifndef F +#define F(str) (str) +#endif +#ifndef _SFR_BYTE +#define _SFR_BYTE(n) (n) +#endif +#ifndef memchr_P +#define memchr_P(str, c, len) memchr((str), (c), (len)) +#endif +#ifndef memcmp_P +#define memcmp_P(a, b, n) memcmp((a), (b), (n)) +#endif +#ifndef memcpy_P +#define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) +#endif +#ifndef memmem_P +#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen)) +#endif +#ifndef memrchr_P +#define memrchr_P(str, val, len) memrchr((str), (val), (len)) +#endif +#ifndef strcat_P +#define strcat_P(dest, src) strcat((dest), (src)) +#endif +#ifndef strchr_P +#define strchr_P(str, c) strchr((str), (c)) +#endif +#ifndef strchrnul_P +#define strchrnul_P(str, c) strchrnul((str), (c)) +#endif +#ifndef strcmp_P +#define strcmp_P(a, b) strcmp((a), (b)) +#endif +#ifndef strcpy_P +#define strcpy_P(dest, src) strcpy((dest), (src)) +#endif +#ifndef strcasecmp_P +#define strcasecmp_P(a, b) strcasecmp((a), (b)) +#endif +#ifndef strcasestr_P +#define strcasestr_P(a, b) strcasestr((a), (b)) +#endif +#ifndef strlcat_P +#define strlcat_P(dest, src, len) strlcat((dest), (src), (len)) +#endif +#ifndef strlcpy_P +#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len)) +#endif +#ifndef strlen_P +#define strlen_P(s) strlen((const char *)(s)) +#endif +#ifndef strnlen_P +#define strnlen_P(str, len) strnlen((str), (len)) +#endif +#ifndef strncmp_P +#define strncmp_P(a, b, n) strncmp((a), (b), (n)) +#endif +#ifndef strncasecmp_P +#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n)) +#endif +#ifndef strncat_P +#define strncat_P(a, b, n) strncat((a), (b), (n)) +#endif +#ifndef strncpy_P +#define strncpy_P(a, b, n) strncpy((a), (b), (n)) +#endif +#ifndef strpbrk_P +#define strpbrk_P(str, chrs) strpbrk((str), (chrs)) +#endif +#ifndef strrchr_P +#define strrchr_P(str, c) strrchr((str), (c)) +#endif +#ifndef strsep_P +#define strsep_P(strp, delim) strsep((strp), (delim)) +#endif +#ifndef strspn_P +#define strspn_P(str, chrs) strspn((str), (chrs)) +#endif +#ifndef strstr_P +#define strstr_P(a, b) strstr((a), (b)) +#endif +#ifndef sprintf_P +#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__) +#endif +#ifndef vfprintf_P +#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__) +#endif +#ifndef printf_P +#define printf_P(...) printf(__VA_ARGS__) +#endif +#ifndef snprintf_P +#define snprintf_P(s, n, ...) snprintf((s), (n), __VA_ARGS__) +#endif +#ifndef vsprintf_P +#define vsprintf_P(s, ...) vsprintf((s),__VA_ARGS__) +#endif +#ifndef vsnprintf_P +#define vsnprintf_P(s, n, ...) vsnprintf((s), (n),__VA_ARGS__) +#endif +#ifndef fprintf_P +#define fprintf_P(s, ...) fprintf((s), __VA_ARGS__) +#endif + +#ifndef pgm_read_byte +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#endif +#ifndef pgm_read_word +#define pgm_read_word(addr) (*(const unsigned short *)(addr)) +#endif +#ifndef pgm_read_dword +#define pgm_read_dword(addr) (*(const unsigned long *)(addr)) +#endif +#ifndef pgm_read_float +#define pgm_read_float(addr) (*(const float *)(addr)) +#endif + +#ifndef pgm_read_byte_near +#define pgm_read_byte_near(addr) pgm_read_byte(addr) +#endif +#ifndef pgm_read_word_near +#define pgm_read_word_near(addr) pgm_read_word(addr) +#endif +#ifndef pgm_read_dword_near +#define pgm_read_dword_near(addr) pgm_read_dword(addr) +#endif +#ifndef pgm_read_float_near +#define pgm_read_float_near(addr) pgm_read_float(addr) +#endif +#ifndef pgm_read_byte_far +#define pgm_read_byte_far(addr) pgm_read_byte(addr) +#endif +#ifndef pgm_read_word_far +#define pgm_read_word_far(addr) pgm_read_word(addr) +#endif +#ifndef pgm_read_dword_far +#define pgm_read_dword_far(addr) pgm_read_dword(addr) +#endif +#ifndef pgm_read_float_far +#define pgm_read_float_far(addr) pgm_read_float(addr) +#endif + +#ifndef pgm_read_pointer +#define pgm_read_pointer +#endif + +// Fix bug in pgm_read_ptr +#undef pgm_read_ptr +#define pgm_read_ptr(addr) (*((void**)(addr))) + +#endif // __AVR__ diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 5769da05d0f2..20cbb35386ba 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -43,6 +43,7 @@ #include #include "core/utility.h" + #include "module/motion.h" #include "module/planner.h" #include "module/endstops.h" @@ -57,6 +58,7 @@ #include "gcode/parser.h" #include "gcode/queue.h" +#include "feature/pause.h" #include "sd/cardreader.h" #include "lcd/marlinui.h" @@ -77,6 +79,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 @@ -135,7 +141,6 @@ #if ENABLED(EXPERIMENTAL_I2CBUS) #include "feature/twibus.h" - TWIBus i2c; #endif #if ENABLED(I2C_POSITION_ENCODERS) @@ -169,8 +174,8 @@ #include "feature/bedlevel/bedlevel.h" #endif -#if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) - #include "feature/pause.h" +#if ENABLED(GCODE_REPEAT_MARKERS) + #include "feature/repeat.h" #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -185,7 +190,7 @@ #include "feature/runout.h" #endif -#if HAS_Z_SERVO_PROBE +#if EITHER(PROBE_TARE, HAS_Z_SERVO_PROBE) #include "module/probe.h" #endif @@ -259,40 +264,12 @@ bool wait_for_heatup = true; #endif -#if PIN_EXISTS(CHDK) - extern millis_t chdk_timeout; -#endif - -#if ENABLED(I2C_POSITION_ENCODERS) - I2CPositionEncodersMgr I2CPEM; -#endif - /** * *************************************************************************** * ******************************** FUNCTIONS ******************************** * *************************************************************************** */ -void setup_killpin() { - #if HAS_KILL - #if KILL_PIN_STATE - SET_INPUT_PULLDOWN(KILL_PIN); - #else - SET_INPUT_PULLUP(KILL_PIN); - #endif - #endif -} - -void setup_powerhold() { - #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); - #endif - #if ENABLED(PSU_CONTROL) - powersupply_on = ENABLED(PSU_DEFAULT_OFF); - if (ENABLED(PSU_DEFAULT_OFF)) PSU_OFF(); else PSU_ON(); - #endif -} - /** * Stepper Reset (RigidBoard, et.al.) */ @@ -301,18 +278,6 @@ void setup_powerhold() { void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); } // Set to input, allowing pullups to pull the pin high #endif -#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0 - - void i2c_on_receive(int bytes) { // just echo all bytes received to serial - i2c.receive(bytes); - } - - void i2c_on_request() { // just send dummy data for now - i2c.reply("Hello World!\n"); - } - -#endif - /** * Sensitive pin test for M42, M226 */ @@ -334,17 +299,6 @@ bool pin_is_protected(const pin_t pin) { #pragma GCC diagnostic pop -void protected_pin_err() { - SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); -} - -void quickstop_stepper() { - planner.quick_stop(); - planner.synchronize(); - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); -} - void enable_e_steppers() { #define _ENA_E(N) ENABLE_AXIS_E##N(); REPEAT(E_STEPPERS, _ENA_E) @@ -356,6 +310,8 @@ void enable_all_steppers() { ENABLE_AXIS_Y(); ENABLE_AXIS_Z(); enable_e_steppers(); + + TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled()); } void disable_e_steppers() { @@ -375,42 +331,9 @@ void disable_all_steppers() { DISABLE_AXIS_Y(); DISABLE_AXIS_Z(); disable_e_steppers(); -} -#if ENABLED(G29_RETRY_AND_RECOVER) - - void event_probe_failure() { - #ifdef ACTION_ON_G29_FAILURE - host_action(PSTR(ACTION_ON_G29_FAILURE)); - #endif - #ifdef G29_FAILURE_COMMANDS - gcode.process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS)); - #endif - #if ENABLED(G29_HALT_ON_FAILURE) - #ifdef ACTION_ON_CANCEL - host_action_cancel(); - #endif - kill(GET_TEXT(MSG_LCD_PROBING_FAILED)); - #endif - } - - void event_probe_recover() { - TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR)); - #ifdef ACTION_ON_G29_RECOVER - host_action(PSTR(ACTION_ON_G29_RECOVER)); - #endif - #ifdef G29_RECOVER_COMMANDS - gcode.process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS)); - #endif - } - -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "feature/pause.h" -#else - constexpr bool did_pause_print = false; -#endif + TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled()); +} /** * A Print Job exists when the timer is running or SD printing @@ -435,6 +358,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) @@ -447,6 +371,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(); @@ -497,8 +422,8 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { // Prevent steppers timing-out in the middle of M600 // unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled - const bool parked_or_ignoring = ignore_stepper_queue || - (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print); + const bool parked_or_ignoring = ignore_stepper_queue + || TERN0(PAUSE_PARK_NO_STEPPER_TIMEOUT, did_pause_print); // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout if (parked_or_ignoring) gcode.reset_stepper_timeout(ms); @@ -536,6 +461,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { } #if PIN_EXISTS(CHDK) // Check if pin should be set to LOW (after M240 set it HIGH) + extern millis_t chdk_timeout; if (chdk_timeout && ELAPSED(ms, chdk_timeout)) { chdk_timeout = 0; WRITE(CHDK_PIN, LOW); @@ -572,7 +498,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 @@ -641,11 +567,12 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { #if ENABLED(DUAL_X_CARRIAGE) // handle delayed move timeout - if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) { + if (delayed_move_time && ELAPSED(ms, delayed_move_time) && IsRunning()) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done destination = current_position; prepare_line_to_destination(); + planner.synchronize(); } #endif @@ -696,6 +623,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)); @@ -707,7 +638,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()); @@ -751,6 +682,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(); @@ -759,6 +691,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 @@ -780,6 +713,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; } /** @@ -970,14 +907,15 @@ void setup() { #endif MYSERIAL0.begin(BAUDRATE); - uint32_t serial_connect_timeout = millis() + 1000UL; + millis_t serial_connect_timeout = millis() + 1000UL; while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + #if HAS_MULTI_SERIAL && !HAS_ETHERNET MYSERIAL1.begin(BAUDRATE); 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(); @@ -1012,13 +950,29 @@ void setup() { SETUP_RUN(recovery.setup()); #endif - SETUP_RUN(setup_killpin()); + #if HAS_KILL + SETUP_LOG("KILL_PIN"); + #if KILL_PIN_STATE + SET_INPUT_PULLDOWN(KILL_PIN); + #else + SET_INPUT_PULLUP(KILL_PIN); + #endif + #endif #if HAS_TMC220x SETUP_RUN(tmc_serial_begin()); #endif - SETUP_RUN(setup_powerhold()); + #if HAS_SUICIDE + SETUP_LOG("SUICIDE_PIN") + OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); + #endif + + #if ENABLED(PSU_CONTROL) + SETUP_LOG("PSU_CONTROL"); + powersupply_on = ENABLED(PSU_DEFAULT_OFF); + if (ENABLED(PSU_DEFAULT_OFF)) PSU_OFF(); else PSU_ON(); + #endif #if HAS_STEPPER_RESET SETUP_RUN(disableStepperDrivers()); @@ -1095,6 +1049,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 @@ -1331,7 +1289,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/MarlinCore.h b/Marlin/src/MarlinCore.h index 908636e9677c..f5bdbed535e2 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -37,11 +37,6 @@ void stop(); void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false)); inline void idle_no_sleep() { idle(TERN_(ADVANCED_PAUSE_FEATURE, true)); } -#if ENABLED(EXPERIMENTAL_I2CBUS) - #include "feature/twibus.h" - extern TWIBus i2c; -#endif - #if ENABLED(G38_PROBE_TARGET) extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed @@ -59,8 +54,6 @@ void disable_all_steppers(); void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false); void minkill(const bool steppers_off=false); -void quickstop_stepper(); - // Global State of the firmware enum MarlinState : uint8_t { MF_INITIALIZING = 0, @@ -103,7 +96,6 @@ extern bool wait_for_heatup; #endif bool pin_is_protected(const pin_t pin); -void protected_pin_err(); #if HAS_SUICIDE inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); } @@ -116,11 +108,6 @@ void protected_pin_err(); inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; } #endif -#if ENABLED(G29_RETRY_AND_RECOVER) - void event_probe_recover(); - void event_probe_failure(); -#endif - extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[], SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[], diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index a6fc1b4dfdd0..13a202daedb1 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 @@ -188,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 @@ -318,20 +319,25 @@ #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 +#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_V4210 4040 // Creality v4.2.10 (STM32F103RE) as found in the CR-30 +#define BOARD_CREALITY_V431 4041 // Creality v4.3.1 (STM32F103RE) +#define BOARD_CREALITY_V452 4042 // Creality v4.5.2 (STM32F103RE) +#define BOARD_CREALITY_V453 4043 // Creality v4.5.3 (STM32F103RE) +#define BOARD_TRIGORILLA_PRO 4044 // Trigorilla Pro (STM32F103ZET6) +#define BOARD_FLY_MINI 4045 // FLY MINI (STM32F103RCT6) +#define BOARD_FLSUN_HISPEED 4046 // FLSUN HiSpeedV1 (STM32F103VET6) +#define BOARD_BEAST 4047 // STM32F103RET6 Libmaple-based controller // // ARM Cortex-M4F @@ -363,6 +369,10 @@ #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) +#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/language.h b/Marlin/src/core/language.h index f1e477933ad9..923ad903cb55 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -68,6 +68,7 @@ // ro Romanian // ru Russian // sk Slovak +// sv Swedish // tr Turkish // uk Ukrainian // vi Vietnamese @@ -91,7 +92,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 @@ -154,6 +155,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/core/macros.h b/Marlin/src/core/macros.h index 2e38fad30ef6..d5b3342437ea 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -84,17 +84,13 @@ #define _BV(n) (1<<(n)) #define TEST(n,b) (!!((n)&_BV(b))) #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) - #ifndef SBI - #define SBI(A,B) (A |= (1 << (B))) + #define SBI(A,B) (A |= _BV(B)) #endif - #ifndef CBI - #define CBI(A,B) (A &= ~(1 << (B))) + #define CBI(A,B) (A &= ~_BV(B)) #endif - #define TBI(N,B) (N ^= _BV(B)) - #define _BV32(b) (1UL << (b)) #define TEST32(n,b) !!((n)&_BV32(b)) #define SBI32(n,b) (n |= _BV32(b)) @@ -151,7 +147,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 +160,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)) @@ -214,6 +212,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) @@ -284,6 +283,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/core/multi_language.h b/Marlin/src/core/multi_language.h index 6af4af2f8df4..5a26edf8d453 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -20,6 +20,8 @@ ****************************************************************************/ #pragma once +#include "../inc/MarlinConfigPre.h" + typedef const char Language_Str[]; #ifdef LCD_LANGUAGE_5 @@ -57,26 +59,27 @@ typedef const char Language_Str[]; #define GET_LANG(LANG) _GET_LANG(LANG) #if NUM_LANGUAGES > 1 - extern uint8_t lang; + #define HAS_MULTI_LANGUAGE 1 #define GET_TEXT(MSG) ( \ - lang == 0 ? GET_LANG(LCD_LANGUAGE)::MSG : \ - lang == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \ - lang == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \ - lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \ - GET_LANG(LCD_LANGUAGE_5)::MSG \ - ) - #define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \ - GET_LANG(LCD_LANGUAGE_5)::CHARSIZE) + ui.language == 0 ? GET_LANG(LCD_LANGUAGE )::MSG : \ + ui.language == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \ + ui.language == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \ + ui.language == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \ + GET_LANG(LCD_LANGUAGE_5)::MSG ) + #define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE )::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_5)::CHARSIZE ) #else #define GET_TEXT(MSG) GET_LANG(LCD_LANGUAGE)::MSG - #define MAX_LANG_CHARSIZE GET_LANG(LCD_LANGUAGE)::CHARSIZE + #define MAX_LANG_CHARSIZE LANG_CHARSIZE #endif #define GET_TEXT_F(MSG) (const __FlashStringHelper*)GET_TEXT(MSG) #define GET_LANGUAGE_NAME(INDEX) GET_LANG(LCD_LANGUAGE_##INDEX)::LANGUAGE +#define LANG_CHARSIZE GET_TEXT(CHARSIZE) +#define USE_WIDE_GLYPH (LANG_CHARSIZE > 2) #define MSG_1_LINE(A) A "\0" "\0" #define MSG_2_LINE(A,B) A "\0" B "\0" 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/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/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/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index 995e9d0dbcef..a33f08ad0ee1 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -23,6 +23,10 @@ #include "../../inc/MarlinConfigPre.h" +#if EITHER(RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28) + #define G28_L0_ENSURES_LEVELING_OFF 1 +#endif + #if ENABLED(PROBE_MANUALLY) extern bool g29_in_progress; #else 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; } 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 c90b1f7ac155..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]; @@ -122,20 +130,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) }; @@ -173,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. @@ -186,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), @@ -215,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 94bec99194b7..3f7b2d7d9666 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -321,7 +321,8 @@ // Check for commands that require the printer to be homed if (may_move) { planner.synchronize(); - if (axes_should_home()) gcode.home_all_axes(); + // Send 'N' to force homing before G29 (internal only) + if (axes_should_home() || parser.seen('N')) gcode.home_all_axes(); TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0)); } @@ -543,7 +544,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: { @@ -727,7 +728,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 &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 +759,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, 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 +789,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(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) ); } @@ -972,6 +973,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); @@ -1206,7 +1213,7 @@ found_a_NAN = true; - xy_int8_t near { -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 +1228,7 @@ if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l) d2 = d1; - near.set(i, j); + nearby.set(i, j); } } @@ -1229,8 +1236,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 && nearby.x >= 0 && d2 > farthest.distance) { + farthest.pos = nearby; // Found an invalid location farther from the defined mesh point farthest.distance = d2; } } // GRID_LOOP 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. 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/feature/bltouch.h b/Marlin/src/feature/bltouch.h index 40685af1b357..8bd41f03e404 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -23,19 +23,16 @@ #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; -#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/feature/dac/dac_dac084s085.cpp b/Marlin/src/feature/dac/dac_dac084s085.cpp index 82d17fa28f07..649aa5561bfa 100644 --- a/Marlin/src/feature/dac/dac_dac084s085.cpp +++ b/Marlin/src/feature/dac/dac_dac084s085.cpp @@ -92,7 +92,7 @@ void dac084s085::cshigh() { WRITE(SPI_EEPROM1_CS, HIGH); WRITE(SPI_EEPROM2_CS, HIGH); WRITE(SPI_FLASH_CS, HIGH); - WRITE(SS_PIN, HIGH); + WRITE(SD_SS_PIN, HIGH); } #endif // MB(ALLIGATOR) 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/feature/direct_stepping.h b/Marlin/src/feature/direct_stepping.h index cde9d1a0b438..b3007731cdb2 100644 --- a/Marlin/src/feature/direct_stepping.h +++ b/Marlin/src/feature/direct_stepping.h @@ -93,8 +93,8 @@ namespace DirectStepping { static constexpr int DIRECTIONAL = dir ? 1 : 0; static constexpr int SEGMENTS = segments; - static constexpr int NUM_SEGMENTS = 1 << BITS_SEGMENT; - static constexpr int SEGMENT_STEPS = (1 << (BITS_SEGMENT - DIRECTIONAL)) - 1; + static constexpr int NUM_SEGMENTS = _BV(BITS_SEGMENT); + static constexpr int SEGMENT_STEPS = _BV(BITS_SEGMENT - DIRECTIONAL) - 1; static constexpr int TOTAL_STEPS = SEGMENT_STEPS * SEGMENTS; static constexpr int PAGE_SIZE = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8; diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 0bb0253149eb..659e516787fc 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -33,7 +33,6 @@ // External references extern bool wait_for_user, wait_for_heatup; -void quickstop_stepper(); class EmergencyParser { @@ -76,7 +75,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/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 8a3e959e0702..fa3cf1503f4d 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -34,7 +34,6 @@ #include "encoder_i2c.h" -#include "../module/temperature.h" #include "../module/stepper.h" #include "../gcode/parser.h" @@ -42,6 +41,8 @@ #include +I2CPositionEncodersMgr I2CPEM; + void I2CPositionEncoder::init(const uint8_t address, const AxisEnum axis) { encoderAxis = axis; i2cAddress = address; @@ -85,7 +86,7 @@ void I2CPositionEncoder::update() { * the encoder would be re-enabled. */ - /* + #if 0 // If the magnetic strength has been good for a certain time, start trusting the module again if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) { @@ -111,7 +112,7 @@ void I2CPositionEncoder::update() { SERIAL_ECHOLNPGM(")"); #endif } - */ + #endif return; } @@ -332,7 +333,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 +383,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/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index e5c52562a9ad..2a71af11d67d 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -139,7 +139,7 @@ void FWRetract::retract(const bool retracting if (retracting) { // Retract by moving from a faux E position back to the current E position current_retract[active_extruder] = base_retract; - prepare_internal_move_to_destination( // set current to destination + prepare_internal_move_to_destination( // set current from destination settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) ); diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp index d9c5ae7c1b1c..3dca2eb2e9bd 100644 --- a/Marlin/src/feature/joystick.cpp +++ b/Marlin/src/feature/joystick.cpp @@ -32,7 +32,6 @@ #include "../inc/MarlinConfig.h" // for pins #include "../module/planner.h" -#include "../module/temperature.h" Joystick joystick; @@ -127,6 +126,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 diff --git a/Marlin/src/feature/joystick.h b/Marlin/src/feature/joystick.h index 1d25a30cc24d..e8e218b2f940 100644 --- a/Marlin/src/feature/joystick.h +++ b/Marlin/src/feature/joystick.h @@ -27,7 +27,6 @@ #include "../inc/MarlinConfigPre.h" #include "../core/types.h" -#include "../core/macros.h" #include "../module/temperature.h" class Joystick { 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/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/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); } diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 61adcfca72a7..a4b7f257a9b8 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -91,8 +91,6 @@ MMU2 mmu2; #define MMU2_NO_TOOL 99 #define MMU_BAUD 115200 -#define mmuSerial MMU2_SERIAL - bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; #if HAS_PRUSA_MMU2S bool MMU2::mmu2s_triggered; @@ -128,12 +126,11 @@ void MMU2::init() { set_runout_valid(false); #if PIN_EXISTS(MMU2_RST) - // TODO use macros for this WRITE(MMU2_RST_PIN, HIGH); SET_OUTPUT(MMU2_RST_PIN); #endif - mmuSerial.begin(MMU_BAUD); + MMU2_SERIAL.begin(MMU_BAUD); extruder = MMU2_NO_TOOL; safe_delay(10); @@ -386,8 +383,8 @@ bool MMU2::rx_start() { bool MMU2::rx_str_P(const char* str) { uint8_t i = strlen(rx_buffer); - while (mmuSerial.available()) { - rx_buffer[i++] = mmuSerial.read(); + while (MMU2_SERIAL.available()) { + rx_buffer[i++] = MMU2_SERIAL.read(); rx_buffer[i] = '\0'; if (i == sizeof(rx_buffer) - 1) { @@ -418,7 +415,7 @@ bool MMU2::rx_str_P(const char* str) { void MMU2::tx_str_P(const char* str) { clear_rx_buffer(); uint8_t len = strlen_P(str); - LOOP_L_N(i, len) mmuSerial.write(pgm_read_byte(str++)); + LOOP_L_N(i, len) MMU2_SERIAL.write(pgm_read_byte(str++)); rx_buffer[0] = '\0'; prev_request = millis(); } @@ -429,7 +426,7 @@ void MMU2::tx_str_P(const char* str) { void MMU2::tx_printf_P(const char* format, int argument = -1) { clear_rx_buffer(); uint8_t len = sprintf_P(tx_buffer, format, argument); - LOOP_L_N(i, len) mmuSerial.write(tx_buffer[i]); + LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]); rx_buffer[0] = '\0'; prev_request = millis(); } @@ -440,7 +437,7 @@ void MMU2::tx_printf_P(const char* format, int argument = -1) { void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { clear_rx_buffer(); uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2); - LOOP_L_N(i, len) mmuSerial.write(tx_buffer[i]); + LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]); rx_buffer[0] = '\0'; prev_request = millis(); } @@ -449,7 +446,7 @@ void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { * Empty the rx buffer */ void MMU2::clear_rx_buffer() { - while (mmuSerial.available()) mmuSerial.read(); + while (MMU2_SERIAL.available()) MMU2_SERIAL.read(); rx_buffer[0] = '\0'; } @@ -955,7 +952,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { /** * Load filament to nozzle of multimaterial printer * - * This function is used only only after T? (user select filament) and M600 (change filament). + * This function is used 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. */ diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 1593b0cc572e..5ab4f2b146b9 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -137,10 +137,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); #endif - #if HAS_LCD_MENU - lcd_pause_show_message(PAUSE_MESSAGE_HEATING, mode); - #endif - UNUSED(mode); + ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode); if (wait) return thermalManager.wait_for_hotend(active_extruder); @@ -181,19 +178,13 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l DEBUG_SECTION(lf, "load_filament", true); DEBUG_ECHOLNPAIR("... slowlen:", slow_load_length, " fastlen:", fast_load_length, " purgelen:", purge_length, " maxbeep:", int(max_beep_count), " showlcd:", int(show_lcd), " pauseforuser:", int(pause_for_user), " pausemode:", int(mode) DXC_SAY); - UNUSED(show_lcd); - if (!ensure_safe_temperature(false, mode)) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_STATUS, mode); return false; } if (pause_for_user) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_INSERT, mode); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_INSERT, mode); SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_INSERT)); first_impatient_beep(max_beep_count); @@ -217,9 +208,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l } } - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_LOAD, mode); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_LOAD, mode); #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; @@ -250,9 +239,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE); TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR)); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."))); @@ -266,9 +253,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l do { if (purge_length > 0) { // "Wait for filament purge" - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE); // Extrude filament to get into hotend unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE); @@ -281,7 +266,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l // Show "Purge More" / "Resume" menu and wait for reply KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = false; - lcd_pause_show_message(PAUSE_MESSAGE_OPTION); + ui.pause_show_message(PAUSE_MESSAGE_OPTION); while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep(); } #endif @@ -295,6 +280,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 * @@ -318,22 +315,16 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, #endif ); - UNUSED(show_lcd); - #if !BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) constexpr float mix_multiplier = 1.0; #endif if (!ensure_safe_temperature(false, mode)) { - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_STATUS); return false; } - #if HAS_LCD_MENU - if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, mode); - #endif + if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_UNLOAD, mode); // Retract filament unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier); @@ -357,11 +348,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 +435,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; } @@ -467,7 +458,7 @@ void show_continue_prompt(const bool is_reload) { DEBUG_SECTION(scp, "pause_print", true); DEBUG_ECHOLNPAIR("... is_reload:", int(is_reload)); - TERN_(HAS_LCD_MENU, lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING)); + ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); SERIAL_ECHO_START(); serialprintPGM(is_reload ? PSTR(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n")); } @@ -508,7 +499,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep // Wait for the user to press the button to re-heat the nozzle, then // re-heat the nozzle, re-show the continue prompt, restart idle timers, start over if (nozzle_timed_out) { - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_HEAT)); + ui.pause_show_message(PAUSE_MESSAGE_HEAT); SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT)); TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_HEATER_TIMEOUT), GET_TEXT(MSG_REHEAT))); @@ -602,7 +593,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le thermalManager.wait_for_hotend(active_extruder, false); } - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_RESUME)); + ui.pause_show_message(PAUSE_MESSAGE_RESUME); // Check Temperature before moving hotend ensure_safe_temperature(); @@ -641,7 +632,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le // Write PLR now to update the z axis value TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); + ui.pause_show_message(PAUSE_MESSAGE_STATUS); #ifdef ACTION_ON_RESUMED host_action_resumed(); diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index c69ed73546e0..7e58d4564ebb 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -101,4 +101,8 @@ bool unload_filament(const float &unload_length, const bool show_lcd=false, cons #endif ); -#endif // ADVANCED_PAUSE_FEATURE +#else // !ADVANCED_PAUSE_FEATURE + + constexpr uint8_t did_pause_print = 0; + +#endif // !ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 8d05d146986f..d22247b46df4 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -122,7 +122,7 @@ void Power::power_off() { #ifdef PSU_POWEROFF_GCODE GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWEROFF_GCODE)); #endif - PSU_PIN_OFF(); + PSU_PIN_OFF(); } } 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/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index c4e0ef694abe..0e669a74d49c 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -180,8 +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.feedrate = uint16_t(MMS_TO_MMM(feedrate_mm_s)); 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); @@ -340,6 +342,30 @@ void PrintJobRecovery::resume() { gcode.process_subcommands_now_P(PSTR("M420 S0 Z0")); #endif + #if HAS_HEATED_BED + const int16_t bt = info.target_temperature_bed; + if (bt) { + // Restore the bed temperature + sprintf_P(cmd, PSTR("M190 S%i"), bt); + gcode.process_subcommands_now(cmd); + } + #endif + + // Restore all hotend temperatures + #if HAS_HOTEND + HOTEND_LOOP() { + const int16_t et = info.target_temperature[e]; + if (et) { + #if HAS_MULTI_HOTEND + sprintf_P(cmd, PSTR("T%i S"), e); + gcode.process_subcommands_now(cmd); + #endif + sprintf_P(cmd, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(cmd); + } + } + #endif + // Reset E, raise Z, home XY... #if Z_HOME_DIR > 0 @@ -351,20 +377,11 @@ void PrintJobRecovery::resume() { #else // "G92.9 E0 ..." - // Set Z to 0, raise Z by info.zraise, and Home (XY only for Cartesian) - // with no raise. (Only do simulated homing in Marlin Dev Mode.) - - sprintf_P(cmd, PSTR("G92.9 E0 " - #if ENABLED(BACKUP_POWER_SUPPLY) - "Z%s" // Z was already raised at outage - #else - "Z0\nG1Z%s" // Set Z=0 and Raise Z now - #endif - ), - dtostrf(info.zraise, 1, 3, str_1) - ); + // If a Z raise occurred at outage restore Z, otherwise raise Z now + sprintf_P(cmd, PSTR("G92.9 E0 " TERN(BACKUP_POWER_SUPPLY, "Z%s", "Z0\nG1Z%s")), dtostrf(info.zraise, 1, 3, str_1)); gcode.process_subcommands_now(cmd); + // Home safely with no Z raise gcode.process_subcommands_now_P(PSTR( "G28R0" // No raise during G28 #if IS_CARTESIAN && DISABLED(POWER_LOSS_RECOVER_ZHOME) @@ -402,30 +419,6 @@ void PrintJobRecovery::resume() { #endif #endif - #if HAS_HEATED_BED - const int16_t bt = info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - gcode.process_subcommands_now(cmd); - } - #endif - - // Restore all hotend temperatures - #if HAS_HOTEND - HOTEND_LOOP() { - const int16_t et = info.target_temperature[e]; - if (et) { - #if HAS_MULTI_HOTEND - sprintf_P(cmd, PSTR("T%i S"), e); - gcode.process_subcommands_now(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - gcode.process_subcommands_now(cmd); - } - } - #endif - // Select the previously active tool (with no_move) #if HAS_MULTI_EXTRUDER sprintf_P(cmd, PSTR("T%i S"), info.active_extruder); @@ -507,6 +500,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..25581e17230d 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); @@ -146,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/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..0f4d9425b768 --- /dev/null +++ b/Marlin/src/feature/repeat.h @@ -0,0 +1,53 @@ +/** + * 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 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); + static void loop(); + static void cancel(); +}; + +extern Repeat repeat; diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 50e18e52ef04..be769d2dc82f 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -59,6 +59,7 @@ bool FilamentMonitorBase::enabled = true, // Filament Runout event handler // #include "../MarlinCore.h" +#include "../feature/pause.h" #include "../gcode/queue.h" #if ENABLED(HOST_ACTION_COMMANDS) @@ -71,7 +72,7 @@ bool FilamentMonitorBase::enabled = true, void event_filament_runout() { - if (TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print)) return; // Action already in progress. Purge triggered repeated runout. + if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) if (migration.in_progress) { diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 09443e6e2b2d..4b93d01eb7a1 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -118,9 +118,7 @@ class TFilamentMonitor : public FilamentMonitorBase { // Give the response a chance to update its counter. static inline void run() { - if ( enabled && !filament_ran_out - && (printingIsActive() || TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print)) - ) { + if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) { TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here response.run(); sensor.run(); @@ -343,9 +341,7 @@ class FilamentSensorBase { } static inline void block_completed(const block_t* const b) { - if (b->steps.x || b->steps.y || b->steps.z - || TERN0(ADVANCED_PAUSE_FEATURE, did_pause_print) // Allow pause purge move to re-trigger runout state - ) { + if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; const int32_t steps = b->steps.e; diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index 8646ec872f6f..623f223caa1b 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -28,48 +28,41 @@ #include "../module/motion.h" // for active_extruder -#if ENABLED(MANUAL_SOLENOID_CONTROL) - #define HAS_SOLENOID(N) HAS_SOLENOID_##N -#else - #define HAS_SOLENOID(N) (HAS_SOLENOID_##N && EXTRUDERS > N) +// PARKING_EXTRUDER options alter the default behavior of solenoids, this ensures compliance of M380-381 + +#if ENABLED(PARKING_EXTRUDER) + #include "../module/tool_change.h" #endif +#define HAS_SOLENOID(N) (HAS_SOLENOID_##N && (ENABLED(MANUAL_SOLENOID_CONTROL) || N < EXTRUDERS)) + // Used primarily with MANUAL_SOLENOID_CONTROL static void set_solenoid(const uint8_t num, const bool active) { - const uint8_t value = active ? HIGH : LOW; + const uint8_t value = active ? PE_MAGNET_ON_STATE : !PE_MAGNET_ON_STATE; switch (num) { - case 0: - OUT_WRITE(SOL0_PIN, value); - break; + case 0: OUT_WRITE(SOL0_PIN, value); break; #if HAS_SOLENOID(1) - case 1: - OUT_WRITE(SOL1_PIN, value); - break; + case 1: OUT_WRITE(SOL1_PIN, value); break; #endif #if HAS_SOLENOID(2) - case 2: - OUT_WRITE(SOL2_PIN, value); - break; + case 2: OUT_WRITE(SOL2_PIN, value); break; #endif #if HAS_SOLENOID(3) - case 3: - OUT_WRITE(SOL3_PIN, value); - break; + case 3: OUT_WRITE(SOL3_PIN, value); break; #endif #if HAS_SOLENOID(4) - case 4: - OUT_WRITE(SOL4_PIN, value); - break; + case 4: OUT_WRITE(SOL4_PIN, value); break; #endif #if HAS_SOLENOID(5) - case 5: - OUT_WRITE(SOL5_PIN, value); - break; + case 5: OUT_WRITE(SOL5_PIN, value); break; #endif - default: - SERIAL_ECHO_MSG(STR_INVALID_SOLENOID); - break; + default: SERIAL_ECHO_MSG(STR_INVALID_SOLENOID); break; } + + #if ENABLED(PARKING_EXTRUDER) + if (!active && active_extruder == num) // If active extruder's solenoid is disabled, carriage is considered parked + parking_extruder_set_parked(true); + #endif } void enable_solenoid(const uint8_t num) { set_solenoid(num, true); } diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 3b28b61b4944..66c04a001c0a 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -36,6 +36,9 @@ SpindleLaser cutter; uint8_t SpindleLaser::power; +#if ENABLED(LASER_FEATURE) + cutter_test_pulse_t SpindleLaser::testPulse = 50; // Test fire Pulse time ms value. +#endif bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR cutter_power_t SpindleLaser::menuPower, // Power set via LCD menu in PWM, PERCENT, or RPM SpindleLaser::unitPower; // LCD status power in PWM, PERCENT, or RPM @@ -43,7 +46,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 +74,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 +107,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; } @@ -118,7 +128,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..57fc136c8ca3 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -30,6 +30,10 @@ #include "spindle_laser_types.h" +#if USE_BEEPER + #include "../libs/buzzer.h" +#endif + #if ENABLED(LASER_POWER_INLINE) #include "../module/planner.h" #endif @@ -57,7 +61,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), @@ -90,6 +94,10 @@ class SpindleLaser { static const cutter_power_t mpower_min() { return cpwr_to_upwr(SPEED_POWER_MIN); } static const cutter_power_t mpower_max() { return cpwr_to_upwr(SPEED_POWER_MAX); } + #if ENABLED(LASER_FEATURE) + static cutter_test_pulse_t testPulse; // Test fire Pulse ms value + #endif + static bool isReady; // Ready to apply power setting from the UI to OCR static uint8_t power; @@ -117,6 +125,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 +157,7 @@ class SpindleLaser { #elif CUTTER_UNIT_IS(RPM) 2 #else - #error "???" + #error "CUTTER_UNIT_IS(???)" #endif )); } @@ -191,9 +205,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 +224,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() { @@ -221,7 +238,21 @@ class SpindleLaser { } #endif - #endif + #if ENABLED(LASER_FEATURE) + /** + * Test fire the laser using the testPulse ms duration + * Also fires with any PWM power that was previous set + * If not set defaults to 80% power + */ + static inline void test_fire_pulse() { + enable_forward(); // Turn Laser on (Spindle speak but same funct) + TERN_(USE_BEEPER, buzzer.tone(30, 3000)); + delay(testPulse); // Delay for time set by user in pulse ms menu screen. + disable(); // Turn laser off + } + #endif + + #endif // HAS_LCD_MENU #if ENABLED(LASER_POWER_INLINE) /** diff --git a/Marlin/src/feature/spindle_laser_types.h b/Marlin/src/feature/spindle_laser_types.h index 181c4d73ac07..0075e5481900 100644 --- a/Marlin/src/feature/spindle_laser_types.h +++ b/Marlin/src/feature/spindle_laser_types.h @@ -39,12 +39,22 @@ 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(LASER_FEATURE) + typedef uint16_t cutter_test_pulse_t; + #define CUTTER_MENU_PULSE_TYPE uint16_3 #endif #if ENABLED(MARLIN_DEV_MODE) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index d27177326bc6..8d0156883baa 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -147,7 +147,7 @@ static TMC_driver_data get_driver_data(TMC2208Stepper &st) { constexpr uint8_t OTPW_bp = 0, OT_bp = 1; - constexpr uint8_t S2G_bm = 0b11110; // 2..5 + constexpr uint8_t S2G_bm = 0b111100; // 2..5 TMC_driver_data data; const auto ds = data.drv_status = st.DRV_STATUS(); data.is_otpw = TEST(ds, OTPW_bp); @@ -291,7 +291,7 @@ bool should_step_down = false; if (need_update_error_counters) { - if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; + if (data.is_ot | data.is_s2g) st.error_count++; else if (st.error_count > 0) st.error_count--; #if ENABLED(STOP_ON_ERROR) @@ -604,8 +604,6 @@ case TMC_PWM_OFS_AUTO: SERIAL_PRINT(st.pwm_ofs_auto(), DEC); break; case TMC_PWM_GRAD_AUTO: SERIAL_PRINT(st.pwm_grad_auto(), DEC); break; 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; } @@ -631,6 +629,8 @@ case TMC_T150: if (st.t150()) SERIAL_CHAR('*'); break; case TMC_T143: if (st.t143()) SERIAL_CHAR('*'); break; case TMC_T120: if (st.t120()) SERIAL_CHAR('*'); break; + case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break; + case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break; case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break; default: break; } diff --git a/Marlin/src/feature/tramming.cpp b/Marlin/src/feature/tramming.cpp new file mode 100644 index 000000000000..d03f0cf53bd7 --- /dev/null +++ b/Marlin/src/feature/tramming.cpp @@ -0,0 +1,69 @@ +/** + * 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 ENABLED(ASSISTED_TRAMMING) + +#include "tramming.h" + +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +#include "../core/debug_out.h" + +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 + PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); + #ifdef TRAMMING_POINT_NAME_5 + PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); + #ifdef TRAMMING_POINT_NAME_6 + PGMSTR(point_name_6, TRAMMING_POINT_NAME_6); + #endif + #endif +#endif + +PGM_P const tramming_point_name[] PROGMEM = { + 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 + #ifdef TRAMMING_POINT_NAME_6 + , point_name_6 + #endif + #endif + #endif +}; + +#ifdef ASSISTED_TRAMMING_WAIT_POSITION + + // Move to the defined wait position + void move_to_tramming_wait_pos() { + constexpr xyz_pos_t wait_pos = ASSISTED_TRAMMING_WAIT_POSITION; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Moving away"); + do_blocking_move_to(wait_pos, XY_PROBE_FEEDRATE_MM_S); + } + +#endif + +#endif // ASSISTED_TRAMMING diff --git a/Marlin/src/feature/tramming.h b/Marlin/src/feature/tramming.h index 79f7407716d3..eb27fe82fe2a 100644 --- a/Marlin/src/feature/tramming.h +++ b/Marlin/src/feature/tramming.h @@ -19,8 +19,10 @@ * along with this program. If not, see . * */ +#pragma once -#include "../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfig.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." @@ -29,13 +31,20 @@ 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."); +static_assert(WITHIN(G35_PROBE_COUNT, 3, 6), "TRAMMING_POINT_XY requires between 3 and 6 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); VALIDATE_TRAMMING_POINT(5); 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[] + #ifdef TRAMMING_POINT_NAME_6 + , point_name_6[] + #endif #endif #endif ; @@ -50,6 +59,10 @@ extern const char point_name_1[], point_name_2[], point_name_3[] #ifdef TRAMMING_POINT_NAME_5 #undef _NR_TRAM_NAMES #define _NR_TRAM_NAMES 5 + #ifdef TRAMMING_POINT_NAME_6 + #undef _NR_TRAM_NAMES + #define _NR_TRAM_NAMES 6 + #endif #endif #endif #endif @@ -57,3 +70,9 @@ static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_N #undef _NR_TRAM_NAMES extern PGM_P const tramming_point_name[]; + +#ifdef ASSISTED_TRAMMING_WAIT_POSITION + void move_to_tramming_wait_pos(); +#else + inline void move_to_tramming_wait_pos() {} +#endif diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index 3cc20579ac57..855a3188d10c 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -28,6 +28,8 @@ #include +TWIBus i2c; + TWIBus::TWIBus() { #if I2C_SLAVE_ADDRESS == 0 Wire.begin(); // No address joins the BUS as the master @@ -155,6 +157,14 @@ void TWIBus::flush() { reset(); } + void i2c_on_receive(int bytes) { // just echo all bytes received to serial + i2c.receive(bytes); + } + + void i2c_on_request() { // just send dummy data for now + i2c.reply("Hello World!\n"); + } + #endif #if ENABLED(DEBUG_TWIBUS) diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 82aa9aa16a2a..59391534824c 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -31,6 +31,17 @@ typedef void (*twiReceiveFunc_t)(int bytes); typedef void (*twiRequestFunc_t)(); +/** + * For a light i2c protocol that runs on two boards running Marlin see: + * See https://github.com/MarlinFirmware/Marlin/issues/4776#issuecomment-246262879 + */ +#if I2C_SLAVE_ADDRESS > 0 + + void i2c_on_receive(int bytes); // Demo i2c onReceive handler + void i2c_on_request(); // Demo i2c onRequest handler + +#endif + #define TWIBUS_BUFFER_SIZE 32 /** @@ -238,3 +249,5 @@ class TWIBus { static inline void debug(const char[], uint8_t) {} #endif }; + +extern TWIBus i2c; diff --git a/Marlin/src/feature/z_stepper_align.cpp b/Marlin/src/feature/z_stepper_align.cpp index 87b1f6f25163..1b4eb4474903 100644 --- a/Marlin/src/feature/z_stepper_align.cpp +++ b/Marlin/src/feature/z_stepper_align.cpp @@ -54,27 +54,11 @@ 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) + #else // !Z_STEPPER_ALIGN_XY const xy_pos_t xy_init[] = { #if NUM_Z_STEPPER_DRIVERS >= 3 // First probe point... @@ -115,7 +99,7 @@ void ZStepperAlign::reset_to_default() { #endif }; - #endif // !defined(Z_STEPPER_ALIGN_XY) + #endif // !Z_STEPPER_ALIGN_XY COPY(xy, xy_init); diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 789d8bcf193a..46f75f25906f 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -40,27 +40,7 @@ // Define tramming point names. // -#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 - PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); - #ifdef TRAMMING_POINT_NAME_5 - PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); - #endif -#endif - -PGM_P const tramming_point_name[] PROGMEM = { - 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 -}; +#include "../../feature/tramming.h" /** * G35: Read bed corners to help adjust bed screws @@ -178,11 +158,10 @@ void GcodeSuite::G35() { // the probe deployed if it was successful. probe.stow(); + move_to_tramming_wait_pos(); + // 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")); } #endif // ASSISTED_TRAMMING diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 9999d92e223b..28ffd59edc30 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -181,14 +181,18 @@ G29_TYPE GcodeSuite::G29() { no_action = seenA || seenQ, faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action; - // Don't allow auto-leveling without homing first - if (homing_needed_error()) G29_RETURN(false); - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip"); G29_RETURN(false); } + // Send 'N' to force homing before G29 (internal only) + if (parser.seen('N')) + gcode.process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR)); + + // Don't allow auto-leveling without homing first + if (homing_needed_error()) G29_RETURN(false); + // Define local vars 'static' for manual probing, 'auto' otherwise #define ABL_VAR TERN_(PROBE_MANUALLY, static) @@ -249,7 +253,6 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_LINEAR) struct linear_fit_data lsf_results; - incremental_LSF_reset(&lsf_results); #endif /** @@ -324,6 +327,8 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_LINEAR) + incremental_LSF_reset(&lsf_results); + do_topography_map = verbose_level > 2 || parser.boolval('T'); // X and Y specify points in each direction, overriding the default @@ -392,7 +397,22 @@ G29_TYPE GcodeSuite::G29() { planner.synchronize(); - if (!faux) remember_feedrate_scaling_off(); + #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 BOTH(AUTO_BED_LEVELING_BILINEAR, EXTENSIBLE_UI) + ExtUI::onMeshLevelingStart(); + #endif + + if (!faux) { + remember_feedrate_scaling_off(); + + #if ENABLED(PREHEAT_BEFORE_LEVELING) + if (!dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP); + #endif + } // Disable auto bed leveling during G29. // Be formal so G29 can be done successively without G28. @@ -409,7 +429,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) ) { @@ -423,18 +442,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) diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index d5cc8a4fcb83..cf27c14d3b12 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -85,7 +85,7 @@ void GcodeSuite::G29() { mbl.reset(); mbl_probe_index = 0; if (!ui.wait_for_move) { - queue.inject_P(PSTR("G28\nG29 S2")); + queue.inject_P(parser.seen('N') ? PSTR("G28" TERN(G28_L0_ENSURES_LEVELING_OFF, "L0", "") "\nG29S2") : PSTR("G29S2")); return; } state = MeshNext; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index c4effe7d58b8..2de029a08b0f 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 @@ -207,8 +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); - #if ENABLED(DUAL_X_CARRIAGE) bool IDEX_saved_duplication_state = extruder_duplication_enabled; DualXMode IDEX_saved_mode = dual_x_carriage_mode; @@ -225,25 +227,26 @@ 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; } + 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); + const bool leveling_restore_state = parser.boolval('L', TERN(RESTORE_LEVELING_AFTER_G28, planner.leveling_active, ENABLED(ENABLE_LEVELING_AFTER_G28))); + IF_ENABLED(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session 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 @@ -287,6 +290,10 @@ void GcodeSuite::G28() { #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) const uint8_t old_tool_index = active_extruder; #endif + // PARKING_EXTRUDER homing requires different handling of movement / solenoid activation, depending on the side of homing + #if ENABLED(PARKING_EXTRUDER) + const bool pe_final_change_must_unpark = parking_extruder_unpark_after_homing(old_tool_index, X_HOME_DIR + 1 == old_tool_index * 2); + #endif tool_change(0, true); #endif @@ -319,15 +326,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) @@ -434,13 +440,13 @@ 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_(HAS_LEVELING, set_bed_leveling_enabled(leveling_restore_state)); restore_feedrate_and_scaling(); // Restore the active tool after homing #if HAS_MULTI_HOTEND && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) - tool_change(old_tool_index, NONE(PARKING_EXTRUDER, DUAL_X_CARRIAGE)); // Do move if one of these + tool_change(old_tool_index, TERN(PARKING_EXTRUDER, !pe_final_change_must_unpark, DISABLED(DUAL_X_CARRIAGE))); // Do move if one of these #endif #if HAS_HOMING_CURRENT @@ -462,6 +468,7 @@ void GcodeSuite::G28() { ui.refresh(); TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming()); + TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete()); report_current_position(); diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index 315b2d7333dd..bcca00dd42b3 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -39,10 +39,11 @@ void GcodeSuite::G34() { // Home before the alignment procedure - if (!all_axes_known()) home_all_axes(); + 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 @@ -63,7 +64,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/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 8d3dd0d06b23..0bcf954faf3f 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; @@ -320,7 +320,6 @@ void GcodeSuite::G34() { }; #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. @@ -478,32 +477,18 @@ void GcodeSuite::M422() { const bool is_probe_point = parser.seen('S'); - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - if (is_probe_point && parser.seen('W')) { - SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); - return; - } - #endif + if (TERN0(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, is_probe_point && parser.seen('W'))) { + SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); + return; + } xy_pos_t *pos_dest = ( - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - !is_probe_point ? z_stepper_align.stepper_xy : - #endif + TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !is_probe_point ? z_stepper_align.stepper_xy :) z_stepper_align.xy ); - if (!is_probe_point - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - && !parser.seen('W') - #endif - ) { - SERIAL_ECHOLNPGM( - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - "?(S) or (W) is required." - #else - "?(S) is required." - #endif - ); + if (!is_probe_point && TERN1(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !parser.seen('W'))) { + SERIAL_ECHOLNPGM("?(S)" TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, " or (W)") " is required."); return; } @@ -512,7 +497,7 @@ void GcodeSuite::M422() { if (is_probe_point) { position_index = parser.intval('S') - 1; if (!WITHIN(position_index, 0, int8_t(NUM_Z_STEPPER_DRIVERS) - 1)) { - SERIAL_ECHOLNPGM("?(S) Z-ProbePosition index invalid."); + SERIAL_ECHOLNPGM("?(S) Probe-position index invalid."); return; } } @@ -520,7 +505,7 @@ void GcodeSuite::M422() { #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) position_index = parser.intval('W') - 1; if (!WITHIN(position_index, 0, NUM_Z_STEPPER_DRIVERS - 1)) { - SERIAL_ECHOLNPGM("?(W) Z-Stepper index invalid."); + SERIAL_ECHOLNPGM("?(W) Z-stepper index invalid."); return; } #endif 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/gcode/calibrate/G76_M192_M871.cpp b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp index 8ffada5c0310..7438b0e83d62 100644 --- a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp @@ -38,7 +38,7 @@ #include "../../feature/probe_temp_comp.h" #include "../../lcd/marlinui.h" -#include "../../MarlinCore.h" // for wait_for_heatup and idle() +#include "../../MarlinCore.h" // for wait_for_heatup, idle(), G28_STR #if ENABLED(PRINTJOB_TIMER_AUTOSTART) #include "../../module/printcounter.h" @@ -91,6 +91,12 @@ * - `B` - Run bed temperature calibration. * - `P` - Run probe temperature calibration. */ + +static void say_waiting_for() { SERIAL_ECHOPGM("Waiting for "); } +static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); } +static void say_successfully_calibrated() { SERIAL_ECHOPGM("Successfully calibrated"); } +static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibrate"); } + void GcodeSuite::G76() { // Check if heated bed is available and z-homing is done with probe #if TEMP_SENSOR_BED == 0 || !(HOMING_Z_WITH_PROBE) @@ -108,7 +114,7 @@ void GcodeSuite::G76() { }; auto wait_for_temps = [&](const float tb, const float tp, millis_t &ntr, const millis_t timeout=0) { - SERIAL_ECHOLNPGM("Waiting for bed and probe temperature."); + say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature."); while (fabs(thermalManager.degBed() - tb) > 0.1f || thermalManager.degProbe() > tp) if (report_temps(ntr, timeout)) return true; return false; @@ -162,7 +168,7 @@ void GcodeSuite::G76() { return; } - process_subcommands_now_P(PSTR("G28")); + process_subcommands_now_P(G28_STR); } remember_feedrate_scaling_off(); @@ -184,7 +190,7 @@ void GcodeSuite::G76() { uint16_t target_bed = cali_info_init[TSI_BED].start_temp, target_probe = temp_comp.bed_calib_probe_temp; - SERIAL_ECHOLNPGM("Waiting for cooling."); + say_waiting_for(); SERIAL_ECHOLNPGM(" cooling."); while (thermalManager.degBed() > target_bed || thermalManager.degProbe() > target_probe) report_temps(next_temp_report); @@ -207,7 +213,8 @@ void GcodeSuite::G76() { // Move the nozzle to the probing point and wait for the probe to reach target temp do_blocking_move_to(noz_pos_xyz); - SERIAL_ECHOLNPGM("Waiting for probe heating."); + say_waiting_for_probe_heating(); + SERIAL_EOL(); while (thermalManager.degProbe() < target_probe) report_temps(next_temp_report); @@ -216,10 +223,14 @@ void GcodeSuite::G76() { } SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index()); - if (temp_comp.finish_calibration(TSI_BED)) - SERIAL_ECHOLNPGM("Successfully calibrated bed."); - else - SERIAL_ECHOLNPGM("!Failed to calibrate bed. Values reset."); + if (temp_comp.finish_calibration(TSI_BED)) { + say_successfully_calibrated(); + SERIAL_ECHOLNPGM(" bed."); + } + else { + say_failed_to_calibrate(); + SERIAL_ECHOLNPGM(" bed. Values reset."); + } // Cleanup thermalManager.setTargetBed(0); @@ -254,7 +265,8 @@ void GcodeSuite::G76() { // Move probe to probing point and wait for it to reach target temperature do_blocking_move_to(noz_pos_xyz); - SERIAL_ECHOLNPAIR("Waiting for probe heating. Bed:", target_bed, " Probe:", target_probe); + say_waiting_for_probe_heating(); + SERIAL_ECHOLNPAIR(" Bed:", target_bed, " Probe:", target_probe); const millis_t probe_timeout_ms = millis() + 900UL * 1000UL; while (thermalManager.degProbe() < target_probe) { if (report_temps(next_temp_report, probe_timeout_ms)) { @@ -271,9 +283,9 @@ void GcodeSuite::G76() { SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index()); if (temp_comp.finish_calibration(TSI_PROBE)) - SERIAL_ECHOPGM("Successfully calibrated"); + say_successfully_calibrated(); else - SERIAL_ECHOPGM("!Failed to calibrate"); + say_failed_to_calibrate(); SERIAL_ECHOLNPGM(" probe."); // Cleanup diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index e70815ad543a..46367df10d6a 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -245,6 +245,7 @@ void GcodeSuite::M48() { SERIAL_ECHO(n + 1); SERIAL_ECHOPAIR(" of ", int(n_samples)); SERIAL_ECHOPAIR_F(": z: ", pz, 3); + SERIAL_CHAR(' '); dev_report(verbose_level > 2, mean, sigma, min, max); SERIAL_EOL(); } 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(); diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index df145d5d11c9..f86874acec2f 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -25,7 +25,8 @@ #if DISABLED(EMERGENCY_PARSER) #include "../gcode.h" -#include "../../MarlinCore.h" // for wait_for_heatup, kill, quickstop_stepper +#include "../../MarlinCore.h" // for wait_for_heatup, kill +#include "../../module/motion.h" // for quickstop_stepper /** * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. diff --git a/Marlin/src/gcode/control/M226.cpp b/Marlin/src/gcode/control/M226.cpp index ad717e614d8a..63f022e82bd8 100644 --- a/Marlin/src/gcode/control/M226.cpp +++ b/Marlin/src/gcode/control/M226.cpp @@ -28,6 +28,8 @@ #include "../../MarlinCore.h" // for pin_is_protected and idle() #include "../../module/stepper.h" +void protected_pin_err(); + /** * M226: Wait until the specified pin reaches the state required (M226 P S) */ 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/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index c635c06ec63b..6ef8455e0b5c 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -31,6 +31,10 @@ #include "../../module/temperature.h" #endif +void protected_pin_err() { + SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); +} + /** * M42: Change pin status via GCode * diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index 592b2b3dcefb..3ce284f82e86 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -61,16 +61,10 @@ void GcodeSuite::T(const int8_t tool_index) { } #endif - #if EXTRUDERS < 2 - - tool_change(tool_index); - - #else - - tool_change( - tool_index, - (tool_index == active_extruder) || parser.boolval('S') - ); - - #endif + tool_change(tool_index + #if HAS_MULTI_EXTRUDER + , TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change() + || parser.boolval('S') + #endif + ); } 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/filwidth/M404-M407.cpp b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp index 516289fe2779..a70f7a61fec7 100644 --- a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp @@ -26,7 +26,6 @@ #include "../../../feature/filwidth.h" #include "../../../module/planner.h" -#include "../../../module/temperature.h" #include "../../../MarlinCore.h" #include "../../gcode.h" diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index 526d9101e1c7..438d1527f5f7 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" -#include "../../../MarlinCore.h" // for i2c +#include "../../../feature/twibus.h" /** * M260: Send data to a I2C slave device 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/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index b1d76e83ae98..9391b8661b2c 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -27,13 +27,10 @@ #include "../../gcode.h" #include "../../parser.h" #include "../../../feature/pause.h" +#include "../../../lcd/marlinui.h" #include "../../../module/motion.h" -#include "../../../sd/cardreader.h" #include "../../../module/printcounter.h" - -#if HAS_LCD_MENU - #include "../../../lcd/marlinui.h" -#endif +#include "../../../sd/cardreader.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../feature/powerloss.h" @@ -76,7 +73,7 @@ void GcodeSuite::M125() { const bool sd_printing = TERN0(SDSUPPORT, IS_SD_PRINTING()); - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); + ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); // If possible, show an LCD prompt with the 'P' flag const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P')); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index e676ed38a4a0..1c282f2052c7 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -28,15 +28,12 @@ #include "../../../feature/pause.h" #include "../../../module/motion.h" #include "../../../module/printcounter.h" +#include "../../../lcd/marlinui.h" #if HAS_MULTI_EXTRUDER #include "../../../module/tool_change.h" #endif -#if HAS_LCD_MENU - #include "../../../lcd/marlinui.h" -#endif - #if ENABLED(MMU2_MENUS) #include "../../../lcd/menu/menu_mmu2.h" #endif @@ -96,13 +93,13 @@ void GcodeSuite::M600() { #endif // Show initial "wait for start" message - #if HAS_LCD_MENU && DISABLED(MMU2_MENUS) - lcd_pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder); + #if DISABLED(MMU2_MENUS) + ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder); #endif #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(true); #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..9a2b77493667 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -29,15 +29,12 @@ #include "../../../module/motion.h" #include "../../../module/temperature.h" #include "../../../feature/pause.h" +#include "../../../lcd/marlinui.h" #if HAS_MULTI_EXTRUDER #include "../../../module/tool_change.h" #endif -#if HAS_LCD_MENU - #include "../../../lcd/marlinui.h" -#endif - #if HAS_PRUSA_MMU2 #include "../../../feature/mmu/mmu2.h" #endif @@ -59,10 +56,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(); @@ -84,7 +79,7 @@ void GcodeSuite::M701() { if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); // Show initial "wait for load" message - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder)); + ui.pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder); #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Change toolhead if specified @@ -130,7 +125,7 @@ void GcodeSuite::M701() { TERN_(MIXING_EXTRUDER, mixer.T(old_mixing_tool)); // Restore original mixing tool // Show status screen - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); + ui.pause_show_message(PAUSE_MESSAGE_STATUS); } /** @@ -147,10 +142,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(); @@ -184,7 +177,7 @@ void GcodeSuite::M702() { if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); // Show initial "wait for unload" message - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder)); + ui.pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU) // Change toolhead if specified @@ -236,7 +229,7 @@ void GcodeSuite::M702() { TERN_(MIXING_EXTRUDER, mixer.T(old_mixing_tool)); // Restore original mixing tool // Show status screen - TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_STATUS)); + ui.pause_show_message(PAUSE_MESSAGE_STATUS); } #endif // ADVANCED_PAUSE_FEATURE 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/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 3bce34c1f323..88607b4081cb 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -61,7 +61,7 @@ GcodeSuite gcode; #include "../feature/password/password.h" #endif -#include "../MarlinCore.h" // for idle() +#include "../MarlinCore.h" // for idle, kill // Inactivity shutdown millis_t GcodeSuite::previous_move_ms = 0, @@ -209,6 +209,31 @@ void GcodeSuite::dwell(millis_t time) { */ #if BOTH(HAS_LEVELING, G29_RETRY_AND_RECOVER) + void GcodeSuite::event_probe_recover() { + TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR)); + #ifdef ACTION_ON_G29_RECOVER + host_action(PSTR(ACTION_ON_G29_RECOVER)); + #endif + #ifdef G29_RECOVER_COMMANDS + process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS)); + #endif + } + + void GcodeSuite::event_probe_failure() { + #ifdef ACTION_ON_G29_FAILURE + host_action(PSTR(ACTION_ON_G29_FAILURE)); + #endif + #ifdef G29_FAILURE_COMMANDS + process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS)); + #endif + #if ENABLED(G29_HALT_ON_FAILURE) + #ifdef ACTION_ON_CANCEL + host_action_cancel(); + #endif + kill(GET_TEXT(MSG_LCD_PROBING_FAILED)); + #endif + } + #ifndef G29_MAX_RETRIES #define G29_MAX_RETRIES 0 #endif @@ -216,7 +241,10 @@ void GcodeSuite::dwell(millis_t time) { void GcodeSuite::G29_with_retry() { uint8_t retries = G29_MAX_RETRIES; while (G29()) { // G29 should return true for failed probes ONLY - if (retries--) event_probe_recover(); + if (retries) { + event_probe_recover(); + --retries; + } else { event_probe_failure(); return; @@ -252,6 +280,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 @@ -717,6 +746,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 412: M412(); break; // M412: Enable/Disable filament runout detection #endif + #if HAS_MULTI_LANGUAGE + case 414: M414(); break; // M414: Select multi language menu + #endif + #if HAS_LEVELING case 420: M420(); break; // M420: Enable/Disable Bed Leveling #endif @@ -882,6 +915,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..2b7589662e42 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -213,6 +213,7 @@ * M410 - Quickstop. Abort all planned moves. * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR) * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY) + * M414 - Set language by index. (Requires LCD_LANGUAGE_2...) * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) * M422 - Set Z Stepper automatic alignment position using probe. X Y A (Requires Z_STEPPER_AUTO_ALIGN) @@ -242,6 +243,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) @@ -368,9 +370,9 @@ class GcodeSuite { static void process_subcommands_now_P(PGM_P pgcode); static void process_subcommands_now(char * gcode); - static inline void home_all_axes() { + static inline void home_all_axes(const bool keep_leveling=false) { extern const char G28_STR[]; - process_subcommands_now_P(G28_STR); + process_subcommands_now_P(keep_leveling ? G28_STR : TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR)); } #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) @@ -450,6 +452,8 @@ class GcodeSuite { #if HAS_LEVELING #if ENABLED(G29_RETRY_AND_RECOVER) + static void event_probe_failure(); + static void event_probe_recover(); static void G29_with_retry(); #define G29_TYPE bool #else @@ -746,6 +750,8 @@ class GcodeSuite { TERN_(HAS_FILAMENT_SENSOR, static void M412()); + TERN_(HAS_MULTI_LANGUAGE, static void M414()); + #if HAS_LEVELING static void M420(); static void M421(); @@ -807,6 +813,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/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index 06576bb75e5d..27207b717210 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -66,7 +66,7 @@ void GcodeSuite::M118() { #endif if (hasE) SERIAL_ECHO_START(); - if (hasA) SERIAL_ECHOPGM("// "); + if (hasA) SERIAL_ECHOPGM("//"); SERIAL_ECHOLN(p); TERN_(HAS_MULTI_SERIAL, serial_port_index = old_serial); diff --git a/Marlin/src/gcode/lcd/M414.cpp b/Marlin/src/gcode/lcd/M414.cpp new file mode 100644 index 000000000000..760028a899f2 --- /dev/null +++ b/Marlin/src/gcode/lcd/M414.cpp @@ -0,0 +1,44 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_MULTI_LANGUAGE + +#include "../gcode.h" +#include "../../MarlinCore.h" +#include "../../lcd/marlinui.h" + +/** + * M414: Set the language for the UI + * + * Parameters + * S : The language to select + */ +void GcodeSuite::M414() { + + if (parser.seenval('S')) + ui.set_language(parser.value_byte()); + +} + +#endif // HAS_MULTI_LANGUAGE diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index c713877a0e6a..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,22 +76,36 @@ 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. - 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); #ifdef MIN_ARC_SEGMENTS - uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * (angular_travel / RADIANS(360))); - NOLESS(min_segments, 1U); + uint16_t min_segments = MIN_ARC_SEGMENTS; #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])) { - angular_travel = RADIANS(360); + // 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 = MIN_ARC_SEGMENTS; + min_segments = CEIL(min_segments * ABS(angular_travel) / RADIANS(360)); + NOLESS(min_segments, 1U); #endif } diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index 18cc161fce29..df8dad7999f1 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -27,7 +27,6 @@ #include "../gcode.h" #include "../../feature/babystep.h" #include "../../module/probe.h" -#include "../../module/temperature.h" #include "../../module/planner.h" #if ENABLED(BABYSTEP_ZPROBE_OFFSET) 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/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 12dfce5111ff..8197205edac9 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -31,6 +31,7 @@ GCodeQueue queue; #include "../lcd/marlinui.h" #include "../sd/cardreader.h" +#include "../module/motion.h" #include "../module/planner.h" #include "../module/temperature.h" #include "../MarlinCore.h" @@ -51,6 +52,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. @@ -154,8 +159,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 @@ -538,12 +541,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 @@ -578,10 +580,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; @@ -591,17 +592,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/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 4a461170bc39..cba0e51af160 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 @@ -40,7 +44,7 @@ #endif #if HAS_LEDS_OFF_FLAG - #include "../../MarlinCore.h" // for wait_for_user_response + #include "../../MarlinCore.h" // for wait_for_user_response() #include "../../feature/leds/printer_event_leds.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,9 +99,11 @@ 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()); + // Re-select the last printed file in the UI TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); } diff --git a/Marlin/src/gcode/sd/M21_M22.cpp b/Marlin/src/gcode/sd/M21_M22.cpp index 77df751fc774..a618bc0be31c 100644 --- a/Marlin/src/gcode/sd/M21_M22.cpp +++ b/Marlin/src/gcode/sd/M21_M22.cpp @@ -35,6 +35,10 @@ void GcodeSuite::M21() { card.mount(); } /** * M22: Release SD Card */ -void GcodeSuite::M22() { card.release(); } +void GcodeSuite::M22() { + + if (!IS_SD_PRINTING()) card.release(); + +} #endif // SDSUPPORT 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/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index 90e1b601e477..07e46e177571 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -45,7 +45,7 @@ #endif #endif -#if ENABLED(SINGLENOZZLE) +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) #include "../../module/tool_change.h" #endif @@ -88,7 +88,7 @@ void GcodeSuite::M104() { if (got_temp) { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - singlenozzle_temp[target_extruder] = temp; + thermalManager.singlenozzle_temp[target_extruder] = temp; if (target_extruder != active_extruder) return; #endif thermalManager.setTargetHotend(temp, target_extruder); @@ -166,7 +166,7 @@ void GcodeSuite::M109() { if (got_temp) { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - singlenozzle_temp[target_extruder] = temp; + thermalManager.singlenozzle_temp[target_extruder] = temp; if (target_extruder != active_extruder) return; #endif thermalManager.setTargetHotend(temp, target_extruder); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9c080ee2869d..a5bb24f27c41 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -651,11 +651,9 @@ #if ENABLED(DWIN_CREALITY_LCD) #define SERIAL_CATCHALL 0 -#endif - -// Pressure sensor with a BLTouch-like interface -#if ENABLED(CREALITY_TOUCH) - #define BLTOUCH + #ifndef LCD_SERIAL_PORT + #define LCD_SERIAL_PORT 3 // Creality 4.x board + #endif #endif /** @@ -819,9 +817,26 @@ #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 + #undef USE_PROBE_FOR_Z_HOMING #endif #if Z_HOME_DIR > 0 @@ -870,6 +885,7 @@ #if !HAS_LEVELING #undef PROBE_MANUALLY #undef RESTORE_LEVELING_AFTER_G28 + #undef ENABLE_LEVELING_AFTER_G28 #endif #ifdef GRID_MAX_POINTS_X @@ -1032,11 +1048,6 @@ #define INVERT_E_DIR false #endif -// Fallback SPI Speed -#ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED -#endif - /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. @@ -1057,28 +1068,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 @@ -1087,12 +1093,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 @@ -1101,6 +1106,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) @@ -1154,6 +1167,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 @@ -1163,12 +1182,15 @@ #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' #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 @@ -1181,11 +1203,5 @@ #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 1bd9dc47a417..22a671c5b3d6 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 @@ -207,14 +211,18 @@ #if DISABLED(Y_DUAL_STEPPER_DRIVERS) #undef Y2_DRIVER_TYPE #endif -#if NUM_Z_STEPPER_DRIVERS < 2 - #undef Z2_DRIVER_TYPE -#endif -#if NUM_Z_STEPPER_DRIVERS < 3 - #undef Z3_DRIVER_TYPE -#endif + #if NUM_Z_STEPPER_DRIVERS < 4 #undef Z4_DRIVER_TYPE + #undef INVERT_Z4_VS_Z_DIR + #if NUM_Z_STEPPER_DRIVERS < 3 + #undef Z3_DRIVER_TYPE + #undef INVERT_Z3_VS_Z_DIR + #if NUM_Z_STEPPER_DRIVERS < 2 + #undef Z2_DRIVER_TYPE + #undef INVERT_Z2_VS_Z_DIR + #endif + #endif #endif // @@ -378,6 +386,14 @@ #define POLL_JOG #endif +#ifndef HOMING_BUMP_MM + #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. @@ -496,7 +512,10 @@ #endif // Flag the indexed serial ports that are in use -#define ANY_SERIAL_IS(N) (defined(SERIAL_PORT) && SERIAL_PORT == (N)) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == (N)) || (defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == (N)) +#define ANY_SERIAL_IS(N) (defined(SERIAL_PORT) && SERIAL_PORT == (N)) || \ + (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == (N)) || \ + (defined(MMU2_SERIAL_PORT) && MMU2_SERIAL_PORT == (N)) || \ + (defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == (N)) #if ANY_SERIAL_IS(-1) #define USING_SERIAL_DEFAULT #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 35fd92e10b76..acf8f3620b78 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -323,6 +323,11 @@ */ #if ENABLED(SDSUPPORT) + // Extender cable doesn't support SD_DETECT_PIN + #if ENABLED(NO_SD_DETECT) + #undef SD_DETECT_PIN + #endif + #if HAS_SD_HOST_DRIVE && SD_CONNECTION_IS(ONBOARD) // // The external SD card is not used. Hardware SPI is used to access the card. @@ -1647,6 +1652,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) \ @@ -1997,6 +2050,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) @@ -2246,7 +2302,6 @@ #if FAN_COUNT > 0 #define HAS_FAN 1 - #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING) #endif /** @@ -2314,11 +2369,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 } @@ -2374,7 +2425,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 @@ -2448,6 +2499,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 @@ -2539,10 +2594,10 @@ */ #if HAS_MARLINUI_U8GLIB #ifndef DOGLCD_SCK - #define DOGLCD_SCK SCK_PIN + #define DOGLCD_SCK SD_SCK_PIN #endif #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI MOSI_PIN + #define DOGLCD_MOSI SD_MOSI_PIN #endif #endif @@ -2632,7 +2687,7 @@ // Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768 // on boards where SD card and LCD display share the same SPI bus // because of a bug in the shared SPI implementation. (See #8122) -#if defined(TARGET_LPC1768) && IS_RRD_FG_SC && (SCK_PIN == LCD_PINS_D4) +#if defined(TARGET_LPC1768) && IS_RRD_FG_SC && (SD_SCK_PIN == LCD_PINS_D4) #define SDCARD_SORT_ALPHA // Keep one directory level in RAM. Changing directory levels // may still glitch the screen, but LCD updates clean it up. #undef SDSORT_LIMIT @@ -2657,6 +2712,11 @@ #endif #endif +// Fallback SPI Speed for SD +#if ENABLED(SDSUPPORT) && !defined(SD_SPI_SPEED) + #define SD_SPI_SPEED SPI_FULL_SPEED +#endif + // Defined here to catch the above defines #if ENABLED(SDCARD_SORT_ALPHA) && (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) #define HAS_FOLDER_SORTING 1 diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 2eafa2b4171f..8fdb4b9baeae 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -55,3 +55,5 @@ #include "../core/serial.h" #endif + +#include "../core/multi_language.h" diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9f4c10dd53e1..2d4b073e159d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -105,9 +105,9 @@ #elif defined(USE_AUTOMATIC_VERSIONING) #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE." #elif defined(SDSLOW) - #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." + #error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead." #elif defined(SDEXTRASLOW) - #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." + #error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead." #elif defined(FILAMENT_SENSOR) #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR." #elif defined(ENDSTOPPULLUP_FIL_RUNOUT) @@ -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)) && !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." #elif defined(PID_ADD_EXTRUSION_RATE) @@ -357,6 +359,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) @@ -529,12 +533,16 @@ #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." #else #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW." #endif +#elif defined(ASSISTED_TRAMMING_MENU_ITEM) + #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed." #endif /** @@ -580,10 +588,6 @@ #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." -#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 @@ -705,6 +709,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +#if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY) + #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY" +#endif + #if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." #endif @@ -715,7 +723,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 /** @@ -1249,8 +1257,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 @@ -1355,12 +1362,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."); @@ -1409,6 +1410,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 /** @@ -1447,8 +1456,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) - #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 @@ -1475,6 +1482,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 @@ -1510,6 +1521,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 */ @@ -1580,7 +1595,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * ULTIPANEL encoder */ -#if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK) +#if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK) #error "ULTIPANEL controllers require some kind of encoder." #endif @@ -1603,7 +1618,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 @@ -1865,7 +1880,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 @@ -1912,7 +1927,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 @@ -1920,16 +1935,16 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Basic multi hotend duplication mode */ #if ENABLED(MULTI_NOZZLE_DUPLICATION) - #if HOTENDS < 2 - #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends." + #if ENABLED(SINGLENOZZLE) + #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE." #elif ENABLED(DUAL_X_CARRIAGE) #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE." - #elif ENABLED(SINGLENOZZLE) - #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE." #elif ENABLED(MIXING_EXTRUDER) #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER." #elif ENABLED(SWITCHING_EXTRUDER) #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER." + #elif HOTENDS < 2 + #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends." #endif #endif @@ -2287,7 +2302,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) \ @@ -2331,7 +2346,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) @@ -2374,11 +2389,26 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #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 MMU2_SERIAL_PORT == -1 + #error "MMU2_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU2_SERIAL_PORT 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 +/** + * MMU2 require a dedicated serial port + */ +#ifdef MMU2_SERIAL_PORT + #if MMU2_SERIAL_PORT == SERIAL_PORT + #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT." + #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2 + #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2." + #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT + #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT." + #endif +#endif + /** * Serial displays require a dedicated serial port */ @@ -2658,6 +2688,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 @@ -2895,10 +2929,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 @@ -3193,10 +3231,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 @@ -3226,7 +3262,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/inc/Version.h b/Marlin/src/inc/Version.h index 5fb065dc35d8..99ce5ba14ae2 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 "2021-01-22" #endif /** @@ -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/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 00968f4ba0e9..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) { @@ -714,7 +708,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(); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 74be828c727e..44128cc9f8d1 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); @@ -313,7 +313,7 @@ void MarlinUI::init_lcd() { t = 0; #if ENABLED(TFTGLCD_PANEL_SPI) // SPI speed must be less 10MHz - _SET_OUTPUT(TFTGLCD_CS); + SET_OUTPUT(TFTGLCD_CS); WRITE(TFTGLCD_CS, HIGH); spiInit(TERN(__STM32F1__, SPI_QUARTER_SPEED, SPI_FULL_SPEED)); WRITE(TFTGLCD_CS, LOW); @@ -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(); @@ -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) { @@ -632,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 @@ -861,13 +855,14 @@ void MarlinUI::draw_status_screen() { void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { if (!PanelDetected) return; ui.encoder_direction_normal(); - lcd.setCursor(0, MIDDLE_Y); + const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y; + lcd.setCursor(0, y); lcd.write(COLOR_EDIT); lcd_put_u8str_P(pstr); 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 + lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces + lcd.write(' '); // Overwrite char if value gets shorter lcd.print(value); lcd.write(' '); lcd.print_line(); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h index eedcc4afa073..c399b907e460 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.h @@ -61,15 +61,12 @@ extern TFTGLCD lcd; #include "../lcdprint.h" // Use panel encoder - free old encoder pins -#undef BTN_EN1 -#undef BTN_EN2 -#undef BTN_ENC -#define BTN_EN1 -1 -#define BTN_EN2 -1 -#define BTN_ENC -1 +#undef BTN_EN1 +#undef BTN_EN2 +#undef BTN_ENC #ifndef EN_C - #define EN_C 4 //for click + #define EN_C 4 // for click #endif #endif // IS_TFTGLCD_PANEL diff --git a/Marlin/src/lcd/buttons.h b/Marlin/src/lcd/buttons.h new file mode 100644 index 000000000000..07a4524def18 --- /dev/null +++ b/Marlin/src/lcd/buttons.h @@ -0,0 +1,234 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../inc/MarlinConfig.h" + +#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL + #define HAS_ENCODER_WHEEL 1 +#endif +#if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT) + #define HAS_DIGITAL_BUTTONS 1 +#endif +#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) + #define HAS_SHIFT_ENCODER 1 +#endif + +// I2C buttons must be read in the main thread +#if ANY(LCD_I2C_VIKI, LCD_I2C_PANELOLU2, IS_TFTGLCD_PANEL) + #define HAS_SLOW_BUTTONS 1 +#endif + +#if HAS_ENCODER_WHEEL + #define ENCODER_PHASE_0 0 + #define ENCODER_PHASE_1 2 + #define ENCODER_PHASE_2 3 + #define ENCODER_PHASE_3 1 +#endif + +#if EITHER(HAS_DIGITAL_BUTTONS, DWIN_CREALITY_LCD) + + // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) + #define BLEN_A 0 + #define BLEN_B 1 + + #define EN_A _BV(BLEN_A) + #define EN_B _BV(BLEN_B) + + #define _BUTTON_PRESSED(BN) !READ(BTN_##BN) + + #if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS + #define BLEN_C 2 + #define EN_C _BV(BLEN_C) + #endif + + #if ENABLED(LCD_I2C_VIKI) + + #include + + #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) + + // button and encoder bit positions within 'buttons' + #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C + #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) + #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) + #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) + #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) + + #if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used + #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name + #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented. + #else + #define BUTTON_CLICK() (buttons & (B_MI|B_RI)) + #endif + + // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update + + #elif ENABLED(LCD_I2C_PANELOLU2) + + #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin + + #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) + + #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later + + #define BUTTON_CLICK() (buttons & B_MI) + + #endif + + #endif + +#else + + #undef BUTTON_EXISTS + #define BUTTON_EXISTS(...) false + + // Dummy button, never pressed + #define _BUTTON_PRESSED(BN) false + + // Shift register bits correspond to buttons: + #define BL_LE 7 // Left + #define BL_UP 6 // Up + #define BL_MI 5 // Middle + #define BL_DW 4 // Down + #define BL_RI 3 // Right + #define BL_ST 2 // Red Button + #define B_LE _BV(BL_LE) + #define B_UP _BV(BL_UP) + #define B_MI _BV(BL_MI) + #define B_DW _BV(BL_DW) + #define B_RI _BV(BL_RI) + #define B_ST _BV(BL_ST) + + #ifndef BUTTON_CLICK + #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) + #endif + +#endif + +#if IS_RRW_KEYPAD + #define BTN_OFFSET 0 // Bit offset into buttons for shift register values + + #define BLEN_KEYPAD_F3 0 + #define BLEN_KEYPAD_F2 1 + #define BLEN_KEYPAD_F1 2 + #define BLEN_KEYPAD_DOWN 3 + #define BLEN_KEYPAD_RIGHT 4 + #define BLEN_KEYPAD_MIDDLE 5 + #define BLEN_KEYPAD_UP 6 + #define BLEN_KEYPAD_LEFT 7 + + #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) + #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) + #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) + #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) + #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) + #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) + #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) + #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) + + #define RRK(B) (keypad_buttons & (B)) + + #ifdef EN_C + #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) + #else + #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) + #endif +#endif + +#ifndef EN_A + #define EN_A 0 +#endif +#ifndef EN_B + #define EN_B 0 +#endif +#ifndef EN_C + #define EN_C 0 +#endif +#if BUTTON_EXISTS(BACK) || EITHER(HAS_TOUCH_BUTTONS, IS_TFTGLCD_PANEL) + #define BLEN_D 3 + #define EN_D _BV(BLEN_D) +#else + #define EN_D 0 +#endif + +#define BUTTON_PRESSED(BN) (_BUTTON_PRESSED_##BN) + +#if BUTTON_EXISTS(EN1) + #define _BUTTON_PRESSED_EN1 _BUTTON_PRESSED(EN1) +#else + #define _BUTTON_PRESSED_EN1 false +#endif +#if BUTTON_EXISTS(EN2) + #define _BUTTON_PRESSED_EN2 _BUTTON_PRESSED(EN2) +#else + #define _BUTTON_PRESSED_EN2 false +#endif +#if BUTTON_EXISTS(ENC_EN) + #define _BUTTON_PRESSED_ENC_EN _BUTTON_PRESSED(ENC_EN) +#else + #define _BUTTON_PRESSED_ENC_EN false +#endif +#if BUTTON_EXISTS(ENC) + #define _BUTTON_PRESSED_ENC _BUTTON_PRESSED(ENC) +#else + #define _BUTTON_PRESSED_ENC false +#endif +#if BUTTON_EXISTS(UP) + #define _BUTTON_PRESSED_UP _BUTTON_PRESSED(UP) +#else + #define _BUTTON_PRESSED_UP false +#endif +#if BUTTON_EXISTS(DWN) + #define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DWN) +#else + #define _BUTTON_PRESSED_DWN false +#endif +#if BUTTON_EXISTS(LFT) + #define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LFT) +#else + #define _BUTTON_PRESSED_LFT false +#endif +#if BUTTON_EXISTS(RT) + #define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RT) +#else + #define _BUTTON_PRESSED_RT false +#endif +#if BUTTON_EXISTS(BACK) + #define _BUTTON_PRESSED_BACK _BUTTON_PRESSED(BACK) +#else + #define _BUTTON_PRESSED_BACK false +#endif + +#ifndef BUTTON_CLICK + #if EN_C > 0 + #define BUTTON_CLICK() (buttons & EN_C) + #else + #define BUTTON_CLICK() false + #endif +#endif + +#if EN_D > 0 + #define LCD_BACK_CLICKED() (buttons & EN_D) +#else + #define LCD_BACK_CLICKED() false +#endif diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h index 1511c6993323..30a5361ab926 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h @@ -107,3 +107,16 @@ class U8GLIB_MINI12864_2X_HAL : public U8GLIB { : U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset) { } }; + +extern u8g_dev_t u8g_dev_ssd1309_sw_spi; +extern u8g_dev_t u8g_dev_ssd1309_hw_spi; + +class U8GLIB_SSD1309_128X64_HAL : public U8GLIB { +public: + U8GLIB_SSD1309_128X64_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_ssd1309_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) + { } + U8GLIB_SSD1309_128X64_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) + { } +}; diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index 535502f2e1a6..8a707ab41a36 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -52,7 +52,9 @@ #elif defined(ARDUINO_ARCH_STM32) + uint8_t u8g_com_std_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_std_sw_spi_fn #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn #elif defined(__AVR__) diff --git a/Marlin/src/lcd/dogm/dogm_Bootscreen.h b/Marlin/src/lcd/dogm/dogm_Bootscreen.h index c9001119d9d4..0b8845ed794d 100644 --- a/Marlin/src/lcd/dogm/dogm_Bootscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Bootscreen.h @@ -32,8 +32,16 @@ #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + typedef struct { + const unsigned char *bitmap; + const unsigned short duration; + } boot_frame_t; + #include "../../../_Bootscreen.h" + #ifndef CUSTOM_BOOTSCREEN_BMPWIDTH + #define CUSTOM_BOOTSCREEN_BMPWIDTH 128 + #endif #ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8) #endif @@ -41,6 +49,13 @@ #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) #endif + #ifndef CUSTOM_BOOTSCREEN_Y + #if ENABLED(CUSTOM_BOOTSCREEN_BOTTOM_JUSTIFY) + #define CUSTOM_BOOTSCREEN_Y (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) + #else + #define CUSTOM_BOOTSCREEN_Y ((LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2) + #endif + #endif #endif #if ENABLED(BOOT_MARLIN_LOGO_SMALL) diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h index d2e7ec2c56db..491006e05a20 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h @@ -15,9 +15,10 @@ const u8g_fntpgm_uint8_t fontpage_2_186_186[33] U8G_FONT_SECTION("fontpage_2_186 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBA,0xBA,0x00,0x0A,0x00,0x00, 0x00,0x03,0x0A,0x0A,0x06,0x01,0x00,0x20,0x40,0x00,0xC0,0x40,0x40,0x40,0x40,0x40, 0xE0}; -const u8g_fntpgm_uint8_t fontpage_2_190_190[33] U8G_FONT_SECTION("fontpage_2_190_190") = { - 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBE,0xBE,0x00,0x0A,0x00,0x00, - 0x00,0x03,0x0A,0x0A,0x06,0x01,0x00,0xA0,0x40,0x00,0xC0,0x40,0x40,0x40,0x40,0x40, +const u8g_fntpgm_uint8_t fontpage_2_189_190[49] U8G_FONT_SECTION("fontpage_2_189_190") = { + 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBD,0xBE,0x00,0x0A,0x00,0x00, + 0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x50,0x20,0x00,0x80,0x80,0x80,0x80,0x80,0x80, + 0xF8,0x03,0x0A,0x0A,0x06,0x01,0x00,0xA0,0x40,0x00,0xC0,0x40,0x40,0x40,0x40,0x40, 0xE0}; const u8g_fntpgm_uint8_t fontpage_2_199_200[47] U8G_FONT_SECTION("fontpage_2_199_200") = { 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC8,0x00,0x0A,0x00,0x00, @@ -40,7 +41,7 @@ const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 140, 143, fontpage_2_140_143), // 'Č' -- 'ď' FONTDATA_ITEM(2, 186, 186, fontpage_2_186_186), // 'ĺ' -- 'ĺ' - FONTDATA_ITEM(2, 190, 190, fontpage_2_190_190), // 'ľ' -- 'ľ' + FONTDATA_ITEM(2, 189, 190, fontpage_2_189_190), // 'Ľ' -- 'ľ' FONTDATA_ITEM(2, 199, 200, fontpage_2_199_200), // 'Ň' -- 'ň' FONTDATA_ITEM(2, 224, 225, fontpage_2_224_225), // 'Š' -- 'š' FONTDATA_ITEM(2, 229, 229, fontpage_2_229_229), // 'ť' -- 'ť' diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 4e265a8ee4df..1ab76a208dcf 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -54,6 +54,7 @@ #include "../../sd/cardreader.h" #include "../../module/temperature.h" #include "../../module/printcounter.h" +#include "../../MarlinCore.h" #if ENABLED(SDSUPPORT) #include "../../libs/duration_t.h" @@ -110,19 +111,24 @@ bool MarlinUI::detected() { return true; } // Draws a slice of a particular frame of the custom bootscreen, without the u8g loop void MarlinUI::draw_custom_bootscreen(const uint8_t frame/*=0*/) { constexpr u8g_uint_t left = u8g_uint_t((LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2), - top = u8g_uint_t((LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2); + top = u8g_uint_t(CUSTOM_BOOTSCREEN_Y); #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) constexpr u8g_uint_t right = left + CUSTOM_BOOTSCREEN_BMPWIDTH, bottom = top + CUSTOM_BOOTSCREEN_BMPHEIGHT; #endif - const u8g_pgm_uint8_t * const bmp = - #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) - (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame]) + #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) + const void * const frame_ptr = pgm_read_ptr(&custom_bootscreen_animation[frame]); + #if ENABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME) + const boot_frame_t * const frame_info = (boot_frame_t*)frame_ptr; + const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&frame_info->bitmap); #else - custom_start_bmp + const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)frame_ptr; #endif - ; + #else + const u8g_pgm_uint8_t * const bmp = custom_start_bmp; + #endif + UNUSED(frame); u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp); @@ -141,22 +147,31 @@ bool MarlinUI::detected() { return true; } // Shows the custom bootscreen, with the u8g loop, animations and delays void MarlinUI::show_custom_bootscreen() { #if DISABLED(CUSTOM_BOOTSCREEN_ANIMATED) - constexpr millis_t d = 0; + constexpr millis_t frame_time = 0; constexpr uint8_t f = 0; #else - constexpr millis_t d = CUSTOM_BOOTSCREEN_FRAME_TIME; + #if DISABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME) + constexpr millis_t frame_time = CUSTOM_BOOTSCREEN_FRAME_TIME; + #endif LOOP_L_N(f, COUNT(custom_bootscreen_animation)) #endif { + #if ENABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME) + const uint8_t fr = _MIN(f, COUNT(custom_bootscreen_animation) - 1); + const boot_frame_t * const frame_info = (boot_frame_t*)pgm_read_ptr(&custom_bootscreen_animation[fr]); + const millis_t frame_time = pgm_read_word(&frame_info->duration); + #endif u8g.firstPage(); do { draw_custom_bootscreen(f); } while (u8g.nextPage()); - if (d) safe_delay(d); + if (frame_time) safe_delay(frame_time); } #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 @@ -210,10 +225,10 @@ bool MarlinUI::detected() { return true; } #if DISABLED(BOOT_MARLIN_LOGO_ANIMATED) draw_bootscreen_bmp(start_bmp); #else - constexpr millis_t d = MARLIN_BOOTSCREEN_FRAME_TIME; + constexpr millis_t frame_time = MARLIN_BOOTSCREEN_FRAME_TIME; LOOP_L_N(f, COUNT(marlin_bootscreen_animation)) { draw_bootscreen_bmp((uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f])); - if (d) safe_delay(d); + if (frame_time) safe_delay(frame_time); } #endif } @@ -441,20 +456,22 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) { const u8g_uint_t len = utf8_strlen_P(pstr), by = (y + 1) * (MENU_FONT_HEIGHT); - const pixel_len_t bw = len * (MENU_FONT_WIDTH), bx = x * (MENU_FONT_WIDTH); + const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; + const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH); if (inv) { u8g.setColorIndex(1); - u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1); + u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT) + 1, bw / prop + 2, MENU_FONT_HEIGHT - 1); u8g.setColorIndex(0); } - lcd_put_u8str_P(bx, by, pstr); + lcd_put_u8str_P(bx / prop, by, pstr); if (inv) u8g.setColorIndex(1); } 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*/) { ui.draw_select_screen_prompt(pref, string, suff); draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); - draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) + 1), LCD_HEIGHT - 1, yes, yesno); + const u8g_uint_t xpos = (LCD_WIDTH) / (USE_WIDE_GLYPH ? 2 : 1); + draw_boxed_string(xpos - (utf8_strlen_P(yes) + 1), LCD_HEIGHT - 1, yes, yesno); } #if ENABLED(SDSUPPORT) @@ -527,6 +544,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Put Relevant Text on Display + extern const char X_LBL[], Y_LBL[], Z_LBL[]; + // Show X and Y positions at top of screen u8g.setColorIndex(1); if (PAGE_UNDER(7)) { diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index 29a1b7d3cff5..e5229cd08845 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -37,7 +37,7 @@ // RepRapWorld Graphical LCD #define U8G_CLASS U8GLIB_ST7920_128X64_4X - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_ENABLE == SD_MOSI_PIN) #define U8G_PARAM LCD_PINS_RS #else #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS @@ -48,7 +48,7 @@ // RepRap Discount Full Graphics Smart Controller // and other variant LCDs using ST7920 - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_ENABLE == SD_MOSI_PIN) #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.) #define U8G_PARAM LCD_PINS_RS #else @@ -88,7 +88,7 @@ #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) #define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI) - #if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN + #if SMART_RAMPS || DOGLCD_SCK != SD_SCK_PIN || DOGLCD_MOSI != SD_MOSI_PIN #define FORCE_SOFT_SPI // SW-SPI #endif @@ -110,11 +110,9 @@ #define U8G_CLASS U8GLIB_MINI12864_2X // 8 stripes (HW-SPI) #endif -#elif EITHER(MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864) +#elif ENABLED(MKS_12864OLED_SSD1306) // MKS 128x64 (SSD1306) OLED I2C LCD - // - or - - // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER #define FORCE_SOFT_SPI // SW-SPI @@ -124,6 +122,18 @@ #define U8G_CLASS U8GLIB_SSD1306_128X64 // 8 stripes #endif +#elif ENABLED(FYSETC_242_OLED_12864) + + // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER + + #define FORCE_SOFT_SPI // SW-SPI + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X // 4 stripes + #else + #define U8G_CLASS U8GLIB_SSD1309_128X64_HAL + #endif + #elif ENABLED(ZONESTAR_12864OLED_SSD1306) // Zonestar SSD1306 OLED SPI LCD diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 882b2fef506a..406e7b864038 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); } /** @@ -624,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'); @@ -710,6 +703,7 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string); } else if (elapsed_string[0]) { + extern const char E_LBL[]; lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL); lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); } @@ -898,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 @@ -917,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 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/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index f97a323350ee..b3e579e6a44a 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -245,9 +245,8 @@ u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire = { u8g_dev_ssd1306_128x64_2x_2_w uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_seq) { uint8_t is_escape = 0; - uint8_t value; for (;;) { - value = u8g_pgm_read(esc_seq); + uint8_t value = u8g_pgm_read(esc_seq); if (is_escape == 0) { if (value != 255) { if (u8g_WriteByte(u8g, dev, value) == 0 ) diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp new file mode 100644 index 000000000000..8ba19216b113 --- /dev/null +++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp @@ -0,0 +1,128 @@ +/** + * 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 HAS_MARLINUI_U8GLIB + +#include "HAL_LCD_com_defines.h" +#include + +#define WIDTH 128 +#define HEIGHT 64 +#define PAGE_HEIGHT 8 + +// SSD1309 init sequence +static const uint8_t u8g_dev_ssd1309_128x64_init_seq[] PROGMEM = { + U8G_ESC_CS(0), // Disable chip + U8G_ESC_ADR(0), // Instruction mode + U8G_ESC_RST(1), // Do reset low pulse with (1*16)+2 milliseconds + U8G_ESC_CS(1), // Enable chip + + 0xFD,0x12, // Command Lock + 0xAE, // Set Display Off + 0xD5,0xA0, // Set Display Clock Divide Ratio/Oscillator Frequency + 0xA8,0x3F, // Set Multiplex Ratio + 0x3D,0x00, // Set Display Offset + 0x40, // Set Display Start Line + 0xA1, // Set Segment Re-Map + 0xC8, // Set COM Output Scan Direction + 0xDA,0x12, // Set COM Pins Hardware Configuration + 0x81,0xDF, // Set Current Control + 0xD9,0x82, // Set Pre-Charge Period + 0xDB,0x34, // Set VCOMH Deselect Level + 0xA4, // Set Entire Display On/Off + 0xA6, // Set Normal/Inverse Display + U8G_ESC_VCC(1), // Power up VCC & Stabilized + U8G_ESC_DLY(50), + 0xAF, // Set Display On + U8G_ESC_DLY(50), + U8G_ESC_CS(0), // Disable chip + U8G_ESC_END // End of sequence +}; + +// Select one init sequence here +#define u8g_dev_ssd1309_128x64_init_seq u8g_dev_ssd1309_128x64_init_seq + +static const uint8_t u8g_dev_ssd1309_128x64_data_start[] PROGMEM = { + U8G_ESC_ADR(0), // Instruction mode + U8G_ESC_CS(1), // Enable chip + 0x010, // Set upper 4 bit of the col adr to 0 + 0x000, // Set lower 4 bit of the col adr to 4 + U8G_ESC_END // End of sequence +}; + +static const uint8_t u8g_dev_ssd13xx_sleep_on[] PROGMEM = { + U8G_ESC_ADR(0), // Instruction mode + U8G_ESC_CS(1), // Enable chip + 0x0AE, // Display off + U8G_ESC_CS(0), // Disable chip + U8G_ESC_END // End of sequence +}; + +static const uint8_t u8g_dev_ssd13xx_sleep_off[] PROGMEM = { + U8G_ESC_ADR(0), // Instruction mode + U8G_ESC_CS(1), // Enable chip + 0x0AF, // Display on + U8G_ESC_DLY(50), // Delay 50 ms + U8G_ESC_CS(0), // Disable chip + U8G_ESC_END // End of sequence +}; + +uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { + switch(msg) { + case U8G_DEV_MSG_INIT: + u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); + u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq); + break; + case U8G_DEV_MSG_STOP: + break; + case U8G_DEV_MSG_PAGE_NEXT: { + u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); + u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_data_start); + u8g_WriteByte(u8g, dev, 0x0B0 | pb->p.page); // Select current page (SSD1306) + u8g_SetAddress(u8g, dev, 1); // Data mode + if (u8g_pb_WriteBuffer(pb, u8g, dev) == 0) return 0; + u8g_SetChipSelect(u8g, dev, 0); + } + break; + case U8G_DEV_MSG_CONTRAST: + u8g_SetChipSelect(u8g, dev, 1); + u8g_SetAddress(u8g, dev, 0); // Instruction mode + u8g_WriteByte(u8g, dev, 0x081); + u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) ); // 11 Jul 2015: fixed contrast calculation + u8g_SetChipSelect(u8g, dev, 0); + return 1; + case U8G_DEV_MSG_SLEEP_ON: + u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_on); + return 1; + case U8G_DEV_MSG_SLEEP_OFF: + u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd13xx_sleep_off); + return 1; + } + return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); +} + +uint8_t u8g_dev_ssd1309_buf[WIDTH*2] U8G_NOCOMMON ; +u8g_pb_t u8g_dev_ssd1309_pb = { {8, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1309_buf}; +u8g_dev_t u8g_dev_ssd1309_sw_spi = { u8g_dev_ssd1309_128x64_fn, &u8g_dev_ssd1309_pb, U8G_COM_HAL_SW_SPI_FN }; + +#endif // HAS_MARLINUI_U8GLIB 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..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: @@ -525,6 +524,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 diff --git a/Marlin/src/lcd/dwin/dwin_lcd.cpp b/Marlin/src/lcd/dwin/dwin_lcd.cpp index 7d1528bed19b..1978c6a4f801 100644 --- a/Marlin/src/lcd/dwin/dwin_lcd.cpp +++ b/Marlin/src/lcd/dwin/dwin_lcd.cpp @@ -82,20 +82,27 @@ inline void DWIN_String(size_t &i, const __FlashStringHelper * string) { // Send the data in the buffer and the packet end inline void DWIN_Send(size_t &i) { ++i; - LOOP_L_N(n, i) { MYSERIAL1.write(DWIN_SendBuf[n]); delayMicroseconds(1); } - LOOP_L_N(n, 4) { MYSERIAL1.write(DWIN_BufTail[n]); delayMicroseconds(1); } + LOOP_L_N(n, i) { LCD_SERIAL.write(DWIN_SendBuf[n]); delayMicroseconds(1); } + LOOP_L_N(n, 4) { LCD_SERIAL.write(DWIN_BufTail[n]); delayMicroseconds(1); } } /*-------------------------------------- System variable function --------------------------------------*/ // Handshake (1: Success, 0: Fail) bool DWIN_Handshake(void) { + #ifndef LCD_BAUDRATE + #define LCD_BAUDRATE 115200 + #endif + LCD_SERIAL.begin(LCD_BAUDRATE); + const millis_t serial_connect_timeout = millis() + 1000UL; + while (!LCD_SERIAL && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + size_t i = 0; DWIN_Byte(i, 0x00); DWIN_Send(i); - while (MYSERIAL1.available() > 0 && recnum < (signed)sizeof(databuf)) { - databuf[recnum] = MYSERIAL1.read(); + while (LCD_SERIAL.available() > 0 && recnum < (signed)sizeof(databuf)) { + databuf[recnum] = LCD_SERIAL.read(); // ignore the invalid data if (databuf[0] != FHONE) { // prevent the program from running. if (recnum > 0) { diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index fe2397fa6b42..b872ce32aa07 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" @@ -185,8 +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 }; -constexpr float default_axis_steps_per_unit[] = DEFAULT_AXIS_STEPS_PER_UNIT; + +#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; @@ -214,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(); @@ -223,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 } @@ -500,9 +502,7 @@ inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valr valref += EncoderRate.encoderMoveValue; else if (encoder_diffState == ENCODER_DIFF_CCW) valref -= EncoderRate.encoderMoveValue; - else if (encoder_diffState == ENCODER_DIFF_ENTER) - return true; - return false; + return encoder_diffState == ENCODER_DIFF_ENTER; } // @@ -727,14 +727,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 > @@ -1164,7 +1164,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; @@ -1187,7 +1187,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; @@ -1210,7 +1210,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; @@ -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(); @@ -1494,8 +1493,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; } @@ -1523,7 +1522,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); @@ -1689,7 +1688,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) @@ -2322,9 +2321,9 @@ void HMI_Prepare() { DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 216, MBASE(2), current_position.y * MINUNITMULT); DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 216, MBASE(3), current_position.z * MINUNITMULT); #if HAS_HOTEND - queue.inject_P(PSTR("G92 E0")); - current_position.e = HMI_ValueStruct.Move_E_scale = 0; - DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 3, 1, 216, MBASE(4), 0); + current_position.e = HMI_ValueStruct.Move_E_scale = 0.0; + sync_plan_position_e(); + DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 3, 1, 216, MBASE(4), 0.0); #endif break; case PREPARE_CASE_DISA: // Disable steppers @@ -2333,7 +2332,7 @@ void HMI_Prepare() { case PREPARE_CASE_HOME: // Homing checkkey = Last_Prepare; index_prepare = MROWS; - queue.inject_P(PSTR("G28")); // G28 will set home_flag + queue.inject_P(G28_STR); // G28 will set home_flag Popup_Window_Home(); break; #if HAS_ZOFFSET_ITEM @@ -2575,6 +2574,7 @@ void HMI_AxisMove() { if (encoder_diffState == ENCODER_DIFF_ENTER) { HMI_flag.ETempTooLow_flag = false; current_position.e = HMI_ValueStruct.Move_E_scale = 0; + sync_plan_position_e(); Draw_Move_Menu(); DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 216, MBASE(1), HMI_ValueStruct.Move_X_scale); DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 216, MBASE(2), HMI_ValueStruct.Move_Y_scale); @@ -2957,75 +2957,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(); @@ -3638,7 +3640,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; @@ -3659,7 +3663,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/Marlin/src/lcd/dwin/e3v2/dwin.h b/Marlin/src/lcd/dwin/e3v2/dwin.h index 5bff2e9f7890..5656d67e9a6e 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.h +++ b/Marlin/src/lcd/dwin/e3v2/dwin.h @@ -249,7 +249,7 @@ typedef struct { float Move_E_scale = 0; #endif float offset_value = 0; - char show_mode = 0; // -1: Temperature control 0: Printing temperature + int8_t show_mode = 0; // -1: Temperature control 0: Printing temperature } HMI_value_t; #define DWIN_CHINESE 123 @@ -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(); diff --git a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp index d39c6cfbd5e8..6c229b7aca22 100644 --- a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp +++ b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp @@ -33,6 +33,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "rotary_encoder.h" +#include "../../buttons.h" #include "../../../MarlinCore.h" #include "../../../HAL/shared/Delay.h" @@ -43,17 +44,23 @@ #include +#ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 4 +#endif + ENCODER_Rate EncoderRate; // Buzzer -void Encoder_tick(void) { - WRITE(BEEPER_PIN, 1); - delay(10); - WRITE(BEEPER_PIN, 0); +void Encoder_tick() { + #if PIN_EXISTS(BEEPER) + WRITE(BEEPER_PIN, HIGH); + delay(10); + WRITE(BEEPER_PIN, LOW); + #endif } // Encoder initialization -void Encoder_Configuration(void) { +void Encoder_Configuration() { #if BUTTON_EXISTS(EN1) SET_INPUT_PULLUP(BTN_EN1); #endif @@ -63,21 +70,21 @@ void Encoder_Configuration(void) { #if BUTTON_EXISTS(ENC) SET_INPUT_PULLUP(BTN_ENC); #endif - #ifdef BEEPER_PIN + #if PIN_EXISTS(BEEPER) SET_OUTPUT(BEEPER_PIN); #endif } // Analyze encoder value and return state -ENCODER_DiffState Encoder_ReceiveAnalyze(void) { +ENCODER_DiffState Encoder_ReceiveAnalyze() { const millis_t now = millis(); - static unsigned char lastEncoderBits; - unsigned char newbutton = 0; + static uint8_t lastEncoderBits; + uint8_t newbutton = 0; static signed char temp_diff = 0; ENCODER_DiffState temp_diffState = ENCODER_DIFF_NO; - if (BUTTON_PRESSED(EN1)) newbutton |= 0x01; - if (BUTTON_PRESSED(EN2)) newbutton |= 0x02; + if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; + if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; if (BUTTON_PRESSED(ENC)) { static millis_t next_click_update_ms; if (ELAPSED(now, next_click_update_ms)) { @@ -94,22 +101,22 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { } if (newbutton != lastEncoderBits) { switch (newbutton) { - case ENCODER_PHASE_0: { - if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++; + case ENCODER_PHASE_0: + if (lastEncoderBits == ENCODER_PHASE_3) temp_diff++; else if (lastEncoderBits == ENCODER_PHASE_1) temp_diff--; - }break; - case ENCODER_PHASE_1: { - if (lastEncoderBits == ENCODER_PHASE_0) temp_diff++; + break; + case ENCODER_PHASE_1: + if (lastEncoderBits == ENCODER_PHASE_0) temp_diff++; else if (lastEncoderBits == ENCODER_PHASE_2) temp_diff--; - }break; - case ENCODER_PHASE_2: { - if (lastEncoderBits == ENCODER_PHASE_1) temp_diff++; + break; + case ENCODER_PHASE_2: + if (lastEncoderBits == ENCODER_PHASE_1) temp_diff++; else if (lastEncoderBits == ENCODER_PHASE_3) temp_diff--; - }break; - case ENCODER_PHASE_3: { - if (lastEncoderBits == ENCODER_PHASE_2) temp_diff++; + break; + case ENCODER_PHASE_3: + if (lastEncoderBits == ENCODER_PHASE_2) temp_diff++; else if (lastEncoderBits == ENCODER_PHASE_0) temp_diff--; - }break; + break; } lastEncoderBits = newbutton; } @@ -137,9 +144,12 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { } EncoderRate.lastEncoderTime = ms; } + #else + constexpr int32_t encoderMultiplier = 1; - #endif // ENCODER_RATE_MULTIPLIER + + #endif // EncoderRate.encoderMoveValue += (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); EncoderRate.encoderMoveValue = (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); @@ -153,23 +163,23 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { #if PIN_EXISTS(LCD_LED) // Take the low 24 valid bits 24Bit: G7 G6 G5 G4 G3 G2 G1 G0 R7 R6 R5 R4 R3 R2 R1 R0 B7 B6 B5 B4 B3 B2 B1 B0 - unsigned int LED_DataArray[LED_NUM]; + uint16_t LED_DataArray[LED_NUM]; // LED light operation - void LED_Action(void) { + void LED_Action() { LED_Control(RGB_SCALE_WARM_WHITE,0x0F); delay(30); LED_Control(RGB_SCALE_WARM_WHITE,0x00); } // LED initialization - void LED_Configuration(void) { + void LED_Configuration() { SET_OUTPUT(LCD_LED_PIN); } // LED write data - void LED_WriteData(void) { - unsigned char tempCounter_LED, tempCounter_Bit; + void LED_WriteData() { + uint8_t tempCounter_LED, tempCounter_Bit; for (tempCounter_LED = 0; tempCounter_LED < LED_NUM; tempCounter_LED++) { for (tempCounter_Bit = 0; tempCounter_Bit < 24; tempCounter_Bit++) { if (LED_DataArray[tempCounter_LED] & (0x800000 >> tempCounter_Bit)) { @@ -190,14 +200,13 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { // LED control // RGB_Scale: RGB color ratio // luminance: brightness (0~0xFF) - void LED_Control(unsigned char RGB_Scale, unsigned char luminance) { - unsigned char temp_Counter; - for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { - LED_DataArray[temp_Counter] = 0; + void LED_Control(const uint8_t RGB_Scale, const uint8_t luminance) { + for (uint8_t i = 0; i < LED_NUM; i++) { + LED_DataArray[i] = 0; switch (RGB_Scale) { - case RGB_SCALE_R10_G7_B5: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*5/10; break; - case RGB_SCALE_R10_G7_B4: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*7/10) << 16 | luminance*4/10; break; - case RGB_SCALE_R10_G8_B7: LED_DataArray[temp_Counter] = (luminance*10/10) << 8 | (luminance*8/10) << 16 | luminance*7/10; break; + case RGB_SCALE_R10_G7_B5: LED_DataArray[i] = (luminance * 10/10) << 8 | (luminance * 7/10) << 16 | luminance * 5/10; break; + case RGB_SCALE_R10_G7_B4: LED_DataArray[i] = (luminance * 10/10) << 8 | (luminance * 7/10) << 16 | luminance * 4/10; break; + case RGB_SCALE_R10_G8_B7: LED_DataArray[i] = (luminance * 10/10) << 8 | (luminance * 8/10) << 16 | luminance * 7/10; break; } } LED_WriteData(); @@ -207,45 +216,38 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void) { // RGB_Scale: RGB color ratio // luminance: brightness (0~0xFF) // change_Time: gradient time (ms) - void LED_GraduallyControl(unsigned char RGB_Scale, unsigned char luminance, unsigned int change_Interval) { - unsigned char temp_Counter; - unsigned char LED_R_Data[LED_NUM], LED_G_Data[LED_NUM], LED_B_Data[LED_NUM]; - bool LED_R_Flag = 0, LED_G_Flag = 0, LED_B_Flag = 0; - - for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { + void LED_GraduallyControl(const uint8_t RGB_Scale, const uint8_t luminance, const uint16_t change_Interval) { + struct { uint8_t g, r, b; } led_data[LED_NUM]; + for (uint8_t i = 0; i < LED_NUM; i++) { switch (RGB_Scale) { - case RGB_SCALE_R10_G7_B5: { - LED_R_Data[temp_Counter] = luminance*10/10; - LED_G_Data[temp_Counter] = luminance*7/10; - LED_B_Data[temp_Counter] = luminance*5/10; - }break; - case RGB_SCALE_R10_G7_B4: { - LED_R_Data[temp_Counter] = luminance*10/10; - LED_G_Data[temp_Counter] = luminance*7/10; - LED_B_Data[temp_Counter] = luminance*4/10; - }break; - case RGB_SCALE_R10_G8_B7: { - LED_R_Data[temp_Counter] = luminance*10/10; - LED_G_Data[temp_Counter] = luminance*8/10; - LED_B_Data[temp_Counter] = luminance*7/10; - }break; + case RGB_SCALE_R10_G7_B5: + led_data[i] = { luminance * 7/10, luminance * 10/10, luminance * 5/10 }; + break; + case RGB_SCALE_R10_G7_B4: + led_data[i] = { luminance * 7/10, luminance * 10/10, luminance * 4/10 }; + break; + case RGB_SCALE_R10_G8_B7: + led_data[i] = { luminance * 8/10, luminance * 10/10, luminance * 7/10 }; + break; } } - for (temp_Counter = 0; temp_Counter < LED_NUM; temp_Counter++) { - if ((unsigned char)(LED_DataArray[temp_Counter] >> 8) > LED_R_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x000100; - else if ((unsigned char)(LED_DataArray[temp_Counter] >> 8) < LED_R_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x000100; - while (1) { - else LED_R_Flag = 1; - if ((unsigned char)(LED_DataArray[temp_Counter]>>16) > LED_G_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x010000; - else if ((unsigned char)(LED_DataArray[temp_Counter]>>16) < LED_G_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x010000; - else LED_G_Flag = 1; - if ((unsigned char)LED_DataArray[temp_Counter] > LED_B_Data[temp_Counter]) LED_DataArray[temp_Counter] -= 0x000001; - else if ((unsigned char)LED_DataArray[temp_Counter] < LED_B_Data[temp_Counter]) LED_DataArray[temp_Counter] += 0x000001; - else LED_B_Flag = 1; + + struct { bool g, r, b; } led_flag = { false, false, false }; + for (uint8_t i = 0; i < LED_NUM; i++) { + while (1) { + const uint8_t g = uint8_t(LED_DataArray[i] >> 16), + r = uint8_t(LED_DataArray[i] >> 8), + b = uint8_t(LED_DataArray[i]); + if (g == led_data[i].g) led_flag.g = true; + else LED_DataArray[i] += (g > led_data[i].g) ? -0x010000 : 0x010000; + if (r == led_data[i].r) led_flag.r = true; + else LED_DataArray[i] += (r > led_data[i].r) ? -0x000100 : 0x000100; + if (b == led_data[i].b) led_flag.b = true; + else LED_DataArray[i] += (b > led_data[i].b) ? -0x000001 : 0x000001; + LED_WriteData(); + if (led_flag.r && led_flag.g && led_flag.b) break; + delay(change_Interval); } - LED_WriteData(); - if (LED_R_Flag && LED_G_Flag && LED_B_Flag) break; - else delay(change_Interval); } } diff --git a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.h b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.h index 93e54839d625..7de80dfe01ca 100644 --- a/Marlin/src/lcd/dwin/e3v2/rotary_encoder.h +++ b/Marlin/src/lcd/dwin/e3v2/rotary_encoder.h @@ -30,19 +30,9 @@ ****************************************************************************/ #include "../../../inc/MarlinConfig.h" -#include "../../../MarlinCore.h" /*********************** Encoder Set ***********************/ -#define ENCODER_PHASE_0 0 -#define ENCODER_PHASE_1 2 -#define ENCODER_PHASE_2 3 -#define ENCODER_PHASE_3 1 - -#define ENCODER_PULSES_PER_STEP 4 - -#define BUTTON_PRESSED(BN) !READ(BTN_## BN) - typedef struct { bool enabled = false; int encoderMoveValue = 0; @@ -59,10 +49,10 @@ typedef enum { } ENCODER_DiffState; // Encoder initialization -void Encoder_Configuration(void); +void Encoder_Configuration(); // Analyze encoder value and return state -ENCODER_DiffState Encoder_ReceiveAnalyze(void); +ENCODER_DiffState Encoder_ReceiveAnalyze(); /*********************** Encoder LED ***********************/ @@ -82,23 +72,23 @@ ENCODER_DiffState Encoder_ReceiveAnalyze(void); extern unsigned int LED_DataArray[LED_NUM]; // LED light operation - void LED_Action(void); + void LED_Action(); // LED initialization - void LED_Configuration(void); + void LED_Configuration(); // LED write data - void LED_WriteData(void); + void LED_WriteData(); // LED control // RGB_Scale: RGB color ratio // luminance: brightness (0~0xFF) - void LED_Control(unsigned char RGB_Scale, unsigned char luminance); + void LED_Control(const uint8_t RGB_Scale, const uint8_t luminance); // LED gradient control // RGB_Scale: RGB color ratio // luminance: brightness (0~0xFF) // change_Time: gradient time (ms) - void LED_GraduallyControl(unsigned char RGB_Scale, unsigned char luminance, unsigned int change_Interval); + void LED_GraduallyControl(const uint8_t RGB_Scale, const uint8_t luminance, const uint16_t change_Interval); #endif // LCD_LED 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/anycubic_chiron/FileNavigator.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.cpp index fb4c84abb485..19f8ec81bc5b 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.cpp @@ -44,6 +44,8 @@ using namespace ExtUI; namespace Anycubic { + FileNavigator filenavigator; + FileList FileNavigator::filelist; // Instance of the Marlin file API char FileNavigator::currentfoldername[MAX_PATH_LEN]; // Current folder path uint16_t FileNavigator::lastindex; 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 226fb7291e28..61057b5b10e7 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -54,6 +54,8 @@ namespace Anycubic { float ChironTFT::live_Zoffset; file_menu_t ChironTFT::file_menu; + ChironTFT Chiron; + ChironTFT::ChironTFT(){} void ChironTFT::Startup() { @@ -86,9 +88,9 @@ namespace Anycubic { safe_delay(200); - // Enable levelling and Disable end stops during print + // Enable leveling 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); + injectCommands_P(AC_cmnd_enable_leveling); // Startup tunes are defined in Tunes.h //PlayTune(BEEPER_PIN, Anycubic_PowerOn, 1); @@ -574,10 +576,11 @@ namespace Anycubic { } break; case 15: // A15 Resuming from outage - if (printer_state == AC_printer_resuming_from_power_outage) + 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")); // home and start recovery + injectCommands(AC_cmnd_power_loss_recovery); + injectCommands("M1000"); // home and start recovery + } break; case 16: { // A16 Set HotEnd temp A17 S170 @@ -620,10 +623,10 @@ namespace Anycubic { case 21: // A21 Home Axis A21 X if (!isPrinting()) { switch ((char)panel_command[4]) { - 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; + case 'X': injectCommands_P(PSTR("G28X")); break; + case 'Y': injectCommands_P(PSTR("G28Y")); break; + case 'Z': injectCommands_P(PSTR("G28Z")); break; + case 'C': injectCommands_P(G28_STR); break; } } break; @@ -718,7 +721,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")); // home + injectCommands_P(G28_STR); // home if (isPositionKnown()) { #if ACDEBUG(AC_INFO) @@ -746,7 +749,7 @@ namespace Anycubic { if (isPrinting()) SendtoTFTLN(AC_msg_probing_not_allowed); // forbid auto leveling else { - injectCommands_P(isMachineHomed() ? PSTR("G29") : PSTR("G28\nG29")); + injectCommands_P(PSTR("G28O\nG29")); printer_state = AC_printer_probing; SendtoTFTLN(AC_msg_start_probing); } @@ -762,7 +765,7 @@ namespace Anycubic { selectedmeshpoint.x = selectedmeshpoint.y = 99; } break; - case 'D': // Save Z Offset tables and restore levelling state + case 'D': // Save Z Offset tables and restore leveling state if (!isPrinting()) { setAxisPosition_mm(1.0,Z); injectCommands_P(PSTR("M500")); @@ -784,7 +787,7 @@ namespace Anycubic { float Zshift = atof(&panel_command[4]); setSoftEndstopState(false); // disable endstops // Allow temporary Z position nudging during print - // From the levelling panel use the all points UI to adjust the print pos. + // From the leveling panel use the all points UI to adjust the print pos. if (isPrinting()) { #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPAIR("Change Zoffset from:", live_Zoffset, " to ", live_Zoffset + Zshift); 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 af030df580ad..7012e98d929e 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 @@ -105,8 +105,8 @@ #define AC_cmnd_manual_load_filament PSTR("M83\nG1 E50 F700\nM82") // replace the manual panel commands with something a little faster #define AC_cmnd_manual_unload_filament PSTR("M83\nG1 E-50 F1200\nM82") -#define AC_cmnd_enable_levelling PSTR("M420 S1 V1") -#define AC_cmnd_power_loss_recovery PSTR("G28 X Y R5\nG28 Z") // Lift, home X and Y then home Z when in 'safe' position +#define AC_cmnd_enable_leveling PSTR("M420SV") +#define AC_cmnd_power_loss_recovery PSTR("G28XYR5\nG28Z") // Lift, home X and Y then home Z when in 'safe' position namespace Anycubic { enum heater_state_t : uint8_t { 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 6d15d937b99b..baf2da63581a 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 @@ -27,8 +27,8 @@ #include "../../ui_api.h" #include "../../../../libs/numtostr.h" -#include "../../../../module/motion.h" // for A20 read printing speed feedrate_percentage -#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers +#include "../../../../module/motion.h" // for quickstop_stepper, A20 read printing speed, feedrate_percentage +#include "../../../../MarlinCore.h" // for disable_steppers, G28_STR #include "../../../../inc/MarlinConfig.h" // command sending macro's with debugging capability @@ -274,12 +274,12 @@ void AnycubicTFTClass::HandleSpecialMenu() { case '6': // "<06SMeshLvl>" SERIAL_ECHOLNPGM("Special Menu: Start Mesh Leveling"); - ExtUI::injectCommands_P(PSTR("G29 S1")); + ExtUI::injectCommands_P(PSTR("G29S1")); break; case '7': // "<07MeshNPnt>" SERIAL_ECHOLNPGM("Special Menu: Next Mesh Point"); - ExtUI::injectCommands_P(PSTR("G29 S2")); + ExtUI::injectCommands_P(PSTR("G29S2")); break; case '8': // "<08HtEndPID>" @@ -324,7 +324,7 @@ void AnycubicTFTClass::HandleSpecialMenu() { case '2': // "<02ABL>" SERIAL_ECHOLNPGM("Special Menu: Auto Bed Leveling"); - ExtUI::injectCommands_P(PSTR("G28\nG29")); + ExtUI::injectCommands_P(PSTR("G29N")); break; case '3': // "<03HtendPID>" @@ -592,15 +592,12 @@ void AnycubicTFTClass::GetCommandFromTFT() { } break; case 5: { // A5 GET CURRENT COORDINATE - float xPostition = ExtUI::getAxisPosition_mm(ExtUI::X); - float yPostition = ExtUI::getAxisPosition_mm(ExtUI::Y); - float zPostition = ExtUI::getAxisPosition_mm(ExtUI::Z); - SEND_PGM("A5V X: "); - LCD_SERIAL.print(xPostition); - SEND_PGM(" Y: "); - LCD_SERIAL.print(yPostition); - SEND_PGM(" Z: "); - LCD_SERIAL.print(zPostition); + const float xPosition = ExtUI::getAxisPosition_mm(ExtUI::X), + yPosition = ExtUI::getAxisPosition_mm(ExtUI::Y), + zPosition = ExtUI::getAxisPosition_mm(ExtUI::Z); + SEND_PGM("A5V X: "); LCD_SERIAL.print(xPosition); + SEND_PGM( " Y: "); LCD_SERIAL.print(yPosition); + SEND_PGM( " Z: "); LCD_SERIAL.print(zPosition); SENDLINE_PGM(""); } break; @@ -761,14 +758,14 @@ void AnycubicTFTClass::GetCommandFromTFT() { if (!ExtUI::isPrinting() && !ExtUI::isPrintingFromMediaPaused()) { if (CodeSeen('X') || CodeSeen('Y') || CodeSeen('Z')) { if (CodeSeen('X')) - ExtUI::injectCommands_P(PSTR("G28 X")); + ExtUI::injectCommands_P(PSTR("G28X")); if (CodeSeen('Y')) - ExtUI::injectCommands_P(PSTR("G28 Y")); + ExtUI::injectCommands_P(PSTR("G28Y")); if (CodeSeen('Z')) - ExtUI::injectCommands_P(PSTR("G28 Z")); + ExtUI::injectCommands_P(PSTR("G28Z")); } else if (CodeSeen('C')) { - ExtUI::injectCommands_P(PSTR("G28")); + ExtUI::injectCommands_P(G28_STR); } } break; diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp index 8577b76ce61f..c7cd76733fc1 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp @@ -33,11 +33,9 @@ #include "../../ui_api.h" #include "../../../../MarlinCore.h" -#include "../../../../module/temperature.h" #include "../../../../module/motion.h" #include "../../../../gcode/queue.h" #include "../../../../module/planner.h" -#include "../../../../sd/cardreader.h" #include "../../../../libs/duration_t.h" #include "../../../../module/printcounter.h" #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h index ee536ea21905..88c119566cc1 100644 --- a/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h @@ -25,7 +25,8 @@ #include "../../../../inc/MarlinConfigPre.h" -#include "../../../../MarlinCore.h" +#include // size_t + #if HAS_BED_PROBE #include "../../../../module/probe.h" #endif @@ -96,7 +97,7 @@ class DGUSDisplay { static void WritePGM(const char str[], uint8_t len); static void ProcessRx(); - static inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); } + static inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; static bool Initialized, no_reentrance; diff --git a/Marlin/src/lcd/extui/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/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 8d2d74ea2607..9868492d81f5 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 @@ -27,7 +27,7 @@ #if ENABLED(SDSUPPORT) bool MediaFileReader::open(const char* filename) { - card.init(SPI_SPEED, SDSS); + card.init(SD_SPI_SPEED, SDSS); volume.init(&card); root.openRoot(&volume); return file.open(&root, filename, O_READ); 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/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/basic/spi.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp index a9b46e013bad..006cbe872c08 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 @@ -33,7 +33,7 @@ namespace FTDI { SPIClass EVE_SPI(CLCD_SPI_BUS); #endif #ifndef CLCD_HW_SPI_SPEED - #define CLCD_HW_SPI_SPEED 8000000 >> SPI_SPEED + #define CLCD_HW_SPI_SPEED 8000000 >> SD_SPI_SPEED #endif SPISettings SPI::spi_settings(CLCD_HW_SPI_SPEED, MSBFIRST, SPI_MODE0); #endif 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 0f4bbbdb9aec..9be7882a390f 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 @@ -206,6 +206,10 @@ // Define macros for compatibility + // Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments + #define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT + #define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) + #define _CAT(a,V...) a##V #define CAT(a,V...) _CAT(a,V) 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 006978babb1e..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,11 +29,12 @@ #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" #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/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..07d1ff56246d 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 @@ -75,9 +75,7 @@ namespace FTDI { while (has_more_notes()) { onIdle(); - #ifdef EXTENSIBLE_UI - ExtUI::yield(); - #endif + TERN_(TOUCH_UI_FTDI_EVE, ExtUI::yield()); } } 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 a69280f5fc2e..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 { @@ -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'; @@ -49,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/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..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,16 +21,18 @@ #include "../ftdi_extended.h" -#ifdef FTDI_EXTENDED +#if ENABLED(FTDI_EXTENDED) 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..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; /** @@ -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); @@ -74,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); @@ -89,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]; @@ -97,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/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..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 */ @@ -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 }, @@ -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/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..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 @@ -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 @@ -152,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"; @@ -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/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/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..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 @@ -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" @@ -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 @@ -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/alert_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp index 89d9f053303f..d63119afe547 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 @@ -32,7 +32,7 @@ using namespace Theme; void AlertDialogBox::onEntry() { BaseScreen::onEntry(); - sound.play(screen_data.AlertDialogBox.isError ? sad_trombone : twinkle, PLAY_ASYNCHRONOUS); + sound.play(screen_data.AlertDialog.isError ? sad_trombone : twinkle, PLAY_ASYNCHRONOUS); } void AlertDialogBox::onRedraw(draw_mode_t what) { @@ -45,7 +45,7 @@ template void AlertDialogBox::show(const T message) { drawMessage(message); storeBackground(); - screen_data.AlertDialogBox.isError = false; + screen_data.AlertDialog.isError = false; GOTO_SCREEN(AlertDialogBox); } @@ -53,7 +53,7 @@ template void AlertDialogBox::showError(const T message) { drawMessage(message); storeBackground(); - screen_data.AlertDialogBox.isError = true; + screen_data.AlertDialog.isError = true; GOTO_SCREEN(AlertDialogBox); } 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..5271df3022c7 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), @@ -116,8 +116,8 @@ void BaseNumericAdjustmentScreen::widgets_t::_button(CommandProcessor &cmd, uint BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t::precision(uint8_t decimals, precision_default_t initial) { _decimals = decimals; - if (screen_data.BaseNumericAdjustmentScreen.increment == 0) { - screen_data.BaseNumericAdjustmentScreen.increment = 243 + (initial - DEFAULT_LOWEST) - _decimals; + if (screen_data.BaseNumericAdjustment.increment == 0) { + screen_data.BaseNumericAdjustment.increment = 243 + (initial - DEFAULT_LOWEST) - _decimals; } return *this; } @@ -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 @@ -154,7 +154,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcessor &cmd, uint8_t, const uint8_t tag) { const char *label = PSTR("?"); uint8_t pos; - uint8_t & increment = screen_data.BaseNumericAdjustmentScreen.increment; + uint8_t & increment = screen_data.BaseNumericAdjustment.increment; if (increment == 0) { increment = tag; // Set the default value to be the first. @@ -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 } @@ -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) { @@ -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), @@ -358,7 +358,7 @@ void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) { } void BaseNumericAdjustmentScreen::onEntry() { - screen_data.BaseNumericAdjustmentScreen.increment = 0; // This will force the increment to be picked while drawing. + screen_data.BaseNumericAdjustment.increment = 0; // This will force the increment to be picked while drawing. BaseScreen::onEntry(); CommandProcessor cmd; cmd.set_button_style_callback(nullptr); @@ -367,14 +367,14 @@ void BaseNumericAdjustmentScreen::onEntry() { bool BaseNumericAdjustmentScreen::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); return true; - case 240 ... 245: screen_data.BaseNumericAdjustmentScreen.increment = tag; break; + case 240 ... 245: screen_data.BaseNumericAdjustment.increment = tag; break; default: return current_screen.onTouchHeld(tag); } return true; } float BaseNumericAdjustmentScreen::getIncrement() { - switch (screen_data.BaseNumericAdjustmentScreen.increment) { + switch (screen_data.BaseNumericAdjustment.increment) { case 240: return 0.001; case 241: return 0.01; case 242: return 0.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 c54a7e04b5e2..9fb2b2002564 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 @@ -196,7 +196,7 @@ void BedMeshScreen::drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI:: } if (opts & USE_HIGHLIGHT) { - const uint8_t tag = screen_data.BedMeshScreen.highlightedTag; + const uint8_t tag = screen_data.BedMesh.highlightedTag; uint8_t x, y; if (tagToPoint(tag, x, y)) { cmd.cmd(COLOR_A(128)) @@ -221,16 +221,16 @@ bool BedMeshScreen::tagToPoint(uint8_t tag, uint8_t &x, uint8_t &y) { } void BedMeshScreen::onEntry() { - screen_data.BedMeshScreen.highlightedTag = 0; - screen_data.BedMeshScreen.count = GRID_MAX_POINTS; - screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_NONE; + screen_data.BedMesh.highlightedTag = 0; + screen_data.BedMesh.count = GRID_MAX_POINTS; + screen_data.BedMesh.message = screen_data.BedMesh.MSG_NONE; BaseScreen::onEntry(); } float BedMeshScreen::getHightlightedValue() { - if (screen_data.BedMeshScreen.highlightedTag) { + if (screen_data.BedMesh.highlightedTag) { xy_uint8_t pt; - tagToPoint(screen_data.BedMeshScreen.highlightedTag, pt.x, pt.y); + tagToPoint(screen_data.BedMesh.highlightedTag, pt.x, pt.y); return ExtUI::getMeshPoint(pt); } return NAN; @@ -250,12 +250,12 @@ 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) { - case screen_data.BedMeshScreen.MSG_MESH_COMPLETE: cmd.text(MESSAGE_POS, GET_TEXT_F(MSG_BED_MAPPING_DONE)); break; - case screen_data.BedMeshScreen.MSG_MESH_INCOMPLETE: cmd.text(MESSAGE_POS, GET_TEXT_F(MSG_BED_MAPPING_INCOMPLETE)); break; + switch (screen_data.BedMesh.message) { + case screen_data.BedMesh.MSG_MESH_COMPLETE: cmd.text(MESSAGE_POS, GET_TEXT_F(MSG_BED_MAPPING_DONE)); break; + case screen_data.BedMesh.MSG_MESH_INCOMPLETE: cmd.text(MESSAGE_POS, GET_TEXT_F(MSG_BED_MAPPING_INCOMPLETE)); break; default: break; } } @@ -277,11 +277,11 @@ void BedMeshScreen::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { constexpr float autoscale_max_amplitude = 0.03; - const bool gotAllPoints = screen_data.BedMeshScreen.count >= GRID_MAX_POINTS; + const bool gotAllPoints = screen_data.BedMesh.count >= GRID_MAX_POINTS; if (gotAllPoints) { drawHighlightedPointValue(); } - const float levelingProgress = sq(float(screen_data.BedMeshScreen.count) / GRID_MAX_POINTS); + const float levelingProgress = sq(float(screen_data.BedMesh.count) / GRID_MAX_POINTS); BedMeshScreen::drawMesh(INSET_POS(MESH_POS), ExtUI::getMeshArray(), USE_POINTS | USE_HIGHLIGHT | USE_AUTOSCALE | (gotAllPoints ? USE_COLORS : 0), autoscale_max_amplitude * levelingProgress @@ -290,7 +290,7 @@ void BedMeshScreen::onRedraw(draw_mode_t what) { } bool BedMeshScreen::onTouchStart(uint8_t tag) { - screen_data.BedMeshScreen.highlightedTag = tag; + screen_data.BedMesh.highlightedTag = tag; return true; } @@ -309,35 +309,24 @@ void BedMeshScreen::onMeshUpdate(const int8_t, const int8_t, const float) { onRefresh(); } -bool BedMeshScreen::isMeshComplete(ExtUI::bed_mesh_t data) { - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { - if (isnan(data[x][y])) { - return false; - } - } - } - return true; -} - void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { switch (state) { case ExtUI::MESH_START: - screen_data.BedMeshScreen.count = 0; - screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_NONE; + screen_data.BedMesh.count = 0; + screen_data.BedMesh.message = screen_data.BedMesh.MSG_NONE; break; case ExtUI::MESH_FINISH: - if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray())) - screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_COMPLETE; + if (screen_data.BedMesh.count == GRID_MAX_POINTS && ExtUI::getMeshValid()) + screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_COMPLETE; else - screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_INCOMPLETE; - screen_data.BedMeshScreen.count = GRID_MAX_POINTS; + screen_data.BedMesh.message = screen_data.BedMesh.MSG_MESH_INCOMPLETE; + screen_data.BedMesh.count = GRID_MAX_POINTS; break; case ExtUI::PROBE_START: - screen_data.BedMeshScreen.highlightedTag = pointToTag(x, y); + screen_data.BedMesh.highlightedTag = pointToTag(x, y); break; case ExtUI::PROBE_FINISH: - screen_data.BedMeshScreen.count++; + screen_data.BedMesh.count++; break; } BedMeshScreen::onMeshUpdate(x, y, 0); @@ -345,7 +334,7 @@ void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::pr void BedMeshScreen::startMeshProbe() { GOTO_SCREEN(BedMeshScreen); - screen_data.BedMeshScreen.count = 0; + screen_data.BedMesh.count = 0; injectCommands_P(PSTR(BED_LEVELING_COMMANDS)); } 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_status_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp index 2515732d43de..90d8d6251d3b 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,57 +70,32 @@ 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)); + #if ENABLED(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 - - #ifdef TOUCH_UI_USE_UTF8 + 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); + + #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif } @@ -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)); - - ui.bounds(POLY(h0_temp), x, y, h, v); - cmd.text(x, y, h, v, str); + cmd.font(font_medium); - if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0) - format_temp_and_temp(str, getActualTemp_celsius(E1), getTargetTemp_celsius(E1)); + #if ENABLED(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); } } @@ -275,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 @@ -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); @@ -344,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 } @@ -389,10 +318,8 @@ 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 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; + case 13: GOTO_SCREEN(BioConfirmHomeE); break; + case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28Z")); break; case 15: GOTO_SCREEN(TemperatureScreen); break; case 16: fine_motion = !fine_motion; break; default: return false; @@ -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/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/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..624bb263eb09 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 @@ -85,175 +122,113 @@ 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; - screen_data.ChangeFilamentScreen.saved_extruder = getActiveTool(); + screen_data.ChangeFilament.e_tag = ExtUI::getActiveTool() + 10; + screen_data.ChangeFilament.t_tag = 0; + screen_data.ChangeFilament.repeat_tag = 0; + screen_data.ChangeFilament.saved_extruder = getActiveTool(); #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - screen_data.ChangeFilamentScreen.need_purge = true; + screen_data.ChangeFilament.need_purge = true; #endif } void ChangeFilamentScreen::onExit() { - setActiveTool(screen_data.ChangeFilamentScreen.saved_extruder, true); + setActiveTool(screen_data.ChangeFilament.saved_extruder, true); } void ChangeFilamentScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; - #ifdef 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) - #ifdef 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 - .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) - #ifdef 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) - #ifdef 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)); + if (screen_data.ChangeFilament.t_tag && !t_ok) { + 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) - const bool tog2 = screen_data.ChangeFilamentScreen.t_tag == 2; - const bool tog3 = screen_data.ChangeFilamentScreen.t_tag == 3; - const bool tog4 = screen_data.ChangeFilamentScreen.t_tag == 4; - const bool tog10 = screen_data.ChangeFilamentScreen.e_tag == 10; + const bool tog2 = screen_data.ChangeFilament.t_tag == 2; + const bool tog3 = screen_data.ChangeFilament.t_tag == 3; + const bool tog4 = screen_data.ChangeFilament.t_tag == 4; + const bool tog10 = screen_data.ChangeFilament.e_tag == 10; #if HAS_MULTI_HOTEND - const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; + const bool tog11 = screen_data.ChangeFilament.e_tag == 11; #endif - #ifdef 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( - #ifdef TOUCH_UI_PORTRAIT - font_large - #else - font_small - #endif - ); + const bool tog7 = screen_data.ChangeFilament.repeat_tag == 7; + const bool tog8 = screen_data.ChangeFilament.repeat_tag == 8; { 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)) - #ifdef 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() { - switch (screen_data.ChangeFilamentScreen.t_tag) { + switch (screen_data.ChangeFilament.t_tag) { case 2: return LOW_TEMP; case 3: return MED_TEMP; case 4: return HIGH_TEMP; @@ -262,7 +237,7 @@ uint8_t ChangeFilamentScreen::getSoftenTemp() { } ExtUI::extruder_t ChangeFilamentScreen::getExtruder() { - switch (screen_data.ChangeFilamentScreen.e_tag) { + switch (screen_data.ChangeFilament.e_tag) { case 13: return ExtUI::E3; case 12: return ExtUI::E2; case 11: return ExtUI::E1; @@ -273,8 +248,8 @@ ExtUI::extruder_t ChangeFilamentScreen::getExtruder() { void ChangeFilamentScreen::doPurge() { #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 constexpr float purge_distance_mm = FILAMENT_UNLOAD_PURGE_LENGTH; - if (screen_data.ChangeFilamentScreen.need_purge) { - screen_data.ChangeFilamentScreen.need_purge = false; + if (screen_data.ChangeFilament.need_purge) { + screen_data.ChangeFilament.need_purge = false; MoveAxisScreen::setManualFeedrate(getExtruder(), purge_distance_mm); ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(getExtruder()) + purge_distance_mm, getExtruder()); } @@ -302,23 +277,23 @@ bool ChangeFilamentScreen::onTouchEnd(uint8_t tag) { case 3: case 4: // Change temperature - screen_data.ChangeFilamentScreen.t_tag = tag; + screen_data.ChangeFilament.t_tag = tag; setTargetTemp_celsius(getSoftenTemp(), getExtruder()); break; case 7: - screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 7) ? 0 : 7; + screen_data.ChangeFilament.repeat_tag = (screen_data.ChangeFilament.repeat_tag == 7) ? 0 : 7; break; case 8: - screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 8) ? 0 : 8; + screen_data.ChangeFilament.repeat_tag = (screen_data.ChangeFilament.repeat_tag == 8) ? 0 : 8; break; case 10: case 11: // Change extruder - screen_data.ChangeFilamentScreen.e_tag = tag; - screen_data.ChangeFilamentScreen.t_tag = 0; - screen_data.ChangeFilamentScreen.repeat_tag = 0; + screen_data.ChangeFilament.e_tag = tag; + screen_data.ChangeFilament.t_tag = 0; + screen_data.ChangeFilament.repeat_tag = 0; #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 - screen_data.ChangeFilamentScreen.need_purge = true; + screen_data.ChangeFilament.need_purge = true; #endif setActiveTool(getExtruder(), true); break; @@ -344,7 +319,7 @@ bool ChangeFilamentScreen::onTouchHeld(uint8_t tag) { void ChangeFilamentScreen::onIdle() { reset_menu_timeout(); - if (screen_data.ChangeFilamentScreen.repeat_tag) onTouchHeld(screen_data.ChangeFilamentScreen.repeat_tag); + if (screen_data.ChangeFilament.repeat_tag) onTouchHeld(screen_data.ChangeFilament.repeat_tag); if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { onRefresh(); 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..656bf1db13d1 --- /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..9c8ad062aae1 --- /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..61411afa1bde --- /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.MoveAxis.e_rel[0], canMove(E0)); + #elif HAS_MULTI_EXTRUDER + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxis.e_rel[0], canMove(E0)); + w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxis.e_rel[1], canMove(E1)); + #if EXTRUDERS > 2 + w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxis.e_rel[2], canMove(E2)); + #endif + #if EXTRUDERS > 3 + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxis.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 54% 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..99c0c1b66439 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 * @@ -21,7 +21,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) #include "screens.h" @@ -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 53% 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..c9caef6524a7 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 @@ -21,7 +21,7 @@ #include "../config.h" -#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS) +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_COCOA_PRESS) #include "screens.h" #include "screen_data.h" @@ -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,12 +49,12 @@ 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); } } uint16_t PreheatTimerScreen::secondsRemaining() { - const uint32_t elapsed_sec = (millis() - screen_data.PreheatTimerScreen.start_ms) / 1000; + const uint32_t elapsed_sec = (millis() - screen_data.PreheatTimer.start_ms) / 1000; return (COCOA_PRESS_PREHEAT_SECONDS > elapsed_sec) ? COCOA_PRESS_PREHEAT_SECONDS - elapsed_sec : 0; } @@ -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,18 +78,71 @@ 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(); + screen_data.PreheatTimer.start_ms = millis(); } 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..d9881d747a0b --- /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 + #if ENABLED(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)); + + #if ENABLED(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/confirm_start_print_dialog_box.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp index 0dbee2414db1..eeca88f2809a 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 @@ -53,12 +53,12 @@ bool ConfirmStartPrintDialogBox::onTouchEnd(uint8_t tag) { const char *ConfirmStartPrintDialogBox::getFilename(bool longName) { FileList files; - files.seek(screen_data.ConfirmStartPrintDialogBox.file_index, true); + files.seek(screen_data.ConfirmStartPrintDialog.file_index, true); return longName ? files.longFilename() : files.shortFilename(); } void ConfirmStartPrintDialogBox::show(uint8_t file_index) { - screen_data.ConfirmStartPrintDialogBox.file_index = file_index; + screen_data.ConfirmStartPrintDialog.file_index = file_index; GOTO_SCREEN(ConfirmStartPrintDialogBox); } 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 93dfcba47d2e..59e1c8220de4 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 @@ -36,8 +36,15 @@ void ConfirmUserRequestAlertBox::onRedraw(draw_mode_t mode) { bool ConfirmUserRequestAlertBox::onTouchEnd(uint8_t tag) { switch (tag) { case 1: - ExtUI::setUserConfirmed(); - GOTO_PREVIOUS(); + if (ExtUI::isPrintingPaused()) { + // The TuneMenu will call ExtUI::setUserConfirmed() + GOTO_SCREEN(TuneMenu); + current_screen.forget(); + } + else { + ExtUI::setUserConfirmed(); + GOTO_PREVIOUS(); + } return true; case 2: GOTO_PREVIOUS(); return true; default: return false; @@ -47,7 +54,7 @@ bool ConfirmUserRequestAlertBox::onTouchEnd(uint8_t tag) { void ConfirmUserRequestAlertBox::show(const char* msg) { drawMessage(msg); storeBackground(); - screen_data.AlertDialogBox.isError = false; + screen_data.AlertDialog.isError = false; GOTO_SCREEN(ConfirmUserRequestAlertBox); } @@ -55,4 +62,5 @@ void ConfirmUserRequestAlertBox::hide() { if (AT_SCREEN(ConfirmUserRequestAlertBox)) GOTO_PREVIOUS(); } + #endif // TOUCH_UI_FTDI_EVE 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..20f90d5a4119 --- /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 + + #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) + #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/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..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,37 +52,37 @@ 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")) .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..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 @@ -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/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 aed81045f4de..cadc58226708 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 @@ -32,8 +32,8 @@ using namespace ExtUI; using namespace Theme; void FilesScreen::onEntry() { - screen_data.FilesScreen.cur_page = 0; - screen_data.FilesScreen.selected_tag = 0xFF; + screen_data.Files.cur_page = 0; + screen_data.Files.selected_tag = 0xFF; #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) CLCD::mem_write_32(CLCD::REG::MACRO_0,DL::NOP); #endif @@ -50,24 +50,24 @@ const char *FilesScreen::getSelectedFilename(bool longName) { void FilesScreen::drawSelectedFile() { FileList files; files.seek(getSelectedFileIndex(), true); - screen_data.FilesScreen.flags.is_dir = files.isDir(); + screen_data.Files.flags.is_dir = files.isDir(); drawFileButton( files.filename(), - screen_data.FilesScreen.selected_tag, - screen_data.FilesScreen.flags.is_dir, + screen_data.Files.selected_tag, + screen_data.Files.flags.is_dir, true ); } uint16_t FilesScreen::getSelectedFileIndex() { - return getFileForTag(screen_data.FilesScreen.selected_tag); + return getFileForTag(screen_data.Files.selected_tag); } uint16_t FilesScreen::getFileForTag(uint8_t tag) { - return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; + return screen_data.Files.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 @@ -106,15 +106,15 @@ void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, void FilesScreen::drawFileList() { FileList files; - screen_data.FilesScreen.num_page = max(1,ceil(float(files.count()) / files_per_page)); - screen_data.FilesScreen.cur_page = min(screen_data.FilesScreen.cur_page, screen_data.FilesScreen.num_page-1); - screen_data.FilesScreen.flags.is_root = files.isAtRootDir(); + screen_data.Files.num_page = max(1,ceil(float(files.count()) / files_per_page)); + screen_data.Files.cur_page = min(screen_data.Files.cur_page, screen_data.Files.num_page-1); + screen_data.Files.flags.is_root = files.isAtRootDir(); #undef MARGIN_T #undef MARGIN_B #define MARGIN_T 0 #define MARGIN_B 0 - uint16_t fileIndex = screen_data.FilesScreen.cur_page * files_per_page; + uint16_t fileIndex = screen_data.Files.cur_page * files_per_page; for (uint8_t i = 0; i < files_per_page; i++, fileIndex++) { if (files.seek(fileIndex)) { drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false); @@ -126,8 +126,8 @@ void FilesScreen::drawFileList() { } void FilesScreen::drawHeader() { - const bool prev_enabled = screen_data.FilesScreen.cur_page > 0; - const bool next_enabled = screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page - 1); + const bool prev_enabled = screen_data.Files.cur_page > 0; + const bool next_enabled = screen_data.Files.cur_page < (screen_data.Files.num_page - 1); #undef MARGIN_T #undef MARGIN_B @@ -136,30 +136,30 @@ void FilesScreen::drawHeader() { char str[16]; sprintf_P(str, PSTR("Page %d of %d"), - screen_data.FilesScreen.cur_page + 1, screen_data.FilesScreen.num_page); + screen_data.Files.cur_page + 1, screen_data.Files.num_page); 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() { #undef MARGIN_T #undef MARGIN_B - #ifdef TOUCH_UI_PORTRAIT + #if ENABLED(TOUCH_UI_PORTRAIT) #define MARGIN_T 15 #define MARGIN_B 5 #else #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; + const bool has_selection = screen_data.Files.selected_tag != 0xFF; + const uint8_t back_tag = screen_data.Files.flags.is_root ? 240 : 245; const uint8_t y = GRID_ROWS - footer_h + 1; const uint8_t h = footer_h; @@ -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)); + if (screen_data.Files.flags.is_dir) + 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) { @@ -186,8 +186,8 @@ void FilesScreen::onRedraw(draw_mode_t what) { } void FilesScreen::gotoPage(uint8_t page) { - screen_data.FilesScreen.selected_tag = 0xFF; - screen_data.FilesScreen.cur_page = page; + screen_data.Files.selected_tag = 0xFF; + screen_data.Files.cur_page = page; CommandProcessor cmd; cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(bg_color)) @@ -201,13 +201,13 @@ bool FilesScreen::onTouchEnd(uint8_t tag) { switch (tag) { case 240: GOTO_PREVIOUS(); return true; case 241: - if (screen_data.FilesScreen.cur_page > 0) { - gotoPage(screen_data.FilesScreen.cur_page-1); + if (screen_data.Files.cur_page > 0) { + gotoPage(screen_data.Files.cur_page-1); } break; case 242: - if (screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page-1)) { - gotoPage(screen_data.FilesScreen.cur_page+1); + if (screen_data.Files.cur_page < (screen_data.Files.num_page-1)) { + gotoPage(screen_data.Files.cur_page+1); } break; case 243: @@ -229,18 +229,18 @@ bool FilesScreen::onTouchEnd(uint8_t tag) { break; default: if (tag < 240) { - screen_data.FilesScreen.selected_tag = tag; + screen_data.Files.selected_tag = tag; #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) if (FTDI::ftdi_chip >= 810) { const char *longFilename = getSelectedLongFilename(); if (longFilename[0]) { CommandProcessor cmd; uint16_t text_width = cmd.font(font_medium).text_width(longFilename); - screen_data.FilesScreen.scroll_pos = 0; + screen_data.Files.scroll_pos = 0; if (text_width > display_width) - screen_data.FilesScreen.scroll_max = text_width - display_width + MARGIN_L + MARGIN_R; + screen_data.Files.scroll_max = text_width - display_width + MARGIN_L + MARGIN_R; else - screen_data.FilesScreen.scroll_max = 0; + screen_data.Files.scroll_max = 0; } } #endif @@ -254,9 +254,9 @@ void FilesScreen::onIdle() { #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) if (FTDI::ftdi_chip >= 810) { CLCD::mem_write_32(CLCD::REG::MACRO_0, - VERTEX_TRANSLATE_X(-int32_t(screen_data.FilesScreen.scroll_pos))); - if (screen_data.FilesScreen.scroll_pos < screen_data.FilesScreen.scroll_max * 16) - screen_data.FilesScreen.scroll_pos++; + VERTEX_TRANSLATE_X(-int32_t(screen_data.Files.scroll_pos))); + if (screen_data.Files.scroll_pos < screen_data.Files.scroll_max * 16) + screen_data.Files.scroll_pos++; } #endif } 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..3d50b616fc55 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 @@ -47,8 +47,8 @@ void InterfaceSettingsScreen::onStartup() { } void InterfaceSettingsScreen::onEntry() { - screen_data.InterfaceSettingsScreen.brightness = CLCD::get_brightness(); - screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); + screen_data.InterfaceSettings.brightness = CLCD::get_brightness(); + screen_data.InterfaceSettings.volume = SoundPlayer::get_volume(); BaseScreen::onEntry(); } @@ -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; @@ -96,9 +96,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { #define EDGE_R 30 .colors(ui_slider) #if DISABLED(LCD_FYSETC_TFT81050) - .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.brightness, 128) + .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettings.brightness, 128) #endif - .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) + .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettings.volume, 0xFF) .colors(ui_toggle) .tag(4).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), LockScreen::is_enabled()) #if DISABLED(TOUCH_UI_NO_BOOTSCREEN) @@ -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) @@ -161,13 +161,13 @@ void InterfaceSettingsScreen::onIdle() { CommandProcessor cmd; switch (cmd.track_tag(value)) { case 2: - screen_data.InterfaceSettingsScreen.brightness = max(11, (value * 128UL) / 0xFFFF); - CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness); + screen_data.InterfaceSettings.brightness = max(11, (value * 128UL) / 0xFFFF); + CLCD::set_brightness(screen_data.InterfaceSettings.brightness); SaveSettingsDialogBox::settingsChanged(); break; case 3: - screen_data.InterfaceSettingsScreen.volume = value >> 8; - SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); + screen_data.InterfaceSettings.volume = value >> 8; + SoundPlayer::set_volume(screen_data.InterfaceSettings.volume); SaveSettingsDialogBox::settingsChanged(); break; default: 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..9f21c6b8c737 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; @@ -93,7 +93,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { cmd.font(font_medium) .colors(ui_slider) #define EDGE_R 30 - .tag(2).slider (BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) + .tag(2).slider (BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettings.volume, 0xFF) .colors(ui_toggle) .tag(3).toggle2 (BTN_POS(3,3), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), UIData::touch_sounds_enabled()) #undef EDGE_R @@ -108,7 +108,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { } void InterfaceSoundsScreen::onEntry() { - screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); + screen_data.InterfaceSettings.volume = SoundPlayer::get_volume(); BaseScreen::onEntry(); } @@ -145,8 +145,8 @@ void InterfaceSoundsScreen::onIdle() { CommandProcessor cmd; switch (cmd.track_tag(value)) { case 2: - screen_data.InterfaceSettingsScreen.volume = value >> 8; - SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); + screen_data.InterfaceSettings.volume = value >> 8; + SoundPlayer::set_volume(screen_data.InterfaceSettings.volume); SaveSettingsDialogBox::settingsChanged(); break; default: 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..8d372309bdc9 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) @@ -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) @@ -115,4 +118,4 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) { return true; } -#endif // BOTH(TOUCH_UI_FTDI_EVE,HAS_LEVELING) +#endif // TOUCH_UI_FTDI_EVE && HAS_LEVELING 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..766f414a110a 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 @@ -33,9 +33,9 @@ using namespace Theme; uint16_t LockScreen::passcode = 0; void LockScreen::onEntry() { - const uint8_t siz = sizeof(screen_data.LockScreen.passcode); - memset(screen_data.LockScreen.passcode, '_', siz-1); - screen_data.LockScreen.passcode[siz-1] = '\0'; + const uint8_t siz = sizeof(screen_data.Lock.passcode); + memset(screen_data.Lock.passcode, '_', siz-1); + screen_data.Lock.passcode[siz-1] = '\0'; BaseScreen::onEntry(); } @@ -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,14 +81,14 @@ 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) + .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.Lock.passcode) #else .text(BTN_POS(1,1), BTN_SIZE(1,1), message) .font(font_xlarge) - .text(BTN_POS(1,2), BTN_SIZE(1,1), screen_data.LockScreen.passcode) + .text(BTN_POS(1,2), BTN_SIZE(1,1), screen_data.Lock.passcode) #endif .font(font_large) .colors(normal_btn) @@ -117,8 +117,8 @@ void LockScreen::onRedraw(draw_mode_t what) { char &LockScreen::message_style() { // We use the last byte of the passcode string as a flag to indicate, // which message to show. - constexpr uint8_t last_char = sizeof(screen_data.LockScreen.passcode)-1; - return screen_data.LockScreen.passcode[last_char]; + constexpr uint8_t last_char = sizeof(screen_data.Lock.passcode)-1; + return screen_data.Lock.passcode[last_char]; } void LockScreen::onPasscodeEntered() { @@ -145,10 +145,10 @@ void LockScreen::onPasscodeEntered() { } bool LockScreen::onTouchEnd(uint8_t tag) { - char *c = strchr(screen_data.LockScreen.passcode,'_'); + char *c = strchr(screen_data.Lock.passcode,'_'); if (c) { if (tag == '<') { - if (c != screen_data.LockScreen.passcode) { + if (c != screen_data.Lock.passcode) { // Backspace deletes previous entered characters. *--c = '_'; } @@ -167,7 +167,7 @@ bool LockScreen::onTouchEnd(uint8_t tag) { uint16_t LockScreen::compute_checksum() { uint16_t checksum = 0; - const char* c = screen_data.LockScreen.passcode; + const char* c = screen_data.Lock.passcode; while (*c) { checksum = (checksum << 2) ^ *c++; } 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..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 @@ -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" @@ -37,12 +37,17 @@ 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) #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,41 +57,46 @@ 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) { 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)) + #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)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); } } @@ -96,24 +106,22 @@ 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) - case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; + #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; + #if HAS_LEVELING + 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/media_player_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp index 8912663f27ba..eb0b78a325fe 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 @@ -151,7 +151,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream SERIAL_ECHO_MSG("Done playing video"); exit: - spiInit(SPI_SPEED); // Restore default speed + spiInit(SD_SPI_SPEED); // Restore default speed // Since playing media overwrites RAMG, we need to reinitialize // everything that is stored in RAMG. 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..ba38918b1c85 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,14 +30,14 @@ 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 // screen is entered. LOOP_L_N(i, ExtUI::extruderCount) { - screen_data.MoveAxisScreen.e_rel[i] = 0; + screen_data.MoveAxis.e_rel[i] = 0; } BaseNumericAdjustmentScreen::onEntry(); } @@ -54,21 +54,21 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) { 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)); + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxis.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)); + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxis.e_rel[0], canMove(E0)); + w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxis.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)); + w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxis.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)); + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxis.e_rel[3], canMove(E3)); #endif #endif 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(); @@ -80,23 +80,23 @@ bool MoveAxisScreen::onTouchHeld(uint8_t tag) { case 6: UI_DECREMENT_AXIS(Z); break; case 7: UI_INCREMENT_AXIS(Z); break; // For extruders, also update relative distances. - case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] -= increment; break; - case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] += increment; break; + case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxis.e_rel[0] -= increment; break; + case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxis.e_rel[0] += increment; break; #if HAS_MULTI_EXTRUDER - case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] -= increment; break; - case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] += increment; break; + case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxis.e_rel[1] -= increment; break; + case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxis.e_rel[1] += increment; break; #endif #if EXTRUDERS > 2 - case 12: UI_DECREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] -= increment; break; - case 13: UI_INCREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] += increment; break; + case 12: UI_DECREMENT_AXIS(E2); screen_data.MoveAxis.e_rel[2] -= increment; break; + case 13: UI_INCREMENT_AXIS(E2); screen_data.MoveAxis.e_rel[2] += increment; break; #endif #if EXTRUDERS > 3 - case 14: UI_DECREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] -= increment; break; - case 15: UI_INCREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] += increment; break; + case 14: UI_DECREMENT_AXIS(E3); screen_data.MoveAxis.e_rel[3] -= increment; break; + case 15: UI_INCREMENT_AXIS(E3); screen_data.MoveAxis.e_rel[3] += increment; break; #endif - case 20: SpinnerDialogBox::enqueueAndWait_P(F("G28 X")); break; - case 21: SpinnerDialogBox::enqueueAndWait_P(F("G28 Y")); break; - case 22: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; + case 20: SpinnerDialogBox::enqueueAndWait_P(F("G28X")); break; + case 21: SpinnerDialogBox::enqueueAndWait_P(F("G28Y")); break; + case 22: SpinnerDialogBox::enqueueAndWait_P(F("G28Z")); break; case 23: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; default: return false; @@ -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/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp index aac0f9a277e0..f0d3f7eec5ba 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 @@ -32,11 +32,11 @@ using namespace Theme; using namespace ExtUI; void NudgeNozzleScreen::onEntry() { - screen_data.NudgeNozzleScreen.show_offsets = false; + screen_data.NudgeNozzle.show_offsets = false; #if HAS_MULTI_EXTRUDER - screen_data.NudgeNozzleScreen.link_nozzles = true; + screen_data.NudgeNozzle.link_nozzles = true; #endif - screen_data.NudgeNozzleScreen.rel.reset(); + screen_data.NudgeNozzle.rel.reset(); BaseNumericAdjustmentScreen::onEntry(); } @@ -47,19 +47,19 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) { w.heading(GET_TEXT_F(MSG_NUDGE_NOZZLE)); #if ENABLED(BABYSTEP_XY) - w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X)); - w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y)); + w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzle.rel.x / getAxisSteps_per_mm(X)); + w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzle.rel.y / getAxisSteps_per_mm(Y)); #endif - w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z)); + w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzle.rel.z / getAxisSteps_per_mm(Z)); w.increments(); #if HAS_MULTI_EXTRUDER - w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles); + w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzle.link_nozzles); #endif #if HAS_MULTI_EXTRUDER || HAS_BED_PROBE - w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets); + w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzle.show_offsets); - if (screen_data.NudgeNozzleScreen.show_offsets) { + if (screen_data.NudgeNozzle.show_offsets) { char str[19]; w.draw_mode(BOTH); @@ -83,22 +83,22 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) { bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) { const float inc = getIncrement(); #if HAS_MULTI_EXTRUDER - const bool link = screen_data.NudgeNozzleScreen.link_nozzles; + const bool link = screen_data.NudgeNozzle.link_nozzles; #else constexpr bool link = true; #endif int16_t steps; switch (tag) { - case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break; - case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break; - case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break; - case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break; - case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break; - case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break; + case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzle.rel.x -= steps; break; + case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzle.rel.x += steps; break; + case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzle.rel.y -= steps; break; + case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzle.rel.y += steps; break; + case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzle.rel.z -= steps; break; + case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzle.rel.z += steps; break; #if HAS_MULTI_EXTRUDER - case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break; + case 8: screen_data.NudgeNozzle.link_nozzles = !link; break; #endif - case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break; + case 9: screen_data.NudgeNozzle.show_offsets = !screen_data.NudgeNozzle.show_offsets; break; default: return false; } #if HAS_MULTI_EXTRUDER || HAS_BED_PROBE 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 dab411a25691..fe35fc457b48 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 @@ -30,19 +30,19 @@ struct base_numeric_adjustment_t {uint8_t increment;}; union screen_data_t { - struct base_numeric_adjustment_t BaseNumericAdjustmentScreen; - struct {uint8_t volume; uint8_t brightness;} InterfaceSettingsScreen; - struct {char passcode[5];} LockScreen; - struct {bool isError;} AlertDialogBox; - struct {bool auto_hide;} SpinnerDialogBox; - struct {uint8_t file_index;} ConfirmStartPrintDialogBox; + struct base_numeric_adjustment_t BaseNumericAdjustment; + struct {uint8_t volume; uint8_t brightness;} InterfaceSettings; + struct {char passcode[5];} Lock; + struct {bool isError;} AlertDialog; + struct {bool auto_hide;} SpinnerDialog; + struct {uint8_t file_index;} ConfirmStartPrintDialog; struct { uint8_t e_tag, t_tag, repeat_tag; ExtUI::extruder_t saved_extruder; #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 bool need_purge; #endif - } ChangeFilamentScreen; + } ChangeFilament; struct { struct { uint8_t is_dir : 1; @@ -55,11 +55,11 @@ union screen_data_t { uint16_t scroll_pos; uint16_t scroll_max; #endif - } FilesScreen; + } Files; struct { struct base_numeric_adjustment_t placeholder; float e_rel[ExtUI::extruderCount]; - } MoveAxisScreen; + } MoveAxis; #if HAS_MESH struct { enum : uint8_t { @@ -69,18 +69,18 @@ union screen_data_t { } message; uint8_t count; uint8_t highlightedTag; - } BedMeshScreen; + } BedMesh; #endif #if ENABLED(TOUCH_UI_DEVELOPER_MENU) struct { uint32_t next_watchdog_trigger; const char* message; - } StressTestScreen; + } StressTest; #endif #if ENABLED(TOUCH_UI_COCOA_PRESS) struct { uint32_t start_ms; - } PreheatTimerScreen; + } PreheatTimer; #endif #if ENABLED(BABYSTEPPING) struct { @@ -90,7 +90,7 @@ union screen_data_t { bool link_nozzles; #endif bool show_offsets; - } NudgeNozzleScreen; + } NudgeNozzle; #endif }; 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..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 @@ -45,84 +45,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), -#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 7b062045f97d..51fc76f15b46 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 @@ -53,55 +53,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, -#endif -#if ENABLED(SDSUPPORT) - FILES_SCREEN_CACHE, -#endif CHANGE_FILAMENT_SCREEN_CACHE, INTERFACE_SETTINGS_SCREEN_CACHE, INTERFACE_SOUNDS_SCREEN_CACHE, @@ -112,7 +119,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 @@ -243,6 +250,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); @@ -262,7 +277,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 +460,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 +468,12 @@ class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); static void onIdle(); }; @@ -510,6 +507,7 @@ class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -525,35 +523,37 @@ 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 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 { @@ -741,9 +741,10 @@ class LockScreen : public BaseScreen, public CachedScreen { }; #if ENABLED(SDSUPPORT) + 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; @@ -775,7 +776,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: @@ -793,6 +795,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); @@ -829,7 +832,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: @@ -852,3 +856,56 @@ 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 // TOUCH_UI_COCOA_PRESS 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 a4464c1e4937..2318a0d108ce 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 @@ -37,7 +37,7 @@ void SpinnerDialogBox::show(const progmem_str message) { drawMessage(message); drawSpinner(); storeBackground(); - screen_data.SpinnerDialogBox.auto_hide = false; + screen_data.SpinnerDialog.auto_hide = false; } void SpinnerDialogBox::hide() { @@ -53,13 +53,13 @@ void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem show(message); GOTO_SCREEN(SpinnerDialogBox); ExtUI::injectCommands_P((const char*)commands); - screen_data.SpinnerDialogBox.auto_hide = true; + screen_data.SpinnerDialog.auto_hide = true; } void SpinnerDialogBox::onIdle() { reset_menu_timeout(); - if (screen_data.SpinnerDialogBox.auto_hide && !commandsInQueue()) { - screen_data.SpinnerDialogBox.auto_hide = false; + if (screen_data.SpinnerDialog.auto_hide && !commandsInQueue()) { + screen_data.SpinnerDialog.auto_hide = false; hide(); GOTO_PREVIOUS(); } 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..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 @@ -32,10 +32,10 @@ using namespace FTDI; using namespace Theme; -#ifdef TOUCH_UI_PORTRAIT - #define GRID_ROWS 8 +#if ENABLED(TOUCH_UI_PORTRAIT) + #define GRID_ROWS 16 #else - #define GRID_ROWS 8 + #define GRID_ROWS 16 #endif void StatusScreen::draw_axis_position(draw_mode_t what) { @@ -43,20 +43,20 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { #define GRID_COLS 3 - #ifdef 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) - #define X_VAL_POS BTN_POS(2,5), BTN_SIZE(2,1) - #define Y_VAL_POS BTN_POS(2,6), BTN_SIZE(2,1) - #define Z_VAL_POS BTN_POS(2,7), BTN_SIZE(2,1) + #if ENABLED(TOUCH_UI_PORTRAIT) + #define X_LBL_POS BTN_POS(1, 9), BTN_SIZE(1,2) + #define Y_LBL_POS BTN_POS(1,11), BTN_SIZE(1,2) + #define Z_LBL_POS BTN_POS(1,13), BTN_SIZE(1,2) + #define X_VAL_POS BTN_POS(2, 9), BTN_SIZE(2,2) + #define Y_VAL_POS BTN_POS(2,11), BTN_SIZE(2,2) + #define Z_VAL_POS BTN_POS(2,13), BTN_SIZE(2,2) #else - #define X_LBL_POS BTN_POS(1,5), BTN_SIZE(1,1) - #define Y_LBL_POS BTN_POS(2,5), BTN_SIZE(1,1) - #define Z_LBL_POS BTN_POS(3,5), BTN_SIZE(1,1) - #define X_VAL_POS BTN_POS(1,6), BTN_SIZE(1,1) - #define Y_VAL_POS BTN_POS(2,6), BTN_SIZE(1,1) - #define Z_VAL_POS BTN_POS(3,6), BTN_SIZE(1,1) + #define X_LBL_POS BTN_POS(1, 9), BTN_SIZE(1,2) + #define Y_LBL_POS BTN_POS(2, 9), BTN_SIZE(1,2) + #define Z_LBL_POS BTN_POS(3, 9), BTN_SIZE(1,2) + #define X_VAL_POS BTN_POS(1,11), BTN_SIZE(1,2) + #define Y_VAL_POS BTN_POS(2,11), BTN_SIZE(1,2) + #define Z_VAL_POS BTN_POS(3,11), BTN_SIZE(1,2) #endif #define _UNION_POS(x1,y1,w1,h1,x2,y2,w2,h2) x1,y1,max(x1+w1,x2+w2)-x1,max(y1+h1,y2+h2)-y1 @@ -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)) @@ -103,15 +103,15 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { cmd.tag(6) .font(Theme::font_medium) - .text ( X_VAL_POS, x_str) - .text ( Y_VAL_POS, y_str) - .text ( Z_VAL_POS, z_str); + .text(X_VAL_POS, x_str) + .text(Y_VAL_POS, y_str) + .text(Z_VAL_POS, z_str); } #undef GRID_COLS } -#ifdef TOUCH_UI_PORTRAIT +#if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 8 #else #define GRID_COLS 12 @@ -120,12 +120,12 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { void StatusScreen::draw_temperature(draw_mode_t what) { using namespace Theme; - #define TEMP_RECT_1 BTN_POS(1,1), BTN_SIZE(4,2) - #define TEMP_RECT_2 BTN_POS(1,1), BTN_SIZE(8,1) - #define NOZ_1_POS BTN_POS(1,1), BTN_SIZE(4,1) - #define NOZ_2_POS BTN_POS(5,1), BTN_SIZE(4,1) - #define BED_POS BTN_POS(1,2), BTN_SIZE(4,1) - #define FAN_POS BTN_POS(5,2), BTN_SIZE(4,1) + #define TEMP_RECT_1 BTN_POS(1,1), BTN_SIZE(4,4) + #define TEMP_RECT_2 BTN_POS(1,1), BTN_SIZE(8,2) + #define NOZ_1_POS BTN_POS(1,1), BTN_SIZE(4,2) + #define NOZ_2_POS BTN_POS(5,1), BTN_SIZE(4,2) + #define BED_POS BTN_POS(1,3), BTN_SIZE(4,2) + #define FAN_POS BTN_POS(5,3), BTN_SIZE(4,2) #define _ICON_POS(x,y,w,h) x, y, w/4, h #define _TEXT_POS(x,y,w,h) x + w/4, y, w - w/4, h @@ -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 @@ -164,17 +164,12 @@ 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 - load_utf8_bitmaps(cmd); // Restore font bitmap handles - #endif + TERN_(TOUCH_UI_USE_UTF8, load_utf8_bitmaps(cmd)); // Restore font bitmap handles } if (what & FOREGROUND) { using namespace ExtUI; - char e0_str[20]; - char e1_str[20]; - char bed_str[20]; - char fan_str[20]; + char e0_str[20], e1_str[20], bed_str[20], fan_str[20]; sprintf_P(fan_str, PSTR("%-3d %%"), int8_t(getActualFan_percent(FAN0))); @@ -188,7 +183,6 @@ void StatusScreen::draw_temperature(draw_mode_t what) { else format_temp_and_temp(e0_str, getActualTemp_celsius(H0), getTargetTemp_celsius(H0)); - #if HAS_MULTI_EXTRUDER if (isHeaterIdle(H1)) format_temp_and_idle(e1_str, getActualTemp_celsius(H1)); @@ -207,45 +201,102 @@ void StatusScreen::draw_temperature(draw_mode_t what) { } } +void StatusScreen::_format_time(char *outstr, uint32_t time) { + const uint8_t hrs = time / 3600, + min = (time / 60) % 60, + sec = time % 60; + if (hrs) + sprintf_P(outstr, PSTR("%02d:%02d"), hrs, min); + else + sprintf_P(outstr, PSTR("%02d:%02ds"), min, sec); +} + void StatusScreen::draw_progress(draw_mode_t what) { using namespace ExtUI; using namespace Theme; CommandProcessor cmd; + #undef GRID_COLS #if ENABLED(TOUCH_UI_PORTRAIT) - #define TIME_POS BTN_POS(1,3), BTN_SIZE(4,1) - #define PROGRESS_POS BTN_POS(5,3), BTN_SIZE(4,1) + #define GRID_COLS 3 + #define PROGRESSZONE_POS BTN_POS(1,5), BTN_SIZE(3,2) + #define TIME_POS_X BTN_X(1) + #define TIME_POS_W BTN_W(1) + #define REMAINING_POS_X BTN_X(2) + #define REMAINING_POS_W BTN_W(1) + #define PROGRESS_POS_X BTN_X(3) + #define PROGRESS_POS_W BTN_W(1) + #define PROGRESSZONE_FIRSTLINE_Y BTN_Y(5) + #define PROGRESSBAR_POS BTN_POS(1,6), BTN_SIZE(3,1) #else - #define TIME_POS BTN_POS(9,1), BTN_SIZE(4,1) - #define PROGRESS_POS BTN_POS(9,2), BTN_SIZE(4,1) + #define GRID_COLS 6 + #define PROGRESSZONE_POS BTN_POS(5,1), BTN_SIZE(2,4) + #if ENABLED(SHOW_REMAINING_TIME) + #define TIME_POS BTN_POS(5,1), BTN_SIZE(1,2) + #define REMAINING_POS BTN_POS(6,1), BTN_SIZE(1,2) + #else + #define TIME_POS BTN_POS(5,1), BTN_SIZE(2,2) + #endif + #define PROGRESS_POS BTN_POS(5,3), BTN_SIZE(2,2) + #define PROGRESSBAR_POS BTN_POS(5,2), BTN_SIZE(2,2) #endif if (what & BACKGROUND) { cmd.tag(0).font(font_medium) - .fgcolor(progress).button(TIME_POS, F(""), OPT_FLAT) - .button(PROGRESS_POS, F(""), OPT_FLAT); + .fgcolor(progress).button(PROGRESSZONE_POS, F(""), OPT_FLAT); } if (what & FOREGROUND) { const uint32_t elapsed = getProgress_seconds_elapsed(); - const uint8_t hrs = elapsed/3600; - const uint8_t min = (elapsed/60)%60; + char elapsed_str[10]; + _format_time(elapsed_str, elapsed); - char time_str[10]; - char progress_str[10]; + #if ENABLED(SHOW_REMAINING_TIME) + const uint32_t remaining = getProgress_seconds_remaining(); + char remaining_str[10]; + _format_time(remaining_str, remaining); + #endif - sprintf_P(time_str, PSTR(" %02d : %02d"), hrs, min); - sprintf_P(progress_str, PSTR("%-3d %%"), getProgress_percent() ); + const uint16_t current_progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, getProgress_permyriad(), getProgress_percent() * 100); + constexpr uint16_t progress_range = 10000U; - cmd.font(font_medium) - .tag(7).text(TIME_POS, time_str) - .text(PROGRESS_POS, progress_str); - } -} + const bool show_progress_bar = current_progress > 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(); @@ -269,7 +320,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 } @@ -278,16 +329,16 @@ 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) { 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); } @@ -301,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)) @@ -315,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)) { @@ -334,7 +391,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/stress_test_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp index 2ffbdb9b8ec7..0aed1b7c536d 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 @@ -47,8 +47,8 @@ void StressTestScreen::drawDots(uint16_t x, uint16_t y, uint16_t w, uint16_t h) } bool StressTestScreen::watchDogTestNow() { - return screen_data.StressTestScreen.next_watchdog_trigger && - ELAPSED(millis(), screen_data.StressTestScreen.next_watchdog_trigger); + return screen_data.StressTest.next_watchdog_trigger && + ELAPSED(millis(), screen_data.StressTest.next_watchdog_trigger); } void StressTestScreen::onRedraw(draw_mode_t) { @@ -58,7 +58,7 @@ void StressTestScreen::onRedraw(draw_mode_t) { .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), progmem_str(screen_data.StressTestScreen.message)); + .text(BTN_POS(1,1), BTN_SIZE(4,1), progmem_str(screen_data.StressTest.message)); drawDots(BTN_POS(1,3), BTN_SIZE(4,4)); @@ -92,8 +92,8 @@ void StressTestScreen::startupCheck() { } void StressTestScreen::onEntry() { - screen_data.StressTestScreen.next_watchdog_trigger = millis() + 10000 + random(40000); - screen_data.StressTestScreen.message = PSTR("Test 1: Stress testing..."); + screen_data.StressTest.next_watchdog_trigger = millis() + 10000 + random(40000); + screen_data.StressTest.message = PSTR("Test 1: Stress testing..."); // Turn off heaters. setTargetTemp_celsius(0, E0); @@ -104,13 +104,13 @@ void StressTestScreen::onEntry() { } void StressTestScreen::recursiveLockup() { - screen_data.StressTestScreen.message = PSTR("Test 2: Printer will restart."); + screen_data.StressTest.message = PSTR("Test 2: Printer will restart."); current_screen.onRefresh(); recursiveLockup(); } void StressTestScreen::iterativeLockup() { - screen_data.StressTestScreen.message = PSTR("Test 3: Printer will restart."); + screen_data.StressTest.message = PSTR("Test 3: Printer will restart."); for (;;) current_screen.onRefresh(); } 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..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 @@ -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 + #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) + 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/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 } } 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 10cbb8af5333..5a290109ff01 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) @@ -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) { @@ -71,23 +73,24 @@ 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)) - .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(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)) .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(11).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .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 @@ -103,7 +106,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; @@ -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; } @@ -139,7 +143,9 @@ void TuneMenu::pausePrint() { void TuneMenu::resumePrint() { sound.play(twinkle, PLAY_ASYNCHRONOUS); - if (ExtUI::isPrintingFromMedia()) + if (ExtUI::awaitingUserConfirm()) + ExtUI::setUserConfirmed(); + else if (ExtUI::isPrintingFromMedia()) ExtUI::resumePrint(); #ifdef ACTION_ON_RESUME else host_action_resume(); 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/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" 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; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp index 11c5f816b0b5..e1c46811fe51 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp @@ -169,7 +169,6 @@ void SPIFlashStorage::endWrite() { void SPIFlashStorage::savePage(uint8_t* buffer) { W25QXX.SPI_FLASH_BufferWrite(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize); - // Test env // char fname[256]; // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); @@ -180,7 +179,6 @@ void SPIFlashStorage::savePage(uint8_t* buffer) { void SPIFlashStorage::loadPage(uint8_t* buffer) { W25QXX.SPI_FLASH_BufferRead(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize); - // Test env // char fname[256]; // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index 394ce4807572..76a4de35618e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -73,8 +73,6 @@ void TFT::LCD_clear(uint16_t color) { tftio.WriteMultiple(color, (uint32_t)(TFT_WIDTH) * (TFT_HEIGHT)); } -extern unsigned char bmp_public_buf[17 * 1024]; - void TFT::LCD_Draw_Logo() { #if HAS_LOGO_IN_FLASH setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT); 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 01f64e8fc6e4..a57dfc504b05 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -25,16 +25,12 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../inc/MarlinConfig.h" extern lv_group_t *g; static lv_obj_t *scr; -static lv_obj_t *fw_type, *board; //*fw_version; +static lv_obj_t *fw_type, *board; enum { ID_A_RETURN = 1 }; @@ -48,13 +44,10 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_about(void) { +void lv_draw_about() { scr = lv_screen_create(ABOUT_UI); 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); - fw_type = lv_label_create(scr, "Firmware: Marlin " SHORT_BUILD_VERSION); lv_obj_align(fw_type, nullptr, LV_ALIGN_CENTER, 0, -20); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h index 2ee7ec04c61a..77d66aef1118 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_about(void); +extern void lv_draw_about(); extern void lv_clear_about(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 ffb6f0157970..04c5ee77cbc9 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 @@ -50,7 +50,7 @@ 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: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_acceleration_settings(); draw_return_ui(); break; @@ -95,22 +95,22 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { lv_draw_number_key(); break; case ID_ACCE_UP: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_acceleration_settings(); lv_draw_acceleration_settings(); break; case ID_ACCE_DOWN: - uiCfg.para_ui_page = 1; + uiCfg.para_ui_page = true; lv_clear_acceleration_settings(); lv_draw_acceleration_settings(); break; } } -void lv_draw_acceleration_settings(void) { +void lv_draw_acceleration_settings() { scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle); - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h index 6ab49713c9dd..dc727391067c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_acceleration_settings(void); +extern void lv_draw_acceleration_settings(); extern void lv_clear_acceleration_settings(); #ifdef __cplusplus 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 534fd6072ce0..feefc4107c92 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 @@ -69,7 +69,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_advance_settings(void) { +void lv_draw_advance_settings() { scr = lv_screen_create(ADVANCED_UI, machine_menu.AdvancedConfTitle); int index = 0; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h index 84e4a4d4cf60..8885fc6a4ea7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_advance_settings(void); +extern void lv_draw_advance_settings(); extern void lv_clear_advance_settings(); #ifdef __cplusplus 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 3b39debe578b..e41ad44c7ab5 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 @@ -64,7 +64,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_auto_level_offset_settings(void) { +void lv_draw_auto_level_offset_settings() { 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)); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.h index 688cd205d04f..ec61862a241e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_auto_level_offset_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_auto_level_offset_settings(void); +extern void lv_draw_auto_level_offset_settings(); extern void lv_clear_auto_level_offset_settings(); #ifdef __cplusplus 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 5f489162b054..255f6e8f8ac1 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 @@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { has_adjust_z = 1; break; case ID_BABY_STEP_Z_N: - sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); + sprintf_P(baby_buf, PSTR("M290 Z%.3f"), -babystep_dist); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; break; @@ -111,7 +111,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_baby_stepping(void) { +void lv_draw_baby_stepping() { 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); @@ -136,7 +136,6 @@ void lv_draw_baby_stepping(void) { } 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) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h index 333ba2d59717..8793ad772fca 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h @@ -25,12 +25,11 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_baby_stepping(void); +extern void lv_draw_baby_stepping(); extern void lv_clear_baby_stepping(); extern void disp_baby_step_dist(); extern void disp_z_offset_value(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 a5100776acec..635625950b30 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 @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" @@ -65,9 +61,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { 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]; @@ -88,9 +81,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { 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]; @@ -125,7 +115,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_change_speed(void) { +void lv_draw_change_speed() { 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); @@ -143,9 +133,9 @@ void lv_draw_change_speed(void) { 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 - labelMov = lv_label_create_empty(buttonMov); - labelExt = lv_label_create_empty(buttonExt); - labelStep = lv_label_create_empty(buttonStep); + labelMov = lv_label_create_empty(buttonMov); + labelExt = lv_label_create_empty(buttonExt); + labelStep = lv_label_create_empty(buttonStep); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h index c4996a3ef732..75e4fe309936 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h @@ -28,13 +28,12 @@ #define MIN_EXT_SPEED_PERCENT 10 #define MAX_EXT_SPEED_PERCENT 999 -extern void lv_draw_change_speed(void); +extern void lv_draw_change_speed(); extern void lv_clear_change_speed(); extern void disp_speed_step(); extern void disp_print_speed(); extern void disp_speed_type(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.cpp new file mode 100644 index 000000000000..ae8fe3a3212b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.cpp @@ -0,0 +1,205 @@ +/** + * 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, MKS_WIFI_MODULE) + +#include "lv_conf.h" +#include "draw_ui.h" + +#include "../../../../MarlinCore.h" +#include "../../../../module/temperature.h" + +#include "QR_Encode.h" + +extern lv_group_t * g; +static lv_obj_t * scr; +static lv_obj_t *button_bind_or_not = NULL, *label_bind_or_not = NULL; +static lv_obj_t *buttonReleaseBind = NULL, *label_ReleaseBind = NULL; +static lv_obj_t * text_id; + +static uint8_t unbinding_flag = 0; +static uint8_t id_mark = 0; + +#define ID_CLOUD_BIND_RETURN 1 +#define ID_CLOUD_BIND_OR_NOT 2 +#define ID_CLOUD_RELEASE_BIND 3 + +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_CLOUD_BIND_RETURN: + clear_cur_ui(); + draw_return_ui(); + break; + case ID_CLOUD_RELEASE_BIND: + if (cloud_para.state == 0x12) { + clear_cur_ui(); + lv_draw_dialog(DIALOG_TYPE_UNBIND); + } + break; + } +} + +void lv_draw_cloud_bind() { + lv_obj_t *buttonBack = NULL, *label_Back = NULL; + scr = lv_screen_create(BIND_UI); + + button_bind_or_not = lv_btn_create(scr, NULL); + lv_obj_set_pos(button_bind_or_not, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 3); + lv_obj_set_size(button_bind_or_not, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15); + lv_obj_set_event_cb_mks(button_bind_or_not, event_handler, ID_CLOUD_BIND_OR_NOT, NULL, 0); + lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_REL, &style_para_value); + lv_btn_set_style(button_bind_or_not, LV_BTN_STYLE_PR, &style_para_value); + label_bind_or_not = lv_label_create_empty(button_bind_or_not); + + buttonReleaseBind = lv_btn_create(scr, NULL); + lv_obj_set_pos(buttonReleaseBind, TFT_WIDTH - 130, TFT_HEIGHT - 80 * 2); + lv_obj_set_size(buttonReleaseBind, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15); + lv_obj_set_event_cb_mks(buttonReleaseBind, event_handler, ID_CLOUD_RELEASE_BIND, NULL, 0); + label_ReleaseBind = lv_label_create_empty(buttonReleaseBind); + lv_label_set_text(label_ReleaseBind, cloud_menu.unbind); + lv_obj_align(label_ReleaseBind, buttonReleaseBind, LV_ALIGN_CENTER, 0, 0); + + buttonBack = lv_btn_create(scr, NULL); + lv_obj_set_pos(buttonBack, TFT_WIDTH - 130, TFT_HEIGHT - 80); + lv_obj_set_size(buttonBack, PARA_UI_VALUE_BTN_X_SIZE + 15, PARA_UI_VALUE_BTN_Y_SIZE + 15); + lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_CLOUD_BIND_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_empty(buttonBack); + lv_label_set_text(label_Back, common_menu.text_back); + lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0); + + #if BUTTONS_EXIST(EN1, EN2, ENC) + if (gCfgItems.encoder_enable) { + lv_group_add_obj(g, buttonReleaseBind); + lv_group_add_obj(g, buttonBack); + } + #endif + + text_id = lv_label_create_empty(scr); + lv_obj_set_pos(text_id, 50, 60 + 200 + 20); + lv_obj_set_style(text_id, &tft_style_label_rel); + lv_label_set_text(text_id, (char *)cloud_para.id); + + id_mark = 0; + + disp_bind_state(); +} + +void disp_bind_state() { + if (cloud_para.state != 0x12) + unbinding_flag = 0; + + if (unbinding_flag) { + lv_label_set_text(label_bind_or_not, cloud_menu.unbinding); + lv_obj_align(label_bind_or_not, button_bind_or_not, LV_ALIGN_CENTER, 0, 0); + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_REL, &style_para_value); + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_PR, &style_para_value); + } + else { + if (cloud_para.state == 0x10) { + lv_label_set_text(label_bind_or_not, cloud_menu.disconnected); + lv_obj_align(label_bind_or_not, button_bind_or_not, LV_ALIGN_CENTER, 0, 0); + } + else if (cloud_para.state == 0x11) { + lv_label_set_text(label_bind_or_not, cloud_menu.unbinded); + lv_obj_align(label_bind_or_not, button_bind_or_not, LV_ALIGN_CENTER, 0, 0); + } + else if (cloud_para.state == 0x12) { + lv_label_set_text(label_bind_or_not, cloud_menu.binded); + lv_obj_align(label_bind_or_not, button_bind_or_not, LV_ALIGN_CENTER, 0, 0); + } + else { + lv_label_set_text(label_bind_or_not, cloud_menu.disable); + lv_obj_align(label_bind_or_not, button_bind_or_not, LV_ALIGN_CENTER, 0, 0); + } + } + + if (cloud_para.state == 0x12 && !unbinding_flag) { + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_REL, &style_para_back); + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_PR, &style_para_back); + } + else { + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_REL, &style_para_value); + lv_btn_set_style(buttonReleaseBind, LV_BTN_STYLE_PR, &style_para_value); + } +} + +static char last_cloud_state = 0; +void refresh_bind_ui() { + if ((last_cloud_state != cloud_para.state) || unbinding_flag) { + disp_bind_state(); + last_cloud_state = cloud_para.state; + } + if (cloud_para.id[0]) { + if (!id_mark) { + display_qrcode((uint8_t *)cloud_para.id); + lv_label_set_text(text_id, (char *)cloud_para.id); + } + } + else + id_mark = 0; +} + +void display_qrcode(uint8_t *qrcode_data) { + uint8_t i, j; + uint16_t x, y, p; + + if (!id_mark) { + EncodeData((char *)qrcode_data); + id_mark = 1; + } + + lv_fill_rect(10, QRCODE_Y, 300, QRCODE_Y + 300, LV_COLOR_WHITE); + + if (m_nSymbleSize * 2 > QRCODE_WIDTH) return; + + for (i = 0; i < 40; i++) + if ((m_nSymbleSize * i * 2) > QRCODE_WIDTH) break; + + p = (i - 1) * 2; + + x = QRCODE_X + 70; + y = QRCODE_Y + 70; + + for (i = 0; i < m_nSymbleSize; i++) + for (j = 0; j < m_nSymbleSize; j++) + if (m_byModuleData[i][j] == 1) + lv_fill_rect(x + p * i, y + p * j, x + p * (i + 1) - 1, y + p * (j + 1) - 1, LV_COLOR_BACKGROUND); +} + +void cloud_unbind() { + package_to_wifi(WIFI_CLOUD_UNBIND, (uint8_t *)0, 0); + unbinding_flag = 1; +} + +void lv_clear_cloud_bind() { + #if BUTTONS_EXIST(EN1, EN2, ENC) + if (gCfgItems.encoder_enable) + lv_group_remove_all_objs(g); + #endif + lv_obj_del(scr); +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.h similarity index 71% rename from Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h rename to Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.h index 8acf4e2f4f01..1626680051ca 100644 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LK4PRO.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_cloud_bind.h @@ -21,18 +21,17 @@ */ #pragma once -// Longer UI assumptions -#if HOTENDS > 1 || E_STEPPERS > 1 - #error "Longer UI supports only 1 hotend / E-stepper." +#ifdef __cplusplus +extern "C" { /* C-declarations for C++ */ #endif -#define BOARD_INFO_NAME "LGT Kit 1.0" +extern void lv_draw_cloud_bind(); +extern void lv_clear_cloud_bind(); +extern void disp_bind_state(); +extern void refresh_bind_ui(); +extern void display_qrcode(uint8_t *qrcode_data); +extern void cloud_unbind(); -#define SD_DETECT_PIN 49 -#define FIL_RUNOUT_PIN 2 -#define Z_MIN_PIN 35 - -// -// Import RAMPS 1.4 pins -// -#include "pins_RAMPS.h" +#ifdef __cplusplus +} /* C-declarations for C++ */ +#endif 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..6130e92224af 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -31,11 +31,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" - #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" @@ -55,6 +50,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; @@ -95,7 +95,6 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { 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 @@ -118,20 +117,8 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { 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)) { @@ -161,29 +148,47 @@ 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; + uiCfg.configWifi = true; clear_cur_ui(); draw_return_ui(); } else if (DIALOG_IS(TYPE_FILAMENT_HEAT_LOAD_COMPLETED)) - uiCfg.filament_heat_completed_load = 1; + uiCfg.filament_heat_completed_load = true; else if (DIALOG_IS(TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) - uiCfg.filament_heat_completed_unload = 1; + uiCfg.filament_heat_completed_unload = true; else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED, TYPE_FILAMENT_UNLOAD_COMPLETED)) { clear_cur_ui(); draw_return_ui(); } + #if ENABLED(MKS_WIFI_MODULE) + else if (DIALOG_IS(TYPE_UNBIND)) { + cloud_unbind(); + clear_cur_ui(); + draw_return_ui(); + } + #endif + else { + clear_cur_ui(); + draw_return_ui(); + } } 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; @@ -193,11 +198,11 @@ static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) { 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_completed = false; + uiCfg.filament_unloading_completed = false; + uiCfg.filament_loading_time_flg = false; uiCfg.filament_loading_time_cnt = 0; - uiCfg.filament_unloading_time_flg = 0; + uiCfg.filament_unloading_time_flg = false; uiCfg.filament_unloading_time_cnt = 0; thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; clear_cur_ui(); @@ -232,19 +237,19 @@ void lv_draw_dialog(uint8_t type) { 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); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } 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); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } #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); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } else if (upload_result == 3) { btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); @@ -252,11 +257,14 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelOk, print_file_dialog_menu.confirm); } } + else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) { + // nothing to do + } #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); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); tempText1 = lv_label_create_empty(scr); filament_sprayer_temp(); @@ -269,7 +277,7 @@ void lv_draw_dialog(uint8_t type) { 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); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); filament_bar = lv_bar_create(scr, nullptr); lv_obj_set_pos(filament_bar, (TFT_WIDTH-400)/2, ((TFT_HEIGHT - titleHeight)-40)/2); @@ -291,7 +299,7 @@ void lv_draw_dialog(uint8_t type) { } else { lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } } if (DIALOG_IS(TYPE_PRINT_FILE)) { @@ -302,7 +310,7 @@ void lv_draw_dialog(uint8_t type) { lv_obj_align(labelFile, nullptr, LV_ALIGN_CENTER, 0, -60); } else if (DIALOG_IS(TYPE_STOP)) { - lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); + lv_label_set_text(labelDialog, print_file_dialog_menu.cancel_print); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } else if (DIALOG_IS(TYPE_FINISH_PRINT)) { @@ -418,6 +426,10 @@ void lv_draw_dialog(uint8_t type) { lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } } + else if (DIALOG_IS(TYPE_UPDATE_ESP_FIRMWARE)) { + lv_label_set_text(labelDialog, DIALOG_UPDATE_WIFI_FIRMWARE_EN); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); + } #endif // MKS_WIFI_MODULE else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat); @@ -451,6 +463,12 @@ void lv_draw_dialog(uint8_t type) { lv_label_set_text(labelDialog, filament_menu.filament_dialog_unloading); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70); } + #if ENABLED(MKS_WIFI_MODULE) + else if (DIALOG_IS(TYPE_UNBIND)) { + lv_label_set_text(labelDialog, common_menu.unbind_printer_tips); + lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70); + } + #endif #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { if (btnOk) lv_group_add_obj(g, btnOk); @@ -475,22 +493,22 @@ void filament_dialog_handle() { filament_sprayer_temp(); temps_update_flag = false; } - if (uiCfg.filament_heat_completed_load == 1) { - uiCfg.filament_heat_completed_load = 0; + if (uiCfg.filament_heat_completed_load) { + uiCfg.filament_heat_completed_load = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOADING); planner.synchronize(); - uiCfg.filament_loading_time_flg = 1; + uiCfg.filament_loading_time_flg = true; uiCfg.filament_loading_time_cnt = 0; 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; + if (uiCfg.filament_heat_completed_unload) { + uiCfg.filament_heat_completed_unload = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOADING); planner.synchronize(); - uiCfg.filament_unloading_time_flg = 1; + uiCfg.filament_unloading_time_flg = true; uiCfg.filament_unloading_time_cnt = 0; 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); @@ -498,31 +516,31 @@ void filament_dialog_handle() { if (((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius - gCfgItems.filament_limit_temper)) <= 1) || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius > gCfgItems.filament_limit_temper)) - && (uiCfg.filament_load_heat_flg == 1) + && (uiCfg.filament_load_heat_flg) ) { - uiCfg.filament_load_heat_flg = 0; + uiCfg.filament_load_heat_flg = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED); } - if (uiCfg.filament_loading_completed == 1) { + if (uiCfg.filament_loading_completed) { uiCfg.filament_rate = 0; - uiCfg.filament_loading_completed = 0; + uiCfg.filament_loading_completed = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_LOAD_COMPLETED); } if (((abs((int)((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius - gCfgItems.filament_limit_temper)) <= 1) || ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius > gCfgItems.filament_limit_temper)) - && (uiCfg.filament_unload_heat_flg == 1) + && uiCfg.filament_unload_heat_flg ) { - uiCfg.filament_unload_heat_flg = 0; + uiCfg.filament_unload_heat_flg = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED); } - if (uiCfg.filament_unloading_completed == 1) { + if (uiCfg.filament_unloading_completed) { uiCfg.filament_rate = 0; - uiCfg.filament_unloading_completed = 0; + uiCfg.filament_unloading_completed = false; lv_clear_dialog(); lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED); } 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 c6f42d90b3b1..c43a79a1418b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -33,7 +33,7 @@ enum { DIALOG_TYPE_M80_FAIL, DIALOG_TYPE_MESSAGE_ERR1, - DIALOG_TYPE_UPDATE_ESP_FIRMARE, + DIALOG_TYPE_UPDATE_ESP_FIRMWARE, DIALOG_TYPE_UPDATE_ESP_DATA, DIALOG_TYPE_UPLOAD_FILE, DIALOG_TYPE_UNBIND, @@ -85,7 +85,6 @@ extern void filament_sprayer_temp(); extern void filament_dialog_handle(); extern void lv_filament_setbar(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 924c69536af6..15e319f4a699 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 @@ -65,7 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_eeprom_settings(void) { +void lv_draw_eeprom_settings() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h index 6d5ecf0870eb..3d9f7cae001e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_eeprom_settings(void); +extern void lv_draw_eeprom_settings(); extern void lv_clear_eeprom_settings(); #ifdef __cplusplus 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 c9c2d4f28de2..e090c6a3b594 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 @@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_encoder_settings(void) { +void lv_draw_encoder_settings() { 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_encoder_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.h index 62892a6ec142..392dc67db776 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_encoder_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_encoder_settings(void); +extern void lv_draw_encoder_settings(); extern void lv_clear_encoder_settings(); #ifdef __cplusplus 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 a484f14087b9..bdae725cbb28 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 @@ -27,10 +27,6 @@ #include #include "tft_lvgl_configuration.h" -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "SPI_TFT.h" #include "mks_hardware_test.h" @@ -39,25 +35,6 @@ 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; - - scr = lv_screen_create(ERROR_MESSAGE_UI, ""); - - if (msg) { - message = lv_label_create(scr, msg); - lv_obj_align(message, nullptr, LV_ALIGN_CENTER, 0, -50); - } - - kill_message = lv_label_create(scr, "PRINTER HALTED"); - lv_obj_align(kill_message, nullptr, LV_ALIGN_CENTER, 0, -10); - - reset_tips = lv_label_create(scr, "Please Reset"); - lv_obj_align(reset_tips, nullptr, LV_ALIGN_CENTER, 0, 30); - - lv_task_handler(); - #endif - SPI_TFT.LCD_clear(0x0000); if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); disp_string((TFT_WIDTH - strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h index 8f64d67f93da..35e3bd6cf51a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h @@ -32,7 +32,6 @@ extern void lv_draw_error_message(PGM_P const msg); extern void lv_clear_error_message(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #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 6a1c0c4fb38c..b9af6d33a814 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" @@ -59,20 +55,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_E_ADD: 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")); + sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), uiCfg.extruStep, 60 * uiCfg.extruSpeed); + queue.inject(public_buf_l); extrudeAmount += uiCfg.extruStep; disp_extru_amount(); } break; case ID_E_DEC: 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); + sprintf_P((char *)public_buf_l, PSTR("G91\nG1 E%d F%d\nG90"), 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(); } @@ -121,7 +113,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_extrusion(void) { +void lv_draw_extrusion() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h index 576cc6c66c15..75db2fbab521 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_extrusion(void); +extern void lv_draw_extrusion(); extern void lv_clear_extrusion(); extern void disp_ext_type(); extern void disp_ext_step(); @@ -33,7 +33,6 @@ extern void disp_ext_speed(); extern void disp_hotend_temp(); extern void disp_extru_amount(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 5453bbf86bad..af8b441f24c2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" @@ -52,38 +48,33 @@ static uint8_t fanSpeed; 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 (fanSpeed + 1 <= 255) { - fanSpeed++; - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed < 254) fanSpeed++; break; case ID_F_DEC: - if (fanSpeed > 0) { - fanSpeed--; - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed > 0) fanSpeed--; break; case ID_F_HIGH: - gcode.process_subcommands_now_P(PSTR("M106 S255")); + fanSpeed = 255; break; case ID_F_MID: - gcode.process_subcommands_now_P(PSTR("M106 S127")); + fanSpeed = 127; break; case ID_F_OFF: gcode.process_subcommands_now_P(PSTR("M107")); - break; + return; case ID_F_RETURN: clear_cur_ui(); draw_return_ui(); - break; + return; } + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); } -void lv_draw_fan(void) { +void lv_draw_fan() { lv_obj_t *buttonAdd; #if HAS_FAN diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h index 602d02c6c044..d9b23fbbe4ae 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h @@ -25,11 +25,10 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_fan(void); +extern void lv_draw_fan(); extern void lv_clear_fan(); extern void disp_fan_value(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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..cff99119e8e8 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,13 +45,11 @@ 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) { case ID_FILAMNT_IN: - uiCfg.filament_load_heat_flg = 1; + uiCfg.filament_load_heat_flg = true; 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(); @@ -67,7 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } break; case ID_FILAMNT_OUT: - uiCfg.filament_unload_heat_flg=1; + uiCfg.filament_unload_heat_flg = true; 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)) @@ -87,10 +85,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { break; case ID_FILAMNT_TYPE: #if HAS_MULTI_EXTRUDER - if (uiCfg.curSprayerChoose == 0) - uiCfg.curSprayerChoose = 1; - else if (uiCfg.curSprayerChoose == 1) - uiCfg.curSprayerChoose = 0; + uiCfg.curSprayerChoose = !uiCfg.curSprayerChoose; #endif disp_filament_type(); break; @@ -102,7 +97,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { 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(); @@ -111,7 +105,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_filament_change(void) { +void lv_draw_filament_change() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h index b0068f7f0f32..9c1c9a876750 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h @@ -25,12 +25,11 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_filament_change(void); +extern void lv_draw_filament_change(); extern void lv_clear_filament_change(); extern void disp_filament_type(); extern void disp_filament_temp(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 2c9c3882f029..128989a27cff 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 @@ -46,7 +46,7 @@ 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: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_filament_settings(); draw_return_ui(); break; @@ -76,22 +76,22 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { lv_draw_number_key(); break; case ID_FILAMENT_SET_UP: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_filament_settings(); lv_draw_filament_settings(); break; case ID_FILAMENT_SET_DOWN: - uiCfg.para_ui_page = 1; + uiCfg.para_ui_page = true; lv_clear_filament_settings(); lv_draw_filament_settings(); break; } } -void lv_draw_filament_settings(void) { +void lv_draw_filament_settings() { scr = lv_screen_create(FILAMENT_SETTINGS_UI, machine_menu.FilamentConfTitle); - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.h index a5ae54289534..f9967df31f20 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_filament_settings(void); +extern void lv_draw_filament_settings(); extern void lv_clear_filament_settings(); #ifdef __cplusplus 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 646091bd8b4e..5b65f990c1ad 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -27,14 +27,12 @@ #include "draw_set.h" #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" +extern const char G28_STR[]; + extern lv_group_t *g; static lv_obj_t *scr; @@ -52,31 +50,31 @@ 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: - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); break; case ID_H_X: - queue.inject_P(PSTR("G28 X0")); + queue.inject_P(PSTR("G28X")); break; case ID_H_Y: - queue.inject_P(PSTR("G28 Y0")); + queue.inject_P(PSTR("G28Y")); break; case ID_H_Z: - queue.inject_P(PSTR("G28 Z0")); + queue.inject_P(PSTR("G28Z")); break; case ID_H_OFF_ALL: queue.inject_P(PSTR("M84")); break; case ID_H_OFF_XY: - queue.inject_P(PSTR("M84 X Y")); + queue.inject_P(PSTR("M84XY")); break; case ID_H_RETURN: - lv_clear_home(); - lv_draw_tool(); + clear_cur_ui(); + draw_return_ui(); break; } } -void lv_draw_home(void) { +void lv_draw_home() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h index c5060127a876..779cbb01303a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_home(void); +extern void lv_draw_home(); extern void lv_clear_home(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 cbd028b60aeb..9a1c9dec2a3c 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 @@ -74,7 +74,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_homing_sensitivity_settings(void) { +void lv_draw_homing_sensitivity_settings() { scr = lv_screen_create(HOMING_SENSITIVITY_UI, machine_menu.HomingSensitivityConfTitle); sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0)); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.h index 0c554702b1c6..c6f0e1145739 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_homing_sensitivity_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_homing_sensitivity_settings(void); +extern void lv_draw_homing_sensitivity_settings(); extern void lv_clear_homing_sensitivity_settings(); #ifdef __cplusplus 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 f07c2761b6b3..1c4ac9da6123 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 @@ -70,7 +70,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_jerk_settings(void) { +void lv_draw_jerk_settings() { scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle); sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h index 0531dae9da96..69fd34460981 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_jerk_settings(void); +extern void lv_draw_jerk_settings(); extern void lv_clear_jerk_settings(); #ifdef __cplusplus 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 9f7c936fb3fb..ee219d5d0d98 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -55,13 +55,13 @@ static const lv_btnm_ctrl_t kb_ctrl_uc_map[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, LV_KB_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KB_CTRL_BTN_FLAGS | 2}; -static const char * kb_map_spec[] = {"0", "1", "2", "3", "4" ,"5", "6", "7", "8", "9", LV_SYMBOL_BACKSPACE, "\n", +static const char * kb_map_spec[] = {"0", "1", "2", "3", "4" ,"5", "6", "7", "8", "9", ".", LV_SYMBOL_BACKSPACE, "\n", "abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n", "\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n", LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""}; static const lv_btnm_ctrl_t kb_ctrl_spec_map[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, LV_KB_CTRL_BTN_FLAGS | 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, LV_KB_CTRL_BTN_FLAGS | 2, LV_KB_CTRL_BTN_FLAGS | 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, LV_KB_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KB_CTRL_BTN_FLAGS | 2}; @@ -73,8 +73,6 @@ static const lv_btnm_ctrl_t kb_ctrl_num_map[] = { 1, 1, 1, 1, 1}; 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; lv_kb_ext_t * ext = (lv_kb_ext_t * )lv_obj_get_ext_attr(kb); @@ -104,22 +102,18 @@ 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, nullptr); - //if (res != LV_RES_OK) return; lv_clear_keyboard(); 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 its cursor if needed lv_obj_del(kb); return; } - return; + return; } 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, nullptr); - //if (res != LV_RES_OK) return; const char * ret_ta_txt = lv_ta_get_text(ext->ta); switch (keyboard_value) { #if ENABLED(MKS_WIFI_MODULE) @@ -142,7 +136,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { gCfgItems.wifi_mode_sel = STA_MODEL; - package_to_wifi(WIFI_PARA_SET, (char *)0, 0); + package_to_wifi(WIFI_PARA_SET, (uint8_t *)0, 0); public_buf_l[0] = 0xA5; public_buf_l[1] = 0x09; @@ -151,7 +145,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { public_buf_l[4] = 0x01; public_buf_l[5] = 0xFC; public_buf_l[6] = 0x00; - raw_send_to_wifi(public_buf_l, 6); + raw_send_to_wifi((uint8_t*)public_buf_l, 6); last_disp_state = KEY_BOARD_UI; lv_clear_keyboard(); @@ -238,8 +232,6 @@ void lv_draw_keyboard() { lv_kb_set_style(kb, LV_KB_STYLE_BTN_PR, &pr_style); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - //lv_group_add_obj(g, kb); - //lv_group_set_editing(g, true); } #endif @@ -260,9 +252,6 @@ void lv_draw_keyboard() { } void lv_clear_keyboard() { - #if HAS_ROTARY_ENCODER - 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_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index befed7a64661..5953d0418402 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../inc/MarlinConfig.h" #include @@ -187,7 +183,7 @@ static void disp_language(uint8_t language, uint8_t state) { if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); } -void lv_draw_language(void) { +void lv_draw_language() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h index ca6d40bfc3ca..9e769e36926d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_language(void); +extern void lv_draw_language(); extern void lv_clear_language(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 b1ce90f26646..58c63372040b 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 @@ -40,30 +40,27 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_level_settings(); switch (obj->mks_obj_id) { case ID_LEVEL_RETURN: - lv_clear_level_settings(); draw_return_ui(); break; case ID_LEVEL_POSITION: - lv_clear_level_settings(); lv_draw_manual_level_pos_settings(); break; case ID_LEVEL_COMMAND: keyboard_value = gcodeCommand; - lv_clear_level_settings(); lv_draw_keyboard(); break; #if HAS_BED_PROBE case ID_LEVEL_ZOFFSET: - lv_clear_level_settings(); lv_draw_auto_level_offset_settings(); break; #endif } } -void lv_draw_level_settings(void) { +void lv_draw_level_settings() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.h index ce290172b6e5..95a4e2e2e570 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_level_settings(void); +extern void lv_draw_level_settings(); extern void lv_clear_level_settings(); #ifdef __cplusplus 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 5f81d7b3691a..971ea8a69e00 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 @@ -65,7 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_machine_para(void) { +void lv_draw_machine_para() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h index e830f75db7e5..652a7e1eb7c0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_machine_para(void); +extern void lv_draw_machine_para(); extern void lv_clear_machine_para(); #ifdef __cplusplus 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 deeb51ab0fb8..b79605d74fcf 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 @@ -62,7 +62,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_machine_settings(void) { +void lv_draw_machine_settings() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h index 38d02e718948..dd988ede723a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_machine_settings(void); +extern void lv_draw_machine_settings(); extern void lv_clear_machine_settings(); #ifdef __cplusplus 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 3c8d56291380..0b09ae391d1c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -25,14 +25,12 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" +extern const char G28_STR[]; + extern lv_group_t *g; static lv_obj_t *scr; @@ -49,65 +47,15 @@ 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_POINT1: - 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 (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 (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 (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: + case ID_M_POINT1 ... ID_M_POINT5: if (queue.length == 0) { if (uiCfg.leveling_first_time) { - queue.enqueue_now_P(PSTR("G28")); - uiCfg.leveling_first_time = 0; + uiCfg.leveling_first_time = false; + queue.inject_P(G28_STR); } - 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")); + const int ind = obj->mks_obj_id - ID_M_POINT1; + sprintf_P(public_buf_l, PSTR("G1 Z10\nG1 X%d Y%d\nG1 Z0"), (int)gCfgItems.levelingPos[ind][0], (int)gCfgItems.levelingPos[ind][1]); + queue.inject(public_buf_l); } break; case ID_MANUAL_RETURN: @@ -117,7 +65,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_manualLevel(void) { +void lv_draw_manualLevel() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h index cfa10370e128..4e9b8275ba1c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_manualLevel(void); +extern void lv_draw_manualLevel(); extern void lv_clear_manualLevel(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 6f64badf8be3..6cbd703f9ca1 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 @@ -52,79 +52,61 @@ 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: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_manual_level_pos_settings(); draw_return_ui(); - break; + return; case ID_MANUAL_POS_X1: value = level_pos_x1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y1: value = level_pos_y1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X2: value = level_pos_x2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y2: value = level_pos_y2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X3: value = level_pos_x3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y3: value = level_pos_y3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X4: value = level_pos_x4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y4: value = level_pos_y4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X5: value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y5: value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_UP: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_manual_level_pos_settings(); lv_draw_manual_level_pos_settings(); - break; + return; case ID_MANUAL_POS_DOWN: - uiCfg.para_ui_page = 1; + uiCfg.para_ui_page = true; lv_clear_manual_level_pos_settings(); lv_draw_manual_level_pos_settings(); - break; + return; } + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); } -void lv_draw_manual_level_pos_settings(void) { +void lv_draw_manual_level_pos_settings() { char buf2[50]; scr = lv_screen_create(MANUAL_LEVELING_POSIGION_UI, machine_menu.LevelingParaConfTitle); - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.h index 8e89ecf559fc..83fd225bd3b7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_manual_level_pos_settings(void); +extern void lv_draw_manual_level_pos_settings(); extern void lv_clear_manual_level_pos_settings(); #ifdef __cplusplus 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 60efda8b271d..47bd906a512f 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 @@ -45,54 +45,44 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + + lv_clear_max_feedrate_settings(); switch (obj->mks_obj_id) { case ID_FEED_RETURN: - uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); + uiCfg.para_ui_page = false; draw_return_ui(); - break; + return; case ID_FEED_X: value = XMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_Y: value = YMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_Z: value = ZMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_E0: value = E0MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_E1: value = E1MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_UP: - uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); + uiCfg.para_ui_page = false; lv_draw_max_feedrate_settings(); - break; + return; case ID_FEED_DOWN: - uiCfg.para_ui_page = 1; - lv_clear_max_feedrate_settings(); + uiCfg.para_ui_page = true; lv_draw_max_feedrate_settings(); - break; + return; } + lv_draw_number_key(); } -void lv_draw_max_feedrate_settings(void) { +void lv_draw_max_feedrate_settings() { scr = lv_screen_create(MAXFEEDRATE_UI, machine_menu.MaxFeedRateConfTitle); - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h index 78caca5adea4..f82ffd0eaaa2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_max_feedrate_settings(void); +extern void lv_draw_max_feedrate_settings(); extern void lv_clear_max_feedrate_settings(); #ifdef __cplusplus diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp new file mode 100644 index 000000000000..76bb34988a2b --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp @@ -0,0 +1,170 @@ +/** + * 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 HAS_TFT_LVGL_UI + +#include "../../../../MarlinCore.h" +#include "draw_ready_print.h" +#include "draw_set.h" +#include "lv_conf.h" +#include "draw_ui.h" +#include "../../../../gcode/queue.h" + +extern lv_group_t * g; +static lv_obj_t * scr; + +enum { + ID_GCODE = 1, + ID_CUSTOM_1, + ID_CUSTOM_2, + ID_CUSTOM_3, + ID_CUSTOM_4, + ID_CUSTOM_5, + ID_CUSTOM_6, + ID_CUSTOM_7, + 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_CUSTOM_1: TERN_(USER_CMD_1_ENABLE, queue.inject_P(PSTR(USER_GCODE_1))); break; + case ID_CUSTOM_2: TERN_(USER_CMD_2_ENABLE, queue.inject_P(PSTR(USER_GCODE_2))); break; + case ID_CUSTOM_3: TERN_(USER_CMD_3_ENABLE, queue.inject_P(PSTR(USER_GCODE_3))); break; + case ID_CUSTOM_4: TERN_(USER_CMD_4_ENABLE, queue.inject_P(PSTR(USER_GCODE_4))); break; + case ID_CUSTOM_5: TERN_(USER_CMD_5_ENABLE, queue.inject_P(PSTR(USER_GCODE_5))); break; + case ID_CUSTOM_6: TERN_(USER_CMD_6_ENABLE, queue.inject_P(PSTR(USER_GCODE_6))); break; + case ID_CUSTOM_7: TERN_(USER_CMD_7_ENABLE, queue.inject_P(PSTR(USER_GCODE_7))); break; + case ID_M_RETURN: + lv_clear_more(); + lv_draw_tool(); + break; + } +} + +void lv_draw_more() { + scr = lv_screen_create(MORE_UI); + + const bool enc_ena = TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable); + + #if ENABLED(USER_CMD_1_ENABLE) + lv_obj_t *buttonCustom1 = lv_imgbtn_create(scr, "F:/bmp_custom1.bin", INTERVAL_V, titleHeight, event_handler, ID_CUSTOM_1); + if (enc_ena) lv_group_add_obj(g, buttonCustom1); + lv_obj_t *labelCustom1 = lv_label_create_empty(buttonCustom1); + #endif + + #if ENABLED(USER_CMD_2_ENABLE) + lv_obj_t *buttonCustom2 = lv_imgbtn_create(scr, "F:/bmp_custom2.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_CUSTOM_2); + if (enc_ena) lv_group_add_obj(g, buttonCustom2); + lv_obj_t *labelCustom2 = lv_label_create_empty(buttonCustom2); + #endif + + #if ENABLED(USER_CMD_3_ENABLE) + lv_obj_t *buttonCustom3 = lv_imgbtn_create(scr, "F:/bmp_custom3.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_CUSTOM_3); + if (enc_ena) lv_group_add_obj(g, buttonCustom3); + lv_obj_t *labelCustom3 = lv_label_create_empty(buttonCustom3); + #endif + + #if ENABLED(USER_CMD_4_ENABLE) + lv_obj_t *buttonCustom4 = lv_imgbtn_create(scr, "F:/bmp_custom4.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_CUSTOM_4); + if (enc_ena) lv_group_add_obj(g, buttonCustom4); + lv_obj_t *labelCustom4 = lv_label_create_empty(buttonCustom4); + #endif + + #if ENABLED(USER_CMD_5_ENABLE) + lv_obj_t *buttonCustom5 = lv_imgbtn_create(scr, "F:/bmp_custom5.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_5); + if (enc_ena) lv_group_add_obj(g, buttonCustom5); + lv_obj_t *labelCustom5 = lv_label_create_empty(buttonCustom5); + #endif + + #if ENABLED(USER_CMD_6_ENABLE) + lv_obj_t *buttonCustom6 = lv_imgbtn_create(scr, "F:/bmp_custom6.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_6); + if (enc_ena) lv_group_add_obj(g, buttonCustom6); + lv_obj_t *labelCustom6 = lv_label_create_empty(buttonCustom6); + #endif + + #if ENABLED(USER_CMD_7_ENABLE) + blv_obj_t *uttonCustom7 = lv_imgbtn_create(scr, "F:/bmp_custom7.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_7); + if (enc_ena) lv_group_add_obj(g, buttonCustom7); + lv_obj_t *labelCustom7 = lv_label_create_empty(buttonCustom7); + #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_M_RETURN); + if (enc_ena) lv_group_add_obj(g, buttonBack); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); + + if (gCfgItems.multiple_language != 0) { + #if ENABLED(USER_CMD_1_ENABLE) + lv_label_set_text(labelCustom1, more_menu.custom1); + lv_obj_align(labelCustom1, buttonCustom1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_2_ENABLE) + lv_label_set_text(labelCustom2, more_menu.custom2); + lv_obj_align(labelCustom2, buttonCustom2, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_3_ENABLE) + lv_label_set_text(labelCustom3, more_menu.custom3); + lv_obj_align(labelCustom3, buttonCustom3, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_4_ENABLE) + lv_label_set_text(labelCustom4, more_menu.custom4); + lv_obj_align(labelCustom4, buttonCustom4, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_5_ENABLE) + lv_label_set_text(labelCustom5, more_menu.custom5); + lv_obj_align(labelCustom5, buttonCustom5, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_6_ENABLE) + lv_label_set_text(labelCustom6, more_menu.custom6); + lv_obj_align(labelCustom6, buttonCustom6, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + #endif + #if ENABLED(USER_CMD_7_ENABLE) + lv_label_set_text(labelCustom7, more_menu.custom7); + lv_obj_align(labelCustom7, buttonCustom7, 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 BUTTONS_EXIST(EN1, EN2, ENC) + if (enc_ena) { + TERN_(USER_CMD_1_ENABLE, lv_group_add_obj(g, buttonCustom1)); + TERN_(USER_CMD_2_ENABLE, lv_group_add_obj(g, buttonCustom2)); + TERN_(USER_CMD_3_ENABLE, lv_group_add_obj(g, buttonCustom3)); + TERN_(USER_CMD_4_ENABLE, lv_group_add_obj(g, buttonCustom4)); + TERN_(USER_CMD_5_ENABLE, lv_group_add_obj(g, buttonCustom5)); + TERN_(USER_CMD_6_ENABLE, lv_group_add_obj(g, buttonCustom6)); + TERN_(USER_CMD_7_ENABLE, lv_group_add_obj(g, buttonCustom7)); + lv_group_add_obj(g, buttonBack); + } + #endif +} + +void lv_clear_more() { + #if BUTTONS_EXIST(EN1, EN2, ENC) + if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); + #endif + lv_obj_del(scr); +} + +#endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_more.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_more.h new file mode 100644 index 000000000000..2a68d3da99af --- /dev/null +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_more.h @@ -0,0 +1,33 @@ +/** + * 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_more(); +extern void lv_clear_more(); + +#ifdef __cplusplus +} /* C-declarations for C++ */ +#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 61cefd761537..ec948f10be82 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 @@ -41,30 +41,26 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_motor_settings(); switch (obj->mks_obj_id) { case ID_MOTOR_RETURN: - lv_clear_motor_settings(); draw_return_ui(); break; case ID_MOTOR_STEPS: - lv_clear_motor_settings(); lv_draw_step_settings(); break; #if USE_SENSORLESS case ID_HOME_SENSE: - lv_clear_motor_settings(); lv_draw_homing_sensitivity_settings(); break; #endif #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; #endif @@ -72,7 +68,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_motor_settings(void) { +void lv_draw_motor_settings() { int index = 0; scr = lv_screen_create(MOTOR_SETTINGS_UI, machine_menu.MotorConfTitle); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h index 9a1c7a4db517..632f7bd24d4d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_motor_settings(void); +extern void lv_draw_motor_settings(); extern void lv_clear_motor_settings(); #ifdef __cplusplus 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 30f2a00422aa..d10175344d7c 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 @@ -25,18 +25,20 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" +#include "../../../../module/motion.h" #include "../../../../inc/MarlinConfig.h" extern lv_group_t *g; static lv_obj_t *scr; -static lv_obj_t *labelV, *buttonV; +static lv_obj_t *labelV, *buttonV, *labelP; +static lv_task_t *updatePosTask; +static char cur_label = 'Z'; +static float cur_pos = 0; + +void disp_cur_pos(); enum { ID_M_X_P = 1, @@ -51,70 +53,48 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + if (queue.length <= (BUFSIZE - 3)) { + bool do_inject = true; + float dist = uiCfg.move_dist; + switch (obj->mks_obj_id) { + case ID_M_X_N: dist *= -1; case ID_M_X_P: cur_label = 'X'; break; + case ID_M_Y_N: dist *= -1; case ID_M_Y_P: cur_label = 'Y'; break; + case ID_M_Z_N: dist *= -1; case ID_M_Z_P: cur_label = 'Z'; break; + default: do_inject = false; + } + if (do_inject) { + sprintf_P(public_buf_l, PSTR("G91\nG1 %c%3.1f F%d\nG90"), cur_label, dist, uiCfg.moveSpeed); + queue.inject(public_buf_l); + } + } + switch (obj->mks_obj_id) { - case ID_M_X_P: - 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 (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 (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 (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 (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 (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 (abs(10 * (int)uiCfg.move_dist) == 100) uiCfg.move_dist = 0.1; else - uiCfg.move_dist *= (float)10; + uiCfg.move_dist *= 10.0f; disp_move_dist(); break; case ID_M_RETURN: clear_cur_ui(); draw_return_ui(); - break; + return; + } + disp_cur_pos(); +} + +void refresh_pos(lv_task_t *) { + switch (cur_label) { + case 'X': cur_pos = current_position.x; break; + case 'Y': cur_pos = current_position.y; break; + case 'Z': cur_pos = current_position.z; break; + default: return; } + disp_cur_pos(); } -void lv_draw_move_motor(void) { +void lv_draw_move_motor() { 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); @@ -124,23 +104,32 @@ void lv_draw_move_motor(void) { 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 + // button with image and label changed dynamically 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); #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { - lv_group_add_obj(g, buttonV); - } + if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonV); #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); + // We need to patch the title to leave some space on the right for displaying the status + lv_obj_t * title = lv_obj_get_child_back(scr, NULL); + if (title != NULL) lv_obj_set_width(title, TFT_WIDTH - 101); + labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm"); + if (labelP != NULL) + updatePosTask = lv_task_create(refresh_pos, 300, LV_TASK_PRIO_LOWEST, 0); + disp_move_dist(); + disp_cur_pos(); } -void disp_move_dist() { - // char buf[30] = {0}; +void disp_cur_pos() { + sprintf_P(public_buf_l, PSTR("%c:%3.1fmm"), cur_label, cur_pos); + if (labelP) lv_label_set_text(labelP, public_buf_l); +} +void disp_move_dist() { 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) @@ -168,6 +157,7 @@ void lv_clear_move_motor() { #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); #endif + lv_task_del(updatePosTask); lv_obj_del(scr); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h index fdbb61f6f95f..a9b75c1d13e3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h @@ -25,11 +25,10 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_move_motor(void); +extern void lv_draw_move_motor(); extern void lv_clear_move_motor(); extern void disp_move_dist(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 0989b95f82ad..0694f89d747a 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 @@ -25,15 +25,10 @@ #include "draw_ui.h" #include -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/gcode.h" #include "../../../../gcode/queue.h" #include "../../../../module/planner.h" -#include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" #if ENABLED(POWER_LOSS_RECOVERY) @@ -661,7 +656,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_number_key(void) { +void lv_draw_number_key() { scr = lv_screen_create(NUMBER_KEY_UI, ""); buttonValue = lv_btn_create(scr, 92, 40, 296, 40, event_handler, ID_NUM_KEY1, &style_num_text); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h index 7902da36493a..dbf9015452ae 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_number_key(void); +extern void lv_draw_number_key(); extern void lv_clear_number_key(); #ifdef __cplusplus 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..eb4b3708387d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../module/motion.h" @@ -53,8 +49,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) { @@ -120,7 +114,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_operation(void) { +void lv_draw_operation() { lv_obj_t *buttonExtrusion = nullptr, *buttonSpeed = nullptr, *buttonBack = nullptr, *labelPreHeat = nullptr, *labelExtrusion = nullptr, @@ -180,7 +174,6 @@ void lv_draw_operation(void) { label_PowerOff = lv_label_create_empty(buttonPowerOff); if (uiCfg.print_state != WORKING) { - //label_Filament = lv_label_create_empty(buttonFilament); labelExtrusion = lv_label_create_empty(buttonExtrusion); label_Move = lv_label_create_empty(buttonMove); } @@ -207,8 +200,6 @@ 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); 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_operation.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h index cca1f6a2a5aa..e034f7070b2c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_operation(void); +extern void lv_draw_operation(); extern void lv_clear_operation(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index ec6129446a70..3eb717b71230 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../feature/pause.h" #include "../../../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h index 7d55d8375601..88222f0e1a58 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h @@ -27,7 +27,6 @@ extern void lv_draw_pause_message(const PauseMessage msg); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 a324aef7933e..46aa1a58d125 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 @@ -41,30 +41,25 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_pause_position(); switch (obj->mks_obj_id) { case ID_PAUSE_RETURN: - lv_clear_pause_position(); draw_return_ui(); - break; + return; case ID_PAUSE_X: value = pause_pos_x; - lv_clear_pause_position(); - lv_draw_number_key(); break; case ID_PAUSE_Y: value = pause_pos_y; - lv_clear_pause_position(); - lv_draw_number_key(); break; case ID_PAUSE_Z: value = pause_pos_z; - lv_clear_pause_position(); - lv_draw_number_key(); break; } + lv_draw_number_key(); } -void lv_draw_pause_position(void) { +void lv_draw_pause_position() { scr = lv_screen_create(PAUSE_POS_UI, machine_menu.PausePosText); sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h index 3e9e0798271b..e7c92a73965b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_pause_position(void); +extern void lv_draw_pause_position(); extern void lv_clear_pause_position(); #ifdef __cplusplus 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 0e869e67c420..273462ac90f1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" @@ -60,7 +56,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); } } - #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER + #if DISABLED(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); } @@ -157,7 +153,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_preHeat(void) { +void lv_draw_preHeat() { scr = lv_screen_create(PRE_HEAT_UI); // Create image buttons diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h index c8de942f3f60..da3ce8838410 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h @@ -25,13 +25,12 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_preHeat(void); +extern void lv_draw_preHeat(); extern void lv_clear_preHeat(); extern void disp_temp_type(); extern void disp_step_heat(); extern void disp_desire_temp(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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..0a8f81ea86a2 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 @@ -49,7 +49,7 @@ int8_t curDirLever = 0; LIST_FILE list_file; DIR_OFFSET dir_offset[10]; -extern uint8_t public_buf[512]; +extern uint8_t public_buf[513]; extern char public_buf_m[100]; uint8_t sel_id = 0; @@ -73,8 +73,7 @@ uint8_t sel_id = 0; for (uint16_t i = 0; i < fileCnt; i++) { if (list_file.Sd_file_cnt == list_file.Sd_file_offset) { - const uint16_t nr = SD_ORDER(i, fileCnt); - card.getfilename_sorted(nr); + card.getfilename_sorted(SD_ORDER(i, fileCnt)); list_file.IsFolder[valid_name_cnt] = card.flag.filenameIsDir; strcpy(list_file.file_name[valid_name_cnt], list_file.curDirPath); @@ -205,7 +204,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_print_file(void) { +void lv_draw_print_file() { //uint8_t i; uint8_t file_count; @@ -298,8 +297,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 +357,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 +398,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()) { @@ -416,12 +416,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; - card.setIndex(card.getIndex()); + // 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/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h index 94786ab07013..759ccdc1c03b 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 @@ -33,16 +33,15 @@ typedef struct { extern DIR_OFFSET dir_offset[10]; #define FILE_NUM 6 -#define SHORT_NEME_LEN 13 +#define SHORT_NAME_LEN 13 #define NAME_CUT_LEN 23 #define MAX_DIR_LEVEL 10 typedef struct { - //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; - 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 file_name[FILE_NUM][SHORT_NAME_LEN * MAX_DIR_LEVEL + 1]; + char curDirPath[SHORT_NAME_LEN * MAX_DIR_LEVEL + 1]; + char long_name[FILE_NUM][SHORT_NAME_LEN * 2 + 1]; bool IsFolder[FILE_NUM]; char Sd_file_cnt; char sd_file_index; @@ -51,7 +50,7 @@ typedef struct { extern LIST_FILE list_file; extern void disp_gcode_icon(uint8_t file_num); -extern void lv_draw_print_file(void); +extern void lv_draw_print_file(); 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(); @@ -60,7 +59,6 @@ extern int ascii2dec_test(char *ascii); extern void lv_clear_print_file(); extern void lv_gcode_file_seek(uint32_t pos); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 7614f1e99d16..169cf1af7cd9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../MarlinCore.h" // for marlin_state #include "../../../../module/temperature.h" @@ -75,10 +71,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_PAUSE: 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; @@ -99,7 +92,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { 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; @@ -118,7 +110,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_printing(void) { +void lv_draw_printing() { disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); scr = lv_screen_create(PRINTING_UI); @@ -164,20 +156,6 @@ void lv_draw_printing(void) { } #endif - // 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); - //#endif - - //#if HAS_HEATED_BED - // 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); - labelExt1 = lv_label_create(scr, 250, 146, nullptr); #if HAS_MULTI_EXTRUDER @@ -262,12 +240,10 @@ void disp_fan_Zpos() { } void reset_print_time() { - // print_time.days = 0; print_time.hours = 0; print_time.minutes = 0; print_time.seconds = 0; print_time.ms_10 = 0; - // print_time.start = 1; } void start_print_time() { print_time.start = 1; } @@ -290,7 +266,6 @@ void setProBarRate() { #endif rate = (rate_tmp_r - (PREVIEW_SIZE + To_pre_view)) * 100 / (gCfgItems.curFilesize - (PREVIEW_SIZE + To_pre_view)); } - // gCurFileState.totalSend = rate; if (rate <= 0) return; 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 466efe01cb40..7c98fd767b96 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -36,7 +36,7 @@ enum { STOP }; -extern void lv_draw_printing(void); +extern void lv_draw_printing(); extern void lv_clear_printing(); extern void disp_ext_temp(); extern void disp_bed_temp(); @@ -48,7 +48,6 @@ extern void start_print_time(); extern void stop_print_time(); extern void setProBarRate(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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..97200efb08fb 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 @@ -26,10 +26,6 @@ #include "draw_ready_print.h" #include "draw_tool.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "tft_lvgl_configuration.h" #include "mks_hardware_test.h" #include "draw_ui.h" @@ -39,9 +35,13 @@ #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; extern lv_group_t* g; static lv_obj_t *scr; #if ENABLED(MKS_TEST) @@ -56,17 +56,16 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_ready_print(); + switch (obj->mks_obj_id) { case ID_TOOL: - lv_clear_ready_print(); lv_draw_tool(); break; case ID_SET: - lv_clear_ready_print(); lv_draw_set(); break; case ID_PRINT: - lv_clear_ready_print(); lv_draw_print_file(); break; } @@ -99,65 +98,34 @@ 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_empty(scr); - //lv_obj_set_pos(label_tool, 20, 50); sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius); lv_label_set_text(e1, buf); #if HAS_MULTI_HOTEND sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.temp_hotend[1].celsius); lv_label_set_text(e2, buf); #endif - - //sprintf_P(buf, PSTR("e3:%d"), (int)thermalManager.temp_hotend[2].celsius); - //lv_label_set_text(e3, buf); #if HAS_HEATED_BED sprintf_P(buf, PSTR("bed:%d"), (int)thermalManager.temp_bed.celsius); lv_label_set_text(bed, buf); #endif } -void lv_draw_ready_print(void) { +void lv_draw_ready_print() { char buf[30] = {0}; lv_obj_t *buttonTool; disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); scr = lv_screen_create(PRINT_READY_UI, ""); - //lv_obj_set_hidden(scr, true); if (mks_test_flag == 0x1E) { - //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - // Create image buttons - //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, nullptr); - //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_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_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_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); } @@ -174,11 +142,6 @@ void lv_draw_ready_print(void) { lv_label_set_text(e2, buf); #endif - //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_empty(scr); lv_obj_set_pos(bed, 20, 95); @@ -215,6 +178,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_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h index 5cefe8b59b36..a3cfd6766578 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_ready_print(void); +extern void lv_draw_ready_print(); extern void mks_disp_test(); extern void disp_Limit_ok(); extern void disp_Limit_error(); @@ -33,7 +33,6 @@ extern void disp_det_error(); extern void disp_det_ok(); extern void lv_clear_ready_print(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 0ccb274153b6..6b06793f281c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -27,10 +27,6 @@ #include "draw_set.h" #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "pic_manager.h" @@ -58,36 +54,29 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; - #if ENABLED(MKS_WIFI_MODULE) - char buf[6] = { 0 }; - #endif + if (obj->mks_obj_id == ID_S_CONTINUE) return; + if (obj->mks_obj_id == ID_S_MOTOR_OFF) { + TERN(HAS_SUICIDE, suicide(), queue.enqueue_now_P(PSTR("M84"))); + return; + } + lv_clear_set(); switch (obj->mks_obj_id) { case ID_S_FAN: - lv_clear_set(); lv_draw_fan(); break; case ID_S_ABOUT: - lv_clear_set(); lv_draw_about(); break; - case ID_S_CONTINUE: break; - case ID_S_MOTOR_OFF: - TERN(HAS_SUICIDE, suicide(), queue.enqueue_now_P(PSTR("M84"))); - break; case ID_S_LANGUAGE: - lv_clear_set(); lv_draw_language(); break; case ID_S_MACHINE_PARA: - lv_clear_set(); lv_draw_machine_para(); break; case ID_S_EEPROM_SET: - lv_clear_set(); lv_draw_eeprom_settings(); break; case ID_S_RETURN: - lv_clear_set(); lv_draw_ready_print(); break; @@ -96,32 +85,23 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (gCfgItems.wifi_mode_sel == STA_MODEL) { if (wifi_link_state == WIFI_CONNECTED) { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi(); } else { - if (uiCfg.command_send == 1) { - buf[0] = 0xA5; - buf[1] = 0x07; - buf[2] = 0x00; - buf[3] = 0x00; - buf[4] = 0xFC; - raw_send_to_wifi(buf, 5); - + if (uiCfg.command_send) { + uint8_t cmd_wifi_list[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; + raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list)); last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi_list(); } else { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_dialog(DIALOG_WIFI_ENABLE_TIPS); } } } else { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi(); } break; @@ -129,7 +109,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_set(void) { +void lv_draw_set() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h index b243bca296ad..8ad8b9f2eafe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_set(void); +extern void lv_draw_set(); extern void lv_clear_set(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 022c4d30f9d6..c5cf45143f0e 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 @@ -45,54 +45,43 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_step_settings(); switch (obj->mks_obj_id) { case ID_STEP_RETURN: - uiCfg.para_ui_page = 0; - lv_clear_step_settings(); + uiCfg.para_ui_page = false; draw_return_ui(); - break; + return; case ID_STEP_X: value = Xstep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_Y: value = Ystep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_Z: value = Zstep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_E0: value = E0step; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_E1: value = E1step; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_UP: - uiCfg.para_ui_page = 0; - lv_clear_step_settings(); + uiCfg.para_ui_page = false; lv_draw_step_settings(); - break; + return; case ID_STEP_DOWN: - uiCfg.para_ui_page = 1; - lv_clear_step_settings(); + uiCfg.para_ui_page = true; lv_draw_step_settings(); - break; + return; } + lv_draw_number_key(); } -void lv_draw_step_settings(void) { +void lv_draw_step_settings() { scr = lv_screen_create(STEPS_UI, machine_menu.StepsConfTitle); - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h index b7eaeb4c61e3..249e5a7942d7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_step_settings(void); +extern void lv_draw_step_settings(); extern void lv_clear_step_settings(); #ifdef __cplusplus 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 aaf3073e3d24..61ee3be1c3f4 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 @@ -46,67 +46,56 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_tmc_current_settings(); switch (obj->mks_obj_id) { case ID_TMC_CURRENT_RETURN: - uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); + uiCfg.para_ui_page = false; draw_return_ui(); - break; - + return; #if AXIS_IS_TMC(X) case ID_TMC_CURRENT_X: value = Xcurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(Y) case ID_TMC_CURRENT_Y: value = Ycurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(Z) case ID_TMC_CURRENT_Z: value = Zcurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(E0) case ID_TMC_CURRENT_E0: value = E0current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(E1) case ID_TMC_CURRENT_E1: value = E1current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif case ID_TMC_CURRENT_UP: - uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); + uiCfg.para_ui_page = false; lv_draw_tmc_current_settings(); - break; + return; case ID_TMC_CURRENT_DOWN: - uiCfg.para_ui_page = 1; - lv_clear_tmc_current_settings(); + uiCfg.para_ui_page = true; lv_draw_tmc_current_settings(); - break; + return; } + lv_draw_number_key(); + } -void lv_draw_tmc_current_settings(void) { +void lv_draw_tmc_current_settings() { scr = lv_screen_create(TMC_CURRENT_UI, machine_menu.TmcCurrentConfTitle); float milliamps; - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { #if AXIS_IS_TMC(X) milliamps = stepperX.getMilliamps(); #else diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h index 927db37138e6..8310305e6170 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_tmc_current_settings(void); +extern void lv_draw_tmc_current_settings(); extern void lv_clear_tmc_current_settings(); #ifdef __cplusplus 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 53d7e35382a1..08d442f8a36b 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 @@ -50,9 +50,7 @@ enum { static lv_obj_t *buttonXState = nullptr, *buttonYState = nullptr, *buttonZState = nullptr, *buttonE0State = nullptr; -//#if AXIS_HAS_STEALTHCHOP(E1) - static lv_obj_t *buttonE1State = nullptr; -//#endif +static lv_obj_t *buttonE1State = nullptr; static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; @@ -65,7 +63,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_TMC_MODE_RETURN: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_tmc_step_mode_settings(); draw_return_ui(); break; @@ -97,19 +95,19 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { #endif case ID_TMC_MODE_UP: - uiCfg.para_ui_page = 0; + uiCfg.para_ui_page = false; lv_clear_tmc_step_mode_settings(); lv_draw_tmc_step_mode_settings(); break; case ID_TMC_MODE_DOWN: - uiCfg.para_ui_page = 1; + uiCfg.para_ui_page = true; lv_clear_tmc_step_mode_settings(); lv_draw_tmc_step_mode_settings(); break; } } -void lv_draw_tmc_step_mode_settings(void) { +void lv_draw_tmc_step_mode_settings() { buttonXState = buttonYState = buttonZState = buttonE0State = buttonE1State = nullptr; scr = lv_screen_create(TMC_MODE_UI, machine_menu.TmcStepModeConfTitle); @@ -131,7 +129,7 @@ void lv_draw_tmc_step_mode_settings(void) { stealth_E1 = stepperE1.get_stealthChop(); #endif - if (uiCfg.para_ui_page != 1) { + if (!uiCfg.para_ui_page) { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h index 35c57ab0cc01..a15baf21e828 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_tmc_step_mode_settings(void); +extern void lv_draw_tmc_step_mode_settings(); extern void lv_clear_tmc_step_mode_settings(); #ifdef __cplusplus 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 3a9d78741a8b..682d40858c2b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" @@ -54,51 +50,36 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + if (TERN1(AUTO_BED_LEVELING_BILINEAR, obj->mks_obj_id != ID_T_LEVELING)) + lv_clear_tool(); switch (obj->mks_obj_id) { - case ID_T_PRE_HEAT: - lv_clear_tool(); - lv_draw_preHeat(); - break; - case ID_T_EXTRUCT: - lv_clear_tool(); - lv_draw_extrusion(); - break; - case ID_T_MOV: - lv_clear_tool(); - lv_draw_move_motor(); - break; - case ID_T_HOME: - lv_clear_tool(); - lv_draw_home(); - break; + case ID_T_PRE_HEAT: lv_draw_preHeat(); break; + case ID_T_EXTRUCT: lv_draw_extrusion(); break; + case ID_T_MOV: lv_draw_move_motor(); break; + case ID_T_HOME: lv_draw_home(); break; case ID_T_LEVELING: #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(); + uiCfg.leveling_first_time = true; lv_draw_manualLevel(); #endif break; case ID_T_FILAMENT: 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: TERN_(MKS_TEST, curent_disp_ui = 1); - lv_clear_tool(); lv_draw_ready_print(); break; } } -void lv_draw_tool(void) { +void lv_draw_tool() { 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); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h index 8a033e2c40b9..1cfd297aba2a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h @@ -25,10 +25,9 @@ extern "C" { /* C-declarations for C++ */ #endif -extern void lv_draw_tool(void); +extern void lv_draw_tool(); extern void lv_clear_tool(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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/draw_touch_calibration.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h index b14700dcf336..63749a2b3c2a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h @@ -29,7 +29,6 @@ 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 46c1ab8279cd..88e6fab07c01 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -70,14 +70,12 @@ 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); static const char custom_gcode_command[][100] = { - "G28\nG29\nM500", + "G29N\nM500", "G28", "G28", "G28", @@ -137,12 +135,10 @@ void gCfgItems_init() { gCfgItems.levelingPos[3][1] = Y_MAX_POS - 30; gCfgItems.levelingPos[4][0] = X_BED_SIZE / 2; gCfgItems.levelingPos[4][1] = Y_BED_SIZE / 2; - gCfgItems.cloud_enable = true; - #if ENABLED(MKS_WIFI_MODULE) - gCfgItems.wifi_mode_sel = STA_MODEL; - gCfgItems.fileSysType = FILE_SYS_SD; - gCfgItems.wifi_type = ESP_WIFI; - #endif + gCfgItems.cloud_enable = false; + gCfgItems.wifi_mode_sel = STA_MODEL; + gCfgItems.fileSysType = FILE_SYS_SD; + gCfgItems.wifi_type = ESP_WIFI; gCfgItems.filamentchange_load_length = 200; gCfgItems.filamentchange_load_speed = 1000; gCfgItems.filamentchange_unload_length = 200; @@ -185,22 +181,22 @@ void ui_cfg_init() { uiCfg.curTempType = 0; uiCfg.curSprayerChoose = 0; uiCfg.stepHeat = 10; - uiCfg.leveling_first_time = 0; - uiCfg.para_ui_page = 0; + uiCfg.leveling_first_time = false; + uiCfg.para_ui_page = false; uiCfg.extruStep = 5; uiCfg.extruSpeed = 10; uiCfg.move_dist = 1; uiCfg.moveSpeed = 3000; uiCfg.stepPrintSpeed = 10; - uiCfg.command_send = 0; + uiCfg.command_send = false; uiCfg.dialogType = 0; - uiCfg.filament_heat_completed_load = 0; + uiCfg.filament_heat_completed_load = false; uiCfg.filament_rate = 0; - uiCfg.filament_loading_completed = 0; - uiCfg.filament_unloading_completed = 0; - uiCfg.filament_loading_time_flg = 0; + uiCfg.filament_loading_completed = false; + uiCfg.filament_unloading_completed = false; + uiCfg.filament_loading_time_flg = false; uiCfg.filament_loading_time_cnt = 0; - uiCfg.filament_unloading_time_flg = 0; + uiCfg.filament_unloading_time_flg = false; uiCfg.filament_unloading_time_cnt = 0; #if ENABLED(MKS_WIFI_MODULE) @@ -448,6 +444,7 @@ 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: @@ -568,11 +565,7 @@ char *creat_title_text() { ZERO(tmpCurFileStr); - #if _LFN_UNICODE - //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); - #else - cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); - #endif + cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); ZERO(public_buf_m); @@ -589,17 +582,16 @@ char *creat_title_text() { index++; } - if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/ - ) { + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI) { titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); } if (strlen(public_buf_m) > MAX_TITLE_LEN) { ZERO(public_buf_m); - tmpText = getDispText(0); + tmpText = 0; + for (index = 0; index <= disp_state_stack._disp_index && (!tmpText || *tmpText == 0); index++) + tmpText = getDispText(index); if (*tmpText != 0) { titleText_cat(public_buf_m, sizeof(public_buf_m), tmpText); titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)">...>"); @@ -617,8 +609,6 @@ char *creat_title_text() { void preview_gcode_prehandle(char *path) { #if ENABLED(SDSUPPORT) - //uint8_t re; - //uint32_t read; uint32_t pre_read_cnt = 0; uint32_t *p1; char *cur_name; @@ -647,253 +637,97 @@ char *creat_title_text() { #endif } - #if 1 - - void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { - #if ENABLED(SDSUPPORT) - //uint8_t ress; - //uint32_t write; - volatile uint32_t i, j; - volatile uint16_t *p_index; - //int res; - char *cur_name; - - cur_name = strrchr(path, '/'); - card.openFileRead(cur_name); - - if (gPicturePreviewStart <= 0) { - while (1) { - uint32_t br = card.read(public_buf, 400); - uint32_t* p1 = (uint32_t *)strstr((char *)public_buf, ";gimage:"); - if (p1) { - gPicturePreviewStart += (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0])); - break; - } - else { - gPicturePreviewStart += br; - } - if (br < 400) break; - } - } - - card.setIndex((gPicturePreviewStart + To_pre_view) + size * row + 8); - SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); + void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { + #if ENABLED(SDSUPPORT) + volatile uint32_t i, j; + volatile uint16_t *p_index; + char *cur_name; - j = i = 0; + cur_name = strrchr(path, '/'); + card.openFileRead(cur_name); + if (gPicturePreviewStart <= 0) { while (1) { - card.read(public_buf, 400); - for (i = 0; i < 400;) { - bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); - i += 2; - j++; - } - if (j >= 400) break; - } - for (i = 0; i < 400; i += 2) { - p_index = (uint16_t *)(&bmp_public_buf[i]); - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; - } - SPI_TFT.tftio.WriteSequence((uint16_t*)bmp_public_buf, 200); - #if HAS_BAK_VIEW_IN_FLASH - W25QXX.init(SPI_QUARTER_SPEED); - if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); - W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400); - #endif - row++; - if (row >= 200) { - size = 809; - row = 0; - - gcode_preview_over = false; - //flash_preview_begin = true; - - card.closefile(); - - /* - if (gCurFileState.file_open_flag != 0xAA) { - reset_file_info(); - res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); - if (res == FR_OK) { - f_lseek(file,PREVIEW_SIZE+To_pre_view); - gCurFileState.file_open_flag = 0xAA; - //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); - srcfp = file; - mksReprint.mks_printer_state = MKS_WORKING; - once_flag = false; - } - } - */ - char *cur_name; - - cur_name = strrchr(list_file.file_name[sel_id], '/'); - - SdFile file; - SdFile *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(); + uint32_t br = card.read(public_buf, 400); + uint32_t* p1 = (uint32_t *)strstr((char *)public_buf, ";gimage:"); + if (p1) { + gPicturePreviewStart += (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0])); + break; } - - 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.01; - #if HAS_MULTI_EXTRUDER - planner.flow_percentage[1] = 100; - planner.e_factor[1] = planner.flow_percentage[1] * 0.01; - #endif - card.startFileprint(); - TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); - once_flag = false; + else { + gPicturePreviewStart += br; } - return; + if (br < 400) break; } - card.closefile(); - #endif // SDSUPPORT - } - - #else // if 1 - - void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { - #if ENABLED(SDSUPPORT) - //uint8_t ress; - //uint32_t write; - volatile uint32_t i, j; - volatile uint16_t *p_index; - //int res; - char *cur_name; - uint16_t Color; - - cur_name = strrchr(path, '/'); - card.openFileRead(cur_name); - - card.setIndex((PREVIEW_LITTLE_PIC_SIZE + To_pre_view) + size * row + 8); - #if HAS_TFT_LVGL_UI_SPI - SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); - #else - LCD_setWindowArea(xpos_pixel, ypos_pixel + row, 200, 1); - LCD_WriteRAM_Prepare(); - #endif - - j = 0; - i = 0; + } - while (1) { - card.read(public_buf, 400); - for (i = 0; i < 400;) { - bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); - i += 2; - j++; - } + card.setIndex(gPicturePreviewStart + size * row + 8); + SPI_TFT.setWindow(xpos_pixel, ypos_pixel + row, 200, 1); - //if (i > 800) break; - //#ifdef TFT70 - // if (j > 400) { - // f_read(file, buff_pic, 1, &read); - // break; - // } - //#elif defined(TFT35) - if (j >= 400) - //f_read(file, buff_pic, 1, &read); - break; - //#endif + j = i = 0; + while (1) { + card.read(public_buf, 400); + for (i = 0; i < 400;) { + bmp_public_buf[j] = ascii2dec_test((char*)&public_buf[i]) << 4 | ascii2dec_test((char*)&public_buf[i + 1]); + i += 2; + j++; } - #if HAS_TFT_LVGL_UI_SPI - for (i = 0; i < 400;) { - p_index = (uint16_t *)(&bmp_public_buf[i]); - - Color = (*p_index >> 8); - *p_index = Color | ((*p_index & 0xFF) << 8); - i += 2; - if (*p_index == 0x0000) *p_index = 0xC318; - } - TFT_CS_L; - TFT_DC_H; - SPI.dmaSend(bmp_public_buf, 400, true); - TFT_CS_H; - - #else - for (i = 0; i < 400;) { - p_index = (uint16_t *)(&bmp_public_buf[i]); - if (*p_index == 0x0000) *p_index = 0x18C3; - LCD_IO_WriteData(*p_index); - i = i + 2; - } - #endif + if (j >= 400) break; + } + for (i = 0; i < 400; i += 2) { + p_index = (uint16_t *)(&bmp_public_buf[i]); + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; + } + SPI_TFT.tftio.WriteSequence((uint16_t*)bmp_public_buf, 200); + #if HAS_BAK_VIEW_IN_FLASH W25QXX.init(SPI_QUARTER_SPEED); - if (row < 20) - W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); + if (row < 20) W25QXX.SPI_FLASH_SectorErase(BAK_VIEW_ADDR_TFT35 + row * 4096); W25QXX.SPI_FLASH_BufferWrite(bmp_public_buf, BAK_VIEW_ADDR_TFT35 + row * 400, 400); - row++; - if (row >= 200) { - size = 809; - row = 0; - - gcode_preview_over = false; - //flash_preview_begin = true; - - card.closefile(); - - /* - if (gCurFileState.file_open_flag != 0xAA) { - reset_file_info(); - res = f_open(file, curFileName, FA_OPEN_EXISTING | FA_READ); - if (res == FR_OK) { - f_lseek(file,PREVIEW_SIZE+To_pre_view); - gCurFileState.file_open_flag = 0xAA; - //bakup_file_path((uint8_t *)curFileName, strlen(curFileName)); - srcfp = file; - mksReprint.mks_printer_state = MKS_WORKING; - once_flag = false; - } - } - */ - char *cur_name; - - cur_name = strrchr(list_file.file_name[sel_id], '/'); - - SdFile file; - SdFile *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(); - } + #endif + row++; + if (row >= 200) { + size = 809; + row = 0; + + gcode_preview_over = false; - 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.01; - #if HAS_MULTI_EXTRUDER - planner.flow_percentage[1] = 100; - planner.e_factor[1] = planner.flow_percentage[1] * 0.01; - #endif - card.startFileprint(); - TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); - once_flag = false; - } - return; - } card.closefile(); - #endif // SDSUPPORT - } + char *cur_name; - #endif // if 1 + cur_name = strrchr(list_file.file_name[sel_id], '/'); + + SdFile file; + SdFile *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; + planner.flow_percentage[0] = 100; + planner.e_factor[0] = planner.flow_percentage[0] * 0.01; + #if HAS_MULTI_EXTRUDER + planner.flow_percentage[1] = 100; + planner.e_factor[1] = planner.flow_percentage[1] * 0.01; + #endif + card.startFileprint(); + TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); + once_flag = false; + } + return; + } + card.closefile(); + #endif // SDSUPPORT + } - void Draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) { + void draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) { int index; int y_off = 0; W25QXX.init(SPI_QUARTER_SPEED); @@ -922,12 +756,12 @@ char *creat_title_text() { #if HAS_BAK_VIEW_IN_FLASH if (flash_preview_begin) { flash_preview_begin = false; - Draw_default_preview(xpos_pixel, ypos_pixel, 1); + draw_default_preview(xpos_pixel, ypos_pixel, 1); } #endif #if HAS_GCODE_DEFAULT_VIEW_IN_FLASH if (default_preview_flg) { - Draw_default_preview(xpos_pixel, ypos_pixel, 0); + draw_default_preview(xpos_pixel, ypos_pixel, 0); default_preview_flg = false; } #endif @@ -957,7 +791,6 @@ void GUI_RefreshPage() { switch (disp_state) { case MAIN_UI: - //lv_draw_ready_print(); break; case EXTRUSION_UI: if (temps_update_flag) { @@ -972,14 +805,6 @@ void GUI_RefreshPage() { } break; case PRINT_READY_UI: - /* - if (gCfgItems.display_style == 2) { - if (temps_update_flag) { - temps_update_flag = false; - disp_restro_state(); - } - } - */ break; case PRINT_FILE_UI: break; @@ -1000,23 +825,9 @@ void GUI_RefreshPage() { break; case OPERATE_UI: - /* - if (temps_update_flag) { - temps_update_flag = false; - disp_temp_operate(); - } - - setProBarRateOpera(); - */ break; case PAUSE_UI: - /* - if (temps_update_flag) { - temps_update_flag = false; - disp_temp_pause(); - } - */ break; case FAN_UI: @@ -1027,17 +838,6 @@ void GUI_RefreshPage() { break; case MOVE_MOTOR_UI: - /* - if (mksReprint.mks_printer_state == MKS_IDLE) { - 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); - } - } - */ break; #if ENABLED(MKS_WIFI_MODULE) @@ -1047,12 +847,11 @@ void GUI_RefreshPage() { temps_update_flag = false; } break; - #endif - - case BIND_UI: - /*refresh_bind_ui();*/ - break; + case BIND_UI: + refresh_bind_ui(); + break; + #endif case FILAMENTCHANGE_UI: if (temps_update_flag) { temps_update_flag = false; @@ -1064,7 +863,6 @@ void GUI_RefreshPage() { TERN_(MKS_WIFI_MODULE, wifi_scan_handle()); break; case MESHLEVELING_UI: - /*disp_zpos();*/ break; case HARDWARE_TEST_UI: break; @@ -1077,8 +875,6 @@ void GUI_RefreshPage() { #endif break; case KEY_BOARD_UI: - /*update_password_disp(); - update_join_state_disp();*/ break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_TIPS_UI: @@ -1142,42 +938,43 @@ 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_READY_UI: 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 PAUSE_UI: 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 SPRAYER_UI: break; + case MACHINE_UI: 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 LOG_UI: break; + case DISK_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_clear_wifi(); break; #endif - case MORE_UI: /* Clear_more(); */ break; - case FILETRANSFER_UI: /* Clear_fileTransfer(); */ break; + case MORE_UI: lv_clear_more(); break; + case FILETRANSFER_UI: break; case DIALOG_UI: lv_clear_dialog(); break; - case FILETRANSFERSTATE_UI: /* Clear_WifiFileTransferdialog(); */ break; - case PRINT_MORE_UI: /* Clear_Printmore(); */ break; + case FILETRANSFERSTATE_UI: break; + case PRINT_MORE_UI: break; case FILAMENTCHANGE_UI: lv_clear_filament_change(); break; case LEVELING_UI: lv_clear_manualLevel(); break; - case BIND_UI: /* Clear_Bind(); */ break; + #if ENABLED(MKS_WIFI_MODULE) + case BIND_UI: lv_clear_cloud_bind(); break; + #endif #if HAS_BED_PROBE 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 MESHLEVELING_UI: break; + case HARDWARE_TEST_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_clear_wifi_list(); break; #endif @@ -1187,28 +984,28 @@ void clear_cur_ui() { #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 TEMPERATURE_SETTINGS_UI: 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 MACHINETYPE_UI: break; + case STROKE_UI: break; + case HOME_DIR_UI: break; + case ENDSTOP_TYPE_UI: break; + case FILAMENT_SETTINGS_UI: break; + case LEVELING_SETTIGNS_UI: break; case LEVELING_PARA_UI: lv_clear_level_settings(); break; - case DELTA_LEVELING_PARA_UI: /* Clear_DeltaLevelPara(); */ break; + case DELTA_LEVELING_PARA_UI: 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 MOTORDIR_UI: break; + case HOMESPEED_UI: break; + case NOZZLE_CONFIG_UI: break; + case HOTBED_CONFIG_UI: break; case ADVANCED_UI: lv_clear_advance_settings(); break; - case DOUBLE_Z_UI: /* Clear_DoubleZ(); */ break; - case ENABLE_INVERT_UI: /* Clear_EnableInvert(); */ break; + case DOUBLE_Z_UI: break; + case ENABLE_INVERT_UI: 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; @@ -1233,7 +1030,6 @@ void clear_cur_ui() { #endif default: break; } - //GUI_Clear(); } void draw_return_ui() { @@ -1253,34 +1049,36 @@ void draw_return_ui() { case MOVE_MOTOR_UI: lv_draw_move_motor(); break; case OPERATE_UI: lv_draw_operation(); break; - case PAUSE_UI: /* draw_pause(); */ break; + case PAUSE_UI: 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 SPRAYER_UI: break; + case MACHINE_UI: 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 CALIBRATE_UI: break; + case DISK_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_draw_wifi(); break; #endif - case MORE_UI: /* draw_More(); */ break; - case PRINT_MORE_UI: /* draw_printmore(); */ break; + case MORE_UI: break; + case PRINT_MORE_UI: lv_draw_more(); break; case FILAMENTCHANGE_UI: lv_draw_filament_change(); break; case LEVELING_UI: lv_draw_manualLevel(); break; - case BIND_UI: /* draw_bind(); */ break; + #if ENABLED(MKS_WIFI_MODULE) + case BIND_UI: lv_draw_cloud_bind(); break; + #endif #if HAS_BED_PROBE 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 MESHLEVELING_UI: break; + case HARDWARE_TEST_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_draw_wifi_list(); break; #endif @@ -1290,16 +1088,16 @@ void draw_return_ui() { #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 TEMPERATURE_SETTINGS_UI: 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 MACHINETYPE_UI: break; + case STROKE_UI: break; + case HOME_DIR_UI: break; + case ENDSTOP_TYPE_UI: break; case FILAMENT_SETTINGS_UI: lv_draw_filament_settings(); break; - case LEVELING_SETTIGNS_UI: /* draw_LevelingSettings(); */ break; + case LEVELING_SETTIGNS_UI: break; case LEVELING_PARA_UI: lv_draw_level_settings(); break; - case DELTA_LEVELING_PARA_UI: /* draw_DeltaLevelPara(); */ break; + case DELTA_LEVELING_PARA_UI: 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; @@ -1307,15 +1105,15 @@ void draw_return_ui() { #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 MOTORDIR_UI: break; + case HOMESPEED_UI: break; + case NOZZLE_CONFIG_UI: break; + case HOTBED_CONFIG_UI: break; case ADVANCED_UI: lv_draw_advance_settings(); break; - case DOUBLE_Z_UI: /* draw_DoubleZ(); */ break; - case ENABLE_INVERT_UI: /* draw_EnableInvert(); */ break; + case DOUBLE_Z_UI: break; + case ENABLE_INVERT_UI: break; case NUMBER_KEY_UI: lv_draw_number_key(); break; - case DIALOG_UI: /* draw_dialog(uiCfg.dialogType); */ break; + case DIALOG_UI: break; case BABY_STEP_UI: lv_draw_baby_stepping(); break; case PAUSE_POS_UI: lv_draw_pause_position(); break; #if HAS_TRINAMIC_CONFIG @@ -1612,7 +1410,6 @@ void print_time_count() { } void LV_TASK_HANDLER() { - //lv_tick_inc(1); lv_task_handler(); if (mks_test_flag == 0x1E) mks_hardware_test(); @@ -1622,8 +1419,6 @@ void LV_TASK_HANDLER() { TERN_(MKS_WIFI_MODULE, get_wifi_commands()); - //sd_detection(); - #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_update_encoder(); #endif 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 a888217b9a3f..f02a58ad43aa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -28,7 +28,7 @@ // the colors of the last MKS Ui #undef LV_COLOR_BACKGROUND -#define LV_COLOR_BACKGROUND LV_COLOR_MAKE(0x1A, 0x1A, 0x1A) // LV_COLOR_MAKE(0x00, 0x00, 0x00) +#define LV_COLOR_BACKGROUND LV_COLOR_MAKE(0x1A, 0x1A, 0x1A) #define TFT_LV_PARA_BACK_BODY_COLOR LV_COLOR_MAKE(0x4A, 0x52, 0xFF) @@ -46,6 +46,7 @@ #include "draw_preHeat.h" #include "draw_extrusion.h" #include "draw_home.h" +#include "draw_more.h" #include "draw_move_motor.h" #include "draw_fan.h" #include "draw_about.h" @@ -76,6 +77,8 @@ #include "draw_keyboard.h" #include "draw_encoder_settings.h" +#include "../../../../inc/MarlinConfigPre.h" + #if ENABLED(MKS_WIFI_MODULE) #include "wifiSerial.h" #include "wifi_module.h" @@ -84,11 +87,15 @@ #include "draw_wifi.h" #include "draw_wifi_list.h" #include "draw_wifi_tips.h" + #include "draw_cloud_bind.h" #endif -#include "../../../../inc/MarlinConfigPre.h" -#define FILE_SYS_USB 0 -#define FILE_SYS_SD 1 +#define ESP_WIFI 0x02 +#define AP_MODEL 0x01 +#define STA_MODEL 0x02 + +#define FILE_SYS_USB 0 +#define FILE_SYS_SD 1 #define TICK_CYCLE 1 @@ -157,6 +164,10 @@ #define PARA_UI_BACK_BTN_X_SIZE 70 #define PARA_UI_BACK_BTN_Y_SIZE 40 + #define QRCODE_X 20 + #define QRCODE_Y 40 + #define QRCODE_WIDTH 160 + #else // ifdef TFT35 #define TFT_WIDTH 320 @@ -183,37 +194,37 @@ typedef struct { uint8_t wifi_mode_sel; uint8_t fileSysType; uint8_t wifi_type; - bool cloud_enable; - bool encoder_enable; + bool cloud_enable, + encoder_enable; int levelingPos[5][2]; - int filamentchange_load_length; - int filamentchange_load_speed; - int filamentchange_unload_length; - int filamentchange_unload_speed; - int filament_limit_temper; - float pausePosX; - float pausePosY; - float pausePosZ; + int filamentchange_load_length, + filamentchange_load_speed, + filamentchange_unload_length, + filamentchange_unload_speed, + filament_limit_temper; + float pausePosX, + pausePosY, + pausePosZ; uint32_t curFilesize; } CFG_ITMES; typedef struct { uint8_t curTempType:1, curSprayerChoose:3, - stepHeat:4; - uint8_t leveling_first_time:1, + stepHeat:4, + curSprayerChoose_bak:4; + bool leveling_first_time:1, para_ui_page:1, configWifi:1, command_send:1, filament_load_heat_flg:1, filament_heat_completed_load:1, filament_unload_heat_flg:1, - filament_heat_completed_unload:1; - uint8_t filament_loading_completed:1, + filament_heat_completed_unload:1, + filament_loading_completed:1, filament_unloading_completed:1, filament_loading_time_flg:1, - filament_unloading_time_flg:1, - curSprayerChoose_bak:4; + filament_unloading_time_flg:1; uint8_t wifi_name[32]; uint8_t wifi_key[64]; uint8_t cloud_hostUrl[96]; @@ -229,15 +240,16 @@ typedef struct { uint16_t cloud_port; uint16_t moveSpeed_bak; uint32_t totalSend; - uint32_t filament_loading_time; - uint32_t filament_unloading_time; - uint32_t filament_loading_time_cnt; - uint32_t filament_unloading_time_cnt; + uint32_t filament_loading_time, + filament_unloading_time, + filament_loading_time_cnt, + filament_unloading_time_cnt; float move_dist; float desireSprayerTempBak; - float current_x_position_bak; - float current_y_position_bak; - float current_e_position_bak; + float current_x_position_bak, + current_y_position_bak, + current_z_position_bak, + current_e_position_bak; } UI_CFG; typedef enum { @@ -432,7 +444,7 @@ extern lv_point_t line_points[4][2]; extern void gCfgItems_init(); extern void ui_cfg_init(); extern void tft_style_init(); -extern char *creat_title_text(void); +extern char *creat_title_text(); extern void preview_gcode_prehandle(char *path); extern void update_spi_flash(); extern void update_gcode_command(int addr,uint8_t *s); 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 47a5dff04839..fe22923b441d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -41,60 +41,64 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + clear_cur_ui(); switch (obj->mks_obj_id) { case ID_W_RETURN: - clear_cur_ui(); lv_draw_set(); break; case ID_W_CLOUD: - //clear_cur_ui(); - //draw_return_ui(); - break; - case ID_W_RECONNECT: - clear_cur_ui(); - lv_draw_wifi_list(); + lv_draw_cloud_bind(); break; + #if ENABLED(MKS_WIFI_MODULE) + case ID_W_RECONNECT: { + uint8_t cmd_wifi_list[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; + raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list)); + lv_draw_wifi_list(); + } break; + #endif } } -void lv_draw_wifi(void) { +void lv_draw_wifi() { 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); - #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); - lv_obj_t *buttonReconnect = nullptr, *label_Reconnect = nullptr; + lv_obj_t *buttonCloud = nullptr, *label_Cloud = nullptr; + + const bool enc_ena = TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable); if (gCfgItems.wifi_mode_sel == STA_MODEL) { - buttonReconnect = lv_imgbtn_create(scr, nullptr); + if (gCfgItems.cloud_enable) + buttonCloud = lv_imgbtn_create(scr, "F:/bmp_cloud.bin", BTN_X_PIXEL+INTERVAL_V*2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_CLOUD); - 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); + buttonReconnect = lv_imgbtn_create(scr, "F:/bmp_wifi.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_W_RECONNECT); #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonReconnect); + if (gCfgItems.cloud_enable) lv_group_add_obj(g, buttonCloud); + if (enc_ena) 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_btn_set_layout(buttonReconnect, LV_LAYOUT_OFF); - label_Reconnect = lv_label_create_empty(buttonReconnect); + if (gCfgItems.cloud_enable) label_Cloud = lv_label_create_empty(buttonCloud); } - 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); + // 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); + if (enc_ena) lv_group_add_obj(g, buttonBack); + lv_obj_t *label_Back = lv_label_create_empty(buttonBack); + if (gCfgItems.multiple_language) { if (gCfgItems.wifi_mode_sel == STA_MODEL) { + if (gCfgItems.cloud_enable) { + lv_label_set_text(label_Cloud, wifi_menu.cloud); + 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_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); } wifi_ip_text = lv_label_create_empty(scr); @@ -153,9 +157,8 @@ void disp_wifi_state() { } void lv_clear_wifi() { - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); - #endif + if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable)) + lv_group_remove_all_objs(g); lv_obj_del(scr); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.h index 966a84d3b19b..1187741ad66d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.h @@ -26,7 +26,7 @@ #endif -extern void lv_draw_wifi(void); +extern void lv_draw_wifi(); extern void lv_clear_wifi(); extern void disp_wifi_state(); 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 f902edce7c3e..bda6306e6c0d 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 @@ -88,7 +88,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_wifi_list(void) { +void lv_draw_wifi_list() { 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); @@ -122,12 +122,15 @@ void lv_draw_wifi_list(void) { lv_group_add_obj(g, buttonDown); lv_group_add_obj(g, buttonBack); } + #else + UNUSED(buttonDown); + UNUSED(buttonBack); #endif disp_wifi_list(); } -void disp_wifi_list(void) { +void disp_wifi_list() { int8_t tmpStr[WIFI_NAME_BUFFER_SIZE] = { 0 }; uint8_t i, j; @@ -154,7 +157,7 @@ void disp_wifi_list(void) { } void wifi_scan_handle() { - if (!DIALOG_IS(WIFI_ENABLE_TIPS) || uiCfg.command_send != 1) return; + if (!DIALOG_IS(WIFI_ENABLE_TIPS) || !uiCfg.command_send) 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_list.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.h index e2d9275ef918..e42b738f143e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.h @@ -27,7 +27,7 @@ extern void lv_draw_wifi_list(); extern void lv_clear_wifi_list(); -extern void disp_wifi_list(void); +extern void disp_wifi_list(); extern void cutWifiName(char *name, int len,char *outStr); extern void wifi_scan_handle(); 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 9c8c094e4c1d..fd2c6467e77e 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 @@ -93,7 +93,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { } } -void lv_draw_wifi_settings(void) { +void lv_draw_wifi_settings() { scr = lv_screen_create(WIFI_SETTINGS_UI, machine_menu.WifiConfTitle); 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_settings.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.h index c0d6e0ccdd78..605423b13187 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.h @@ -28,7 +28,7 @@ #define WIFI_AP_TEXT "AP" #define WIFI_STA_TEXT "STA" -extern void lv_draw_wifi_settings(void); +extern void lv_draw_wifi_settings(); extern void lv_clear_wifi_settings(); #ifdef __cplusplus 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 7428d364881d..3db89a87c967 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 @@ -36,7 +36,7 @@ TIPS_TYPE wifi_tips_type; TIPS_DISP tips_disp; tips_menu_def tips_menu; -void lv_draw_wifi_tips(void) { +void lv_draw_wifi_tips() { static lv_obj_t *text_tips,*wifi_name; scr = lv_screen_create(WIFI_TIPS_UI, ""); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.h index 4f81f00a434d..f9896edcc86f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.h @@ -26,7 +26,7 @@ #endif -extern void lv_draw_wifi_tips(void); +extern void lv_draw_wifi_tips(); extern void lv_clear_wifi_tips(); typedef enum { 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 fbc8192ffbc3..f3585cc6cb59 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -50,10 +50,8 @@ static x_header_t __g_xbf_hd = { .min = 0, .max = 0, .bpp = 0 }; static uint8_t __g_font_buf[63]; static uint8_t *__user_font_getdata(int offset, int size) { - //ZERO(__g_font_buf); get_spi_flash_data((char *)__g_font_buf, offset, size); return __g_font_buf; - //return &buf_test[offset]; } static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { @@ -67,9 +65,7 @@ static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t u uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); if (p_pos[0] != 0) { uint32_t pos = p_pos[0]; - //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); __user_font_getdata(pos, 2); - //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 nullptr; @@ -97,12 +93,6 @@ static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_ return false; } -/*lv_font_t gb2312_puhui32 = { -.get_glyph_bitmap = __user_font_get_bitmap, -.get_glyph_dsc = __user_font_get_glyph_dsc, -.line_height = 25, -.base_line = 0, -};*/ lv_font_t gb2312_puhui32; void init_gb2312_font() { gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; 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 128bf0b2d46b..98b4aff881c0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp @@ -45,21 +45,11 @@ #define WIFI_IO1_SET() WRITE(WIFI_IO1_PIN, HIGH); #define WIFI_IO1_RESET() WRITE(WIFI_IO1_PIN, LOW); -void __irq_usart1(void) { - WIFISERIAL.wifi_usart_irq(USART1_BASE); - if (wifi_link_state == WIFI_TRANS_FILE) { - if (WIFISERIAL.available() == (400)) WIFI_IO1_SET(); - if (WIFISERIAL.wifi_rb_is_full()) { - if (esp_state == TRANSFER_IDLE) esp_state = TRANSFERING; - if (storeRcvData(UART_RX_BUFFER_SIZE)) { - if (wifiTransError.flag != 0x1) WIFI_IO1_RESET(); - } - else { - WIFI_IO1_SET(); - esp_state = TRANSFER_STORE; - } - } - } +void __irq_usart1() { + if ((USART1_BASE->CR1 & USART_CR1_RXNEIE) && (USART1_BASE->SR & USART_SR_RXNE)) + WRITE(WIFI_IO1_PIN, HIGH); + + WIFISERIAL.wifi_usart_irq(USART1_BASE); } #ifdef __cplusplus 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 06d6ca6b7234..8cbe319d147f 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 @@ -53,11 +53,8 @@ void test_gpio_readlevel_L() { #if PIN_EXISTS(MT_DET_2) mt_det2_sta = (READ(MT_DET_2_PIN) == 0); #endif - //mt_det3_sta = (READ(FIL_RUNOUT_3_PIN) == 0); endstopx1_sta = (READ(X_MIN_PIN) == 0); - //endstopx2_sta = (READ(X_MAX_PIN) == 0); endstopy1_sta = (READ(Y_MIN_PIN) == 0); - //endstopy2_sta = (READ(Y_MAX_PIN) == 0); endstopz1_sta = (READ(Z_MIN_PIN) == 0); endstopz2_sta = (READ(Z_MAX_PIN) == 0); #endif @@ -75,11 +72,8 @@ void test_gpio_readlevel_H() { #if PIN_EXISTS(MT_DET_2) mt_det2_sta = (READ(MT_DET_2_PIN) == 1); #endif - //mt_det3_sta = (READ(MT_DET_3_PIN) == 1); endstopx1_sta = (READ(X_MIN_PIN) == 1); - //endstopx2_sta = (READ(X_MAX_PIN) == 1); endstopy1_sta = (READ(Y_MIN_PIN) == 1); - //endstopy2_sta = (READ(Y_MAX_PIN) == 1); endstopz1_sta = (READ(Z_MIN_PIN) == 1); endstopz2_sta = (READ(Z_MAX_PIN) == 1); #endif @@ -88,9 +82,7 @@ void test_gpio_readlevel_H() { void init_test_gpio() { #ifdef MKS_TEST SET_INPUT_PULLUP(X_MIN_PIN); - //SET_INPUT_PULLUP(X_MAX_PIN); SET_INPUT_PULLUP(Y_MIN_PIN); - //SET_INPUT_PULLUP(Y_MAX_PIN); SET_INPUT_PULLUP(Z_MIN_PIN); SET_INPUT_PULLUP(Z_MAX_PIN); @@ -100,7 +92,6 @@ void init_test_gpio() { #if PIN_EXISTS(MT_DET_2) SET_INPUT_PULLUP(MT_DET_2_PIN); #endif - //SET_INPUT_PULLUP(MT_DET_3_PIN); SET_INPUT_PULLUP(MKS_TEST_POWER_LOSS_PIN); SET_INPUT_PULLUP(MKS_TEST_PS_ON_PIN); @@ -122,7 +113,6 @@ void init_test_gpio() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_ENABLE_PIN, LOW); #endif - //WRITE(E2_ENABLE_PIN, LOW); #if MB(MKS_ROBIN_E3P) SET_INPUT_PULLUP(PA1); @@ -167,15 +157,13 @@ void mks_gpio_test() { && (READ(PE6) == 0) && (READ(PE7) == 0) #endif - ) // &&(mt_det3_sta == 1)) + ) disp_det_ok(); else disp_det_error(); if ( (endstopx1_sta == 1) - //&& (endstopx2_sta == 1) && (endstopy1_sta == 1) - //&& (endstopy2_sta == 1) && (endstopz1_sta == 1) && (endstopz2_sta == 1) ) @@ -195,9 +183,7 @@ void mks_hardware_test() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_DIR_PIN, LOW); #endif - //WRITE(E2_DIR_PIN, LOW); thermalManager.fan_speed[0] = 255; - //WRITE(HEATER_2_PIN, HIGH); // HE2 #if !MB(MKS_ROBIN_E3P) WRITE(HEATER_1_PIN, HIGH); // HE1 #endif @@ -212,9 +198,7 @@ void mks_hardware_test() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_DIR_PIN, HIGH); #endif - //WRITE(E2_DIR_PIN, HIGH); thermalManager.fan_speed[0] = 0; - //WRITE(HEATER_2_PIN, LOW); // HE2 #if !MB(MKS_ROBIN_E3P) WRITE(HEATER_1_PIN, LOW); // HE1 #endif @@ -229,7 +213,6 @@ void mks_hardware_test() { // nothing here } else { - //mks_test_beeper(); } if (disp_state == PRINT_READY_UI) @@ -637,7 +620,6 @@ void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor } } -//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/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 4dd84d0212c9..8b96587fea1a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -36,14 +36,13 @@ #include "../../../../MarlinCore.h" extern uint16_t DeviceCode; -extern unsigned char bmp_public_buf[17 * 1024]; #if ENABLED(SDSUPPORT) extern char *createFilename(char * const buffer, const dir_t &p); #endif static const char assets[][LONG_FILENAME_LENGTH] = { - //homing screen + // Homing screen "bmp_zeroAll.bin", "bmp_zero.bin", "bmp_zeroX.bin", @@ -51,33 +50,27 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_zeroZ.bin", "bmp_manual_off.bin", - //tool screen + // Tool screen "bmp_preHeat.bin", "bmp_extruct.bin", "bmp_mov.bin", - // "bmp_Zero.bin", "bmp_leveling.bin", "bmp_filamentchange.bin", + "bmp_more.bin", - //fan screen + // Fan screen "bmp_Add.bin", "bmp_Dec.bin", "bmp_speed255.bin", "bmp_speed127.bin", "bmp_speed0.bin", - //preheat screen - // "bmp_Add.bin", - // "bmp_Dec.bin", - "bmp_speed0.bin", - // "bmp_Extru2.bin", - // "bmp_Extru1.bin", "bmp_bed.bin", "bmp_step1_degree.bin", "bmp_step5_degree.bin", "bmp_step10_degree.bin", - //extrusion screen + // Extrusion screen "bmp_in.bin", "bmp_out.bin", "bmp_extru1.bin", @@ -91,15 +84,15 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_step5_mm.bin", "bmp_step10_mm.bin", - //select file screen + // Select file screen "bmp_pageUp.bin", "bmp_pageDown.bin", "bmp_back.bin", //TODO: why two back buttons? Why not just one? (return / back) "bmp_dir.bin", "bmp_file.bin", - //move motor screen - //TODO: 6 equal icons, just in diffenct rotation... it may be optimized too + // Move motor screen + // TODO: 6 equal icons, just in diffenct rotation... it may be optimized too "bmp_xAdd.bin", "bmp_xDec.bin", "bmp_yAdd.bin", @@ -110,26 +103,24 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_step_move1.bin", "bmp_step_move10.bin", - //operation screen + // Operation screen "bmp_auto_off.bin", "bmp_speed.bin", - //"bmp_Mamual.bin", //TODO: didn't find it.. changed to bmp_manual_off.bin "bmp_fan.bin", "bmp_temp.bin", "bmp_extrude_opr.bin", "bmp_move_opr.bin", - //change speed screen + // Change speed screen "bmp_step1_percent.bin", "bmp_step5_percent.bin", "bmp_step10_percent.bin", "bmp_extruct_sel.bin", "bmp_mov_changespeed.bin", - // "bmp_extrude_opr.bin", equal to "bmp_Extruct.bin" "bmp_mov_sel.bin", "bmp_speed_extruct.bin", - //printing screen + // Printing screen "bmp_pause.bin", "bmp_resume.bin", "bmp_stop.bin", @@ -143,7 +134,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_zpos_state.bin", "bmp_operate.bin", - //manual leval screen (only if disabled auto level) + // Manual Level screen (only if auto level is disabled) #if DISABLED(AUTO_BED_LEVELING_BILINEAR) "bmp_leveling1.bin", "bmp_leveling2.bin", @@ -152,7 +143,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_leveling5.bin", #endif - //lang select screen + // Language Select screen #if HAS_LANG_SELECT_SCREEN "bmp_language.bin", "bmp_simplified_cn.bin", @@ -171,7 +162,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_italy_sel.bin", #endif // HAS_LANG_SELECT_SCREEN - // gcode preview + // G-code preview #if HAS_GCODE_DEFAULT_VIEW_IN_FLASH "bmp_preview.bin", #endif @@ -180,23 +171,18 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_logo.bin", #endif - // settings screen + // Settings screen "bmp_about.bin", - //"bmp_Language.bin", - //"bmp_Fan.bin", - //"bmp_manual_off.bin", + "bmp_eeprom_settings.bin", + "bmp_machine_para.bin", + "bmp_function1.bin", - //start screen + // Start screen "bmp_printing.bin", "bmp_set.bin", "bmp_tool.bin", - // settings screen - "bmp_eeprom_settings.bin", - "bmp_machine_para.bin", - "bmp_function1.bin", - - // base icons + // Base icons "bmp_arrow.bin", "bmp_back70x40.bin", "bmp_value_blank.bin", @@ -206,14 +192,24 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_return.bin", #if ENABLED(MKS_WIFI_MODULE) - // wifi screen + // Wifi screen "bmp_wifi.bin", + "bmp_cloud.bin", #endif - // babystep screen + // Babystep screen "bmp_baby_move0_01.bin", "bmp_baby_move0_05.bin", - "bmp_baby_move0_1.bin" + "bmp_baby_move0_1.bin", + + // More screen + "bmp_custom1.bin", + "bmp_custom2.bin", + "bmp_custom3.bin", + "bmp_custom4.bin", + "bmp_custom5.bin", + "bmp_custom6.bin", + "bmp_custom7.bin" }; #if HAS_SPI_FLASH_FONT @@ -247,14 +243,13 @@ uint32_t lv_get_pic_addr(uint8_t *Pname) { } while (PIC.name[j++] != '\0'); if ((strcasecmp((char*)Pname, (char*)PIC.name)) == 0) { - if ((DeviceCode == 0x9488) || (DeviceCode == 0x5761)) + if (DeviceCode == 0x9488 || DeviceCode == 0x5761) addr = PIC_DATA_ADDR_TFT35 + i * PER_PIC_MAX_SPACE_TFT35; else addr = PIC_DATA_ADDR_TFT32 + i * PER_PIC_MAX_SPACE_TFT32; return addr; } } - return addr; } @@ -373,8 +368,6 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { return Pic_SaveAddr; } -uint8_t public_buf[512]; - #if ENABLED(SDSUPPORT) static void dosName2LongName(const char dosName[11], char* longName) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index ea75915df363..0abfd7834a3d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -95,9 +95,7 @@ #define PIC_NAME_ADDR 0x003000 // Pic information addr #define PIC_SIZE_ADDR 0x007000 // Pic size information addr #define PIC_COUNTER_ADDR 0x008000 // Pic total number - //#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture #define PIC_LOGO_ADDR 0x009000 // Logo addr - //#define PIC_DATA_ADDR 0x02F000 // // TFT35 #define DEFAULT_VIEW_ADDR_TFT35 0xC5800 @@ -122,7 +120,7 @@ // SD card information first addr #define VAR_INF_ADDR 0x000000 -#define FLASH_INF_VALID_FLAG 0x20200831 +#define FLASH_INF_VALID_FLAG 0x20201118 //Store some gcode commands, such as auto leveling commands #define GCODE_COMMAND_ADDR VAR_INF_ADDR + 3*1024 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 58f9f4fce6c7..4467df59d965 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -27,12 +27,12 @@ #include #include "../../../../gcode/gcode.h" -#include "../../../../module/temperature.h" #include "../../../../module/planner.h" #include "../../../../module/motion.h" #include "../../../../sd/cardreader.h" #include "../../../../inc/MarlinConfig.h" #include "../../../../MarlinCore.h" +#include "../../../../gcode/queue.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" @@ -56,12 +56,11 @@ void printer_state_polling() { //save the positon uiCfg.current_x_position_bak = current_position.x; uiCfg.current_y_position_bak = current_position.y; + uiCfg.current_z_position_bak = current_position.z; if (gCfgItems.pausePosZ != (float)-1) { - gcode.process_subcommands_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Z%.1f"), gCfgItems.pausePosZ); + sprintf_P(public_buf_l, PSTR("G91\nG1 Z%.1f\nG90"), 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) { sprintf_P(public_buf_l, PSTR("G1 X%.1f Y%.1f"), gCfgItems.pausePosX, gCfgItems.pausePosY); @@ -70,9 +69,6 @@ void printer_state_polling() { uiCfg.print_state = PAUSED; uiCfg.current_e_position_bak = current_position.e; - // #if ENABLED(POWER_LOSS_RECOVERY) - // if (recovery.enabled) recovery.save(true); - // #endif gCfgItems.pause_reprint = true; update_spi_flash(); } @@ -91,10 +87,9 @@ void printer_state_polling() { gcode.process_subcommands_now(public_buf_m); } if (gCfgItems.pausePosZ != (float)-1) { - gcode.process_subcommands_now_P(PSTR("G91")); - 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")); + ZERO(public_buf_m); + sprintf_P(public_buf_m, PSTR("G1 Z%.1f"), uiCfg.current_z_position_bak); + gcode.process_subcommands_now(public_buf_m); } gcode.process_subcommands_now_P(M24_STR); uiCfg.print_state = WORKING; @@ -131,10 +126,8 @@ void printer_state_polling() { gcode.process_subcommands_now(public_buf_m); if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) { - gcode.process_subcommands_now_P(PSTR("G91")); - sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ); + sprintf_P(public_buf_l, PSTR("G91\nG1 Z-%.1f\nG90"), gCfgItems.pausePosZ); gcode.process_subcommands_now(public_buf_l); - gcode.process_subcommands_now_P(PSTR("G90")); } #endif uiCfg.print_state = WORKING; 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 41bf82e80f20..2261eeeba969 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 @@ -114,6 +114,7 @@ #define PROBE_Z_SPEED_EN "Probe Z-axis speed" #define ENABLE_EN "YES" #define DISABLE_EN "NO" +#define LOCKED_EN "N/A" #define Z_MIN_EN "ZMin" #define Z_MAX_EN "ZMax" @@ -381,28 +382,12 @@ #define FILAMENT_EXT1_TEXT_EN "Extrusion2" #define FILAMENT_HEAT_TEXT_EN "Preheat" #define FILAMENT_STOP_TEXT_EN "Stop" -//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" #define FILAMENT_TIPS2_TEXT_EN "T:" #define FILAMENT_TIPS3_TEXT_EN "Loading..." #define FILAMENT_TIPS4_TEXT_EN "Unloading..." #define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" #define FILAMENT_TIPS6_TEXT_EN "Completed" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" -#endif - - #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." @@ -414,16 +399,11 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,\nclick for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,\nclick for return!" - #define PRE_HEAT_EXT_TEXT_EN "E" #define PRE_HEAT_BED_TEXT_EN "Bed" #define FILE_LOADING_EN "Loading......" -#if 0 - #define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" -#else - #define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" -#endif +#define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" #define NO_FILE_EN "No files found!" @@ -491,7 +471,6 @@ #define DIALOG_RETRY_EN "Retry" #define DIALOG_STOP_EN "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" #define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." #define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" #define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" @@ -691,34 +670,16 @@ //manual ip #define MANUAL_IP_TITLE_EN "Manual IP" -#define MANUAL_IP_CANCEL_EN "< Cancel" +#define MANUAL_IP_CANCEL_EN "< Cancel" #define MANUAL_IP_APPLY_EN "Join >" #define MANUAL_IP_ADDRESS_EN "IP Address" #define MANUAL_IP_MASK_EN "Subnet Mask" #define MANUAL_IP_GATEWAY_EN "Default Gateway" #define MANUAL_IP_SERVER_EN "Name Server" #define MANUAL_IP_INIT_DATA_EN "0.0.0.0" -#define MANUAL_TEXT_POINT_EN "." +#define MANUAL_TEXT_POINT_EN "." #define MANUAL_TEXT_ENTER_EN "enter" -//Wifi name -//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" -//#define TEXT_WIFI_SAPCE_EN "space" -//#define TEXT_WIFI_LETTER_EN "abc" -//#define TEXT_WIFI_DIGITAL_EN "123" -//#define TEXT_WIFI_SYMBOL_EN "#+=" -//#define TEXT_WIFI_PASSWORD_EN "Password" - -//#define TEXT_WIFI_POINT_BOLD_EN "`" - -//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." -//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" -//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" - -//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" -//#define TEXT_WIFI_FORGET_EN "Forget Network" -//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" - #define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" #define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" #define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." @@ -764,3 +725,11 @@ #define EEPROM_STORE_TIPS_EN "Store settings to EEPROM?" #define EEPROM_READ_TIPS_EN "Read settings from EEPROM?" #define EEPROM_REVERT_TIPS_EN "Revert settings to factory defaults?" + +#define MORE_CUSTOM1_TEXT_EN USER_DESC_1 +#define MORE_CUSTOM2_TEXT_EN USER_DESC_2 +#define MORE_CUSTOM3_TEXT_EN USER_DESC_3 +#define MORE_CUSTOM4_TEXT_EN USER_DESC_4 +#define MORE_CUSTOM5_TEXT_EN USER_DESC_5 +#define MORE_CUSTOM6_TEXT_EN USER_DESC_6 +#define MORE_CUSTOM7_TEXT_EN USER_DESC_7 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h index 6944d6b23518..e3226b3cbe7c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h @@ -135,26 +135,12 @@ #define FILAMENT_EXT1_TEXT_FR "Extr2" #define FILAMENT_HEAT_TEXT_FR "Preheat" #define FILAMENT_STOP_TEXT_FR "Arrêter" -//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" #define FILAMENT_TIPS2_TEXT_FR "T:" #define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." #define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." #define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" #define FILAMENT_TIPS6_TEXT_FR "Terminé" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" -#endif #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." @@ -171,16 +157,9 @@ #define PRE_HEAT_BED_TEXT_FR "Bed" #define FILE_LOADING_FR "Chargement......" -#if 0 - #define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" -#else - #define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" -#endif - +#define NO_FILE_AND_CHECK_FR "Aucun fichier, vérifiez à nouveau!" #define NO_FILE_FR "Pas de fichier!" - - #define EXTRUDER_TEMP_TEXT_FR "Temper" #define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" #define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" @@ -222,7 +201,7 @@ #define TITLE_ADJUST_FR "Réglage" #define TITLE_WIRELESS_FR "Sans fil" #define TITLE_FILAMENT_FR "Remplacer" -#define TITLE_ABOUT_FR "A propos" +#define TITLE_ABOUT_FR "À propos" #define TITLE_FAN_FR "Ventilateur" #define TITLE_LANGUAGE_FR "Langue" #define TITLE_PAUSE_FR "Pause" @@ -247,7 +226,6 @@ #define DIALOG_STOP_FR "Arrêter" #define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" -//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" #define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." #define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" #define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." @@ -261,10 +239,10 @@ #define MESSAGE_PAUSING_FR "Parking..." #define MESSAGE_CHANGING_FR "Attente filament pour démarrer" #define MESSAGE_UNLOAD_FR "Attente retrait du filament" -#define MESSAGE_WAITING_FR "Presser bouton,pour reprendre" +#define MESSAGE_WAITING_FR "Presser bouton, pour reprendre" #define MESSAGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." #define MESSAGE_LOAD_FR "Attente chargement filament" -#define MESSAGE_PURGE_FR "Attente Purge filament" +#define MESSAGE_PURGE_FR "Attente purge filament" #define MESSAGE_RESUME_FR "Attente reprise impression" #define MESSAGE_HEAT_FR "Presser le bouton pour chauffer..." #define MESSAGE_HEATING_FR "Buse en chauffe Patienter SVP..." @@ -279,3 +257,11 @@ #define EEPROM_STORE_TIPS_FR "Stocker les paramètres dans l'EEPROM?" #define EEPROM_READ_TIPS_FR "Lire les paramètres de l'EEPROM?" #define EEPROM_REVERT_TIPS_FR "Rétablir les paramètres par défaut d'usine?" + +#define MORE_CUSTOM1_TEXT_FR USER_DESC_1 +#define MORE_CUSTOM2_TEXT_FR USER_DESC_2 +#define MORE_CUSTOM3_TEXT_FR USER_DESC_3 +#define MORE_CUSTOM4_TEXT_FR USER_DESC_4 +#define MORE_CUSTOM5_TEXT_FR USER_DESC_5 +#define MORE_CUSTOM6_TEXT_FR USER_DESC_6 +#define MORE_CUSTOM7_TEXT_FR USER_DESC_7 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h index f64ca4df79df..2a1ba83cd0a0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h @@ -135,26 +135,12 @@ #define FILAMENT_EXT1_TEXT_IT "Estrude2" #define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" #define FILAMENT_STOP_TEXT_IT "Stop" -//#define FILAMENT_CHANGE_TEXT_IT "Filamento" #define FILAMENT_TIPS2_TEXT_IT "T:" #define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." #define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." #define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" #define FILAMENT_TIPS6_TEXT_IT "Completato" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_IT "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click for return!" -#endif #define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." @@ -166,16 +152,11 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" - #define PRE_HEAT_EXT_TEXT_IT "E" #define PRE_HEAT_BED_TEXT_IT "Piano" #define FILE_LOADING_IT "Caricamento......" -#if 0 - #define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" -#endif #define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" - #define NO_FILE_IT "Nessun file!" #define EXTRUDER_TEMP_TEXT_IT "Temper" @@ -241,7 +222,6 @@ #define DIALOG_CANCEL_PRINT_IT "Stop stampa?" #define DIALOG_STOP_IT "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" -//#define DIALOG_UNBIND_PRINTER_IT "Libero?" #define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." #define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" #define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" @@ -274,3 +254,11 @@ #define EEPROM_STORE_TIPS_IT "Memorizzare le impostazioni su EEPROM?" #define EEPROM_READ_TIPS_IT "Leggi le impostazioni dalla EEPROM?" #define EEPROM_REVERT_TIPS_IT "Ripristinare le impostazioni predefinite?" + +#define MORE_CUSTOM1_TEXT_IT USER_DESC_1 +#define MORE_CUSTOM2_TEXT_IT USER_DESC_2 +#define MORE_CUSTOM3_TEXT_IT USER_DESC_3 +#define MORE_CUSTOM4_TEXT_IT USER_DESC_4 +#define MORE_CUSTOM5_TEXT_IT USER_DESC_5 +#define MORE_CUSTOM6_TEXT_IT USER_DESC_6 +#define MORE_CUSTOM7_TEXT_IT USER_DESC_7 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h index 9f695b376b59..94103354b957 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h @@ -29,7 +29,7 @@ #define PRINT_TEXT_RU " печать" #define EXTRUDE_TEXT_RU "экструзия" #define LEVELING_TEXT_RU "уровень" -#define AUTO_LEVELING_TEXT_RU "aвто" +#define AUTO_LEVELING_TEXT_RU "aвтоуровень" #define SET_TEXT_RU "настройки" #define MORE_TEXT_RU "больше" @@ -46,23 +46,23 @@ #define BACK_TEXT_RU "назад" #define TOOL_PREHEAT_RU "нагрев" -#define TOOL_EXTRUDE_RU "экструзия" +#define TOOL_EXTRUDE_RU "экструдер" #define TOOL_MOVE_RU "движение" #define TOOL_HOME_RU "домой" #define TOOL_LEVELING_RU "уровень" -#define TOOL_AUTO_LEVELING_RU "aвто" +#define TOOL_AUTO_LEVELING_RU "aвтоуровень" #define TOOL_FILAMENT_RU "замена" #define TOOL_MORE_RU "больше" -#define AXIS_X_ADD_TEXT_RU "X+" -#define AXIS_X_DEC_TEXT_RU "X-" -#define AXIS_Y_ADD_TEXT_RU "Y+" -#define AXIS_Y_DEC_TEXT_RU "Y-" -#define AXIS_Z_ADD_TEXT_RU "Z+" -#define AXIS_Z_DEC_TEXT_RU "Z-" -#define TEXT_01MM_RU "0.1mm" -#define TEXT_1MM_RU "1mm" -#define TEXT_10MM_RU "10mm" +#define AXIS_X_ADD_TEXT_RU "X +" +#define AXIS_X_DEC_TEXT_RU "X -" +#define AXIS_Y_ADD_TEXT_RU "Y +" +#define AXIS_Y_DEC_TEXT_RU "Y -" +#define AXIS_Z_ADD_TEXT_RU "Z +" +#define AXIS_Z_DEC_TEXT_RU "Z -" +#define TEXT_01MM_RU "0.1 mm" +#define TEXT_1MM_RU "1 mm" +#define TEXT_10MM_RU "10 mm" #define HOME_X_TEXT_RU "X" #define HOME_Y_TEXT_RU "Y" @@ -75,18 +75,18 @@ #define EXTRUDER_IN_TEXT_RU "втянуть" #define EXTRUDER_OUT_TEXT_RU "выдавить" -#define EXTRUDE_1MM_TEXT_RU "1mm" -#define EXTRUDE_5MM_TEXT_RU "5mm" -#define EXTRUDE_10MM_TEXT_RU "10mm" +#define EXTRUDE_1MM_TEXT_RU "1 mm" +#define EXTRUDE_5MM_TEXT_RU "5 mm" +#define EXTRUDE_10MM_TEXT_RU "10 mm" #define EXTRUDE_LOW_SPEED_TEXT_RU "мин" #define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" #define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" -#define LEVELING_POINT1_TEXT_RU "1точка" -#define LEVELING_POINT2_TEXT_RU "2точка" -#define LEVELING_POINT3_TEXT_RU "3точка" -#define LEVELING_POINT4_TEXT_RU "4точка" -#define LEVELING_POINT5_TEXT_RU "5точка" +#define LEVELING_POINT1_TEXT_RU "1 точка" +#define LEVELING_POINT2_TEXT_RU "2 точка" +#define LEVELING_POINT3_TEXT_RU "3 точка" +#define LEVELING_POINT4_TEXT_RU "4 точка" +#define LEVELING_POINT5_TEXT_RU "5 точка" #define FILESYS_TEXT_RU "система" #define WIFI_TEXT_RU "WiFi" @@ -95,11 +95,10 @@ #define BREAK_POINT_TEXT_RU "продолжить" #define FILAMENT_TEXT_RU "замена" #define LANGUAGE_TEXT_RU "язык" -#define MOTOR_OFF_TEXT_RU "отклмотор" +#define MOTOR_OFF_TEXT_RU "откл. мотор" #define MOTOR_OFF_XY_TEXT_RU "Off-XY" #define SHUTDOWN_TEXT_RU "выключение" #define MACHINE_PARA_RU "конфиг" -#define EEPROM_SETTINGS_RU "Eeprom Set" #define U_DISK_TEXT_RU "U диск" #define SD_CARD_TEXT_RU "SD диск" @@ -111,14 +110,14 @@ #define WIFI_CONNECTED_TEXT_RU "подключен" #define WIFI_DISCONNECTED_TEXT_RU "не подключен" #define WIFI_EXCEPTION_TEXT_RU "исключение" -#define WIFI_RECONNECT_TEXT_RU "Reconnect" +#define WIFI_RECONNECT_TEXT_RU "выбор сети" #define CLOUD_TEXT_RU "облако" #define CLOUD_BIND_RU "соединён" -#define CLOUD_UNBIND_RU "не соединён" -#define CLOUD_UNBINDING_RU "Unbinding" -#define CLOUD_DISCONNECTED_RU "Disconnected" -#define CLOUD_UNBINDED_RU "Unbinded" -#define CLOUD_BINDED_RU "Binded" +#define CLOUD_UNBIND_RU "отсоед." +#define CLOUD_UNBINDING_RU "отвязано" +#define CLOUD_DISCONNECTED_RU "отключено" +#define CLOUD_UNBINDED_RU "несвяз." +#define CLOUD_BINDED_RU "связано" #define CLOUD_DISABLE_RU "Disable" #define FAN_ADD_TEXT_RU "добавить" @@ -135,26 +134,12 @@ #define FILAMENT_EXT1_TEXT_RU "экструдер2" #define FILAMENT_HEAT_TEXT_RU "нагрев" #define FILAMENT_STOP_TEXT_RU "стоп" -//#define FILAMENT_CHANGE_TEXT_RU "замена" #define FILAMENT_TIPS2_TEXT_RU "T:" #define FILAMENT_TIPS3_TEXT_RU "втянуть..." #define FILAMENT_TIPS4_TEXT_RU "вядавить..." #define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" #define FILAMENT_TIPS6_TEXT_RU "завершено" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" -#endif #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." @@ -166,14 +151,10 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" - #define PRE_HEAT_EXT_TEXT_RU "E" #define PRE_HEAT_BED_TEXT_RU "стол" #define FILE_LOADING_RU "загрузка......" -#if 0 - #define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" -#endif #define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" #define NO_FILE_RU "нет файла!" @@ -187,11 +168,11 @@ #define ABOUT_VERSION_TEXT_RU "Firmware: " #define ABOUT_WIFI_TEXT_RU "WiFi: " -#define PRINTING_OPERATION_RU "управление" +#define PRINTING_OPERATION_RU "опции" #define PRINTING_PAUSE_RU "пауза" #define PRINTING_TEMP_RU "темп" #define PRINTING_CHANGESPEED_RU "скорости" -#define PRINTING_RESUME_RU "возобновить" +#define PRINTING_RESUME_RU "возобн. " #define PRINTING_STOP_RU "стоп" #define PRINTING_MORE_RU "больше" #define PRINTING_EXTRUDER_RU "экстр" @@ -211,6 +192,7 @@ #define TITLE_HOME_RU "Home" #define TITLE_EXTRUDE_RU "экструзия" #define TITLE_LEVELING_RU "уровень" +#define TITLE_MLEVELING_RU "углы" #define TITLE_SET_RU "настройки" #define TITLE_MORE_RU "больше" #define TITLE_CHOOSEFILE_RU "файла" @@ -242,14 +224,13 @@ #define DIALOG_CANCEL_PRINT_RU "стоп?" #define DIALOG_STOP_RU "стоп" #define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" -//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" #define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." #define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" #define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" #define DIALOG_CLOSE_MACHINE_RU "Closing machine......" #define DIALOG_UNBIND_PRINTER_RU "Unbind the printer?" #define DIALOG_FILAMENT_NO_PRESS_RU "Filament detection switch is not pressed" -#define DIALOG_PRINT_FINISH_RU "Печать завершена!" +#define DIALOG_PRINT_FINISH_RU "печать завершена!" #define DIALOG_PRINT_TIME_RU "Время печати: " #define DIALOG_REPRINT_RU "Print again" #define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." @@ -268,10 +249,119 @@ #define MESSAGE_PURGE_MORE_RU "чистка" #define MESSAGE_CONTINUE_PRINT_RU "Распечатать" #define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM" -#define EEPROM_SETTINGS_STORE_RU "Сохранение настроек в EEPROM" +#define EEPROM_SETTINGS_STORE_RU "Cохранение настроек в EEPROM" #define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM" -#define EEPROM_SETTINGS_REVERT_RU "Восстановить заводские настройки по умолчанию" +#define EEPROM_SETTINGS_REVERT_RU "Bосстановить заводские настройки по умолчанию" + +#define MORE_CUSTOM1_TEXT_RU USER_DESC_1 +#define MORE_CUSTOM2_TEXT_RU USER_DESC_2 +#define MORE_CUSTOM3_TEXT_RU USER_DESC_3 +#define MORE_CUSTOM4_TEXT_RU USER_DESC_4 +#define MORE_CUSTOM5_TEXT_RU USER_DESC_5 +#define MORE_CUSTOM6_TEXT_RU USER_DESC_6 +#define MORE_CUSTOM7_TEXT_RU USER_DESC_7 + +//Malderin translate +// +// +#define EEPROM_STORE_TIPS_RU "Cохранить настройки в EEPROM?" +#define EEPROM_READ_TIPS_RU "читать настройки из EEPROM?" +#define EEPROM_REVERT_TIPS_RU "Cбросить настройки к значениям по умолчанию?" +#define EEPROM_SETTINGS_RU "EEPROM" + +#define NEXT_RU "след." +#define PREVIOUS_RU "пред." +#define ENABLE_RU "да " +#define DISABLE_RU "нет" +#define KEY_CONFIRM_RU "OK" + +#define MACHINE_PARA_TITLE_RU "настройки" +#define MACHINE_TYPE_CNOFIG_RU "Hастройки принтера" +#define MOTOR_CONFIG_RU "Hастройки моторов" +#define MACHINE_LEVELING_CONFIG_RU "Hастройки уровня" +#define ADVANCE_CONFIG_RU "Pасширенные настройки" +#define MACHINE_FILAMENT_CONFIG_RU "Hастройки филамента" +#define ENCODER_SETTINGS_RU "Hастройки энкодера" + +#define LEVELING_CONF_TITLE_RU "Hастройки принтера>Hастройки уровня" +#define LEVELING_PARA_CONF_RU "настройки уровня" +#define LEVELING_MANUAL_POS_RU "настройки координат для уровня" +#define LEVELING_AUTO_COMMAND_RU "настройки комманд увтоуровня" +#define LEVELING_AUTO_ZOFFSET_RU "координаты смещения сопла" + +#define MACHINE_CONFIG_TITLE_RU "Hастройки принтера>настройки притера" +#define MAXFEEDRATE_CONF_RU "настройки максимальной скорости" +#define ACCELERATION_CONF_RU "настройки ускорений" +#define JERKCONF_RU "настройки рывков" + +#define MOTOR_CONF_TITLE_RU "Hастройки принтера>Hастройки моторов" +#define STEPSCONF_RU "настройки шагов" +#define TMC_CURRENT_RU "TMC настройки токов" +#define TMC_STEP_MODE_RU "TMC настрйоки режима шагов" + +#define ACCELERATION_CONF_TITLE_RU "Hастройки принтера>ускорения" +#define PRINT_ACCELERATION_RU "ускорение печати" +#define RETRACT_ACCELERATION_RU "ускорение ретракта" +#define TRAVEL_ACCELERATION_RU "ускорение перемещений" +#define X_ACCELERATION_RU "ускорение оси X" +#define Y_ACCELERATION_RU "ускорение оси Y" +#define Z_ACCELERATION_RU "ускорение оси Z" +#define E0_ACCELERATION_RU "ускорение E0" +#define E1_ACCELERATION_RU "ускорение E1" + +#define MAXFEEDRATE_CONF_TITLE_RU "Hастройки принтера>максимальная скорость" +#define X_MAXFEEDRATE_RU "максимальная скорость оси X" +#define Y_MAXFEEDRATE_RU "максимальная скорость оси Y" +#define Z_MAXFEEDRATE_RU "максимальная скорость оси Z" +#define E0_MAXFEEDRATE_RU "максимальная скорость E0" +#define E1_MAXFEEDRATE_RU "максимальная скорость E1" + +#define JERK_CONF_TITLE_RU "Hастройки принтера>скорость рывка" +#define X_JERK_RU "скорость рывка оси X" +#define Y_JERK_RU "скорость рывка оси Y" +#define Z_JERK_RU "скорость рывка оси Z" +#define E_JERK_RU "скорость рывка оси E" + +#define STEPS_CONF_TITLE_RU "Hастройки принтера>настройки шагов" +#define X_STEPS_RU "шаги оси X" +#define Y_STEPS_RU "шаги оси Y" +#define Z_STEPS_RU "шаги оси Z" +#define E0_STEPS_RU "шаги E0" +#define E1_STEPS_RU "шаги E1" + +#define TMC_CURRENT_CONF_TITLE_RU "Hастройки принтера>TMC настройка токов" +#define X_TMC_CURRENT_RU "ток оси X (mA)" +#define Y_TMC_CURRENT_RU "ток оси Y (mA)" +#define Z_TMC_CURRENT_RU "ток оси Z (mA)" +#define E0_TMC_CURRENT_RU "ток E0 (mA)" +#define E1_TMC_CURRENT_RU "ток E1 (mA)" + +#define TMC_MODE_CONF_TITLE_RU "Hастройки принтера>TMC настройки режима шагов" +#define X_TMC_MODE_RU "включает ли двигатель X режим StealthChop" +#define Y_TMC_MODE_RU "включает ли ось Y режим StealthChop" +#define Z_TMC_MODE_RU "включает ли ось Z режим StealthChop" +#define E0_TMC_MODE_RU "включает ли E0 режим StealthChop" +#define E1_TMC_MODE_RU "включает ли E1 режим StealthChop" + +#define ADVANCED_CONF_TITLE_RU "Hастройки принтера>Pасширенные" +#define PAUSE_POSITION_RU "Hастройки позиции паузы печати" +#define PAUSE_POSITION_X_RU "положение по X (абс. полож., -1 недействит.)" +#define PAUSE_POSITION_Y_RU "положение по Y (абс. полож., -1 недействит.)" +#define PAUSE_POSITION_Z_RU "положение по Z (абс. полож., -1 недействит.)" + +#define OFFSET_TITLE_RU "Hастройки принтера>отступ" +#define OFFSET_X_RU "X отступ" +#define OFFSET_Y_RU "Y отступ" +#define OFFSET_Z_RU "Z отступ" + +#define FILAMENT_CONF_TITLE_RU "Hастройки принтера>Hастройки филамента" +#define FILAMENT_IN_LENGTH_RU "длинна загрузки" +#define FILAMENT_IN_SPEED_RU "скорость загрузки" +#define FILAMENT_TEMPERATURE_RU "температура филамента" +#define FILAMENT_OUT_LENGTH_RU "длинна извлечения" +#define FILAMENT_OUT_SPEED_RU "скорость извлечения" + +#define ENCODER_CONF_TITLE_RU "Hастройки принтера>Hастройки энкодера" +#define ENCODER_CONF_TEXT_RU "энкодер используется?" -#define EEPROM_STORE_TIPS_RU "Сохранить настройки в EEPROM?" -#define EEPROM_READ_TIPS_RU "Читать настройки из EEPROM?" -#define EEPROM_REVERT_TIPS_RU "Revert settings to factory defaults?" +//end of Malderin translate diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h index 118992777048..046968ba8723 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h @@ -99,6 +99,7 @@ #define PROBE_Z_SPEED_CN "探针Z方向移动速度" #define ENABLE_CN "是" #define DISABLE_CN "否" +#define LOCKED_CN "否" #define Z_MIN_CN "ZMin" #define Z_MAX_CN "ZMax" @@ -177,42 +178,42 @@ #define E0_STEPS_CN "E0轴脉冲" #define E1_STEPS_CN "E1轴脉冲" -#define TMC_CURRENT_CONF_TITLE_CN "机器参数>TMC电流设置" -#define X_TMC_CURRENT_CN "X轴电流(毫安)" -#define Y_TMC_CURRENT_CN "Y轴电流(毫安)" -#define Z_TMC_CURRENT_CN "Z轴电流(毫安)" -#define E0_TMC_CURRENT_CN "E0轴电流(毫安)" -#define E1_TMC_CURRENT_CN "E1轴电流(毫安)" - -#define TMC_MODE_CONF_TITLE_CN "机器参数>TMC模式设置" -#define X_TMC_MODE_CN "X轴是否使能静音模式" -#define Y_TMC_MODE_CN "Y轴是否使能静音模式" -#define Z_TMC_MODE_CN "Z轴是否使能静音模式" -#define E0_TMC_MODE_CN "E0轴是否使能静音模式" -#define E1_TMC_MODE_CN "E1轴是否使能静音模式" - -#define MOTORDIR_CONF_TITLE_CN "机器参数>电机方向" -#define X_MOTORDIR_CN "X轴电机方向" -#define Y_MOTORDIR_CN "Y轴电机方向" -#define Z_MOTORDIR_CN "Z轴电机方向" -#define E0_MOTORDIR_CN "E0轴电机方向" -#define E1_MOTORDIR_CN "E1轴电机方向" -#define INVERT_P_CN "正向" -#define INVERT_N_CN "反向" - -#define HOMEFEEDRATE_CONF_TITLE_CN "机器参数>归零速度" -#define X_HOMESPEED_CN "XY轴归零速度" -#define Y_HOMESPEED_CN "Y轴归零速度" -#define Z_HOMESPEED_CN "Z轴归零速度" - -#define ADVANCED_CONF_TITLE_CN "机器参数>高级设置" -#define PWROFF_DECTION_CN "断电检测模块" -#define PWROFF_AFTER_PRINT_CN "启动打完关机功能" -#define HAVE_UPS_CN "机器配备UPS电源" -#define Z2_AND_Z2ENDSTOP_CONF_CN "双Z轴双限位功能设置" -#define ENABLE_PINS_CONF_CN "电机使能脚电平设置" -#define WIFI_SETTINGS_CN "Wi-Fi参数设置" -#define ENCODER_SETTINGS_CN "旋钮设置" +#define TMC_CURRENT_CONF_TITLE_CN "机器参数>TMC电流设置" +#define X_TMC_CURRENT_CN "X轴电流(毫安)" +#define Y_TMC_CURRENT_CN "Y轴电流(毫安)" +#define Z_TMC_CURRENT_CN "Z轴电流(毫安)" +#define E0_TMC_CURRENT_CN "E0轴电流(毫安)" +#define E1_TMC_CURRENT_CN "E1轴电流(毫安)" + +#define TMC_MODE_CONF_TITLE_CN "机器参数>TMC模式设置" +#define X_TMC_MODE_CN "X轴是否使能静音模式" +#define Y_TMC_MODE_CN "Y轴是否使能静音模式" +#define Z_TMC_MODE_CN "Z轴是否使能静音模式" +#define E0_TMC_MODE_CN "E0轴是否使能静音模式" +#define E1_TMC_MODE_CN "E1轴是否使能静音模式" + +#define MOTORDIR_CONF_TITLE_CN "机器参数>电机方向" +#define X_MOTORDIR_CN "X轴电机方向" +#define Y_MOTORDIR_CN "Y轴电机方向" +#define Z_MOTORDIR_CN "Z轴电机方向" +#define E0_MOTORDIR_CN "E0轴电机方向" +#define E1_MOTORDIR_CN "E1轴电机方向" +#define INVERT_P_CN "正向" +#define INVERT_N_CN "反向" + +#define HOMEFEEDRATE_CONF_TITLE_CN "机器参数>归零速度" +#define X_HOMESPEED_CN "XY轴归零速度" +#define Y_HOMESPEED_CN "Y轴归零速度" +#define Z_HOMESPEED_CN "Z轴归零速度" + +#define ADVANCED_CONF_TITLE_CN "机器参数>高级设置" +#define PWROFF_DECTION_CN "断电检测模块" +#define PWROFF_AFTER_PRINT_CN "启动打完关机功能" +#define HAVE_UPS_CN "机器配备UPS电源" +#define Z2_AND_Z2ENDSTOP_CONF_CN "双Z轴双限位功能设置" +#define ENABLE_PINS_CONF_CN "电机使能脚电平设置" +#define WIFI_SETTINGS_CN "Wi-Fi参数设置" +#define ENCODER_SETTINGS_CN "旋钮设置" #define Z2_AND_Z2ENDSTOP_CONF_TITLE_CN "双z双限位设置" #define Z2_ENABLE_CN "启用Z2轴" @@ -225,23 +226,23 @@ #define Z_ENABLE_PINS_INVERT_CN "Z轴电机使能电平" #define E_ENABLE_PINS_INVERT_CN "E轴电机使能电平" -#define PAUSE_POSITION_CN "打印暂停位置设置" -#define PAUSE_POSITION_X_CN "X轴暂停位置(绝对位置,-1无效)" -#define PAUSE_POSITION_Y_CN "Y轴暂停位置(绝对位置,-1无效)" -#define PAUSE_POSITION_Z_CN "Z轴暂停位置(相对位置,-1无效)" -#define WIFI_SETTINGS_TITLE_CN "机器参数>Wi-Fi设置" -#define WIFI_SETTINGS_MODE_CN "Wi-Fi 模式" -#define WIFI_SETTINGS_NAME_CN "Wi-Fi 名称: " -#define WIFI_SETTINGS_PASSWORD_CN "Wi-Fi 密码: " -#define WIFI_SETTINGS_CLOUD_CN "是否使用云服务?" -#define WIFI_SETTINGS_CONFIG_CN "配置" -#define WIFI_SETTINGS_EDIT_CN "编辑" -#define WIFI_CONFIG_TIPS_CN "进行Wi-Fi配置?" - -#define OFFSET_TITLE_CN "机器参数>偏移设置" -#define OFFSET_X_CN "X轴与调平开关偏移" -#define OFFSET_Y_CN "Y轴与调平开关偏移" -#define OFFSET_Z_CN "Z轴与调平开关偏移" +#define PAUSE_POSITION_CN "打印暂停位置设置" +#define PAUSE_POSITION_X_CN "X轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Y_CN "Y轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Z_CN "Z轴暂停位置(相对位置,-1无效)" +#define WIFI_SETTINGS_TITLE_CN "机器参数>Wi-Fi设置" +#define WIFI_SETTINGS_MODE_CN "Wi-Fi 模式" +#define WIFI_SETTINGS_NAME_CN "Wi-Fi 名称: " +#define WIFI_SETTINGS_PASSWORD_CN "Wi-Fi 密码: " +#define WIFI_SETTINGS_CLOUD_CN "是否使用云服务?" +#define WIFI_SETTINGS_CONFIG_CN "配置" +#define WIFI_SETTINGS_EDIT_CN "编辑" +#define WIFI_CONFIG_TIPS_CN "进行Wi-Fi配置?" + +#define OFFSET_TITLE_CN "机器参数>偏移设置" +#define OFFSET_X_CN "X轴与调平开关偏移" +#define OFFSET_Y_CN "Y轴与调平开关偏移" +#define OFFSET_Z_CN "Z轴与调平开关偏移" #define HOMING_SENSITIVITY_CONF_TITLE_CN "机器参数>灵敏度调节" #define X_SENSITIVITY_CN "X轴灵敏度" @@ -364,12 +365,7 @@ #define FILAMENT_EXT1_TEXT_CN "喷头2" #define FILAMENT_HEAT_TEXT_CN "预热" #define FILAMENT_STOP_TEXT_CN "停止" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" -#else - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" -#endif +#define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" @@ -456,7 +452,6 @@ #define DIALOG_RETRY_CN "重试" #define DIALOG_STOP_CN "停止" #define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" -//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" #define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" #define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" #define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" @@ -497,3 +492,11 @@ #define EEPROM_STORE_TIPS_CN "是否保存参数到EEPROM?" #define EEPROM_READ_TIPS_CN "是否使用EEPROM参数?" #define EEPROM_REVERT_TIPS_CN "是否恢复默认参数?" + +#define MORE_CUSTOM1_TEXT_CN USER_DESC_1 +#define MORE_CUSTOM2_TEXT_CN USER_DESC_2 +#define MORE_CUSTOM3_TEXT_CN USER_DESC_3 +#define MORE_CUSTOM4_TEXT_CN USER_DESC_4 +#define MORE_CUSTOM5_TEXT_CN USER_DESC_5 +#define MORE_CUSTOM6_TEXT_CN USER_DESC_6 +#define MORE_CUSTOM7_TEXT_CN USER_DESC_7 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h index 2babbaba93c4..0b714930ebfa 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h @@ -23,13 +23,14 @@ //****************西班牙语*************************** #define TOOL_TEXT_SP "Ajustes" -#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" +#define PREHEAT_TEXT_SP "Precalentar" #define MOVE_TEXT_SP "Mover" #define HOME_TEXT_SP "Origen" #define PRINT_TEXT_SP "Imprimir" #define EXTRUDE_TEXT_SP "Extrusor" -#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" -#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" +#define LEVELING_TEXT_SP "Leveling" +#define MLEVELING_TEXT_SP "Leveling" +#define AUTO_LEVELING_TEXT_SP "Autolevel" #define SET_TEXT_SP "Config" #define MORE_TEXT_SP "Más" @@ -50,6 +51,7 @@ #define TOOL_MOVE_SP "Mover" #define TOOL_HOME_SP "Origen" #define TOOL_LEVELING_SP "Leveling" +#define TOOL_MLEVELING_SP "Leveling" #define TOOL_AUTO_LEVELING_SP "Autolevel" #define TOOL_FILAMENT_SP "Filamento" #define TOOL_MORE_SP "Más" @@ -135,50 +137,30 @@ #define FILAMENT_EXT1_TEXT_SP "Extrusor2" #define FILAMENT_HEAT_TEXT_SP "Precalentar" #define FILAMENT_STOP_TEXT_SP "Parar" -//#define FILAMENT_CHANGE_TEXT_SP "Filamento" #define FILAMENT_TIPS2_TEXT_SP "T:" #define FILAMENT_TIPS3_TEXT_SP "Dentro..." #define FILAMENT_TIPS4_TEXT_SP "Fuera..." #define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" #define FILAMENT_TIPS6_TEXT_SP "Completado" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." -#else - #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." -#endif + +#define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." +#define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." +#define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." #define PRE_HEAT_EXT_TEXT_SP "Extrusor" #define PRE_HEAT_BED_TEXT_SP "cama" #define FILE_LOADING_SP "Cargando......" -#if 0 - #define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" -#endif #define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" - #define NO_FILE_SP "Sin archivo!" - - #define EXTRUDER_TEMP_TEXT_SP "Temper" #define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" #define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" @@ -245,7 +227,6 @@ #define DIALOG_RETRY_SP "Reintentar" #define DIALOG_STOP_SP "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" #define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." #define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" #define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" @@ -282,3 +263,11 @@ #define EEPROM_STORE_TIPS_SP "¿Guardar ajustes en EEPROM?" #define EEPROM_READ_TIPS_SP "Leer la configuración de EEPROM?" #define EEPROM_REVERT_TIPS_SP "Revert settings to factory defaults?" + +#define MORE_CUSTOM1_TEXT_SP USER_DESC_1 +#define MORE_CUSTOM2_TEXT_SP USER_DESC_2 +#define MORE_CUSTOM3_TEXT_SP USER_DESC_3 +#define MORE_CUSTOM4_TEXT_SP USER_DESC_4 +#define MORE_CUSTOM5_TEXT_SP USER_DESC_5 +#define MORE_CUSTOM6_TEXT_SP USER_DESC_6 +#define MORE_CUSTOM7_TEXT_SP USER_DESC_7 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h index d956e14aadf1..30d04303132c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h @@ -99,6 +99,7 @@ #define PROBE_Z_SPEED_T_CN "探针Z方向移動速度" #define ENABLE_T_CN "是" #define DISABLE_T_CN "否" +#define LOCKED_T_CN "否" #define Z_MIN_T_CN "ZMin" #define Z_MAX_T_CN "ZMax" @@ -254,7 +255,7 @@ #define TOOL_TEXT_T_CN "工具" #define PREHEAT_TEXT_T_CN "預熱" -#define MOVE_TEXT_T_CN "移動" +#define MOVE_TEXT_T_CN "移動" #define HOME_TEXT_T_CN "回零" #define PRINT_TEXT_T_CN "打印" #define EXTRUDE_TEXT_T_CN "擠出" @@ -364,19 +365,12 @@ #define FILAMENT_EXT1_TEXT_T_CN "噴頭2" #define FILAMENT_HEAT_TEXT_T_CN "預熱" #define FILAMENT_STOP_TEXT_T_CN "停止" -//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" #define FILAMENT_TIPS2_TEXT_T_CN "T:" #define FILAMENT_TIPS3_TEXT_T_CN "正在進料" #define FILAMENT_TIPS4_TEXT_T_CN "正在退料" #define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" #define FILAMENT_TIPS6_TEXT_T_CN "換料完成" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" -#endif - - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" +#define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" @@ -434,8 +428,8 @@ #define TITLE_PRINTING_T_CN "正在打印" #define TITLE_OPERATION_T_CN "操作" #define TITLE_ADJUST_T_CN "調整" -#define TITLE_WIRELESS_T_CN "無線網絡" -#define TITLE_FILAMENT_T_CN "換料" +#define TITLE_WIRELESS_T_CN "無線網絡" +#define TITLE_FILAMENT_T_CN "換料" #define TITLE_ABOUT_T_CN "關於" #define TITLE_FAN_T_CN "風扇" #define TITLE_LANGUAGE_T_CN "語言" @@ -459,7 +453,6 @@ #define DIALOG_RETRY_T_CN "重試" #define DIALOG_STOP_T_CN "停止" #define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" -//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" #define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" #define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" #define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" @@ -497,3 +490,11 @@ #define EEPROM_STORE_TIPS_T_CN "是否保存參數到EEPROM?" #define EEPROM_READ_TIPS_T_CN "是否使用EEPROM參數?" #define EEPROM_REVERT_TIPS_T_CN "是否恢復默認參數?" + +#define MORE_CUSTOM1_TEXT_T_CN USER_DESC_1 +#define MORE_CUSTOM2_TEXT_T_CN USER_DESC_2 +#define MORE_CUSTOM3_TEXT_T_CN USER_DESC_3 +#define MORE_CUSTOM4_TEXT_T_CN USER_DESC_4 +#define MORE_CUSTOM5_TEXT_T_CN USER_DESC_5 +#define MORE_CUSTOM6_TEXT_T_CN USER_DESC_6 +#define MORE_CUSTOM7_TEXT_T_CN USER_DESC_7 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..65b7538b7113 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 @@ -19,12 +19,6 @@ * along with this program. If not, see . * */ - -/** - * @file tft_lvgl_configuration.cpp - * @date 2020-02-21 - */ - #include "../../../../inc/MarlinConfigPre.h" #if HAS_TFT_LVGL_UI @@ -56,6 +50,10 @@ XPT2046 touch; #include "draw_touch_calibration.h" #endif +#if ENABLED(MKS_WIFI_MODULE) + #include "wifi_module.h" +#endif + #include #ifndef TFT_WIDTH @@ -77,9 +75,10 @@ lv_group_t* g; uint16_t DeviceCode = 0x9488; extern uint8_t sel_id; -extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; +uint8_t bmp_public_buf[14 * 1024]; +uint8_t public_buf[513]; -uint8_t bmp_public_buf[17 * 1024]; +extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; void SysTick_Callback() { lv_tick_inc(1); @@ -88,34 +87,30 @@ void SysTick_Callback() { if (tips_disp.timer == TIPS_TIMER_START) tips_disp.timer_count++; #endif - if (uiCfg.filament_loading_time_flg == 1) { + if (uiCfg.filament_loading_time_flg) { uiCfg.filament_loading_time_cnt++; uiCfg.filament_rate = (uint32_t)(((uiCfg.filament_loading_time_cnt / (uiCfg.filament_loading_time * 1000.0)) * 100.0) + 0.5); if (uiCfg.filament_loading_time_cnt >= (uiCfg.filament_loading_time * 1000)) { uiCfg.filament_loading_time_cnt = 0; - uiCfg.filament_loading_time_flg = 0; - uiCfg.filament_loading_completed = 1; + uiCfg.filament_loading_time_flg = false; + uiCfg.filament_loading_completed = true; } } - if (uiCfg.filament_unloading_time_flg == 1) { + if (uiCfg.filament_unloading_time_flg) { uiCfg.filament_unloading_time_cnt++; uiCfg.filament_rate = (uint32_t)(((uiCfg.filament_unloading_time_cnt / (uiCfg.filament_unloading_time * 1000.0)) * 100.0) + 0.5); if (uiCfg.filament_unloading_time_cnt >= (uiCfg.filament_unloading_time * 1000)) { uiCfg.filament_unloading_time_cnt = 0; - uiCfg.filament_unloading_time_flg = 0; - uiCfg.filament_unloading_completed = 1; + uiCfg.filament_unloading_time_flg = false; + uiCfg.filament_unloading_completed = true; uiCfg.filament_rate = 100; } } } -extern uint8_t bmp_public_buf[17 * 1024]; - void tft_lvgl_init() { - //uint16_t test_id=0; W25QXX.init(SPI_QUARTER_SPEED); - //test_id=W25QXX.W25QXX_ReadID(); gCfgItems_init(); ui_cfg_init(); @@ -123,13 +118,16 @@ void tft_lvgl_init() { watchdog_refresh(); // LVGL init takes time + #if MB(MKS_ROBIN_NANO) + OUT_WRITE(PB0, LOW); // HE1 + #endif + // 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) UpdateAssets(); watchdog_refresh(); // LVGL init takes time @@ -141,19 +139,19 @@ void tft_lvgl_init() { lv_init(); - lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 14); // Initialize the display buffer - lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ - lv_disp_drv_init(&disp_drv); /*Basic initialization*/ - disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ - disp_drv.buffer = &disp_buf; /*Assign the buffer to the display*/ - lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ + lv_disp_drv_t disp_drv; // Descriptor of a display driver + lv_disp_drv_init(&disp_drv); // Basic initialization + disp_drv.flush_cb = my_disp_flush; // Set your driver function + disp_drv.buffer = &disp_buf; // Assign the buffer to the display + lv_disp_drv_register(&disp_drv); // Finally register the driver lv_indev_drv_t indev_drv; - lv_indev_drv_init(&indev_drv); /*Descriptor of a input device driver*/ - indev_drv.type = LV_INDEV_TYPE_POINTER; /*Touch pad is a pointer-like device*/ - indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ - lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ + lv_indev_drv_init(&indev_drv); // Descriptor of a input device driver + indev_drv.type = LV_INDEV_TYPE_POINTER; // Touch pad is a pointer-like device + indev_drv.read_cb = my_touchpad_read; // Set your driver function + lv_indev_drv_register(&indev_drv); // Finally register the driver #if HAS_ROTARY_ENCODER g = lv_group_create(); @@ -197,6 +195,8 @@ void tft_lvgl_init() { lv_encoder_pin_init(); + TERN_(MKS_WIFI_MODULE, mks_wifi_firmware_update()); + bool ready = true; #if ENABLED(POWER_LOSS_RECOVERY) recovery.load(); @@ -216,17 +216,9 @@ 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 - } + if (ready) lv_draw_ready_print(); - if (mks_test_flag == 0x1E) - mks_gpio_test(); + if (mks_test_flag == 0x1E) mks_gpio_test(); } void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { @@ -238,8 +230,17 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co 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*/ + lv_disp_flush_ready(disp); // Indicate you are ready with the flushing + + W25QXX.init(SPI_QUARTER_SPEED); +} +void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_color_t bk_color) { + uint16_t width, height; + width = x2 - x1 + 1; + height = y2 - y1 + 1; + SPI_TFT.setWindow((uint16_t)x1, (uint16_t)y1, width, height); + SPI_TFT.tftio.WriteMultiple(bk_color.full, width * height); W25QXX.init(SPI_QUARTER_SPEED); } @@ -278,11 +279,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { tmpTime = millis(); diffTime = getTickDiff(tmpTime, touch_time1); - /*Save the state and save the pressed coordinate*/ - //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); - //touchpad_get_xy(&last_x, &last_y); - /*Save the pressed coordinates and the state*/ if (diffTime > 20) { if (get_point(&last_x, &last_y)) { @@ -290,7 +286,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { data->state = LV_INDEV_STATE_PR; // Set the coordinates (if released use the last-pressed coordinates) - data->point.x = last_x; data->point.y = last_y; @@ -313,13 +308,13 @@ int16_t enc_diff = 0; lv_indev_state_t state = LV_INDEV_STATE_REL; bool my_mousewheel_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { - (void) indev_drv; /*Unused*/ + (void) indev_drv; // Unused data->state = state; data->enc_diff = enc_diff; enc_diff = 0; - return false; /*No more data to read so return false*/ + return false; // No more data to read so return false } extern uint8_t currentFlashPage; @@ -342,7 +337,7 @@ lv_fs_res_t spi_flash_open_cb (lv_fs_drv_t * drv, void * file_p, const char * pa lv_fs_res_t spi_flash_close_cb (lv_fs_drv_t * drv, void * file_p) { lv_fs_res_t res = LV_FS_RES_OK; - /* Add your code here*/ + /* Add your code here */ pic_read_addr_offset = pic_read_base_addr; return res; } @@ -375,9 +370,8 @@ lv_fs_res_t spi_flash_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p //sd 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]; *name_buf = '/'; strcpy(name_buf + 1, path); @@ -385,12 +379,17 @@ 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; + // 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; } lv_fs_res_t sd_close_cb (lv_fs_drv_t * drv, void * file_p) { - /* Add your code here*/ + /* Add your code here */ lv_close_gcode_file(); return LV_FS_RES_OK; } @@ -404,21 +403,20 @@ lv_fs_res_t sd_read_cb (lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t b else if (btr == 4) { uint8_t header_pic[4] = { 0x04, 0x90, 0x81, 0x0C }; memcpy(buf, header_pic, 4); - //pic_read_addr_offset += 4; *br = 4; } return LV_FS_RES_OK; } 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; } @@ -452,9 +450,6 @@ void lv_encoder_pin_init() { } #if 1 // HAS_ENCODER_ACTION - - //static const int8_t encoderDirection = 1; - //static int16_t enc_Direction; void lv_update_encoder() { static uint32_t encoder_time1; uint32_t tmpTime, diffTime = 0; @@ -467,19 +462,10 @@ void lv_encoder_pin_init() { #if ANY_BUTTON(EN1, EN2, ENC, BACK) uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif + if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; + if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; + if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; + if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; #else @@ -487,7 +473,6 @@ void lv_encoder_pin_init() { #endif - static uint8_t buttons = 0; buttons = newbutton; static uint8_t lastEncoderBits; @@ -496,9 +481,6 @@ void lv_encoder_pin_init() { #define encrot1 1 #define encrot2 2 - // Manage encoder rotation - //#define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: enc_Direction += encoderDirection; break; case _E2: enc_Direction -= encoderDirection; } - uint8_t enc = 0; if (buttons & EN_A) enc |= B01; if (buttons & EN_B) enc |= B10; 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 df28893f41aa..d0ea4e376fac 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,9 @@ #include //#define TFT_ROTATION TFT_ROTATE_180 -#define MKS_WIFI_MODULE 0 + +extern uint8_t bmp_public_buf[14 * 1024]; +extern uint8_t public_buf[513]; 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); @@ -43,7 +45,7 @@ extern bool my_mousewheel_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * dat extern void LCD_Clear(uint16_t Color); extern void tft_set_point(uint16_t x, uint16_t y, uint16_t point); extern void LCD_setWindowArea(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t heigh); -extern void LCD_WriteRAM_Prepare(void); +extern void LCD_WriteRAM_Prepare(); extern void lcd_draw_logo(); extern void lv_encoder_pin_init(); extern void lv_update_encoder(); @@ -60,6 +62,8 @@ extern lv_fs_res_t sd_read_cb (lv_fs_drv_t * drv, void * file_p, void * buf, uin extern lv_fs_res_t sd_seek_cb(lv_fs_drv_t * drv, void * file_p, uint32_t pos); extern lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); +extern void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_color_t bk_color); + #ifdef __cplusplus } /* C-declarations for C++ */ #endif 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 c3c0f37365fa..28c90486d097 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 @@ -23,8 +23,6 @@ #if HAS_TFT_LVGL_UI -#include "../../../../MarlinCore.h" - #include "draw_ui.h" #include "tft_multi_language.h" @@ -136,6 +134,7 @@ void machine_setting_disp() { machine_menu.ProbeZspeed = PROBE_Z_SPEED_CN; machine_menu.enable = ENABLE_CN; machine_menu.disable = DISABLE_CN; + machine_menu.locked = LOCKED_CN; machine_menu.z_min = Z_MIN_CN; machine_menu.z_max = Z_MAX_CN; @@ -149,10 +148,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_CN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_CN; - // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_CN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_CN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_CN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_CN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_CN; machine_menu.NozzleConf = NOZZLE_CONF_CN; @@ -167,7 +162,6 @@ void machine_setting_disp() { machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_CN; machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_CN; - // machine_menu.HotbedEnable=HOTBED_ENABLE_CN; machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_CN; machine_menu.HotbedAjustType = HOTBED_ADJUST_CN; machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_CN; @@ -242,7 +236,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_CN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_CN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_CN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_CN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_CN; @@ -369,6 +362,7 @@ void machine_setting_disp() { machine_menu.ProbeZspeed = PROBE_Z_SPEED_T_CN; machine_menu.enable = ENABLE_T_CN; machine_menu.disable = DISABLE_T_CN; + machine_menu.locked = LOCKED_T_CN; machine_menu.z_min = Z_MIN_T_CN; machine_menu.z_max = Z_MAX_T_CN; @@ -382,10 +376,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_T_CN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_T_CN; - // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_T_CN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_T_CN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_T_CN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_T_CN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_T_CN; machine_menu.NozzleConf = NOZZLE_CONF_T_CN; @@ -400,7 +390,6 @@ void machine_setting_disp() { machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_T_CN; machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_T_CN; - // machine_menu.HotbedEnable=HOTBED_ENABLE_T_CN; machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_T_CN; machine_menu.HotbedAjustType = HOTBED_ADJUST_T_CN; machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_T_CN; @@ -475,7 +464,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_T_CN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_T_CN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_T_CN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_T_CN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_T_CN; @@ -499,8 +487,6 @@ void machine_setting_disp() { machine_menu.key_back = KEY_BACK_T_CN; machine_menu.key_reset = KEY_REST_T_CN; machine_menu.key_confirm = KEY_CONFIRM_T_CN; - // machine_menu.high_level = MOTOR_EN_HIGH_LEVEL_T_CN; - // machine_menu.low_level = MOTOR_EN_LOW_LEVEL_T_CN; machine_menu.PausePosText = PAUSE_POSITION_T_CN; machine_menu.xPos = PAUSE_POSITION_X_T_CN; @@ -605,6 +591,7 @@ void machine_setting_disp() { machine_menu.ProbeZspeed = PROBE_Z_SPEED_EN; machine_menu.enable = ENABLE_EN; machine_menu.disable = DISABLE_EN; + machine_menu.locked = LOCKED_EN; machine_menu.z_min = Z_MIN_EN; machine_menu.z_max = Z_MAX_EN; @@ -618,10 +605,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_EN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_EN; - // machine_menu.Level_positon=PROBE_REACH_MAX_LEFT_EN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_EN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_EN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_EN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_EN; machine_menu.NozzleConf = NOZZLE_CONF_EN; @@ -711,7 +694,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_EN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_EN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_EN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_EN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_EN; @@ -823,7 +805,6 @@ void disp_language_init() { about_menu.type_name = ABOUT_TYPE_TEXT; about_menu.firmware_v = ABOUT_VERSION_TEXT; - // about_menu.wifi = ABOUT_WIFI_TEXT; wifi_menu.ip = WIFI_IP_TEXT; wifi_menu.wifi = WIFI_NAME_TEXT; @@ -861,7 +842,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 //MKS_WIFI_MODULE + #endif machine_setting_disp(); operation_menu.babystep = TEXT_BABY_STEP_EN; @@ -923,7 +904,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_CN; file_menu.file_loading = FILE_LOADING_CN; file_menu.no_file = NO_FILE_CN; - file_menu.no_file_and_check = NO_FILE_CN;// NO_FILE_AND_CHECK_CN; + file_menu.no_file_and_check = NO_FILE_CN; // extrude_menu.title = TITLE_EXTRUDE_CN; extrude_menu.in = EXTRUDER_IN_TEXT_CN; @@ -961,12 +942,16 @@ void disp_language_init() { filesys_menu.sd_sys = SD_CARD_TEXT_CN; filesys_menu.usb_sys = U_DISK_TEXT_CN; // - more_menu.title = TITLE_MORE_CN; + more_menu.title = TITLE_MORE_CN; + TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_CN); + TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_CN); + TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_CN); + TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_CN); + TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_CN); + TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_CN); + TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_CN); // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_CN; - // wifi_menu.ip = WIFI_IP_TEXT_CN; - // wifi_menu.state = WIFI_STA_TEXT_CN; wifi_menu.cloud = CLOUD_TEXT_CN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; // CLOUD @@ -976,6 +961,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_CN; cloud_menu.unbinding = CLOUD_UNBINDED_CN; cloud_menu.disconnected = CLOUD_DISCONNECTED_CN; + cloud_menu.unbinded = CLOUD_UNBINDED_CN; cloud_menu.disable = CLOUD_DISABLE_CN; // about_menu.title = ABOUT_TEXT_CN; @@ -1004,7 +990,6 @@ void disp_language_init() { filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_CN; filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_CN; - // language_menu.title = TITLE_LANGUAGE_CN; language_menu.next = PAGE_DOWN_TEXT_CN; @@ -1055,11 +1040,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_CN; printing_more_menu.temp = PRINTING_TEMP_CN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_CN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_CN; print_file_dialog_menu.retry = DIALOG_RETRY_CN; print_file_dialog_menu.stop = DIALOG_STOP_CN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; @@ -1153,7 +1137,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_T_CN; file_menu.file_loading = FILE_LOADING_T_CN; file_menu.no_file = NO_FILE_T_CN; - file_menu.no_file_and_check = NO_FILE_T_CN;// NO_FILE_AND_CHECK_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN; // extrude_menu.title = TITLE_EXTRUDE_T_CN; extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; @@ -1190,12 +1174,16 @@ void disp_language_init() { filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; filesys_menu.usb_sys = U_DISK_TEXT_T_CN; // - more_menu.title = TITLE_MORE_T_CN; + more_menu.title = TITLE_MORE_T_CN; + TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_T_CN); + TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_T_CN); + TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_T_CN); + TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_T_CN); + TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_T_CN); + TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_T_CN); + TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_T_CN); // WIFI - wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_CN; - // wifi_menu.ip = WIFI_IP_TEXT_CN; - // wifi_menu.state= WIFI_STA_TEXT_CN; + wifi_menu.title = WIFI_TEXT; wifi_menu.cloud = CLOUD_TEXT_T_CN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; // CLOUD @@ -1205,6 +1193,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_T_CN; cloud_menu.unbinding = CLOUD_UNBINDED_T_CN; cloud_menu.disconnected = CLOUD_DISCONNECTED_T_CN; + cloud_menu.unbinded = CLOUD_UNBINDED_T_CN; cloud_menu.disable = CLOUD_DISABLE_T_CN; // about_menu.title = ABOUT_TEXT_T_CN; @@ -1233,7 +1222,6 @@ void disp_language_init() { filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; - // language_menu.title = TITLE_LANGUAGE_T_CN; language_menu.next = PAGE_DOWN_TEXT_T_CN; @@ -1284,11 +1272,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; printing_more_menu.temp = PRINTING_TEMP_T_CN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_T_CN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_T_CN; print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; print_file_dialog_menu.stop = DIALOG_STOP_T_CN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; @@ -1363,7 +1350,7 @@ void disp_language_init() { preheat_menu.hotbed = HEATBED_TEXT_EN; preheat_menu.off = CLOSE_TEXT_EN; // - move_menu.title = TITLE_MOVE_EN; + move_menu.title = TITLE_MOVE_EN; // home_menu.title = TITLE_HOME_EN; home_menu.stopmove = HOME_STOPMOVE_EN; @@ -1373,7 +1360,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN; // extrude_menu.title = TITLE_EXTRUDE_EN; extrude_menu.in = EXTRUDER_IN_TEXT_EN; @@ -1405,16 +1392,22 @@ void disp_language_init() { set_menu.shutdown = SHUTDOWN_TEXT_EN; set_menu.machine_para = MACHINE_PARA_EN; set_menu.eepromSet = EEPROM_SETTINGS_EN; + // more_menu.title = TITLE_MORE_EN; + TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN); + TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN); + TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN); + TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_EN); + TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_EN); + TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_EN); + TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_EN); + // filesys_menu.title = TITLE_FILESYS_EN; filesys_menu.sd_sys = SD_CARD_TEXT_EN; filesys_menu.usb_sys = U_DISK_TEXT_EN; // WIFI - wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_EN; - // wifi_menu.ip = WIFI_IP_TEXT_EN; - // wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.title = WIFI_TEXT; wifi_menu.cloud = CLOUD_TEXT_EN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; @@ -1424,6 +1417,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_EN; cloud_menu.unbinding = CLOUD_UNBINDED_EN; cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.unbinded = CLOUD_UNBINDED_EN; cloud_menu.disable = CLOUD_DISABLE_EN; // about_menu.title = TITLE_ABOUT_EN; @@ -1500,11 +1494,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_EN; printing_more_menu.temp = PRINTING_TEMP_EN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_EN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; @@ -1578,7 +1571,7 @@ void disp_language_init() { preheat_menu.hotbed = HEATBED_TEXT_RU; preheat_menu.off = CLOSE_TEXT_RU; // - move_menu.title = MOVE_TEXT_RU; + move_menu.title = MOVE_TEXT_RU; // home_menu.title = TITLE_HOME_RU; home_menu.stopmove = HOME_STOPMOVE_RU; @@ -1588,7 +1581,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_RU; file_menu.file_loading = FILE_LOADING_RU; file_menu.no_file = NO_FILE_RU; - file_menu.no_file_and_check = NO_FILE_RU;// NO_FILE_AND_CHECK_RU; + file_menu.no_file_and_check = NO_FILE_RU; // extrude_menu.title = TITLE_EXTRUDE_RU; extrude_menu.in = EXTRUDER_IN_TEXT_RU; @@ -1621,18 +1614,129 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_RU; set_menu.eepromSet = EEPROM_SETTINGS_RU; more_menu.title = TITLE_MORE_RU; + #if ENABLED(USER_CMD_1_ENABLE) + more_menu.custom1 = MORE_CUSTOM1_TEXT_RU; + #endif + #if ENABLED(USER_CMD_2_ENABLE) + more_menu.custom2 = MORE_CUSTOM2_TEXT_RU; + #endif + #if ENABLED(USER_CMD_3_ENABLE) + more_menu.custom3 = MORE_CUSTOM3_TEXT_RU; + #endif + #if ENABLED(USER_CMD_4_ENABLE) + more_menu.custom4 = MORE_CUSTOM4_TEXT_RU; + #endif + #if ENABLED(USER_CMD_5_ENABLE) + more_menu.custom5 = MORE_CUSTOM5_TEXT_RU; + #endif + #if ENABLED(USER_CMD_6_ENABLE) + more_menu.custom6 = MORE_CUSTOM6_TEXT_RU; + #endif + #if ENABLED(USER_CMD_7_ENABLE) + more_menu.custom7 = MORE_CUSTOM7_TEXT_RU; + #endif // filesys_menu.title = TITLE_FILESYS_RU; filesys_menu.sd_sys = SD_CARD_TEXT_RU; filesys_menu.usb_sys = U_DISK_TEXT_RU; // WIFI - wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_RU; - // wifi_menu.ip = WIFI_IP_TEXT_RU; - // wifi_menu.state = WIFI_STA_TEXT_RU; + wifi_menu.title = WIFI_TEXT; wifi_menu.cloud = CLOUD_TEXT_RU; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; + machine_menu.next = NEXT_RU; + machine_menu.previous = PREVIOUS_RU; + machine_menu.enable = ENABLE_RU; + machine_menu.disable = DISABLE_RU; + machine_menu.key_confirm = KEY_CONFIRM_RU; + + MachinePara_menu.MachineSetting = MACHINE_TYPE_CNOFIG_RU; + MachinePara_menu.title = MACHINE_PARA_TITLE_RU; + machine_menu.MachineConfigTitle = MACHINE_CONFIG_TITLE_RU; + MachinePara_menu.MotorSetting = MOTOR_CONFIG_RU; + MachinePara_menu.leveling = MACHINE_LEVELING_CONFIG_RU; + MachinePara_menu.AdvanceSetting = ADVANCE_CONFIG_RU; + machine_menu.MotorConfTitle = MOTOR_CONF_TITLE_RU; + machine_menu.MaxFeedRateConf = MAXFEEDRATE_CONF_RU; + machine_menu.AccelerationConf = ACCELERATION_CONF_RU; + machine_menu.JerkConf = JERKCONF_RU; + machine_menu.StepsConf = STEPSCONF_RU; + machine_menu.TMCcurrentConf = TMC_CURRENT_RU; + machine_menu.TMCStepModeConf = TMC_STEP_MODE_RU; + machine_menu.PausePosition = PAUSE_POSITION_RU; + machine_menu.FilamentConf = MACHINE_FILAMENT_CONFIG_RU; + machine_menu.EncoderSettings = ENCODER_SETTINGS_RU; + machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_RU; + + machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_RU; + machine_menu.LevelingParaConf = LEVELING_PARA_CONF_RU; + machine_menu.LevelingManuPosConf = LEVELING_MANUAL_POS_RU; + machine_menu.LevelingAutoCommandConf = LEVELING_AUTO_COMMAND_RU; + machine_menu.LevelingAutoZoffsetConf = LEVELING_AUTO_ZOFFSET_RU; + + machine_menu.AccelerationConfTitle = ACCELERATION_CONF_TITLE_RU; + machine_menu.PrintAcceleration = PRINT_ACCELERATION_RU; + machine_menu.RetractAcceleration = RETRACT_ACCELERATION_RU; + machine_menu.TravelAcceleration = TRAVEL_ACCELERATION_RU; + machine_menu.X_Acceleration = X_ACCELERATION_RU; + machine_menu.Y_Acceleration = Y_ACCELERATION_RU; + machine_menu.Z_Acceleration = Z_ACCELERATION_RU; + machine_menu.E0_Acceleration = E0_ACCELERATION_RU; + machine_menu.E1_Acceleration = E1_ACCELERATION_RU; + + machine_menu.MaxFeedRateConfTitle = MAXFEEDRATE_CONF_TITLE_RU; + machine_menu.XMaxFeedRate = X_MAXFEEDRATE_RU; + machine_menu.YMaxFeedRate = Y_MAXFEEDRATE_RU; + machine_menu.ZMaxFeedRate = Z_MAXFEEDRATE_RU; + machine_menu.E0MaxFeedRate = E0_MAXFEEDRATE_RU; + machine_menu.E1MaxFeedRate = E1_MAXFEEDRATE_RU; + + machine_menu.JerkConfTitle = JERK_CONF_TITLE_RU; + machine_menu.X_Jerk = X_JERK_RU; + machine_menu.Y_Jerk = Y_JERK_RU; + machine_menu.Z_Jerk = Z_JERK_RU; + machine_menu.E_Jerk = E_JERK_RU; + + machine_menu.StepsConfTitle = STEPS_CONF_TITLE_RU; + machine_menu.X_Steps = X_STEPS_RU; + machine_menu.Y_Steps = Y_STEPS_RU; + machine_menu.Z_Steps = Z_STEPS_RU; + machine_menu.E0_Steps = E0_STEPS_RU; + machine_menu.E1_Steps = E1_STEPS_RU; + + machine_menu.TmcCurrentConfTitle = TMC_CURRENT_CONF_TITLE_RU; + machine_menu.X_Current = X_TMC_CURRENT_RU; + machine_menu.Y_Current = Y_TMC_CURRENT_RU; + machine_menu.Z_Current = Z_TMC_CURRENT_RU; + machine_menu.E0_Current = E0_TMC_CURRENT_RU; + machine_menu.E1_Current = E1_TMC_CURRENT_RU; + + machine_menu.TmcStepModeConfTitle = TMC_MODE_CONF_TITLE_RU; + machine_menu.X_StepMode = X_TMC_MODE_RU; + machine_menu.Y_StepMode = Y_TMC_MODE_RU; + machine_menu.Z_StepMode = Z_TMC_MODE_RU; + machine_menu.E0_StepMode = E0_TMC_MODE_RU; + machine_menu.E1_StepMode = E1_TMC_MODE_RU; + + machine_menu.PausePosText = PAUSE_POSITION_RU; + machine_menu.xPos = PAUSE_POSITION_X_RU; + machine_menu.yPos = PAUSE_POSITION_Y_RU; + machine_menu.zPos = PAUSE_POSITION_Z_RU; + + machine_menu.OffsetConfTitle = OFFSET_TITLE_RU; + machine_menu.Xoffset = OFFSET_X_RU; + machine_menu.Yoffset = OFFSET_Y_RU; + machine_menu.Zoffset = OFFSET_Z_RU; + + machine_menu.FilamentConfTitle = FILAMENT_CONF_TITLE_RU; + machine_menu.InLength = FILAMENT_IN_LENGTH_RU; + machine_menu.InSpeed = FILAMENT_IN_SPEED_RU; + machine_menu.FilamentTemperature = FILAMENT_TEMPERATURE_RU; + machine_menu.OutLength = FILAMENT_OUT_LENGTH_RU; + machine_menu.OutSpeed = FILAMENT_OUT_SPEED_RU; + + machine_menu.EncoderConfTitle = ENCODER_CONF_TITLE_RU; + machine_menu.EncoderConfText = ENCODER_CONF_TEXT_RU; cloud_menu.title = TITLE_CLOUD_TEXT_RU; cloud_menu.bind = CLOUD_BINDED_RU; @@ -1640,6 +1744,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_RU; cloud_menu.unbinding = CLOUD_UNBINDED_RU; cloud_menu.disconnected = CLOUD_DISCONNECTED_RU; + cloud_menu.unbinded = CLOUD_UNBINDED_RU; cloud_menu.disable = CLOUD_DISABLE_RU; // about_menu.title = ABOUT_TEXT_RU; @@ -1715,11 +1820,10 @@ void disp_language_init() { printing_more_menu.manual = MANUAL_SHUTDOWN_RU; printing_more_menu.speed = PRINTING_CHANGESPEED_RU; printing_more_menu.temp = PRINTING_TEMP_RU; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; - print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.cancel = DIALOG_CANCLE_RU; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_RU; print_file_dialog_menu.retry = DIALOG_RETRY_RU; print_file_dialog_menu.stop = DIALOG_STOP_RU; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; @@ -1807,7 +1911,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_SP; file_menu.file_loading = FILE_LOADING_SP; file_menu.no_file = NO_FILE_SP; - file_menu.no_file_and_check = NO_FILE_SP;// NO_FILE_AND_CHECK_SP; + file_menu.no_file_and_check = NO_FILE_SP; // extrude_menu.title = TITLE_EXTRUDE_SP; extrude_menu.in = EXTRUDER_IN_TEXT_SP; @@ -1840,16 +1944,34 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_SP; set_menu.eepromSet = EEPROM_SETTINGS_SP; more_menu.title = TITLE_MORE_SP; + #if ENABLED(USER_CMD_1_ENABLE) + more_menu.custom1 = MORE_CUSTOM1_TEXT_SP; + #endif + #if ENABLED(USER_CMD_2_ENABLE) + more_menu.custom2 = MORE_CUSTOM2_TEXT_SP; + #endif + #if ENABLED(USER_CMD_3_ENABLE) + more_menu.custom3 = MORE_CUSTOM3_TEXT_SP; + #endif + #if ENABLED(USER_CMD_4_ENABLE) + more_menu.custom4 = MORE_CUSTOM4_TEXT_SP; + #endif + #if ENABLED(USER_CMD_5_ENABLE) + more_menu.custom5 = MORE_CUSTOM5_TEXT_SP; + #endif + #if ENABLED(USER_CMD_6_ENABLE) + more_menu.custom6 = MORE_CUSTOM6_TEXT_SP; + #endif + #if ENABLED(USER_CMD_7_ENABLE) + more_menu.custom7 = MORE_CUSTOM7_TEXT_SP; + #endif // filesys_menu.title = TITLE_FILESYS_SP; filesys_menu.sd_sys = SD_CARD_TEXT_SP; filesys_menu.usb_sys = U_DISK_TEXT_SP; // WIFI - wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_SP; - // wifi_menu.ip = WIFI_IP_TEXT_SP; - // wifi_menu.state = WIFI_STA_TEXT_SP; + wifi_menu.title = WIFI_TEXT; wifi_menu.cloud = CLOUD_TEXT_SP; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; @@ -1859,6 +1981,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_SP; cloud_menu.unbinding = CLOUD_UNBINDED_SP; cloud_menu.disconnected = CLOUD_DISCONNECTED_SP; + cloud_menu.unbinded = CLOUD_UNBINDED_SP; cloud_menu.disable = CLOUD_DISABLE_SP; // about_menu.title = ABOUT_TEXT_SP; @@ -1935,11 +2058,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_SP; printing_more_menu.temp = PRINTING_TEMP_SP; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; - print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.cancel = DIALOG_CANCLE_SP; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_SP; print_file_dialog_menu.retry = DIALOG_RETRY_SP; print_file_dialog_menu.stop = DIALOG_STOP_SP; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; @@ -2057,19 +2179,36 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_FR; set_menu.eepromSet = EEPROM_SETTINGS_FR; more_menu.title = TITLE_MORE_FR; + #if ENABLED(USER_CMD_1_ENABLE) + more_menu.custom1 = MORE_CUSTOM1_TEXT_FR; + #endif + #if ENABLED(USER_CMD_2_ENABLE) + more_menu.custom2 = MORE_CUSTOM2_TEXT_FR; + #endif + #if ENABLED(USER_CMD_3_ENABLE) + more_menu.custom3 = MORE_CUSTOM3_TEXT_FR; + #endif + #if ENABLED(USER_CMD_4_ENABLE) + more_menu.custom4 = MORE_CUSTOM4_TEXT_FR; + #endif + #if ENABLED(USER_CMD_5_ENABLE) + more_menu.custom5 = MORE_CUSTOM5_TEXT_FR; + #endif + #if ENABLED(USER_CMD_6_ENABLE) + more_menu.custom6 = MORE_CUSTOM6_TEXT_FR; + #endif + #if ENABLED(USER_CMD_7_ENABLE) + more_menu.custom7 = MORE_CUSTOM7_TEXT_FR; + #endif // filesys_menu.title = TITLE_FILESYS_FR; filesys_menu.sd_sys = SD_CARD_TEXT_FR; filesys_menu.usb_sys = U_DISK_TEXT_FR; file_menu.file_loading = FILE_LOADING_FR; file_menu.no_file = NO_FILE_FR; - file_menu.no_file_and_check = NO_FILE_FR;// NO_FILE_AND_CHECK_FR; + file_menu.no_file_and_check = NO_FILE_FR; // WIFI - wifi_menu.title = WIFI_NAME_TEXT_FR; - // wifi_menu.key = WIFI_KEY_TEXT_FR; - // wifi_menu.ip = WIFI_IP_TEXT_FR; - // wifi_menu.state = WIFI_STA_TEXT_FR; - // wifi_menu.cloud = CLOSE_TEXT_FR; + wifi_menu.title = WIFI_NAME_TEXT_FR; wifi_menu.cloud = CLOUD_TEXT_FR; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; @@ -2079,6 +2218,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_FR; cloud_menu.unbinding = CLOUD_UNBINDED_FR; cloud_menu.disconnected = CLOUD_DISCONNECTED_FR; + cloud_menu.unbinded = CLOUD_UNBINDED_FR; cloud_menu.disable = CLOUD_DISABLE_FR; // about_menu.title = ABOUT_TEXT_FR; @@ -2153,11 +2293,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_FR; printing_more_menu.temp = PRINTING_TEMP_FR; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; - print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.cancel = DIALOG_CANCLE_FR; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_FR; print_file_dialog_menu.retry = DIALOG_RETRY_FR; print_file_dialog_menu.stop = DIALOG_STOP_FR; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; @@ -2243,7 +2382,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_IT; file_menu.file_loading = FILE_LOADING_IT; file_menu.no_file = NO_FILE_IT; - file_menu.no_file_and_check = NO_FILE_IT;// NO_FILE_AND_CHECK_IT; + file_menu.no_file_and_check = NO_FILE_IT; // extrude_menu.title = TITLE_EXTRUDE_IT; extrude_menu.in = EXTRUDER_IN_TEXT_IT; @@ -2276,16 +2415,34 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_IT; set_menu.eepromSet = EEPROM_SETTINGS_IT; more_menu.title = TITLE_MORE_IT; + #if ENABLED(USER_CMD_1_ENABLE) + more_menu.custom1 = MORE_CUSTOM1_TEXT_IT; + #endif + #if ENABLED(USER_CMD_2_ENABLE) + more_menu.custom2 = MORE_CUSTOM2_TEXT_IT; + #endif + #if ENABLED(USER_CMD_3_ENABLE) + more_menu.custom3 = MORE_CUSTOM3_TEXT_IT; + #endif + #if ENABLED(USER_CMD_4_ENABLE) + more_menu.custom4 = MORE_CUSTOM4_TEXT_IT; + #endif + #if ENABLED(USER_CMD_5_ENABLE) + more_menu.custom5 = MORE_CUSTOM5_TEXT_IT; + #endif + #if ENABLED(USER_CMD_6_ENABLE) + more_menu.custom6 = MORE_CUSTOM6_TEXT_IT; + #endif + #if ENABLED(USER_CMD_7_ENABLE) + more_menu.custom7 = MORE_CUSTOM7_TEXT_IT; + #endif // filesys_menu.title = TITLE_FILESYS_IT; filesys_menu.sd_sys = SD_CARD_TEXT_IT; filesys_menu.usb_sys = U_DISK_TEXT_IT; // WIFI - wifi_menu.title = WIFI_NAME_TEXT_IT; - // wifi_menu.key = WIFI_KEY_TEXT_IT; - // wifi_menu.ip = WIFI_IP_TEXT_IT; - // wifi_menu.state = WIFI_STA_TEXT_IT; + wifi_menu.title = WIFI_NAME_TEXT_IT; wifi_menu.cloud = CLOSE_TEXT_IT; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; @@ -2295,6 +2452,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_IT; cloud_menu.unbinding = CLOUD_UNBINDED_IT; cloud_menu.disconnected = CLOUD_DISCONNECTED_IT; + cloud_menu.unbinded = CLOUD_UNBINDED_IT; cloud_menu.disable = CLOUD_DISABLE_IT; // about_menu.title = ABOUT_TEXT_IT; @@ -2369,11 +2527,10 @@ void disp_language_init() { printing_more_menu.temp = PRINTING_TEMP_IT; printing_more_menu.speed = PRINTING_CHANGESPEED_IT; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; - print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.cancel = DIALOG_CANCLE_IT; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_IT; print_file_dialog_menu.retry = DIALOG_RETRY_IT; print_file_dialog_menu.stop = DIALOG_STOP_IT; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; @@ -2460,7 +2617,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN; // extrude_menu.title = TITLE_EXTRUDE_EN; extrude_menu.in = EXTRUDER_IN_TEXT_EN; @@ -2493,16 +2650,20 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_EN; set_menu.eepromSet = EEPROM_SETTINGS_EN; // - more_menu.title = TITLE_MORE_EN; + more_menu.title = TITLE_MORE_EN; + TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN); + TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN); + TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN); + TERN_(USER_CMD_4_ENABLE, more_menu.custom4 = MORE_CUSTOM4_TEXT_EN); + TERN_(USER_CMD_5_ENABLE, more_menu.custom5 = MORE_CUSTOM5_TEXT_EN); + TERN_(USER_CMD_6_ENABLE, more_menu.custom6 = MORE_CUSTOM6_TEXT_EN); + TERN_(USER_CMD_7_ENABLE, more_menu.custom7 = MORE_CUSTOM7_TEXT_EN); // filesys_menu.title = TITLE_FILESYS_EN; filesys_menu.sd_sys = SD_CARD_TEXT_EN; filesys_menu.usb_sys = U_DISK_TEXT_EN; // WIFI - wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_EN; - // wifi_menu.ip = WIFI_IP_TEXT_EN; - // wifi_menu.state = WIFI_STA_TEXT_EN; + wifi_menu.title = WIFI_TEXT; wifi_menu.cloud = CLOUD_TEXT_EN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; @@ -2512,6 +2673,7 @@ void disp_language_init() { cloud_menu.unbind = CLOUD_UNBIND_EN; cloud_menu.unbinding = CLOUD_UNBINDED_EN; cloud_menu.disconnected = CLOUD_DISCONNECTED_EN; + cloud_menu.unbinded = CLOUD_UNBINDED_EN; cloud_menu.disable = CLOUD_DISABLE_EN; // about_menu.title = TITLE_ABOUT_EN; @@ -2588,11 +2750,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_EN; printing_more_menu.temp = PRINTING_TEMP_EN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_EN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h index 675fd41f168e..a3b55d469b4e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -118,6 +118,7 @@ typedef struct machine_common_disp{ const char *ProbeZspeed; const char *enable; const char *disable; + const char *locked; const char *z_min; const char *z_max; @@ -131,10 +132,6 @@ typedef struct machine_common_disp{ const char *CalibrationRadius; const char *LevelingSubXYZConfTitle; - //const char *Level_positon1; - //const char *Level_positon2; - //const char *Level_positon3; - //const char *Level_positon4; const char *TemperatureConfTitle; const char *NozzleConf; @@ -460,6 +457,13 @@ extern filesys_menu_def filesys_menu; typedef struct more_menu_disp { const char *title; + const char *custom1; + const char *custom2; + const char *custom3; + const char *custom4; + const char *custom5; + const char *custom6; + const char *custom7; const char *back; } more_menu_def; @@ -667,9 +671,9 @@ extern dialog_menu_def dialog_menu; typedef struct print_file_dialog_disp { const char *title; const char *confirm; - const char *cancle; + const char *cancel; const char *print_file; - const char *cancle_print; + const char *cancel_print; const char *retry; const char *stop; const char *no_file_print_tips; @@ -740,12 +744,8 @@ typedef struct eeprom_disp{ extern eeprom_def eeprom_menu; /*****************************************/ -//********************************************// -//#if defined(TFT70) // -//#elif defined(TFT35) #define TEXT_VALUE "%d/%d" -//#endif #define TEXT_VALUE_T ": %d℃" #define TEXT_VALUE_mm ": %dmm" @@ -765,15 +765,15 @@ extern eeprom_def eeprom_menu; #define AXIS_Y_DEC_TEXT "Y-" #define AXIS_Z_ADD_TEXT "Z+" #define AXIS_Z_DEC_TEXT "Z-" -#define TEXT_001MM "0.01mm" -#define TEXT_005MM "0.05mm" -#define TEXT_01MM "0.1mm" -#define TEXT_1MM "1mm" -#define TEXT_10MM "10mm" +#define TEXT_001MM "0.01 mm" +#define TEXT_005MM "0.05 mm" +#define TEXT_01MM "0.1 mm" +#define TEXT_1MM "1 mm" +#define TEXT_10MM "10 mm" -#define EXTRUDE_1MM_TEXT "1mm" -#define EXTRUDE_5MM_TEXT "5mm" -#define EXTRUDE_10MM_TEXT "10mm" +#define EXTRUDE_1MM_TEXT "1 mm" +#define EXTRUDE_5MM_TEXT "5 mm" +#define EXTRUDE_10MM_TEXT "10 mm" #define STEP_1PERCENT "1%" #define STEP_5PERCENT "5%" @@ -796,19 +796,14 @@ extern eeprom_def eeprom_menu; #define HOME_Y_TEXT "Y" #define HOME_Z_TEXT "Z" #define HOME_ALL_TEXT "All" -//#if defined(MKS_ROBIN_NANO) + #define ABOUT_TYPE_TEXT "MKS Robin Pro" -//#elif defined(MKS_ROBIN_MINI) -//#define ABOUT_TYPE_TEXT "MKS Robin Mini" -//#endif + #define ABOUT_VERSION_TEXT "1.0.0" -//#define ABOUT_WIFI_TEXT "WiFi:" #define FAN_OPEN_TEXT "100%" #define FAN_HALF_TEXT "50%" #define FAN_CLOSE_TEXT "0%" -//#define FAN_TIPS1_TEXT "FAN" -//#define FAN_TIPS2_TEXT "FAN\nClose" #define WIFI_TEXT "WIFI" #define WIFI_IP_TEXT "IP: " @@ -830,8 +825,8 @@ extern eeprom_def eeprom_menu; #define DIALOG_UPLOAD_SPEED_EN "Speed" #define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" #define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" -#define DIALOG_UPDATE_NO_DEVICE_EN "please check \nwether memory device insert!" +#define DIALOG_UPDATE_NO_DEVICE_EN "Please check whether\nmemory device inserted!" -#define ZOFFSET_STEP001 "0.01mm" -#define ZOFFSET_STEP01 "0.1mm" -#define ZOFFSET_STEP1 "1mm" +#define ZOFFSET_STEP001 "0.01 mm" +#define ZOFFSET_STEP01 "0.1 mm" +#define ZOFFSET_STEP1 "1 mm" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp index 93fce6af30aa..9e528821d7c3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp @@ -55,10 +55,29 @@ WifiSerial::WifiSerial(usart_dev *usart_device, uint8 tx_pin, uint8 rx_pin) { static void disable_timer_if_necessary(timer_dev *dev, uint8 ch) { if (dev) timer_set_mode(dev, ch, TIMER_DISABLED); } + static void usart_enable_no_irq(usart_dev *usart_device, bool with_irq) { + if (with_irq) usart_enable(usart_device); + else { + usart_reg_map *regs = usart_device->regs; + regs->CR1 |= (USART_CR1_TE | USART_CR1_RE); // don't change the word length etc, and 'or' in the pattern not overwrite |USART_CR1_M_8N1); + regs->CR1 |= USART_CR1_UE; + } + } + #elif STM32_MCU_SERIES == STM32_SERIES_F2 || STM32_MCU_SERIES == STM32_SERIES_F4 #define disable_timer_if_necessary(dev, ch) ((void)0) + + static void usart_enable_no_irq(usart_dev *usart_device, bool with_irq) { + if (with_irq) usart_enable(usart_device); + else { + usart_reg_map *regs = usart_device->regs; + regs->CR1 |= (USART_CR1_TE | USART_CR1_RE); // don't change the word length etc, and 'or' in the pattern not overwrite |USART_CR1_M_8N1); + regs->CR1 |= USART_CR1_UE; + } + } #else #warning "Unsupported STM32 series; timer conflicts are possible" + #define usart_enable_no_irq(X, Y) usart_enable(X) #endif void WifiSerial::begin(uint32 baud) { begin(baud, SERIAL_8N1); } @@ -89,14 +108,14 @@ void WifiSerial::begin(uint32 baud, uint8_t config) { txi->gpio_device, txi->gpio_bit, config); usart_set_baud_rate(this->usart_device, USART_USE_PCLK, baud); - usart_enable(this->usart_device); + usart_enable_no_irq(this->usart_device, baud == WIFI_BAUDRATE); } -void WifiSerial::end(void) { +void WifiSerial::end() { usart_disable(this->usart_device); } -int WifiSerial::available(void) { +int WifiSerial::available() { return usart_data_available(this->usart_device); } @@ -104,7 +123,7 @@ int WifiSerial::available(void) { // I/O // -int WifiSerial::read(void) { +int WifiSerial::read() { if (usart_data_available(usart_device) <= 0) return -1; return usart_getc(usart_device); } @@ -114,7 +133,7 @@ int WifiSerial::write(unsigned char ch) { return 1; } -int WifiSerial::wifi_rb_is_full(void) { +int WifiSerial::wifi_rb_is_full() { return rb_is_full(this->usart_device->rb); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h index 3206666bef2b..c2885ccc90c8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h @@ -26,7 +26,7 @@ #if ENABLED(MKS_WIFI_MODULE) #ifdef SERIAL_PORT_2 - #error "SERIAL_PORT_2 must be disabled with HAS_TFT_LVGL_UI and MKS_WIFI_MODULE." + #error "SERIAL_PORT_2 must be disabled with TFT_LVGL_UI* and MKS_WIFI_MODULE." #endif #define WIFI_BAUDRATE 115200 @@ -58,8 +58,8 @@ class WifiSerial { void begin(uint32 baud); void begin(uint32 baud,uint8_t config); void end(); - int available(void); - int read(void); + int available(); + int read(); int write(uint8_t); inline void wifi_usart_irq(usart_reg_map *regs) { /* Handling RXNEIE and TXEIE interrupts. @@ -87,10 +87,10 @@ class WifiSerial { } } - int wifi_rb_is_full(void); + int wifi_rb_is_full(); - private: struct usart_dev *usart_device; + private: uint8 tx_pin; uint8 rx_pin; }; 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 eeeff4fa31aa..fa01b7196fb9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp @@ -26,6 +26,7 @@ #include "draw_ui.h" #include "wifi_module.h" #include "wifi_upload.h" +#include "SPI_TFT.h" #if ENABLED(MKS_WIFI_MODULE) @@ -36,6 +37,12 @@ #include "../../../../lcd/marlinui.h" #include "../../../../sd/cardreader.h" #include "../../../../module/planner.h" +#include "../../../../module/servo.h" +#include "../../../../module/probe.h" + +#if DISABLED(EMERGENCY_PARSER) + #include "../../../../module/motion.h" +#endif #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../../feature/powerloss.h" #endif @@ -109,12 +116,9 @@ extern IP_PARA ipPara; extern CLOUD_PARA cloud_para; extern bool once_flag, flash_preview_begin, default_preview_flg, gcode_preview_over; +extern bool flash_dma_mode; -extern uint8_t bmp_public_buf[17 * 1024]; - -uint32_t getWifiTick() { - return millis(); -} +uint32_t getWifiTick() { return millis(); } uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { if (lastTick <= curTick) @@ -126,8 +130,10 @@ uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { void wifi_delay(int n) { uint32_t begin = getWifiTick(); uint32_t end = begin; - while (getWifiTickDiff(begin, end) < (uint32_t)n) + while (getWifiTickDiff(begin, end) < (uint32_t)n) { + watchdog_refresh(); end = getWifiTick(); + } } void wifi_reset() { @@ -149,40 +155,123 @@ void mount_file_sys(uint8_t disk_type) { } } -static void dma_init() { - #if 0 - __HAL_RCC_DMA1_CLK_ENABLE(); - - //HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0); - HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 4, 0); - HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn); - - hdma_usart1_rx.Instance = DMA1_Channel5; - //hdma_usart1_rx.Init.Channel = DMA_CHANNEL_4; - hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE; - hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; - hdma_usart1_rx.Init.MemDataAlignment = DMA_PDATAALIGN_BYTE; - hdma_usart1_rx.Init.Mode = DMA_NORMAL; - hdma_usart1_rx.Init.Priority = DMA_PRIORITY_VERY_HIGH; - if (HAL_DMA_Init((DMA_HandleTypeDef *)&hdma_usart1_rx) != HAL_OK) { - Error_Handler(); +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +void changeFlashMode(const bool dmaMode) { + if (flash_dma_mode != dmaMode) { + flash_dma_mode = dmaMode; + if (!flash_dma_mode) { + dma_disable(DMA1, DMA_CH5); + dma_clear_isr_bits(DMA1, DMA_CH4); + } } +} +static bool longName2DosName(const char *longName, uint8_t *dosName) { + uint8_t i; + for (i = FILENAME_LENGTH; i--;) dosName[i] = '\0'; + while (*longName) { + uint8_t c = *longName++; + if (c == '.') { // For a dot... + if (i == 0) return false; + strcat_P((char *)dosName, PSTR(".GCO")); + break; + } + else { + if (c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters + // Fail for illegal characters + PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); + while (const uint8_t b = pgm_read_byte(p++)) if (b == c) return false; + dosName[i++] = c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0); // Uppercase required for 8.3 name + } + if (i >= 5) { + strcat_P((char *)dosName, PSTR("~1.GCO")); + break; + } + } + return dosName[0] != '\0'; // Return true if any name was set +} + +static int storeRcvData(volatile uint8_t *bufToCpy, int32_t len) { + unsigned char tmpW = wifiDmaRcvFifo.write_cur; - HAL_DMA_Start_IT((DMA_HandleTypeDef *)&hdma_usart1_rx, - (uint32_t)&huart1.Instance->DR, - (uint32_t)(&WifiRxFifo.uartTxBuffer[0]), - UART_RX_BUFFER_SIZE); + if (len > UDISKBUFLEN) return 0; + + if (wifiDmaRcvFifo.state[tmpW] == udisk_buf_empty) { + memcpy((unsigned char *) wifiDmaRcvFifo.bufferAddr[tmpW], (uint8_t *)bufToCpy, len); + wifiDmaRcvFifo.state[tmpW] = udisk_buf_full; + wifiDmaRcvFifo.write_cur = (tmpW + 1) % TRANS_RCV_FIFO_BLOCK_NUM; + return 1; + } + return 0; +} - //HAL_UART_Receive_DMA(&huart1,(uint8_t*)&WifiRxFifo.uartTxBuffer[0], UART_RX_BUFFER_SIZE); +static void esp_dma_pre() { + dma_channel_reg_map *channel_regs = dma_tube_regs(DMA1, DMA_CH5); - /* Enable the DMA transfer for the receiver request by setting the DMAR bit - in the UART CR3 register */ - SET_BIT(huart1.Instance->CR3, USART_CR3_DMAR); + CBI32(channel_regs->CCR, 0); + channel_regs->CMAR = (uint32_t)WIFISERIAL.usart_device->rb->buf; + channel_regs->CNDTR = 0x0000; + channel_regs->CNDTR = UART_RX_BUFFER_SIZE; + DMA1->regs->IFCR = 0xF0000; + SBI32(channel_regs->CCR, 0); +} + +static void dma_ch5_irq_handle() { + uint8 status_bits = dma_get_isr_bits(DMA1, DMA_CH5); + dma_clear_isr_bits(DMA1, DMA_CH5); + if (status_bits & 0x8) { + // DMA transmit Error + } + else if (status_bits & 0x2) { + // DMA transmit complete + if (esp_state == TRANSFER_IDLE) + esp_state = TRANSFERING; + + if (storeRcvData(WIFISERIAL.usart_device->rb->buf, UART_RX_BUFFER_SIZE)) { + esp_dma_pre(); + if (wifiTransError.flag != 0x1) + WIFI_IO1_RESET(); + } + else { + WIFI_IO1_SET(); + esp_state = TRANSFER_STORE; + } + } + else if (status_bits & 0x4) { + // DMA transmit half + WIFI_IO1_SET(); + } +} + +static void wifi_usart_dma_init() { + dma_init(DMA1); + uint32_t flags = ( DMA_MINC_MODE | DMA_TRNS_CMPLT | DMA_HALF_TRNS | DMA_TRNS_ERR); + dma_xfer_size dma_bit_size = DMA_SIZE_8BITS; + dma_setup_transfer(DMA1, DMA_CH5, &USART1_BASE->DR, dma_bit_size, + (volatile void*)WIFISERIAL.usart_device->rb->buf, dma_bit_size, flags);// Transmit buffer DMA + dma_set_priority(DMA1, DMA_CH5, DMA_PRIORITY_LOW); + dma_attach_interrupt(DMA1, DMA_CH5, &dma_ch5_irq_handle); + + dma_clear_isr_bits(DMA1, DMA_CH5); + dma_set_num_transfers(DMA1, DMA_CH5, UART_RX_BUFFER_SIZE); + + bb_peri_set_bit(&USART1_BASE->CR3, USART_CR3_DMAR_BIT, 1); + dma_enable(DMA1, DMA_CH5); // enable transmit - #endif for (uint8_t i = 0; i < TRANS_RCV_FIFO_BLOCK_NUM; i++) { wifiDmaRcvFifo.bufferAddr[i] = &bmp_public_buf[1024 * i]; wifiDmaRcvFifo.state[i] = udisk_buf_empty; @@ -193,121 +282,44 @@ static void dma_init() { wifiDmaRcvFifo.write_cur = 0; } -static void wifi_deInit() { - #if 0 - HAL_DMA_Abort((DMA_HandleTypeDef *)&hdma_usart1_rx); - HAL_DMA_DeInit((DMA_HandleTypeDef *)&hdma_usart1_rx); - __HAL_DMA_DISABLE((DMA_HandleTypeDef *)&hdma_usart1_rx); - #endif -} - -extern uint8_t mksUsart1Rx; - void esp_port_begin(uint8_t interrupt) { WifiRxFifo.uart_read_point = 0; WifiRxFifo.uart_write_point = 0; - #if 0 - NVIC_InitTypeDef NVIC_InitStructure; - - USART_InitTypeDef USART_InitStructure; - GPIO_InitTypeDef GPIO_InitStruct; - - WifiRxFifo.uart_read_point = 0; - WifiRxFifo.uart_write_point = 0; - memset((uint8_t*)WifiRxFifo.uartTxBuffer, 0, sizeof(WifiRxFifo.uartTxBuffer)); - - if (interrupt) { - #if TAN - wifi_deInit (); - - //SZ_STM32_COMInit(COM1, 115200); - __HAL_UART_ENABLE_IT(USART1, USART_IT_RXNE); - - USART_InitStructure.USART_BaudRate = 115200; //���ڵIJ����ʣ�����115200 ��ߴ�4.5Mbits/s - USART_InitStructure.USART_WordLength = USART_WordLength_8b; //�����ֳ���(8λ��9λ) - USART_InitStructure.USART_StopBits = USART_StopBits_1; //�����õ�ֹͣλ-֧��1��2��ֹͣλ - USART_InitStructure.USART_Parity = USART_Parity_No; //����żУ�� - USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; //��Ӳ�������� - USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //˫��ģʽ��ʹ�ܷ��ͺͽ��� - - __HAL_RCC_USART1_CLK_ENABLE(); - - GPIO_InitStruct.Pin = TFT_WIFI_TX_Pin|TFT_WIFI_RX_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF7_USART1; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pin = TFT_WIFI_RX_Pin; - HAL_GPIO_Init(GPIOA,&GPIO_InitStruct); - - USART_Init(USART1, &USART_InitStructure); - - NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; - // NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; - // NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - - NVIC_Init(&NVIC_InitStructure); - #else - HAL_UART_DeInit(&huart1); - MX_USART1_UART_Init(3); - //__HAL_UART_ENABLE_IT(&huart1, UART_IT_RXNE); - HAL_UART_Receive_IT(&huart1,&mksUsart1Rx,1); - #endif - } - else{ - #if 0 - NVIC_DisableIRQ(SZ_STM32_COM1_IRQn); - - USART_Cmd(SZ_STM32_COM1, DISABLE); - - RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, DISABLE); - RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE); - SZ_STM32_COMInit(COM1, 1958400); + #if 1 - USART_Cmd(SZ_STM32_COM1, ENABLE); - - wifi_delay(10); - - dma_init(); - #endif - HAL_UART_DeInit(&huart1); - MX_USART1_UART_Init(5); - //dma1_5_IRQ_sel = 1; - dma_init(); - } - #endif - if (interrupt) { #if ENABLED(MKS_WIFI_MODULE) WIFISERIAL.end(); - for (uint16_t i = 0; i < 65535; i++); - WIFISERIAL.begin(WIFI_BAUDRATE); - uint32_t serial_connect_timeout = millis() + 1000UL; - while (/*!WIFISERIAL && */PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - //for (uint8_t i=0;i<100;i++)WIFISERIAL.write(0x33); + if (interrupt) { + for (uint16_t i = 0; i < 65535; i++) { /*nada*/ } + WIFISERIAL.begin(WIFI_BAUDRATE); + millis_t serial_connect_timeout = millis() + 1000UL; + while (PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + } + else { + WIFISERIAL.usart_device->regs->CR1 &= ~USART_CR1_RXNEIE; + WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE); + wifi_usart_dma_init(); + } #endif - } - else { - #if ENABLED(MKS_WIFI_MODULE) + + #else + + #if MKS_WIFI_MODULE WIFISERIAL.end(); - for (uint16_t i = 0; i < 65535; i++); - WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE); - uint32_t serial_connect_timeout = millis() + 1000UL; - while (/*!WIFISERIAL && */PENDING(millis(), serial_connect_timeout)) { /*nada*/ } - //for (uint16_t i=0;i<65535;i++);//WIFISERIAL.write(0x33); + for (uint16_t i = 0; i < 65535; i++) { /*nada*/ } + WIFISERIAL.begin(interrupt ? WIFI_BAUDRATE : WIFI_UPLOAD_BAUDRATE); + millis_t serial_connect_timeout = millis() + 1000UL; + while (PENDING(millis(), serial_connect_timeout)) { /*nada*/ } #endif - dma_init(); - } + if (!interrupt) wifi_usart_dma_init(); + + #endif } #if ENABLED(MKS_WIFI_MODULE) - int raw_send_to_wifi(char *buf, int len) { + int raw_send_to_wifi(uint8_t *buf, int len) { if (buf == 0 || len <= 0) return 0; for (int i = 0; i < len; i++) WIFISERIAL.write(*(buf + i)); @@ -318,11 +330,11 @@ void esp_port_begin(uint8_t interrupt) { void wifi_ret_ack() {} -char buf_to_wifi[256]; +uint8_t buf_to_wifi[256]; int index_to_wifi = 0; -int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { - char wifi_ret_head = 0xA5; - char wifi_ret_tail = 0xFC; +int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len) { + uint8_t wifi_ret_head = 0xA5; + uint8_t wifi_ret_tail = 0xFC; if (type == WIFI_PARA_SET) { int data_offset = 4; @@ -334,9 +346,9 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { buf_to_wifi[data_offset] = gCfgItems.wifi_mode_sel; buf_to_wifi[data_offset + 1] = apLen; - strncpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.wifi_name, apLen); + memcpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.wifi_name, apLen); buf_to_wifi[data_offset + apLen + 2] = keyLen; - strncpy(&buf_to_wifi[data_offset + apLen + 3], (const char *)uiCfg.wifi_key, keyLen); + memcpy(&buf_to_wifi[data_offset + apLen + 3], (const char *)uiCfg.wifi_key, keyLen); buf_to_wifi[data_offset + apLen + keyLen + 3] = wifi_ret_tail; index_to_wifi = apLen + keyLen + 3; @@ -413,7 +425,7 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { buf_to_wifi[data_offset] = gCfgItems.cloud_enable ? 0x0A : 0x05; buf_to_wifi[data_offset + 1] = urlLen; - strncpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.cloud_hostUrl, urlLen); + memcpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.cloud_hostUrl, urlLen); buf_to_wifi[data_offset + urlLen + 2] = uiCfg.cloud_port & 0xFF; buf_to_wifi[data_offset + urlLen + 3] = (uiCfg.cloud_port >> 8) & 0xFF; buf_to_wifi[data_offset + urlLen + 4] = wifi_ret_tail; @@ -444,10 +456,12 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { ZERO(buf_to_wifi); index_to_wifi = 0; } + return 1; } -int send_to_wifi(char *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); } +#define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n")) +int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); } void set_cur_file_sys(int fileType) { gCfgItems.fileSysType = fileType; } @@ -466,9 +480,9 @@ void get_file_list(char *path) { char wait_ip_back_flag = 0; typedef struct { - char write_buf[513]; int write_index; uint8_t saveFileName[30]; + uint8_t fileTransfer; uint32_t fileLen; uint32_t tick_begin; uint32_t tick_end; @@ -478,22 +492,43 @@ FILE_WRITER file_writer; int32_t lastFragment = 0; -char lastBinaryCmd[50] = { 0 }; +char saveFilePath[50]; -int total_write = 0; -char binary_head[2] = { 0, 0 }; -unsigned char binary_data_len = 0; +static SdFile upload_file, *upload_curDir; +static filepos_t pos; int write_to_file(char *buf, int len) { - for (int i = 0; i < len; i++) { - file_writer.write_buf[file_writer.write_index++] = buf[i]; + int i; + int res = 0; + + for (i = 0; i < len; i++) { + public_buf[file_writer.write_index++] = buf[i]; if (file_writer.write_index >= 512) { - int res = card.write(file_writer.write_buf, file_writer.write_index); + res = upload_file.write(public_buf, file_writer.write_index); + + if (res == -1) { + upload_file.close(); + const char * const fname = card.diveToFile(true, upload_curDir, saveFilePath); + + if (upload_file.open(upload_curDir, fname, O_WRITE)) { + upload_file.setpos(&pos); + res = upload_file.write(public_buf, file_writer.write_index); + } + } + if (res == -1) return -1; - ZERO(file_writer.write_buf); + + upload_file.getpos(&pos); file_writer.write_index = 0; } } + + if (res == -1) { + ZERO(public_buf); + file_writer.write_index = 0; + return -1; + } + return 0; } @@ -545,20 +580,17 @@ uint8_t Explore_Disk(char* path , uint8_t recu_level) { for (uint8_t i = 0; i < fileCnt; i++) { card.getfilename_sorted(SD_ORDER(i, fileCnt)); - - //if (card.longFilename[0] == 0) - strcpy(tmp, card.filename); - //else - // strcpy(tmp, card.longFilename); + ZERO(tmp); + strcpy(tmp, card.filename); ZERO(Fstream); strcpy(Fstream, tmp); if (card.flag.filenameIsDir && recu_level <= 10) - strcat(Fstream, ".DIR"); + strcat_P(Fstream, PSTR(".DIR")); - strcat(Fstream, "\r\n"); - send_to_wifi(Fstream, strlen(Fstream)); + strcat_P(Fstream, PSTR("\r\n")); + send_to_wifi((uint8_t*)Fstream, strlen(Fstream)); } return fileCnt; @@ -587,15 +619,16 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { switch (cmd_value) { case 20: // M20: Print SD / µdisk file + file_writer.fileTransfer = 0; if (uiCfg.print_state == IDLE) { int index = 0; if (tmpStr == 0) { gCfgItems.fileSysType = FILE_SYS_SD; - send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); + send_to_wifi((uint8_t *)"Begin file list\r\n", strlen("Begin file list\r\n")); get_file_list((char *)"0:/"); - send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + send_to_wifi((uint8_t *)"End file list\r\n", strlen("End file list\r\n")); + SEND_OK_TO_WIFI; break; } @@ -605,7 +638,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { char *path = (char *)tempBuf; if (strlen((char *)&tmpStr[index]) < 80) { - send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); + send_to_wifi((uint8_t *)"Begin file list\r\n", strlen("Begin file list\r\n")); if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_SD; @@ -614,16 +647,16 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { strcpy((char *)path, (char *)&tmpStr[index]); get_file_list(path); - send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); + send_to_wifi((uint8_t *)"End file list\r\n", strlen("End file list\r\n")); } - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; } } break; case 21: /*init sd card*/ - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; break; case 23: @@ -632,18 +665,42 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { int index = 0; while (tmpStr[index] == ' ') index++; - if (strstr((char *)&tmpStr[index], ".g") || strstr((char *)&tmpStr[index], ".G")) { + if (strstr_P((char *)&tmpStr[index], PSTR(".g")) || strstr_P((char *)&tmpStr[index], PSTR(".G"))) { if (strlen((char *)&tmpStr[index]) < 80) { ZERO(list_file.file_name[sel_id]); + ZERO(list_file.long_name[sel_id]); + uint8_t has_path_selected = 0; if (gCfgItems.wifi_type == ESP_WIFI) { - if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) + if (strncmp_P((char *)&tmpStr[index], PSTR("1:"), 2) == 0) { gCfgItems.fileSysType = FILE_SYS_SD; - else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0) + has_path_selected = 1; + } + else if (strncmp_P((char *)&tmpStr[index], PSTR("0:"), 2) == 0) { gCfgItems.fileSysType = FILE_SYS_USB; + has_path_selected = 1; + } else if (tmpStr[index] != '/') - strcat((char *)list_file.file_name[0], "/"); - strcat((char *)list_file.file_name[sel_id], (char *)&tmpStr[index]); + strcat_P((char *)list_file.file_name[sel_id], PSTR("/")); + + if (file_writer.fileTransfer == 1) { + uint8_t dosName[FILENAME_LENGTH]; + uint8_t fileName[sizeof(list_file.file_name[sel_id])]; + fileName[0] = '\0'; + if (has_path_selected == 1) { + strcat((char *)fileName, (char *)&tmpStr[index + 3]); + strcat_P((char *)list_file.file_name[sel_id], PSTR("/")); + } + else strcat((char *)fileName, (char *)&tmpStr[index]); + if (!longName2DosName((const char *)fileName, dosName)) + strcpy_P(list_file.file_name[sel_id], PSTR("notValid")); + strcat((char *)list_file.file_name[sel_id], (char *)dosName); + strcat((char *)list_file.long_name[sel_id], (char *)dosName); + } + else { + strcat((char *)list_file.file_name[sel_id], (char *)&tmpStr[index]); + strcat((char *)list_file.long_name[sel_id], (char *)&tmpStr[index]); + } } else @@ -654,19 +711,19 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { card.openFileRead(cur_name); if (card.isFileOpen()) - send_to_wifi((char *)"File selected\r\n", strlen("File selected\r\n")); + send_to_wifi((uint8_t *)"File selected\r\n", strlen("File selected\r\n")); else { - send_to_wifi((char *)"file.open failed\r\n", strlen("file.open failed\r\n")); - strcpy(list_file.file_name[sel_id], "notValid"); + send_to_wifi((uint8_t *)"file.open failed\r\n", strlen("file.open failed\r\n")); + strcpy_P(list_file.file_name[sel_id], PSTR("notValid")); } - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; } } } break; case 24: - if (strcmp(list_file.file_name[sel_id], "notValid") != 0) { + if (strcmp_P(list_file.file_name[sel_id], PSTR("notValid")) != 0) { if (uiCfg.print_state == IDLE) { clear_cur_ui(); reset_print_time(); @@ -683,6 +740,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { SdFile file; SdFile *curDir; + card.endFilePrint(); const char * const fname = card.diveToFile(true, curDir, cur_name); if (!fname) return; if (file.open(curDir, fname, O_READ)) { @@ -729,7 +787,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { lv_draw_printing(); } } - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; break; case 25: @@ -748,7 +806,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { else default_preview_flg = true; lv_draw_printing(); - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; } break; @@ -765,7 +823,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { lv_draw_ready_print(); - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; } break; @@ -774,8 +832,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)|| (uiCfg.print_state == REPRINTING)) { print_rate = uiCfg.totalSend; ZERO(tempBuf); - sprintf((char *)tempBuf, "M27 %d\r\n", print_rate); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; @@ -786,16 +844,16 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { int index = 0; while (tmpStr[index] == ' ') index++; - if (strstr((char *)&tmpStr[index], ".g") || strstr((char *)&tmpStr[index], ".G")) { + if (strstr_P((char *)&tmpStr[index], PSTR(".g")) || strstr_P((char *)&tmpStr[index], PSTR(".G"))) { strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]); if (gCfgItems.fileSysType == FILE_SYS_SD) { ZERO(tempBuf); - sprintf((char *)tempBuf, "%s", file_writer.saveFileName); + sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { ZERO(tempBuf); - sprintf((char *)tempBuf, "%s", (char *)file_writer.saveFileName); + sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName); } mount_file_sys(gCfgItems.fileSysType); @@ -806,10 +864,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { ZERO(file_writer.saveFileName); strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]); ZERO(tempBuf); - sprintf((char *)tempBuf, "Writing to file: %s\r\n", (char *)file_writer.saveFileName); + sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName); wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); - total_write = 0; + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); wifi_link_state = WIFI_WAIT_TRANS_START; } else { @@ -825,8 +882,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { case 991: ZERO(tempBuf); if (cmd_value == 105) { - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); - sprintf((char *)tempBuf,"T:%.1f /%.1f B:%.1f /%.1f T0:%.1f /%.1f T1:%.1f /%.1f @:0 B@:0\r\n", + SEND_OK_TO_WIFI; + sprintf_P((char *)tempBuf, PSTR("T:%.1f /%.1f B:%.1f /%.1f T0:%.1f /%.1f T1:%.1f /%.1f @:0 B@:0\r\n"), (float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, #if HAS_HEATED_BED @@ -835,7 +892,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { 0.0f, 0.0f, #endif (float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, - #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER + #if DISABLED(SINGLENOZZLE) && HAS_MULTI_EXTRUDER (float)thermalManager.temp_hotend[1].celsius, (float)thermalManager.temp_hotend[1].target #else 0.0f, 0.0f @@ -843,7 +900,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { ); } else { - sprintf((char *)tempBuf,"T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n", + sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"), (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, #if HAS_HEATED_BED @@ -852,7 +909,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { 0, 0, #endif (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, - #if !defined(SINGLENOZZLE) && HAS_MULTI_EXTRUDER + #if DISABLED(SINGLENOZZLE) && HAS_MULTI_EXTRUDER (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target #else 0, 0 @@ -860,16 +917,16 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { ); } - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); queue.enqueue_one_P(PSTR("M105")); break; case 992: if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) { ZERO(tempBuf); - sprintf((char *)tempBuf, "M992 %d%d:%d%d:%d%d\r\n", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); + sprintf_P((char *)tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; @@ -877,30 +934,30 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) { ZERO(tempBuf); if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return; - sprintf((char *)tempBuf, "M994 %s;%d\n", list_file.file_name[sel_id],(int)gCfgItems.curFilesize); + sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize); wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; case 997: if (uiCfg.print_state == IDLE) { wifi_ret_ack(); - send_to_wifi((char *)"M997 IDLE\r\n", strlen("M997 IDLE\r\n")); + send_to_wifi((uint8_t *)"M997 IDLE\r\n", strlen("M997 IDLE\r\n")); } else if (uiCfg.print_state == WORKING) { wifi_ret_ack(); - send_to_wifi((char *)"M997 PRINTING\r\n", strlen("M997 PRINTING\r\n")); + send_to_wifi((uint8_t *)"M997 PRINTING\r\n", strlen("M997 PRINTING\r\n")); } else if (uiCfg.print_state == PAUSED) { wifi_ret_ack(); - send_to_wifi((char *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); + send_to_wifi((uint8_t *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); } else if (uiCfg.print_state == REPRINTING) { wifi_ret_ack(); - send_to_wifi((char *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); + send_to_wifi((uint8_t *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); } - if (uiCfg.command_send == 0) get_wifi_list_command_send(); + if (!uiCfg.command_send) get_wifi_list_command_send(); break; case 998: @@ -916,12 +973,12 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { case 115: ZERO(tempBuf); - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); - send_to_wifi((char *)"FIRMWARE_NAME:Robin_nano\r\n", strlen("FIRMWARE_NAME:Robin_nano\r\n")); + SEND_OK_TO_WIFI; + send_to_wifi((uint8_t *)"FIRMWARE_NAME:Robin_nano\r\n", strlen("FIRMWARE_NAME:Robin_nano\r\n")); break; default: - strcat((char *)cmd_line, "\n"); + strcat_P((char *)cmd_line, PSTR("\n")); if (espGcodeFifo.wait_tick > 5) { uint32_t left; @@ -938,7 +995,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { index++; } if (left - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line)) - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; else need_ok_later = true; } @@ -947,7 +1004,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { } } else { - strcat((char *)cmd_line, "\n"); + strcat_P((char *)cmd_line, PSTR("\n")); if (espGcodeFifo.wait_tick > 5) { uint32_t left_g; @@ -964,7 +1021,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { index++; } if (left_g - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line)) - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + SEND_OK_TO_WIFI; else need_ok_later = true; } @@ -980,8 +1037,8 @@ static int32_t charAtArray(const uint8_t *_array, uint32_t _arrayLen, uint8_t _c } void get_wifi_list_command_send() { - char buf[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; - raw_send_to_wifi(buf, 5); + uint8_t cmd_wifi_list[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; + raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list)); } static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { @@ -990,7 +1047,7 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { if (msgLen <= 0) return; // ip - sprintf(ipPara.ip_addr, "%d.%d.%d.%d", msg[0], msg[1], msg[2], msg[3]); + sprintf_P(ipPara.ip_addr, PSTR("%d.%d.%d.%d"), msg[0], msg[1], msg[2], msg[3]); // port // connect state @@ -1042,19 +1099,19 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { memcpy(wifi_firm_ver, (const char *)&msg[16 + wifiNameLen + wifiKeyLen + hostLen + id_len], ver_len); } - if (uiCfg.configWifi == 1) { + if (uiCfg.configWifi) { if ((wifiPara.mode != gCfgItems.wifi_mode_sel) || (strncmp(wifiPara.ap_name, (const char *)uiCfg.wifi_name, 32) != 0) || (strncmp(wifiPara.keyCode, (const char *)uiCfg.wifi_key, 64) != 0)) { - package_to_wifi(WIFI_PARA_SET, (char *)0, 0); + package_to_wifi(WIFI_PARA_SET, (uint8_t *)0, 0); } - else uiCfg.configWifi = 0; + else uiCfg.configWifi = false; } if (cfg_cloud_flag == 1) { if (((cloud_para.state >> 4) != (char)gCfgItems.cloud_enable) || (strncmp(cloud_para.hostUrl, (const char *)uiCfg.cloud_hostUrl, 96) != 0) || (cloud_para.port != uiCfg.cloud_port)) { - package_to_wifi(WIFI_CLOUD_CFG, (char *)0, 0); + package_to_wifi(WIFI_CLOUD_CFG, (uint8_t *)0, 0); } else cfg_cloud_flag = 0; } @@ -1074,7 +1131,7 @@ static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) { wifi_list.getNameNum = msg[0]; if (wifi_list.getNameNum < 20) { - uiCfg.command_send = 1; + uiCfg.command_send = true; ZERO(wifi_list.wifiName); wifi_name_num = wifi_list.getNameNum; valid_name_num = 0; @@ -1088,23 +1145,18 @@ static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) { memset(str, 0, WIFI_NAME_BUFFER_SIZE); memcpy(str, &msg[wifiMsgIdex], wifiNameLen); for (j = 0; j < valid_name_num; j++) { - if (strcmp((const char *)str,(const char *)wifi_list.wifiName[j]) == 0) { + if (strcmp((const char *)str, (const char *)wifi_list.wifiName[j]) == 0) { wifi_name_is_same = 1; break; } } - if (wifi_name_is_same != 1) { - //for (j=0;j 0x80) { - wifi_name_is_same = 1; - //break; - } - //} - } + + if (wifi_name_is_same != 1 && str[0] > 0x80) + wifi_name_is_same = 1; + if (wifi_name_is_same == 1) { wifi_name_is_same = 0; wifiMsgIdex += wifiNameLen; - //wifi_list.RSSI[i] = msg[wifiMsgIdex]; wifiMsgIdex += 1; wifi_name_num--; //i--; @@ -1148,7 +1200,7 @@ static void gcode_msg_handle(uint8_t * msg, uint16_t msgLen) { } } -void utf8_2_unicode(uint8_t *source,uint8_t Len) { +void utf8_2_unicode(uint8_t *source, uint8_t Len) { uint8_t i = 0, char_i = 0, char_byte_num = 0; uint16_t u16_h, u16_m, u16_l, u16_value; uint8_t FileName_unicode[30]; @@ -1165,7 +1217,6 @@ void utf8_2_unicode(uint8_t *source,uint8_t Len) { } else if (char_byte_num == 0XC0 || char_byte_num == 0XD0) { //--2byte - u16_h = (((uint16_t)source[i] << 8) & 0x1F00) >> 2; u16_l = ((uint16_t)source[i + 1] & 0x003F); u16_value = (u16_h | u16_l); @@ -1190,37 +1241,14 @@ void utf8_2_unicode(uint8_t *source,uint8_t Len) { i += 4; //char_i += 3; } - else { + else break; - } + if (i >= Len || i >= 255) break; } COPY(source, FileName_unicode); } -char saveFilePath[50]; - -static bool longName2DosName(const char* longName, uint8_t* dosName) { - uint8_t i = 11; - while (i--) dosName[i] = '\0'; - while (*longName) { - uint8_t c = *longName++; - if (c == '.') { // For a dot... - if (i == 0) return false; - else { strcat((char *)dosName,".GCO"); return dosName[0] != '\0'; } - } - else { - // Fail for illegal characters - PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); - while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; - if (c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters - dosName[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name - } - if (i >= 5) strcat((char *)dosName,"~1.GCO"); - } - return dosName[0] != '\0'; // Return true if any name was set -} - static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { uint8_t fileNameLen = *msg; @@ -1233,7 +1261,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { utf8_2_unicode(file_writer.saveFileName,fileNameLen); - ZERO(file_writer.write_buf); + ZERO(public_buf); if (strlen((const char *)file_writer.saveFileName) > sizeof(saveFilePath)) return; @@ -1241,11 +1269,7 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { ZERO(saveFilePath); if (gCfgItems.fileSysType == FILE_SYS_SD) { - //sprintf((char *)saveFilePath, "/%s", file_writer.saveFileName); - card.mount(); - - //ZERO(list_file.long_name[sel_id]); - //memcpy(list_file.long_name[sel_id],file_writer.saveFileName,sizeof(list_file.long_name[sel_id])); + TERN_(SDSUPPORT, card.mount()); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { @@ -1273,26 +1297,19 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { lv_draw_dialog(DIALOG_TYPE_UPLOAD_FILE); return; } - sprintf((char *)saveFilePath, "/%s", dosName); - - ZERO(list_file.long_name[sel_id]); - memcpy(list_file.long_name[sel_id], dosName, sizeof(dosName)); + sprintf_P((char *)saveFilePath, PSTR("%s"), dosName); - char *cur_name=strrchr((const char *)saveFilePath,'/'); + card.cdroot(); + upload_file.close(); + const char * const fname = card.diveToFile(true, upload_curDir, saveFilePath); - SdFile file; - SdFile *curDir; - card.endFilePrint(); - const char * const fname = card.diveToFile(true, curDir, cur_name); - if (!fname) return; - if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - gCfgItems.curFilesize = file.fileSize(); - } - else { + if (!upload_file.open(upload_curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { clear_cur_ui(); upload_result = 2; + wifiTransError.flag = 1; wifiTransError.start_tick = getWifiTick(); + lv_draw_dialog(DIALOG_TYPE_UPLOAD_FILE); return; } @@ -1309,22 +1326,23 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) { lv_task_handler(); file_writer.tick_begin = getWifiTick(); + + file_writer.fileTransfer = 1; } -#define FRAG_MASK _BV32(31) +#define FRAG_MASK ~_BV32(31) static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { uint32_t frag = *((uint32_t *)msg); - if ((frag & FRAG_MASK) != (uint32_t)(lastFragment + 1)) { - ZERO(file_writer.write_buf); + ZERO(public_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; } else { if (write_to_file((char *)msg + 4, msgLen - 4) < 0) { - ZERO(file_writer.write_buf); + ZERO(public_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; @@ -1332,16 +1350,31 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { } lastFragment = frag; - if ((frag & (~FRAG_MASK))) { - int res = card.write(file_writer.write_buf, file_writer.write_index); + if ((frag & (~FRAG_MASK)) != 0) { + int res = upload_file.write(public_buf, file_writer.write_index); if (res == -1) { - ZERO(file_writer.write_buf); + upload_file.close(); + const char * const fname = card.diveToFile(true, upload_curDir, saveFilePath); + if (upload_file.open(upload_curDir, fname, O_WRITE)) { + upload_file.setpos(&pos); + res = upload_file.write(public_buf, file_writer.write_index); + } + } + upload_file.close(); + SdFile file, *curDir; + const char * const fname = card.diveToFile(true, curDir, saveFilePath); + if (file.open(curDir, fname, O_RDWR)) { + gCfgItems.curFilesize = file.fileSize(); + file.close(); + } + else { + ZERO(public_buf); file_writer.write_index = 0; wifi_link_state = WIFI_CONNECTED; upload_result = 2; return; } - ZERO(file_writer.write_buf); + ZERO(public_buf); file_writer.write_index = 0; file_writer.tick_end = getWifiTick(); upload_time = getWifiTickDiff(file_writer.tick_begin, file_writer.tick_end) / 1000; @@ -1349,13 +1382,11 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { wifi_link_state = WIFI_CONNECTED; upload_result = 3; } - } } void esp_data_parser(char *cmdRxBuf, int len) { - int32_t head_pos; - int32_t tail_pos; + int32_t head_pos, tail_pos; uint16_t cpyLen; int16_t leftLen = len; bool loop_again = false; @@ -1460,7 +1491,6 @@ void esp_data_parser(char *cmdRxBuf, int len) { esp_msg_index = 0; return; } - if ((charAtArray(esp_msg_buf, esp_msg_index, ESP_PROTOC_HEAD) != -1) && (charAtArray(esp_msg_buf, esp_msg_index, ESP_PROTOC_TAIL) != -1)) loop_again = true; } @@ -1468,19 +1498,6 @@ void esp_data_parser(char *cmdRxBuf, int len) { } int32_t tick_net_time1, tick_net_time2; - -int storeRcvData(int32_t len) { - unsigned char tmpW = wifiDmaRcvFifo.write_cur; - if (len <= UDISKBUFLEN && wifiDmaRcvFifo.state[tmpW] == udisk_buf_empty) { - for (uint16_t i = 0; i < len; i++) - wifiDmaRcvFifo.bufferAddr[tmpW][i] = WIFISERIAL.read(); - wifiDmaRcvFifo.state[tmpW] = udisk_buf_full; - wifiDmaRcvFifo.write_cur = (tmpW + 1) % TRANS_RCV_FIFO_BLOCK_NUM; - return 1; - } - return 0; -} - int32_t readWifiFifo(uint8_t *retBuf, uint32_t bufLen) { unsigned char tmpR = wifiDmaRcvFifo.read_cur; if (bufLen >= UDISKBUFLEN && wifiDmaRcvFifo.state[tmpR] == udisk_buf_full) { @@ -1503,20 +1520,33 @@ void stopEspTransfer() { wifiTransError.start_tick = getWifiTick(); card.removeFile((const char *)saveFilePath); } - else { - } + wifi_delay(200); WIFI_IO1_SET(); - //exchangeFlashMode(1); //change spi flash to use dma mode + + // disable dma + dma_clear_isr_bits(DMA1, DMA_CH5); + bb_peri_set_bit(&USART1_BASE->CR3, USART_CR3_DMAR_BIT, 0); + dma_disable(DMA1, DMA_CH5); + + wifi_delay(200); + changeFlashMode(true); // Set SPI flash to use DMA mode esp_port_begin(1); + wifi_delay(200); + + W25QXX.init(SPI_QUARTER_SPEED); + + TERN_(HAS_TFT_LVGL_UI_SPI, SPI_TFT.spi_init(SPI_FULL_SPEED)); + TERN_(HAS_SERVOS, servo_init()); + TERN_(HAS_Z_SERVO_PROBE, probe.servo_probe_init()); + if (wifiTransError.flag != 0x1) WIFI_IO1_RESET(); } void wifi_rcv_handle() { int32_t len = 0; - uint8_t ucStr[(UART_RX_BUFFER_SIZE) + 1] = { 0 }; + uint8_t ucStr[(UART_RX_BUFFER_SIZE) + 1] = {0}; int8_t getDataF = 0; - if (wifi_link_state == WIFI_TRANS_FILE) { #if 0 if (WIFISERIAL.available() == UART_RX_BUFFER_SIZE) { @@ -1538,9 +1568,9 @@ void wifi_rcv_handle() { getDataF = 1; } if (esp_state == TRANSFER_STORE) { - if (storeRcvData(UART_RX_BUFFER_SIZE)) { + if (storeRcvData(WIFISERIAL.usart_device->rb->buf, UART_RX_BUFFER_SIZE)) { esp_state = TRANSFERING; - //esp_dma_pre(); + esp_dma_pre(); if (wifiTransError.flag != 0x1) WIFI_IO1_RESET(); } else @@ -1548,13 +1578,11 @@ void wifi_rcv_handle() { } } else { - //len = readUsartFifo((SZ_USART_FIFO *)&WifiRxFifo, (int8_t *)ucStr, UART_RX_BUFFER_SIZE); len = readWifiBuf((int8_t *)ucStr, UART_RX_BUFFER_SIZE); if (len > 0) { esp_data_parser((char *)ucStr, len); - if (wifi_link_state == WIFI_TRANS_FILE) { - //exchangeFlashMode(0); //change spi flash not use dma mode + changeFlashMode(false); // Set SPI flash to use non-DMA mode wifi_delay(10); esp_port_begin(0); wifi_delay(10); @@ -1565,7 +1593,7 @@ void wifi_rcv_handle() { } if (need_ok_later && (queue.length < BUFSIZE)) { need_ok_later = false; - send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); + send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n")); } } @@ -1576,7 +1604,7 @@ void wifi_rcv_handle() { tick_net_time2 = getWifiTick(); if (wifi_link_state == WIFI_TRANS_FILE) { - if ((tick_net_time1 != 0) && (getWifiTickDiff(tick_net_time1, tick_net_time2) > 4500)) { + if (tick_net_time1 && getWifiTickDiff(tick_net_time1, tick_net_time2) > 8000) { wifi_link_state = WIFI_CONNECTED; upload_result = 2; clear_cur_ui(); @@ -1584,11 +1612,10 @@ void wifi_rcv_handle() { lv_draw_dialog(DIALOG_TYPE_UPLOAD_FILE); } } - - if ((tick_net_time1 != 0) && (getWifiTickDiff(tick_net_time1, tick_net_time2) > 10000)) + if (tick_net_time1 && getWifiTickDiff(tick_net_time1, tick_net_time2) > 10000) wifi_link_state = WIFI_NOT_CONFIG; - if ((tick_net_time1 != 0) && (getWifiTickDiff(tick_net_time1, tick_net_time2) > 120000)) { + if (tick_net_time1 && getWifiTickDiff(tick_net_time1, tick_net_time2) > 120000) { wifi_link_state = WIFI_NOT_CONFIG; wifi_reset(); tick_net_time1 = getWifiTick(); @@ -1605,7 +1632,10 @@ void wifi_rcv_handle() { } void wifi_looping() { - do { wifi_rcv_handle(); } while (wifi_link_state == WIFI_TRANS_FILE); + do { + wifi_rcv_handle(); + watchdog_refresh(); + } while (wifi_link_state == WIFI_TRANS_FILE); } void mks_esp_wifi_init() { @@ -1623,32 +1653,8 @@ void mks_esp_wifi_init() { wifi_reset(); #if 0 - res = f_open(&esp_upload.uploadFile, ESP_FIRMWARE_FILE, FA_OPEN_EXISTING | FA_READ); - - if (res == FR_OK) { - f_close(&esp_upload.uploadFile); - - wifi_delay(2000); - - if (usartFifoAvailable((SZ_USART_FIFO *)&WifiRxFifo) < 20) { - return; - } - - clear_cur_ui(); - - draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMARE); - - if (wifi_upload(0) >= 0) { - - f_unlink("1:/MKS_WIFI_CUR"); - f_rename(ESP_FIRMWARE_FILE,"/MKS_WIFI_CUR"); - } - draw_return_ui(); - - update_flag = 1; - } - if (update_flag == 0) { - res = f_open(&esp_upload.uploadFile, ESP_WEB_FIRMWARE_FILE, FA_OPEN_EXISTING | FA_READ); + if (update_flag == 0) { + res = f_open(&esp_upload.uploadFile, ESP_WEB_FIRMWARE_FILE, FA_OPEN_EXISTING | FA_READ); if (res == FR_OK) { f_close(&esp_upload.uploadFile); @@ -1661,7 +1667,7 @@ void mks_esp_wifi_init() { clear_cur_ui(); - draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMARE); + draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMWARE); if (wifi_upload(1) >= 0) { f_unlink("1:/MKS_WIFI_CUR"); @@ -1701,32 +1707,42 @@ void mks_esp_wifi_init() { wifi_link_state = WIFI_NOT_CONFIG; } -#define BUF_INC_POINTER(p) ((p + 1 == UART_FIFO_BUFFER_SIZE) ? 0 : (p + 1)) -int usartFifoAvailable(SZ_USART_FIFO *fifo) { - int diff = fifo->uart_write_point - fifo->uart_read_point; - if (diff < 0) diff += UART_FIFO_BUFFER_SIZE; - return diff; -} +void mks_wifi_firmware_update() { + card.openFileRead((char *)ESP_FIRMWARE_FILE); + + if (card.isFileOpen()) { + card.closefile(); + + wifi_delay(2000); + + if (usartFifoAvailable((SZ_USART_FIFO *)&WifiRxFifo) < 20) + return; + + clear_cur_ui(); -int readUsartFifo(SZ_USART_FIFO *fifo, int8_t *buf, int32_t len) { - int i = 0 ; - while (i < len && fifo->uart_read_point != fifo->uart_write_point) { - buf[i++] = fifo->uartTxBuffer[fifo->uart_read_point]; - fifo->uart_read_point = BUF_INC_POINTER(fifo->uart_read_point); + lv_draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMWARE); + + lv_task_handler(); + watchdog_refresh(); + + if (wifi_upload(0) >= 0) { + card.removeFile((char *)ESP_FIRMWARE_FILE_RENAME); + SdFile file, *curDir; + const char * const fname = card.diveToFile(true, curDir, ESP_FIRMWARE_FILE); + if (file.open(curDir, fname, O_READ)) { + file.rename(curDir, (char *)ESP_FIRMWARE_FILE_RENAME); + file.close(); + } + } + clear_cur_ui(); } - return i; } -int writeUsartFifo(SZ_USART_FIFO *fifo, int8_t *buf, int32_t len) { - if (buf == 0 || len <= 0) return -1; +#define BUF_INC_POINTER(p) ((p + 1 == UART_FIFO_BUFFER_SIZE) ? 0:(p + 1)) - int i = 0 ; - while (i < len && fifo->uart_read_point != BUF_INC_POINTER(fifo->uart_write_point)) { - fifo->uartTxBuffer[fifo->uart_write_point] = buf[i++]; - fifo->uart_write_point = BUF_INC_POINTER(fifo->uart_write_point); - } - return i; +int usartFifoAvailable(SZ_USART_FIFO *fifo) { + return WIFISERIAL.available(); } void get_wifi_commands() { @@ -1798,10 +1814,9 @@ void get_wifi_commands() { if (!wifi_comment_mode) wifi_line_buffer[wifi_read_count++] = wifi_char; } } - }// queue has space, serial has data - else { + } // queue has space, serial has data + else espGcodeFifo.wait_tick++; - } } int readWifiBuf(int8_t *buf, int32_t len) { 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 656e440bc237..07ae6f72dbd3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h @@ -34,11 +34,6 @@ #define UART_RX_BUFFER_SIZE 1024 #define UART_FIFO_BUFFER_SIZE 1024 -#define ESP_WIFI 0x02 - -#define AP_MODEL 0x01 -#define STA_MODEL 0x02 - #define WIFI_DECODE_TYPE 1 #define IP_DHCP_FLAG 1 @@ -66,7 +61,7 @@ typedef enum{ udisk_buf_full, } UDISK_DATA_BUFFER_STATE; -#define TRANS_RCV_FIFO_BLOCK_NUM 8 +#define TRANS_RCV_FIFO_BLOCK_NUM 14 typedef struct { unsigned char *bufferAddr[TRANS_RCV_FIFO_BLOCK_NUM]; @@ -164,16 +159,16 @@ typedef enum { typedef struct { uint32_t uart_read_point; uint32_t uart_write_point; - uint8_t uartTxBuffer[UART_FIFO_BUFFER_SIZE]; + //uint8_t uartTxBuffer[UART_FIFO_BUFFER_SIZE]; } SZ_USART_FIFO; #define WIFI_GCODE_BUFFER_LEAST_SIZE 96 #define WIFI_GCODE_BUFFER_SIZE (WIFI_GCODE_BUFFER_LEAST_SIZE * 3) typedef struct { - uint8_t wait_tick; - uint8_t Buffer[WIFI_GCODE_BUFFER_SIZE]; - uint32_t r; - uint32_t w; + uint8_t wait_tick; + uint8_t Buffer[WIFI_GCODE_BUFFER_SIZE]; + uint32_t r; + uint32_t w; } WIFI_GCODE_BUFFER; extern volatile WIFI_STATE wifi_link_state; @@ -184,18 +179,18 @@ extern CLOUD_PARA cloud_para; extern WIFI_GCODE_BUFFER espGcodeFifo; extern uint32_t getWifiTick(); -extern uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick); +extern uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick); extern void mks_esp_wifi_init(); extern int cfg_cloud_flag; -extern int send_to_wifi(char *buf, int len); +extern int send_to_wifi(uint8_t *buf, int len); extern void wifi_looping(); -extern int raw_send_to_wifi(char *buf, int len); -extern int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len); +extern int raw_send_to_wifi(uint8_t *buf, int len); +extern int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len); extern void get_wifi_list_command_send(); extern void get_wifi_commands(); extern int readWifiBuf(int8_t *buf, int32_t len); -extern int storeRcvData(int32_t len); +extern void mks_wifi_firmware_update(); #ifdef __cplusplus } /* C-declarations for C++ */ 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 1de5571276ce..378de6d58455 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -28,6 +28,7 @@ #include "wifi_upload.h" #include "../../../../MarlinCore.h" +#include "../../../../sd/cardreader.h" #define WIFI_SET() WRITE(WIFI_RESET_PIN, HIGH); #define WIFI_RESET() WRITE(WIFI_RESET_PIN, LOW); @@ -75,7 +76,6 @@ const uint32_t ESP_UNKNOWN_ADDR = 0x40001121; // not used const uint32_t ESP_USER_DATA_RAM_ADDR = 0x3FFE8000; // &user data ram const uint32_t ESP_IRAM_ADDR = 0x40100000; // instruction RAM const uint32_t ESP_FLASH_ADDR = 0x40200000; // address of start of Flash -//const uint32_t ESP_FLASH_READ_STUB_BEGIN = IRAM_ADDR + 0x18; UPLOAD_STRUCT esp_upload; @@ -86,6 +86,7 @@ static const uint32_t defaultTimeout = 500; static const uint32_t eraseTimeout = 15000; static const uint32_t blockWriteTimeout = 200; static const uint32_t blockWriteInterval = 15; // 15ms is long enough, 10ms is mostly too short +static SdFile update_file, *update_curDir; // Messages corresponding to result codes, should make sense when followed by " error" const char *resultMessages[] = { @@ -114,23 +115,15 @@ signed char IsReady() { return esp_upload.state == upload_idle; } -void uploadPort_write(const uint8_t *buf, size_t len) { - #if 0 - int i; - - for (i = 0; i < len; i++) { - while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET) { /* nada */ } - USART_SendData(USART1, *(buf + i)); - } - #endif +void uploadPort_write(const uint8_t *buf, const size_t len) { + for (size_t i = 0; i < len; i++) + WIFISERIAL.write(*(buf + i)); } char uploadPort_read() { uint8_t retChar; - if (readUsartFifo(&WifiRxFifo, (int8_t *)&retChar, 1) == 1) - return retChar; - else - return 0; + retChar = WIFISERIAL.read(); + return _MAX(retChar, 0); } int uploadPort_available() { @@ -157,25 +150,21 @@ void flushInput() { // Extract 1-4 bytes of a value in little-endian order from a buffer beginning at a specified offset uint32_t getData(unsigned byteCnt, const uint8_t *buf, int ofst) { uint32_t val = 0; - if (buf && byteCnt) { unsigned int shiftCnt = 0; - if (byteCnt > 4) - byteCnt = 4; - do{ + NOMORE(byteCnt, 4U); + do { val |= (uint32_t)buf[ofst++] << shiftCnt; shiftCnt += 8; } while (--byteCnt); } - return(val); + return val; } // Put 1-4 bytes of a value in little-endian order into a buffer beginning at a specified offset. void putData(uint32_t val, unsigned byteCnt, uint8_t *buf, int ofst) { if (buf && byteCnt) { - if (byteCnt > 4) { - byteCnt = 4; - } + NOMORE(byteCnt, 4U); do { buf[ofst++] = (uint8_t)(val & 0xFF); val >>= 8; @@ -192,44 +181,25 @@ void putData(uint32_t val, unsigned byteCnt, uint8_t *buf, int ofst) { // -2 - a SLIP escape byte was found but the following byte wasn't available // -3 - a SLIP escape byte was followed by an invalid byte int ReadByte(uint8_t *data, signed char slipDecode) { - if (uploadPort_available() == 0) { - return(0); - } + if (uploadPort_available() == 0) return 0; - // at least one byte is available + // At least one byte is available *data = uploadPort_read(); - if (!slipDecode) { - return(1); - } - if (*data == 0xC0) { - // this shouldn't happen - return(-1); - } + if (!slipDecode) return 1; - // if not the SLIP escape, we're done - if (*data != 0xDB) { - return(1); - } + if (*data == 0xC0) return -1; // This shouldn't happen + if (*data != 0xDB) return 1; // If not the SLIP escape, we're done // SLIP escape, check availability of subsequent byte - if (uploadPort_available() == 0) { - return(-2); - } + if (uploadPort_available() == 0) return -2; // process the escaped byte *data = uploadPort_read(); - if (*data == 0xDC) { - *data = 0xC0; - return(2); - } + if (*data == 0xDC) { *data = 0xC0; return 2; } + if (*data == 0xDD) { *data = 0xDB; return 2; } - if (*data == 0xDD) { - *data = 0xDB; - return(2); - } - // invalid - return(-3); + return -3; // invalid } // When we write a sync packet, there must be no gaps between most of the characters. // So use this function, which does a block write to the UART buffer in the latest CoreNG. @@ -243,7 +213,7 @@ void WriteByteRaw(uint8_t b) { } // Write a byte to the serial port optionally SLIP encoding. Return the number of bytes actually written. -void WriteByteSlip(uint8_t b) { +void WriteByteSlip(const uint8_t b) { if (b == 0xC0) { WriteByteRaw(0xDB); WriteByteRaw(0xDC); @@ -252,9 +222,8 @@ void WriteByteSlip(uint8_t b) { WriteByteRaw(0xDB); WriteByteRaw(0xDD); } - else { + else uploadPort_write((const uint8_t *)&b, 1); - } } // Wait for a data packet to be returned. If the body of the packet is @@ -296,10 +265,10 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t EspUploadResult stat; //IWDG_ReloadCounter(); + watchdog_refresh(); - if (getWifiTickDiff(startTime, getWifiTick()) > msTimeout) { - return(timeout); - } + if (getWifiTickDiff(startTime, getWifiTick()) > msTimeout) + return timeout; if (uploadPort_available() < needBytes) { // insufficient data available @@ -311,81 +280,67 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t switch (state) { case begin: // expecting frame start c = uploadPort_read(); - if (c != (uint8_t)0xC0) { - break; - } + if (c == (uint8_t)0xC0) break; state = header; needBytes = 2; - break; case end: // expecting frame end c = uploadPort_read(); - if (c != (uint8_t)0xC0) { - return slipFrame; - } + if (c != (uint8_t)0xC0) return slipFrame; state = done; - break; case header: // reading an 8-byte header - case body: // reading the response body - { - int rslt; - // retrieve a byte with SLIP decoding - rslt = ReadByte(&c, 1); - if (rslt != 1 && rslt != 2) { - // some error occurred - stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame; - return stat; - } - else if (state == header) { - //store the header byte - hdr[hdrIdx++] = c; - if (hdrIdx >= headerLength) { - // get the body length, prepare a buffer for it - *bodyLen = (uint16_t)getData(2, hdr, 2); - - // extract the value, if requested - if (valp != 0) { - *valp = getData(4, hdr, 4); - } - - if (*bodyLen != 0) { - state = body; - } - else { - needBytes = 1; - state = end; - } - } - } - else { - // Store the response body byte, check for completion - if (bodyIdx < ARRAY_SIZE(respBuf)) { - respBuf[bodyIdx] = c; - } - ++bodyIdx; - if (bodyIdx >= *bodyLen) { + case body: { // reading the response body + int rslt; + // retrieve a byte with SLIP decoding + rslt = ReadByte(&c, 1); + if (rslt != 1 && rslt != 2) { + // some error occurred + stat = (rslt == 0 || rslt == -2) ? slipData : slipFrame; + return stat; + } + else if (state == header) { + //store the header byte + hdr[hdrIdx++] = c; + if (hdrIdx >= headerLength) { + // get the body length, prepare a buffer for it + *bodyLen = (uint16_t)getData(2, hdr, 2); + + // extract the value, if requested + if (valp) + *valp = getData(4, hdr, 4); + + if (*bodyLen != 0) + state = body; + else { needBytes = 1; state = end; } } } - break; + else { + // Store the response body byte, check for completion + if (bodyIdx < ARRAY_SIZE(respBuf)) + respBuf[bodyIdx] = c; + + if (++bodyIdx >= *bodyLen) { + needBytes = 1; + state = end; + } + } + } break; - default: // this shouldn't happen - return slipState; + default: return slipState; // this shouldn't happen } } // Extract elements from the header resp = (uint8_t)getData(1, hdr, 0); opRet = (uint8_t)getData(1, hdr, 1); + // Sync packets often provoke a response with a zero opcode instead of ESP_SYNC - if (resp != 0x01 || opRet != op) { - //printf("resp %02x %02x\n", resp, opRet); //debug - return respHeader; - } + if (resp != 0x01 || opRet != op) return respHeader; return success; } @@ -405,7 +360,6 @@ void _writePacket(const uint8_t *data, size_t len) { } else { outBuf[outIndex++] = *data; - } data++; --len; @@ -444,7 +398,6 @@ void sendCommand(uint8_t op, uint32_t checkVal, const uint8_t *data, size_t data putData(checkVal, 4, hdr, 4); // send the packet - //flushInput(); if (op == ESP_SYNC) writePacketRaw(hdr, sizeof(hdr), data, dataLen); else @@ -492,9 +445,8 @@ EspUploadResult Sync(uint16_t timeout) { for (;;) { size_t bodyLen; EspUploadResult rc = readPacket(ESP_SYNC, 0, &bodyLen, defaultTimeout); - if (rc != success || bodyLen != 2) { - break; - } + watchdog_refresh(); + if (rc != success || bodyLen != 2) break; } } //DEBUG @@ -538,7 +490,6 @@ uint16_t checksum(const uint8_t *data, uint16_t dataLen, uint16_t cksum) { } EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { - #if 0 const uint32_t blkSize = EspFlashBlockSize; int i; @@ -559,15 +510,14 @@ EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { putData(0, 4, blkBuf, hdrOfst + 12); // Get the data for the block - f_read(&esp_upload.uploadFile, blkBuf + dataOfst, blkSize, &cnt );//->Read(reinterpret_cast(blkBuf + dataOfst), blkSize); + cnt = update_file.read(blkBuf + dataOfst, blkSize); //->Read(reinterpret_cast(blkBuf + dataOfst), blkSize); if (cnt != blkSize) { - if (f_tell(&esp_upload.uploadFile) == esp_upload.fileSize) { + if (update_file.curPosition() == esp_upload.fileSize) { // partial last block, fill the remainder memset(blkBuf + dataOfst + cnt, 0xFF, blkSize - cnt); } - else { + else return fileRead; - } } // Patch the flash parameters into the first block if it is loaded at address 0 @@ -580,222 +530,136 @@ EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { // Calculate the block checksum cksum = checksum(blkBuf + dataOfst, blkSize, ESP_CHECKSUM_MAGIC); - for (i = 0; i < 3; i++) { - if ((stat = doCommand(ESP_FLASH_DATA, blkBuf, blkBufSize, cksum, 0, blockWriteTimeout)) == success) { + for (i = 0; i < 3; i++) + if ((stat = doCommand(ESP_FLASH_DATA, blkBuf, blkBufSize, cksum, 0, blockWriteTimeout)) == success) break; - } - } - - //printf("Upload %d\%\n", ftell(&esp_upload.uploadFile) * 100 / esp_upload.fileSize); - return stat; - #else - return success; - #endif } void upload_spin() { - #if 0 - switch (esp_upload.state) { - case resetting: - - if (esp_upload.connectAttemptNumber == 9) { - // Time to give up - //Network::ResetWiFi(); - esp_upload.uploadResult = connected; - esp_upload.state = done; - } - else { - - // Reset the serial port at the new baud rate. Also reset the ESP8266. - // const uint32_t baud = uploadBaudRates[esp_upload.connectAttemptNumber/esp_upload.retriesPerBaudRate]; - if (esp_upload.connectAttemptNumber % esp_upload.retriesPerBaudRate == 0) { - } - //uploadPort.begin(baud); - //uploadPort_close(); - - uploadPort_begin(); - wifi_delay(2000); - - flushInput(); - - esp_upload.lastAttemptTime = esp_upload.lastResetTime = getWifiTick(); - esp_upload.state = connecting; - } - - break; - - case connecting: - if ((getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= connectAttemptInterval) && (getWifiTickDiff(esp_upload.lastResetTime, getWifiTick()) >= 500)) { - // Attempt to establish a connection to the ESP8266. - EspUploadResult res = Sync(5000); - esp_upload.lastAttemptTime = getWifiTick(); - if (res == success) { - // Successful connection - //MessageF(" success on attempt %d\n", (connectAttemptNumber % retriesPerBaudRate) + 1); - //printf("connect success\n"); - esp_upload.state = erasing; + switch (esp_upload.state) { + case resetting: + if (esp_upload.connectAttemptNumber == 9) { + esp_upload.uploadResult = connected; + esp_upload.state = done; } else { - // This attempt failed - esp_upload.connectAttemptNumber++; - if (esp_upload.connectAttemptNumber % retriesPerReset == 0) { - esp_upload.state = resetting; // try a reset and a lower baud rate - } - } - } - break; - - case erasing: - if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= blockWriteInterval) { - uint32_t eraseSize; - const uint32_t sectorsPerBlock = 16; - const uint32_t sectorSize = 4096; - const uint32_t numSectors = (esp_upload.fileSize + sectorSize - 1)/sectorSize; - const uint32_t startSector = esp_upload.uploadAddress/sectorSize; - - uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock); - NOMORE(headSectors, numSectors); - - eraseSize = (numSectors < 2 * headSectors) - ? (numSectors + 1) / 2 * sectorSize - : (numSectors - headSectors) * sectorSize; - - //MessageF("Erasing %u bytes...\n", fileSize); - esp_upload.uploadResult = flashBegin(esp_upload.uploadAddress, eraseSize); - if (esp_upload.uploadResult == success) { - //MessageF("Uploading file...\n"); - esp_upload.uploadBlockNumber = 0; - esp_upload.uploadNextPercentToReport = percentToReportIncrement; - esp_upload.lastAttemptTime = getWifiTick(); - esp_upload.state = uploading; + uploadPort_begin(); + wifi_delay(2000); + flushInput(); + esp_upload.lastAttemptTime = esp_upload.lastResetTime = getWifiTick(); + esp_upload.state = connecting; } - else { - //MessageF("Erase failed\n"); - esp_upload.state = done; - } - } - break; - - case uploading: - // The ESP needs several milliseconds to recover from one packet before it will accept another - if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= 15) { - unsigned int percentComplete; - const uint32_t blkCnt = (esp_upload.fileSize + EspFlashBlockSize - 1) / EspFlashBlockSize; - if (esp_upload.uploadBlockNumber < blkCnt) { - esp_upload.uploadResult = flashWriteBlock(0, 0); + break; + + case connecting: + if ((getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= connectAttemptInterval) && (getWifiTickDiff(esp_upload.lastResetTime, getWifiTick()) >= 500)) { + EspUploadResult res = Sync(5000); esp_upload.lastAttemptTime = getWifiTick(); - if (esp_upload.uploadResult != success) { - //MessageF("Flash block upload failed\n"); - esp_upload.state = done; - } - percentComplete = (100 * esp_upload.uploadBlockNumber)/blkCnt; - ++esp_upload.uploadBlockNumber; - if (percentComplete >= esp_upload.uploadNextPercentToReport) { - //MessageF("%u%% complete\n", percentComplete); - esp_upload.uploadNextPercentToReport += percentToReportIncrement; + if (res == success) + esp_upload.state = erasing; + else { + esp_upload.connectAttemptNumber++; + if (esp_upload.connectAttemptNumber % retriesPerReset == 0) + esp_upload.state = resetting; } } - else { - esp_upload.state = done; - } - } - break; + break; - case done: - f_close(&esp_upload.uploadFile); - //uploadPort.end(); - //uploadPort_close(); + case erasing: + if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= blockWriteInterval) { + uint32_t eraseSize; + const uint32_t sectorsPerBlock = 16; + const uint32_t sectorSize = 4096; + const uint32_t numSectors = (esp_upload.fileSize + sectorSize - 1)/sectorSize; + const uint32_t startSector = esp_upload.uploadAddress/sectorSize; + + uint32_t headSectors = sectorsPerBlock - (startSector % sectorsPerBlock); + NOMORE(headSectors, numSectors); + + eraseSize = (numSectors < 2 * headSectors) + ? (numSectors + 1) / 2 * sectorSize + : (numSectors - headSectors) * sectorSize; + + esp_upload.uploadResult = flashBegin(esp_upload.uploadAddress, eraseSize); + if (esp_upload.uploadResult == success) { + esp_upload.uploadBlockNumber = 0; + esp_upload.uploadNextPercentToReport = percentToReportIncrement; + esp_upload.lastAttemptTime = getWifiTick(); + esp_upload.state = uploading; + } + else + esp_upload.state = done; + } + break; - //WIFI_COM.begin(115200, true); - //wifi_init(); + case uploading: + // The ESP needs several milliseconds to recover from one packet before it will accept another + if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= 15) { + unsigned int percentComplete; + const uint32_t blkCnt = (esp_upload.fileSize + EspFlashBlockSize - 1) / EspFlashBlockSize; + if (esp_upload.uploadBlockNumber < blkCnt) { + esp_upload.uploadResult = flashWriteBlock(0, 0); + esp_upload.lastAttemptTime = getWifiTick(); + if (esp_upload.uploadResult != success) + esp_upload.state = done; + percentComplete = (100 * esp_upload.uploadBlockNumber)/blkCnt; + ++esp_upload.uploadBlockNumber; + if (percentComplete >= esp_upload.uploadNextPercentToReport) + esp_upload.uploadNextPercentToReport += percentToReportIncrement; + } + else + esp_upload.state = done; + } + break; - if (esp_upload.uploadResult == success) { - //printf("upload successfully\n"); - } - else { - //printf("upload failed\n"); - } - esp_upload.state = upload_idle;//idle; - break; + case done: + update_file.close(); + esp_upload.state = upload_idle; + break; - default: - break; + default: break; } - #endif } // Try to upload the given file at the given address void SendUpdateFile(const char *file, uint32_t address) { - #if 0 - FRESULT res = f_open(&esp_upload.uploadFile, file, FA_OPEN_EXISTING | FA_READ); + const char * const fname = card.diveToFile(true, update_curDir, ESP_FIRMWARE_FILE); + if (!update_file.open(update_curDir, fname, O_READ)) return; - if (res != FR_OK) return; + esp_upload.fileSize = update_file.fileSize(); - esp_upload.fileSize = f_size(&esp_upload.uploadFile); if (esp_upload.fileSize == 0) { - f_close(&esp_upload.uploadFile); + update_file.close(); return; } - f_lseek(&esp_upload.uploadFile, 0); esp_upload.uploadAddress = address; esp_upload.connectAttemptNumber = 0; esp_upload.state = resetting; - #endif } static const uint32_t FirmwareAddress = 0x00000000, WebFilesAddress = 0x00100000; void ResetWiFiForUpload(int begin_or_end) { - #if 0 - uint32_t start, now; - - GPIO_InitTypeDef GPIO_InitStructure; - - #if V1_0_V1_1 - GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStructure.Pin = GPIO_Pin_8; - GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; - HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); - #else - GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStructure.Pin = GPIO_Pin_13; - GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; - HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); - #endif - start = getWifiTick(); - now = start; - - if (begin_or_end == 0) { - #if V1_0_V1_1 - HAL_GPIO_WritePin(GPIOA,GPIO_Pin_8,GPIO_PIN_RESET); //update mode - #else - HAL_GPIO_WritePin(GPIOC,GPIO_Pin_13,GPIO_PIN_RESET); //update mode - #endif - } - else { - #if V1_0_V1_1 - #if V1_0_V1_1 - HAL_GPIO_WritePin(GPIOA,GPIO_Pin_8,GPIO_PIN_SET); //boot mode - GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStructure.Pin = GPIO_Pin_8; - GPIO_InitStructure.Mode = GPIO_MODE_INPUT; - HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); - #endif - #else - HAL_GPIO_WritePin(GPIOC,GPIO_Pin_13,GPIO_PIN_SET); //boot mode - GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStructure.Pin = GPIO_Pin_13; - GPIO_InitStructure.Mode = GPIO_MODE_INPUT; - HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); - #endif - } - WIFI_RESET(); - while (getWifiTickDiff(start, now) < 500) now = getWifiTick(); - WIFI_SET(); - #endif + //#if 0 + uint32_t start, now; + + start = getWifiTick(); + now = start; + + if (begin_or_end == 0) { + SET_OUTPUT(WIFI_IO0_PIN); + WRITE(WIFI_IO0_PIN, LOW); + } + else + SET_INPUT_PULLUP(WIFI_IO0_PIN); + + WIFI_RESET(); + while (getWifiTickDiff(start, now) < 500) now = getWifiTick(); + WIFI_SET(); + //#endif } int32_t wifi_upload(int type) { @@ -803,18 +667,16 @@ int32_t wifi_upload(int type) { ResetWiFiForUpload(0); - if (type == 0) - SendUpdateFile(ESP_FIRMWARE_FILE, FirmwareAddress); - else if (type == 1) - SendUpdateFile(ESP_WEB_FIRMWARE_FILE, FirmwareAddress); - else if (type == 2) - SendUpdateFile(ESP_WEB_FILE, WebFilesAddress); - else - return -1; + switch (type) { + case 0: SendUpdateFile(ESP_FIRMWARE_FILE, FirmwareAddress); break; + case 1: SendUpdateFile(ESP_WEB_FIRMWARE_FILE, FirmwareAddress); break; + case 2: SendUpdateFile(ESP_WEB_FILE, WebFilesAddress); break; + default: return -1; + } while (esp_upload.state != upload_idle) { upload_spin(); - //IWDG_ReloadCounter(); + watchdog_refresh(); } ResetWiFiForUpload(1); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h index d942a2c84f80..ff98173b9555 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h @@ -25,9 +25,10 @@ extern "C" { /* C-declarations for C++ */ #endif -#define ESP_FIRMWARE_FILE "1:/MksWifi.bin" -#define ESP_WEB_FIRMWARE_FILE "1:/MksWifi_Web.bin" -#define ESP_WEB_FILE "1:/MksWifi_WebView.bin" +#define ESP_FIRMWARE_FILE "MksWifi.bin" +#define ESP_FIRMWARE_FILE_RENAME "MKSWIFI.CUR" +#define ESP_WEB_FIRMWARE_FILE "1:/MksWifi_Web.bin" +#define ESP_WEB_FILE "1:/MksWifi_WebView.bin" typedef enum { upload_idle, @@ -52,7 +53,6 @@ typedef enum { } EspUploadResult; typedef struct { - //FIL uploadFile; uint32_t fileSize; uint32_t uploadAddress; 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.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 1583db41e90b..18689fe36d6e 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 @@ -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 @@ -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; @@ -889,9 +885,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() { @@ -947,6 +943,10 @@ namespace ExtUI { feedrate_percentage = constrain(value, 10, 500); } + bool awaitingUserConfirm() { + return wait_for_user; + } + void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } @@ -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/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index c429a0aadee9..478fe689092d 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); @@ -140,6 +151,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); } @@ -185,6 +197,7 @@ namespace ExtUI { void setTravelAcceleration_mm_s2(const float); void setFeedrate_percent(const float); void setFlow_percent(const int16_t, const extruder_t); + bool awaitingUserConfirm(); void setUserConfirmed(); #if ENABLED(LIN_ADVANCE) @@ -344,11 +357,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 *); 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..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í"); @@ -241,7 +237,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..68791d9eaa16 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"); @@ -234,7 +230,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"); @@ -271,16 +267,6 @@ namespace Language_de { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge. Falscher Extruder"); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge. Temperatur zu hoch."); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Auswählen"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Auswählen *"); PROGMEM Language_Str MSG_ACC = _UxGT("Beschleunigung"); 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 af0903b91612..b17e81d831db 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -107,16 +107,19 @@ 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_LASER_PULSE_MS = _UxGT("Test Pulse ms"); + PROGMEM Language_Str MSG_LASER_FIRE_PULSE = _UxGT("Fire Pulse"); + 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"); @@ -125,6 +128,10 @@ 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_LEVEL_CORNERS_GOOD_POINTS = _UxGT("Good Points: "); + PROGMEM Language_Str MSG_LEVEL_CORNERS_LAST_Z = _UxGT("Last Z: "); 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"); @@ -254,7 +261,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"); @@ -379,11 +386,13 @@ 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"); 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 ="); @@ -428,9 +437,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"); @@ -678,14 +687,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 1ec1e3dbda1a..58559a4ff507 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"); @@ -236,7 +232,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"); @@ -269,16 +265,6 @@ namespace Language_es { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Apg"); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Auto-ajuste"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Auto-ajuste *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Seleccionar"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleccionar *"); PROGMEM Language_Str MSG_ACC = _UxGT("Aceleración"); 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..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"); @@ -225,7 +231,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"); @@ -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"); } diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 5b0da33649c9..d0ec16b35f82 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"); @@ -233,7 +229,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"); @@ -270,16 +266,6 @@ namespace Language_gl { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida. Extrusor danado."); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida. Temperatura moi alta."); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida. Tempo excedido."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Escolla"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Escolla *"); PROGMEM Language_Str MSG_ACC = _UxGT("Acel"); 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..523f9c1c69de 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"); @@ -235,7 +231,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"); @@ -272,16 +268,6 @@ namespace Language_hu { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba. Rossz Adagoló."); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba. Magas hömérséklet."); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Kiválaszt"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Kiválaszt *"); PROGMEM Language_Str MSG_ACC = _UxGT("Gyorsítás"); @@ -375,8 +361,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 +408,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 +425,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 +571,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...")); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 6a10afec07d5..5bfb6aa9aa22 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"); @@ -71,10 +71,9 @@ 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"); + 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"); @@ -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 " ~"; @@ -102,16 +105,19 @@ namespace Language_it { #endif PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); 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_LASER_POWER = _UxGT("Potenza laser"); PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potenza mandrino"); + PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Alterna Laser"); + PROGMEM Language_Str MSG_LASER_PULSE_MS = _UxGT("ms impulso di test"); + PROGMEM Language_Str MSG_LASER_FIRE_PULSE = _UxGT("Spara impulso"); + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Alterna mandrino"); + PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Mandrino in avanti"); PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverti mandrino"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Accendi aliment."); PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Spegni aliment."); PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Estrudi"); @@ -119,8 +125,12 @@ 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_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_LEVEL_CORNERS_GOOD_POINTS = _UxGT("Punti buoni: "); + PROGMEM Language_Str MSG_LEVEL_CORNERS_LAST_Z = _UxGT("Ultimo Z: "); + 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"); @@ -129,7 +139,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 +149,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"); @@ -250,10 +261,13 @@ 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"); + 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"); @@ -287,16 +301,6 @@ namespace Language_it { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita. Estrusore errato."); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita. Temperatura troppo alta."); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Seleziona"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleziona *"); PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); @@ -372,11 +376,13 @@ 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"); PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Host Avvio"); PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Arresta stampa"); + PROGMEM Language_Str MSG_END_LOOPS = _UxGT("Fine cicli di rip."); PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Stampa Oggetto"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancella Oggetto"); PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto ="); @@ -441,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"); @@ -554,14 +560,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. ..."); @@ -638,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:"); @@ -661,6 +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_SOUND = _UxGT("Suono"); + 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("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_CALIBRATION_COMPLETED = _UxGT("Calibrazione completata"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Calibrazione fallita"); } 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..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"); @@ -230,7 +226,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..60b0c550564f 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"); @@ -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 05fc639f8395..4ddf424b3d67 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"); @@ -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 c2e50fc69807..bd7e1b7a64b0 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"); @@ -232,7 +228,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"); @@ -269,16 +265,6 @@ namespace Language_ro { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder."); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high."); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Select"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Select *"); PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 0be6cb5eb3bd..b3176c0a5443 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,18 +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_OFF = _UxGT("Выключить лазер"); - PROGMEM Language_Str MSG_LASER_ON = _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_OFF = _UxGT("Выключить шпиндель"); - PROGMEM Language_Str MSG_SPINDLE_ON = _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("Экструзия"); @@ -136,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"); @@ -165,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("Температура стола"); @@ -253,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.Строить холодную"); @@ -275,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("Уровень зелёного"); @@ -290,7 +306,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мм"); @@ -418,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("Завершить объект"); @@ -523,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"); @@ -543,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"); @@ -664,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 @@ -672,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("Сменить градиент"); @@ -683,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_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("Актив.В-инструм."); @@ -692,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"); @@ -706,11 +728,26 @@ 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("Плохая скор.стран."); + #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_BAD_PAGE = _UxGT("Полохая страница"); - PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Полохая скор.стран."); + 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("Парковка...")); // @@ -742,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("Сброс"); @@ -763,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_sk.h b/Marlin/src/lcd/language/language_sk.h index 2e05ee45132f..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"); @@ -247,7 +243,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"); @@ -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_sv.h b/Marlin/src/lcd/language/language_sv.h new file mode 100644 index 000000000000..722443fb21c1 --- /dev/null +++ b/Marlin/src/lcd/language/language_sv.h @@ -0,0 +1,681 @@ +/** + * 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 för more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Swedish + * + * LCD Menu Messages + * See also https://marlinfw.org/docs/development/lcd_language.html + */ + +#define DISPLAY_CHARSET_ISO10646_1 + +namespace Language_sv { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Swedish"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Redo."); + PROGMEM Language_Str MSG_MARLIN = _UxGT("Marlin"); + PROGMEM Language_Str MSG_YES = _UxGT("JA"); + PROGMEM Language_Str MSG_NO = _UxGT("NEJ"); + PROGMEM Language_Str MSG_BACK = _UxGT("Bakåt"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Avbryter..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Instatt"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Borttaget"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Väntar på media"); + PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("SD init misslyckades"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Media läsningsfel"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB enhet borttagen"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start misslyckad"); + PROGMEM Language_Str MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Underanrop överskriden"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Slutstop"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Mjuk slutstopp"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Huvud"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Advancerade inställningar"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguration"); + PROGMEM Language_Str MSG_RUN_AUTO_FILES = _UxGT("Autostarta Filer"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Inaktivera Stegare"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Meny"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Framstegsindikator Test"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Hem"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Hem X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Hem Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Hem Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Justering"); + PROGMEM Language_Str MSG_ITERATION = _UxGT("G34 Iteration: %i"); + PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Noggrannhet Minskar!"); + PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Noggrannhet uppnådd"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Hemning XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klicka för att börja"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Nästa Punkt"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivellering Färdig!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Falna Höjd"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Sätt Hem Offset"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset Tillämpad"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Sätt Origo"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assisterad justering"); + PROGMEM Language_Str MSG_TRAMMING_WIZARD = _UxGT("Justerings Wizard"); + PROGMEM Language_Str MSG_SELECT_ORIGIN = _UxGT("Välj Origo"); + PROGMEM Language_Str MSG_LAST_VALUE_SP = _UxGT("Senaste värde "); + + #if PREHEAT_COUNT + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Förvärmning ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Förvärmning ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Förvärmning ") PREHEAT_1_LABEL _UxGT(" Stoppa"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Förvärmning ") PREHEAT_1_LABEL _UxGT(" Stoppa ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Förvärmning ") PREHEAT_1_LABEL _UxGT(" Alla"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Förvärmning ") PREHEAT_1_LABEL _UxGT(" Bädd"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Förvärmning ") PREHEAT_1_LABEL _UxGT(" Konf"); + + PROGMEM Language_Str MSG_PREHEAT_M = _UxGT("Förvärmning $"); + PROGMEM Language_Str MSG_PREHEAT_M_H = _UxGT("Förvärmning $ ~"); + PROGMEM Language_Str MSG_PREHEAT_M_END = _UxGT("Förvärmning $ Stoppa"); + PROGMEM Language_Str MSG_PREHEAT_M_END_E = _UxGT("Förvärmning $ Stoppa ~"); + PROGMEM Language_Str MSG_PREHEAT_M_ALL = _UxGT("Förvärmning $ Alla"); + PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Förvärmning $ Bädd"); + PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Förvärmning $ Donf"); + #endif + + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Förvärmning Anpassad"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Nedkylning"); + PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frekvens"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser kontroll"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindel Kontroll"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Styrka"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindel Styrka"); + PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Växla Laser"); + PROGMEM Language_Str MSG_LASER_PULSE_MS = _UxGT("Test Puls ms"); + PROGMEM Language_Str MSG_LASER_FIRE_PULSE = _UxGT("Avfyra Puls"); + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Växla Spindel"); + PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Spindel Framåt"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindel Bakåt"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Av"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser På"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindel Av"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindel På"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Sätt på ström"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Stäng av ström"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudera"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Dra tillbaka"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Flytta Axel"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bädd Nivellering"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivellera Bädd"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivellera Hörn"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Höj Bädd tills nästa Sond Triggad"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Alla Hörn inom Tolerans. Nivellering Bädd"); + PROGMEM Language_Str MSG_LEVEL_CORNERS_GOOD_POINTS = _UxGT("Bra Punkter: "); + PROGMEM Language_Str MSG_LEVEL_CORNERS_LAST_Z = _UxGT("Senaste Z: "); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Nästa Hörn"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Nät Redigerare"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Redigera Nät"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Nätredigering Stoppad"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Sonderingspunkt"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z Värde"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Anpassade Kommandon"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Sond Test"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punkt"); + PROGMEM Language_Str MSG_M48_OUT_OF_BOUNDS = _UxGT("Sond utan för gränser"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Avvikelse"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Läge"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Verktygsoffset"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Parkera"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicering"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Speglad Kopia"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Kontroll"); + PROGMEM Language_Str MSG_IDEX_DUPE_GAP = _UxGT("Duplicera X-Avstånd"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2:a Munstycke X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2:a Munstycke Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2:a Munstycke Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Utför G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Verktyg"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Enad Bädd Nivellering (UBL)"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Lutningspunkt"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manuellt skapa nät"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Placera Shim & Mät"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Mät"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Ta bort & Mät bädd"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Flyttar till nästa"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktivera UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Avaktivera UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Bädd Temp"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bädd Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Hetände Temp"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hetände Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Nät Redigera"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Redigera Anpassat Nät"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Finjustera Nät"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Färdig Redigera Nät"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Bygg Anpassat Nät"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Bygg Nät"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Bygg Nät ($)"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Bygg Kallt Nät"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Justera Nät Höjd"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Höjd Antal"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validera Nät"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Validera Nät ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validera Anpassat Nät"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Värma Bädd"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Värma Munstycke"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Manuel grundning..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Fastlängd Grundning"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Färdig Grundning"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Avbruten"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Nivellera G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Fortsätt Bädd Nät"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nät Nivellering"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Punkts Nivellering"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Rutnät Nivellering"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivellera Nät"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Sidopunkter"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Kart Typ"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Utmatning Nät Map"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Utmatning för Värd"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Utmatning för CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Utanför skrivare Backup"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Utmatning UBL Info"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Ifyllnad Mängd"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manuell Ifyllnad"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Smart Ifyllnad"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Ifyllnad Nät"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Ogiltigförklara Alla"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Ogiltigförklara Närmast"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Finjustera Alla"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Finjustera Närmast"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Nät Lagra"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Minnesöppning"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Ladda Bädd Nät"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Spara Bädd Nät"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("Nät %i Ladda"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("Nät %i Sparad"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Ingen Lagring"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Fel: UBL Sparad"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Fel: UBL Återställd"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Stoppad"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Steg-för-Steg UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Bygg Kallt Nät"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Smart Ifyllnad"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Validera Nät"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Finjustera Alla"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Validera Nät"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Finjustera Alla"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Spara Bädd Nät"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Kontroll"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Ljus"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Ljus Förinställd"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Röd"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Gul"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Grön"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blå"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violet"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Vitt"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Standard"); + PROGMEM Language_Str MSG_LED_CHANNEL_N = _UxGT("Kanal ="); + PROGMEM Language_Str MSG_LEDS2 = _UxGT("Ljus #2"); + PROGMEM Language_Str MSG_NEO2_PRESETS = _UxGT("Ljus #2 Förinställd"); + PROGMEM Language_Str MSG_NEO2_BRIGHTNESS = _UxGT("Ljusstyrka"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Anpassat Ljus"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Rör Intensitet"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Grön Intensitet"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Blå Intensitet"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Vit Intensitet"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brightness"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Flyttar..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Fri XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Flytta X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Flytta Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Flytta Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hetände för kall"); + PROGMEM Language_Str MSG_MOVE_N_MM = _UxGT("Flytta %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Flytta 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Flytta 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Flytta 10mm"); + PROGMEM Language_Str MSG_MOVE_0001IN = _UxGT("Flytta 0.001tum"); + PROGMEM Language_Str MSG_MOVE_001IN = _UxGT("Flytta 0.01tum"); + PROGMEM Language_Str MSG_MOVE_01IN = _UxGT("Flytta 0.1tum"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Hastighet"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bädd Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Munstycke"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Munstycke ~"); + PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Munstycke Parkerad"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Munstycke Standby"); + PROGMEM Language_Str MSG_BED = _UxGT("Bädd"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Inkapsling"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fläkt Hastighet"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fläkt Hastighet ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Lagrad Fläkt ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra Fläkt Hastighet"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fläkt Hastighet ~"); + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Kontroller Fläkt"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Overksam Hastighet"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Auto läga"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Aktive Hastighet"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Overksam Period"); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flöde"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flöde ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontroll"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("På"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Av"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autojustera"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autojustera *"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); + PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad. Dålig extruder."); + PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad. Temperatur för hög."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); + PROGMEM Language_Str MSG_SELECT = _UxGT("Välj"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Välj *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); + PROGMEM Language_Str MSG_JERK = _UxGT("Ryck"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-Ryck"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-Ryck"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-Ryck"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-Ryck"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Knutpunkt Avv"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Hastighet"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VTrav Min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Acceleration"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-Dra tillbaka"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-Färdas"); + PROGMEM Language_Str MSG_XY_FREQUENCY_LIMIT = _UxGT("Frekvens max"); + PROGMEM Language_Str MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Flöde min"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Steg/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" Steg/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" Steg/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" Steg/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E Steg/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* Steg/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Rörelse"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Tråd"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E i mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT = _UxGT("E Gräns i mm³"); + PROGMEM Language_Str MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Gräns *"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Tråd Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Tråd Dia. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Lossa mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Ladda mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advancera K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advancera K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Kontrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Spara Inställningar"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Ladda Inställningar"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Återställ Standard"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initiera EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("EEPROM CRC Fel"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("EEPROM Index Fel"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("EEPROM Version Fel"); + PROGMEM Language_Str MSG_SETTINGS_STORED = _UxGT("Inställningar Lagrad"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Media Uppdatera"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Återställ Skrivare"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Uppdatera"); + PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info Skärm"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Förbered"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Justera"); + PROGMEM Language_Str MSG_POWER_MONITOR = _UxGT("Ström övervakning"); + PROGMEM Language_Str MSG_CURRENT = _UxGT("Ström"); + PROGMEM Language_Str MSG_VOLTAGE = _UxGT("Spänning"); + PROGMEM Language_Str MSG_POWER = _UxGT("Ström"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start Utskrift"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Nästa"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Initiera"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stoppa"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Skriv"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Återställa"); + PROGMEM Language_Str MSG_BUTTON_IGNORE = _UxGT("Ignorera"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Avbryt"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Färdig"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Bakåt"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Fortsätt"); + PROGMEM Language_Str MSG_BUTTON_SKIP = _UxGT("Hoppa över"); + PROGMEM Language_Str MSG_PAUSING = _UxGT("Paus.."); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausera Utskrift"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Återuppta Utskrift"); + PROGMEM Language_Str MSG_HOST_START_PRINT = _UxGT("Värd Start"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stoppa Utskrift"); + PROGMEM Language_Str MSG_END_LOOPS = _UxGT("Slut Upprepningsloop"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Skriver Objekt"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Avbryt Objekt"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Avbryt Objekt ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Ström Avbrott"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Skriv fråm Media"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Inget Media"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Sov..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Klick för att återuppta..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Utskrift Pausad"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Skriver..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Utskrift Avbruten"); + PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Utskrift Färdig"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Ingen Flytt."); + PROGMEM Language_Str MSG_KILLED = _UxGT("DÖDAD. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPAD. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Dra tillbaka mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Byt Dra.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Dra tillbaka V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hoppa mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Åter dra tillbaka. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Byt åter dra t. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Återdrat. V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Byt åter dra. V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto-Dra-tillbka"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Byt Längd"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Byt Extra"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Rensa Längd"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Byt verktyg"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Höj"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Grund Hastighet"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Återgå Hastighet"); + PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Parkera Huvud"); + PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Återgår Hastighet"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Fläkt Hastighet"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Fläkt Tid"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Auto PÅ"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Auto AV"); + PROGMEM Language_Str MSG_TOOL_MIGRATION = _UxGT("Verktyg Migration"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_AUTO = _UxGT("Auto-migration"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_END = _UxGT("Senast Extruder"); + PROGMEM Language_Str MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrera till *"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Byt Tråd"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Byt Tråd *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Ladda Tråd"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Ladda *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Lossa Tråd"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Lossa *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Lossa All"); + PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Bifoga Media"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Byt Media"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Släpp Media"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z Sond Utanför Bädd"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Skev Faktor"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Själv-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Återställ"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Stuva undan"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Fällut"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW-Läge"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("5V-Läge"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("OD-Läge"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Läge-Lägring"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Sätt BLTouch to 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Sätt BLTouch to OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Reportera Dränering"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("FARA: Dålig inställningar kan orsaka skada! Fortsätt ändå?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Initiera TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Test"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Spara"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Fällut TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Fällut Z-Sond"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Stuva undan Z-Sond"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Hem %s%s%s Först"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Sond Offsets"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("Sond X Offset"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Sond Y Offset"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Sond Z Offset"); + PROGMEM Language_Str MSG_MOVE_NOZZLE_TO_BED = _UxGT("Flytta Munstycke till Bädd"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Småsteg X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Småsteg Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Småsteg Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Slutstopp Avbrott"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Värma Misslyckad"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Fel: REDUNDANT TEMP"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TERMISK ÖVERDRIFT"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("BÄDD TERMISK ÖVERDRIFT"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMMARE T. ÖVERDRIFT"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Fel: MAXTEMP"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Fel: MINTEMP"); + PROGMEM Language_Str MSG_HALTED = _UxGT("Utskrift stoppad"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Snälla Återställ"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("t"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Värmer..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Kyler..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bädd Värmer..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Bädd Kyler..."); + PROGMEM Language_Str MSG_PROBE_HEATING = _UxGT("Sond Värmer..."); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Sond Kyler..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Kammare Värmer..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Kammare Kyler..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrering"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrera X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrera Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrera Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrera Center"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Inställningar"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibrering"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Sätt Delta Höjd"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Sond Z-offset"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Höjd"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Om Skrivaren"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Skrivare Info"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Punkt Nivellering"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Linjär Nivellering"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilinjär Nivellering"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Enhetlig Bädd Nivellering (UBL)"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nät Nivellering"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Skrivar Stats"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Kort Info"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistor"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruderare"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoll"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Överdrift Övervakning: AV"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Överdrift Övervakning: PÅ"); + PROGMEM Language_Str MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Hetände Overksam Tidsgräns"); + + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Lådljus"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Ljus ljusstyrka"); + PROGMEM Language_Str MSG_KILL_EXPECTED_PRINTER = _UxGT("INKORREKT SKRIVARE"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Utskriftsantal"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Färdiga"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total Utskriftstid"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längsta Jobbtid"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruderade Totalt"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Utskrift"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Färdig"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längsta"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruderad"); + #endif + + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Driv Styrka"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC KOPPLNINGSFEL"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("TRÅDBYTE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("UTSKRIFTSPAUSERAD"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("LADDA TRÅD"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("LOSSA TRÅD"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ÅTERGÅ VAÖ:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Rensa mer"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Fortsätt"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Munstycke: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Utskjut Sensor"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Utskjut Dist mm"); + PROGMEM Language_Str MSG_KILL_HOMING_FAILED = _UxGT("Hemning Misslyckad"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondering Misslyckad"); + + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("VÄLJ TRÅD"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Uppdatera MMU Firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Behöver uppmärksamhet."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("MMU Återuppta"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU Återupptas..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU Ladda"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU Ladda Alla"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Ladda till Munstycke"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU Mata ut"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU Mata ut ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU Lossa"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Ladda Tråd %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Mata ut Tråd ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Lossa Tråd..."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Alla"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Tråd ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Återställ MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU Återställer..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Ta bort, Klicka"); + + PROGMEM Language_Str MSG_MIX = _UxGT("Mixa"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponent ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixer"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Full Gradient"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Växla Mix"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Totera Mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Omvänd Gradient"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktive V-verktyg"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Start V-verktyg"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Slut V-verktyg"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-verktyg"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Återställ V-verktyg"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Kommitta V-verktyg Mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-verktyg blev Återställda"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Start Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Slut Z:"); + + PROGMEM Language_Str MSG_GAMES = _UxGT("Spel"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Labyrint"); + + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Dålig sida index"); + PROGMEM Language_Str MSG_BAD_PAGE_SPEED = _UxGT("Dålig sida hastighet"); + + PROGMEM Language_Str MSG_EDIT_PASSWORD = _UxGT("Redigera Lösenord"); + PROGMEM Language_Str MSG_LOGIN_REQUIRED = _UxGT("Login Krävs"); + PROGMEM Language_Str MSG_PASSWORD_SETTINGS = _UxGT("Lösenordsinställningar"); + PROGMEM Language_Str MSG_ENTER_DIGIT = _UxGT("Ange Siffra"); + PROGMEM Language_Str MSG_CHANGE_PASSWORD = _UxGT("Sätt/Redigera Lösenord"); + PROGMEM Language_Str MSG_REMOVE_PASSWORD = _UxGT("Ta bort Lösenord"); + PROGMEM Language_Str MSG_PASSWORD_SET = _UxGT("Lösenord är "); + PROGMEM Language_Str MSG_START_OVER = _UxGT("Börja om"); + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Kom ihåg att Spara!"); + PROGMEM Language_Str MSG_PASSWORD_REMOVED = _UxGT("Lösenord Bort taget"); + + // + // Filament Change screens show up to 3 lines on a 4-line display + // ...or up to 2 lines on a 3-line display + // + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Tryck på knappen", "för att fortsätta utskrift")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parkera...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Vänta på", "trådbyte", "att börja")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Sätt in tråd", "och tryck på knappen", "för att fortsätta")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Tryck på knappen", "för att värma munstycke")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Munstycke värms", "Var snäll och vänta...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Väntar på", "trådlossning")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Väntar på", "trådladdning")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Väntar på", "tråd utrensning")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Klicka för att slutföra", "tråd utrensning")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Väntar på utskrift", "att återstarta...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Klick för att fortsätta")); + PROGMEM Language_Str MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Parkera...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Vänta...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Sätt in och klicka")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Klicka för att värma")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Värmer...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Lossar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Laddar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Rensar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Klicka för att slutföra")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Återgår...")); + #endif + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Drivers"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver Ström"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid Tröskelvärde"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorlös Hemning"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stegningsläge"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Smyghack Aktiverad"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Återställ"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" in:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Backlash"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korrigering"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Glättning"); + + PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Nivå X Axel"); + PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Auto Kalibrera"); + #if ENABLED(TOUCH_UI_FTDI_EVE) + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Overksam tidsgräns, temperatur minskning. Tryck ok för att återvärma och igen för att fortsätta."); + #else + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Värmare Tidsgräns"); + #endif + PROGMEM Language_Str MSG_REHEAT = _UxGT("Återvärm"); + PROGMEM Language_Str MSG_REHEATING = _UxGT("Återvärmning..."); + + PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Z Sond Wizard"); + PROGMEM Language_Str MSG_PROBE_WIZARD_PROBING = _UxGT("Sondering Z Referens"); + PROGMEM Language_Str MSG_PROBE_WIZARD_MOVING = _UxGT("Flyttar till Sonderings Pos"); + + PROGMEM Language_Str MSG_SOUND = _UxGT("Ljud"); + + PROGMEM Language_Str MSG_TOP_LEFT = _UxGT("Uppe Vänster"); + PROGMEM Language_Str MSG_BOTTOM_LEFT = _UxGT("Nere Vänster"); + PROGMEM Language_Str MSG_TOP_RIGHT = _UxGT("Uppe Höger"); + PROGMEM Language_Str MSG_BOTTOM_RIGHT = _UxGT("Nere Höger"); + PROGMEM Language_Str MSG_CALIBRATION_COMPLETED = _UxGT("Kalibrering Färdig"); + PROGMEM Language_Str MSG_CALIBRATION_FAILED = _UxGT("Kalibrering Misslyckad"); +} diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 307abf118a8c..a7a4056c0b2b 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ç"); @@ -235,7 +231,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"); @@ -261,16 +257,6 @@ namespace Language_tr { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Kapalı"); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Kalibrasyon"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Kalibrasyon *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Seç"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seç *"); PROGMEM Language_Str MSG_ACC = _UxGT("İvme"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 71b4cd018d7d..069ad7066df1 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 диску"); @@ -61,12 +66,15 @@ namespace Language_uk { 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"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест лінії прогр."); PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Авто паркування"); PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Паркування X"); 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("Наступна точка"); @@ -75,10 +83,10 @@ namespace Language_uk { #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Встанов. зміщення дому"); #else - PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Встанов.зміщ.дому"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Встанов. зміщ. дому"); #endif PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); - PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Встановити ноль"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Встановити нуль"); #if PREHEAT_COUNT PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Нагрів ") PREHEAT_1_LABEL; PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Нагрів ") PREHEAT_1_LABEL " ~"; @@ -96,12 +104,10 @@ namespace Language_uk { PROGMEM Language_Str MSG_PREHEAT_M_BEDONLY = _UxGT("Нагрів $ стіл"); PROGMEM Language_Str MSG_PREHEAT_M_SETTINGS = _UxGT("Нагрів $ налашт"); #endif - PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Нагрів Свій"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Нагрів свого"); 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,14 +115,16 @@ 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("Увімкнути шпіндель"); + PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Перемкнути шпіндель"); + PROGMEM Language_Str MSG_LASER_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_REVERSE = _UxGT("Напрямок шпінделя"); + 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("Екструзія"); @@ -125,6 +133,12 @@ namespace Language_uk { PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Вирівнювання столу"); PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Вирівняти стіл"); PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Вирівняти кути"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Вгору до спрацювання зонду"); // not sure about this one + #else + PROGMEM Language_Str MSG_LEVEL_CORNERS_RAISE = _UxGT("Вгору до спрацюв. зонду"); + #endif + PROGMEM Language_Str MSG_LEVEL_CORNERS_IN_RANGE = _UxGT("Кути в межах. Вирівнювання столу"); // Too long? PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Наступний кут"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Зміщення по Z"); @@ -138,15 +152,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_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_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"); @@ -154,7 +173,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Виконується G29"); PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Інструменти UBL"); PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Налаштування UBL"); - PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Точка розвороту"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Точка нахилу"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ручне введення сітки"); PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Розмістити шайбу і вимір."); @@ -163,15 +182,15 @@ namespace Language_uk { PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Розм. шайбу і вимір."); #endif PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Вимірювання"); - PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Видалити і виміряти"); - PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("До наступної точки"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Видалити і виміряти стіл"); + 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"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура столу"); - PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура столу"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура свого столу"); PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); - PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Температура свого сопла"); PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редагувати свою сітку"); PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Точне редагування сітки"); PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Будувати свою сітку"); @@ -188,20 +207,21 @@ namespace Language_uk { PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Сітка побудована"); PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Будувати сітку"); #if PREHEAT_COUNT - PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Будувати сітку $"); - PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Підтвердити $"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M = _UxGT("Будувати сітку ($)"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M = _UxGT("Підтвердити ($)"); #endif PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Буд. холодну сітку"); PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Встан.висоту сітки"); PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Висота"); PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Підтвердити сітку"); PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Підтвердити свою"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 нагрів столу"); PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 нагрів сопла"); PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Ручне грунтування"); - PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Грунт фікс. довж."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Фікс. довж. грунт."); // ґ is not supported PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Грунтув. виконане"); - PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 завершена"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 скасовано"); PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Вийти з G26"); PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Продовжити сітку"); PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Вирівнювання сітки"); @@ -229,7 +249,11 @@ namespace Language_uk { PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Заповнити сітку"); PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Анулювати все"); PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Анулювати найближчу"); - PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Точно налашт. все"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Точно налаштувати все"); + #else + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Точно налашт. все"); + #endif #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Точно налашт.найближчу"); #else @@ -247,7 +271,7 @@ namespace Language_uk { 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.Будувати холодну"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Збудувати холодну"); PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Розумне заповн-я"); PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Затвердити сітку"); PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Точно налашт.все"); @@ -263,7 +287,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Передустан. світла"); #endif PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Червоний"); - PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Оранжевий"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Помаранчевий"); PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Жовтий"); PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Зелений"); PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Синій"); @@ -271,14 +295,22 @@ 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_CUSTOM_LEDS = _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("Рівень зеленого"); PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Рівень синього"); PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Рівень білого"); PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Яскравість"); - PROGMEM Language_Str MSG_MOVING = _UxGT("Переміщення..."); + PROGMEM Language_Str MSG_MOVING = _UxGT("Рух..."); PROGMEM Language_Str MSG_FREE_XY = _UxGT("Звільнити XY"); PROGMEM Language_Str MSG_MOVE_X = _UxGT("Рух по X"); PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Рух по Y"); @@ -286,34 +318,32 @@ 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_01MM = _UxGT("Рух по 0.1мм"); - PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Рух по 1мм"); - PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Рух по 10мм"); + 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мм"); PROGMEM Language_Str MSG_SPEED = _UxGT("Швидкість"); PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Столу"); PROGMEM Language_Str MSG_NOZZLE = _UxGT("Сопло, ") LCD_STR_DEGREE "C"; PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); PROGMEM Language_Str MSG_NOZZLE_PARKED = _UxGT("Сопло запарковане"); - PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Сопло очикує"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Сопло очікує"); PROGMEM Language_Str MSG_BED = _UxGT("Стіл, ") LCD_STR_DEGREE "C"; PROGMEM Language_Str MSG_CHAMBER = _UxGT("Камера,") LCD_STR_DEGREE "C"; - PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Охолодження"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодження ~"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Швидк. вент."); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Швидк. вент. ~"); #if LCD_WIDTH > 21 - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збережене охолодж. ~"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Додаткове охолодж."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Додаткове охолодж. ~"); - PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Контролер охолодження"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збереж. швидк. вент. ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Дод. швидк. вент. ~"); #else - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збереж.охолодж. ~"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Додат. охолодж."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Додат.охолодж ~"); - PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Контролер охолодж."); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Збереж. вент. ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Додат.вент. ~"); #endif + PROGMEM Language_Str MSG_CONTROLLER_FAN = _UxGT("Вент. контролера"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Дод. швидк. вент."); PROGMEM Language_Str MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Холості оберти"); - PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Робочі оберти"); PROGMEM Language_Str MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Авто-режим"); + PROGMEM Language_Str MSG_CONTROLLER_FAN_SPEED = _UxGT("Робочі оберти"); PROGMEM Language_Str MSG_CONTROLLER_FAN_DURATION = _UxGT("Період простою"); PROGMEM Language_Str MSG_FLOW = _UxGT("Потік"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Потік ~"); @@ -330,7 +360,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_PID_AUTOTUNE_DONE = _UxGT("Підбір PID виконано"); PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору. Поганий екструдер."); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору. Температура завищена."); - PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Завершення часу."); + PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); PROGMEM Language_Str MSG_SELECT = _UxGT("Вибрати"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Вибрати *"); @@ -372,7 +402,7 @@ 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 в мм") SUPERSCRIPT_THREE; + 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("Діам. прутка"); @@ -416,18 +446,21 @@ 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_END_LOOPS = _UxGT("End Repeat Loops"); // needs translation PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Друк об'єкта"); PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Завершити об'єкт"); PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Завершити об'єкт ="); PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Віднов. після збою"); PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Друкувати з SD"); PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD-картки немає"); - PROGMEM Language_Str MSG_DWELL = _UxGT("Сплячка..."); + PROGMEM Language_Str MSG_DWELL = _UxGT("Сон..."); PROGMEM Language_Str MSG_USERWAIT = _UxGT("Продовжити..."); PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Друк призупинено"); PROGMEM Language_Str MSG_PRINTING = _UxGT("Друк..."); @@ -439,6 +472,8 @@ namespace Language_uk { #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягування, мм"); PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Зміна втягув.,мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ретракт V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Стрибок, мм"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Повернення, мм"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Поверн.зміни, мм"); PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автовтягування"); @@ -453,8 +488,8 @@ namespace Language_uk { PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Підскок, мм"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Повернення V"); PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Поверн.зміни V"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Поміняти довжини"); - PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поміняти додатково"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Змінити довжини"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_EXTRA = _UxGT("Змінити додатково"); PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Очистити довжину"); PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Зміна сопла"); PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Підняти по Z"); @@ -468,11 +503,11 @@ namespace Language_uk { PROGMEM Language_Str MSG_FILAMENT_PARK_ENABLED = _UxGT("Паркувати голову"); PROGMEM Language_Str MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Відновити швидкість"); #if LCD_WIDTH > 21 - PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти охолодження"); - PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час охолодження"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти вентилятора"); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час вентилятора"); #else - PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти охолодж."); - PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час охолодж."); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти вент."); + PROGMEM Language_Str MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час вент."); #endif PROGMEM Language_Str MSG_TOOL_MIGRATION_ON = _UxGT("Авто Увімк."); PROGMEM Language_Str MSG_TOOL_MIGRATION_OFF = _UxGT("Авто Вимкн."); @@ -489,34 +524,35 @@ namespace Language_uk { PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Видалити все"); PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Вставити SD-картку"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Заміна SD-картки"); - PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Звільніть SD-картку"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Видаліть SD-картку"); PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z-Зонд поза столом"); PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Фактор нахилу"); - PROGMEM Language_Str MSG_BLTOUCH = _UxGT("Z-зонд BLTouch"); - PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Само-Тест"); - PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Зкинути BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Само-тест"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Зкинути зонд"); PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Підняти зонд"); PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Опустити зонд"); PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Режим SW"); PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Режим 5V"); PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Режим OD"); PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Режим збереження"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Встановити на 5V"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Встановити на OD"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Злив звіту"); - PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("НЕБЕЗПЕКА: Неправильні параметри приводять до пошкоджень! Продовжувати?"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Встановити BLT на 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Встановити BLT на OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Звітувати злив"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("НЕБЕЗПЕКА: Неправильні параметри приводять до пошкоджень! Продовжити?"); PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("Z-Зонд TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Ініціалізація"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Ініц. TouchMI"); PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Тест Z-зміщення"); PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Зберегти"); PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установити TouchMI"); - PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Установити зонд"); - PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Завантажити зонд"); - PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Дім %s%s%s перший"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Установити Z-зонд"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Завантажити Z-зонд"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Спочатку дім %s%s%s"); PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Зміщення зонду"); - 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_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"); @@ -527,7 +563,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ВИТІК ТЕПЛА"); PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ВИТІК ТЕПЛА СТОЛУ"); PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ВИТІК ТЕПЛА КАМЕРИ"); - PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("ПЕРЕГРІВ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("МАКСИМАЛЬНА Т"); PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("МІНІМАЛЬНА Т") LCD_STR_DEGREE; PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ЗУПИНЕНО"); PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Перезавантажте"); @@ -538,14 +574,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("Нагрів зонду..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрування Delta"); #if LCD_WIDTH >= 20 PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охолодження столу..."); PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охолодження камери..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрування Delta"); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Охолодження зонду..."); #else PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охол. столу..."); PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Охол. камери..."); - PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібрув. Delta"); + PROGMEM Language_Str MSG_PROBE_COOLING = _UxGT("Охол. зонду..."); #endif PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калібрувати X"); PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калібрувати Y"); @@ -553,41 +591,32 @@ namespace Language_uk { PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калібр. центр"); PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Параметри Delta"); PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Автокалібрування"); - PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Висота Delta"); - #if LCD_WIDTH >= 20 - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондування Z-зміщ."); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стрижень діагоналі"); - #else - PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондув. Z-зміщ."); - PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Стрижень діаг."); - #endif + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Встан. Висоту Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z-зміщення зонду"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Діагональ стрижня"); PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Висота"); PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Радіус"); PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Про принтер"); - PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Данні принтера"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Дані принтера"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точкове вирівнювання"); PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівнювання"); PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівнювання"); - #elif LCD_WIDTH == 20 - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точкове вирівнюв."); - PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівнюван."); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівнюв."); #else - PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точк. вирівн."); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-точкове вирівн."); PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівн."); - PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білін. вирівнюв."); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівн."); #endif - PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Керування UBL"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("UBL"); PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Вирівнювання сітки"); PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Статистика принтера"); PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Про плату"); PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Термістори"); PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Екструдери"); - PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Біт/секунду"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Бод"); PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль витіку ") LCD_STR_THERMOMETER _UxGT(" Вимк"); @@ -602,6 +631,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 @@ -647,25 +677,30 @@ namespace Language_uk { PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Помилка зондування"); PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ОБЕРІТЬ ПРУТОК"); - PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("Налаштування MMU"); - PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Понови прошивку MMU!"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_KILL_MMU2_FIRMWARE = _UxGT("Онови прошивку MMU!"); PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU потребує уваги"); - PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Продовжити друк"); - PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Продовження..."); - PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Завантажити пруток"); - PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Завантажити все"); - PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Завантажити в сопло"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Звільнити пруток"); - PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Звільнити пруток ~"); - PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Вивантажити пруток"); - PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Завантаження %i..."); - PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Звільнення прутка..."); - PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Вивантаження ...."); - PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Все"); - PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Пруток ~"); - PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Перезапуск MMU"); - PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); - PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Видаліть, натисніть"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("MMU Продовжити"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("MMU Продовження..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU Завантажити"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("MMU Завантажити все"); + #if LCD_WIDTH > 21 + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Завантажити в сопло"); + #else + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Завантаж. в сопло"); + #endif + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("MMU Звільнити"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("MMU Звільнити ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("MMU Вивантажити"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("MMU Завантаж. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("MMU Звільнення..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("MMU Вивантаження..."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("MMU Все"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("MMU Пруток ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("MMU Перезапуск"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU Перезапуск..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("MMU Видаліть, натисніть"); + #if LCD_WIDTH > 21 PROGMEM Language_Str MSG_MIX = _UxGT("Змішування"); #else @@ -675,51 +710,63 @@ namespace Language_uk { PROGMEM Language_Str MSG_MIXER = _UxGT("Змішувач"); PROGMEM Language_Str MSG_GRADIENT = _UxGT("Градієнт"); PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Повний градієнт"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Змішування переключ."); PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Циклічне змішування"); PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Градієнт змішування"); PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Змінити градієнт"); + #if LCD_WIDTH > 21 - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перемкнути змішування"); PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Активація В-інструменту"); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Початок В-інструменту"); - 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("Змішати В-інструменти"); #else - PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Перемкнути змішув."); - PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Актив.В-інструм."); - PROGMEM Language_Str MSG_START_VTOOL = _UxGT("В-інструм. поч."); - 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_ACTIVE_VTOOL = _UxGT("Актив. В-інструм."); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інструм."); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструм."); #endif - PROGMEM Language_Str MSG_START_Z = _UxGT("Початок Z"); - PROGMEM Language_Str MSG_END_Z = _UxGT(" Кінець Z"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Початок В-інструменту"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Кінець В-інструменту"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Змішати В-інструменти"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("В-інструменти зкинуті"); + + PROGMEM Language_Str MSG_START_Z = _UxGT("Початок Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Кінець Z:"); PROGMEM Language_Str MSG_GAMES = _UxGT("Ігри"); PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Цеглини"); PROGMEM Language_Str MSG_INVADERS = _UxGT("Вторгнення"); - PROGMEM Language_Str MSG_SNAKE = _UxGT("Змійка"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Zм!йк@"); PROGMEM Language_Str MSG_MAZE = _UxGT("Лабіринт"); + PROGMEM Language_Str MSG_BAD_PAGE = _UxGT("Погана сторінка"); #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_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("Старт через"); + PROGMEM Language_Str MSG_REMINDER_SAVE_SETTINGS = _UxGT("Не забудь зберегти!"); + 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 + // ...or up to 2 lines on a 3-line display + // #if LCD_HEIGHT >= 4 // Up to 3 lines allowed PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_3_LINE("Натисніть кнопку", "для продовження", "друку")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Зачекайте", "на початок", "заміни прутка")); - PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставте пруток", "та натисніть", "для продовження...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставте пруток", "та натисніть", "для продовження")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Натисніть кнопку", "для нагріву сопла")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Сопло нагрівається", "зачекайте...")); PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Зачекайте", "на вивід прутка")); @@ -755,9 +802,32 @@ namespace Language_uk { PROGMEM Language_Str MSG_LEVEL_X_AXIS = _UxGT("Рівень вісі X"); PROGMEM Language_Str MSG_AUTO_CALIBRATE = _UxGT("Авто калібрування"); - PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Час нагрівача збіг"); + + #if ENABLED(TOUCH_UI_FTDI_EVE) + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Час простою збіг, температура впала. Натисніть ОК, щоби знову нагріти та продовжити"); + #else + PROGMEM Language_Str MSG_HEATER_TIMEOUT = _UxGT("Час нагрівача збіг"); + #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_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 0e1de36b57cd..5e7c5e7cb5e0 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" @@ -230,7 +226,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" @@ -267,16 +263,6 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败. 坏的挤出机"); PROGMEM Language_Str MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败. 温度太高"); PROGMEM Language_Str MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); - PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); - PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("选择"); //"Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("选择 *"); PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 9708bbda9c0c..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" @@ -228,7 +224,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/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 2c78b14834b4..32f425168f8d 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -28,6 +28,7 @@ #if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT +#include "marlinui.h" #include "lcdprint.h" /** diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index cf34a7ade92e..b7732d319889 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -76,8 +76,8 @@ #define INFO_FONT_HEIGHT (INFO_FONT_ASCENT + INFO_FONT_DESCENT) #define INFO_FONT_WIDTH 6 - #define SETCURSOR(col, row) lcd_moveto((col) * (MENU_FONT_WIDTH), ((row) + 1) * (MENU_FONT_HEIGHT)) - #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), ((row) + 1) * (MENU_FONT_HEIGHT)) + #define LCD_COL_X(col) (( (col)) * (MENU_FONT_WIDTH)) + #define LCD_ROW_Y(row) ((1 + (row)) * (MENU_FONT_HEIGHT)) #else @@ -94,14 +94,18 @@ #define LCD_PIXEL_WIDTH LCD_WIDTH #define LCD_PIXEL_HEIGHT LCD_HEIGHT - #define SETCURSOR(col, row) lcd_moveto(col, row) - #define SETCURSOR_RJ(len, row) SETCURSOR(LCD_WIDTH - (len), row) + #define LCD_COL_X(col) (col) + #define LCD_ROW_Y(row) (row) #endif -#define SETCURSOR_X(col) SETCURSOR(col, _lcdLineNr) -#define SETCURSOR_X_RJ(len) SETCURSOR_RJ(len, _lcdLineNr) -#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) +#define LCD_COL_X_RJ(len) (LCD_PIXEL_WIDTH - LCD_COL_X(len)) +#define LCD_BOTTOM_ROW (LCD_PIXEL_HEIGHT - 1) +#define SETCURSOR(col, row) lcd_moveto(LCD_COL_X(col), LCD_ROW_Y(row)) +#define SETCURSOR_RJ(len, row) lcd_moveto(LCD_COL_X_RJ(len), LCD_ROW_Y(row)) +#define SETCURSOR_X(col) SETCURSOR(col, _lcdLineNr) +#define SETCURSOR_X_RJ(len) SETCURSOR_RJ(len, _lcdLineNr) +#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) int lcd_glyph_height(); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 241d3a171213..25f3903ddc2d 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -78,6 +78,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #endif +#if HAS_MULTI_LANGUAGE + uint8_t MarlinUI::language; // Initialized by settings.load() +#endif + #if ENABLED(SOUND_MENU_ITEM) bool MarlinUI::buzzer_enabled = true; #endif @@ -342,7 +346,6 @@ void MarlinUI::init() { init_lcd(); #if HAS_DIGITAL_BUTTONS - #if BUTTON_EXISTS(EN1) SET_INPUT_PULLUP(BTN_EN1); #endif @@ -352,15 +355,12 @@ void MarlinUI::init() { #if BUTTON_EXISTS(ENC) 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 - #if BUTTON_EXISTS(UP) SET_INPUT(BTN_UP); #endif @@ -373,8 +373,7 @@ void MarlinUI::init() { #if BUTTON_EXISTS(RT) SET_INPUT(BTN_RT); #endif - - #endif // !HAS_DIGITAL_BUTTONS + #endif #if HAS_SHIFT_ENCODER @@ -383,14 +382,14 @@ void MarlinUI::init() { SET_OUTPUT(SR_DATA_PIN); SET_OUTPUT(SR_CLK_PIN); - #elif defined(SHIFT_CLK) + #elif PIN_EXISTS(SHIFT_CLK) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - #if defined(SHIFT_EN) && SHIFT_EN >= 0 - OUT_WRITE(SHIFT_EN, LOW); + SET_OUTPUT(SHIFT_CLK_PIN); + OUT_WRITE(SHIFT_LD_PIN, HIGH); + #if PIN_EXISTS(SHIFT_EN) + OUT_WRITE(SHIFT_EN_PIN, LOW); #endif - SET_INPUT_PULLUP(SHIFT_OUT); + SET_INPUT_PULLUP(SHIFT_OUT_PIN); #endif @@ -684,10 +683,13 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { millis_t ManualMove::start_time = 0; float ManualMove::menu_scale = 1; - TERN_(IS_KINEMATIC, float ManualMove::offset = 0); - TERN_(IS_KINEMATIC, bool ManualMove::processing = false); + #if IS_KINEMATIC + float ManualMove::offset = 0; + xyze_pos_t ManualMove::all_axes_destination = { 0 }; + bool ManualMove::processing = false; + #endif TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0); - uint8_t ManualMove::axis = (uint8_t)NO_AXIS; + AxisEnum ManualMove::axis = NO_AXIS; /** * If a manual move has been posted and its time has arrived, and if the planner @@ -713,24 +715,28 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (processing) return; // Prevent re-entry from idle() calls // Add a manual move to the queue? - if (axis != (uint8_t)NO_AXIS && ELAPSED(millis(), start_time) && !planner.is_full()) { + if (axis != NO_AXIS && ELAPSED(millis(), start_time) && !planner.is_full()) { - const feedRate_t fr_mm_s = (uint8_t(axis) <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t fr_mm_s = (axis <= E_AXIS) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; #if IS_KINEMATIC #if HAS_MULTI_EXTRUDER - const int8_t old_extruder = active_extruder; + REMEMBER(ae, active_extruder); if (axis == E_AXIS) active_extruder = e_index; #endif // Apply a linear offset to a single axis - destination = current_position; - if (axis <= XYZE) destination[axis] += offset; + if (axis == ALL_AXES) + destination = all_axes_destination; + else if (axis <= XYZE) { + destination = current_position; + destination[axis] += offset; + } // Reset for the next move offset = 0; - axis = (uint8_t)NO_AXIS; + axis = NO_AXIS; // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to // move_to_destination. This will cause idle() to be called, which can then call this function while the @@ -740,8 +746,6 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination processing = false; - TERN_(HAS_MULTI_EXTRUDER, active_extruder = old_extruder); - #else // For Cartesian / Core motion simply move to the current_position @@ -749,7 +753,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { //SERIAL_ECHOLNPAIR("Add planner.move with Axis ", int(axis), " at FR ", fr_mm_s); - axis = (uint8_t)NO_AXIS; + axis = NO_AXIS; #endif } @@ -767,7 +771,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (move_axis == E_AXIS) e_index = eindex >= 0 ? eindex : active_extruder; #endif start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - axis = (uint8_t)move_axis; + axis = move_axis; //SERIAL_ECHOLNPAIR("Post Move with Axis ", int(axis), " soon."); } @@ -825,11 +829,7 @@ millis_t next_lcd_update_ms; #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 + return !BUTTON_PRESSED(ENC_EN); // Update encoder only when ENC_EN is not LOW (pressed) } void MarlinUI::update() { @@ -885,18 +885,17 @@ void MarlinUI::update() { else if (!wait_for_unclick && (buttons & EN_C)) // OK button, if not waiting for a debounce release: do_click(); } - else // keep wait_for_unclick value - - #endif // HAS_TOUCH_BUTTONS + // keep wait_for_unclick value + #endif - { - // Integrated LCD click handling via button_pressed - if (!external_control && button_pressed()) { - if (!wait_for_unclick) do_click(); // Handle the click - } - else - wait_for_unclick = false; + if (!touch_buttons) { + // Integrated LCD click handling via button_pressed + if (!external_control && button_pressed()) { + if (!wait_for_unclick) do_click(); // Handle the click } + else + wait_for_unclick = false; + } if (LCD_BACK_CLICKED()) { quick_feedback(); @@ -923,7 +922,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); @@ -1193,19 +1192,10 @@ void MarlinUI::update() { #if ANY_BUTTON(EN1, EN2, ENC, BACK) uint8_t newbutton = 0; - - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (can_encode() && BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - #endif + if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; + if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; + if (can_encode() && BUTTON_PRESSED(ENC)) newbutton |= EN_C; + if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; #else @@ -1220,40 +1210,26 @@ void MarlinUI::update() { const int8_t pulses = epps * encoderDirection; - if (false) { - // for the else-ifs below + if (BUTTON_PRESSED(UP)) { + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(DWN)) { + encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(LFT)) { + encoderDiff = -pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(RT)) { + encoderDiff = pulses; + next_button_update_ms = now + 300; } - #if BUTTON_EXISTS(UP) - else if (BUTTON_PRESSED(UP)) { - encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(DWN) - else if (BUTTON_PRESSED(DWN)) { - encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(LFT) - else if (BUTTON_PRESSED(LFT)) { - encoderDiff = -pulses; - next_button_update_ms = now + 300; - } - #endif - #if BUTTON_EXISTS(RT) - else if (BUTTON_PRESSED(RT)) { - encoderDiff = pulses; - next_button_update_ms = now + 300; - } - #endif #endif // UP || DWN || LFT || RT - buttons = (newbutton - #if HAS_SLOW_BUTTONS - | slow_buttons - #endif + buttons = (newbutton | TERN0(HAS_SLOW_BUTTONS, slow_buttons) #if BOTH(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION) | (touch_buttons & TERN(HAS_ENCODER_WHEEL, ~(EN_A | EN_B), 0xFF)) #endif @@ -1279,13 +1255,13 @@ void MarlinUI::update() { * The rotary encoder part is also independent of the LCD chipset. */ uint8_t val = 0; - WRITE(SHIFT_LD, LOW); - WRITE(SHIFT_LD, HIGH); + WRITE(SHIFT_LD_PIN, LOW); + WRITE(SHIFT_LD_PIN, HIGH); LOOP_L_N(i, 8) { val >>= 1; - if (READ(SHIFT_OUT)) SBI(val, 7); - WRITE(SHIFT_CLK, HIGH); - WRITE(SHIFT_CLK, LOW); + if (READ(SHIFT_OUT_PIN)) SBI(val, 7); + WRITE(SHIFT_CLK_PIN, HIGH); + WRITE(SHIFT_CLK_PIN, LOW); } TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val; #endif @@ -1301,11 +1277,6 @@ void MarlinUI::update() { #if HAS_ENCODER_WHEEL static uint8_t lastEncoderBits; - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 - // Manage encoder rotation #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: encoderDiff += encoderDirection; break; case _E2: encoderDiff -= encoderDirection; } @@ -1314,10 +1285,10 @@ void MarlinUI::update() { if (buttons & EN_B) enc |= B10; if (enc != lastEncoderBits) { switch (enc) { - case encrot0: ENCODER_SPIN(encrot3, encrot1); break; - case encrot1: ENCODER_SPIN(encrot0, encrot2); break; - case encrot2: ENCODER_SPIN(encrot1, encrot3); break; - case encrot3: ENCODER_SPIN(encrot2, encrot0); break; + case ENCODER_PHASE_0: ENCODER_SPIN(ENCODER_PHASE_3, ENCODER_PHASE_1); break; + case ENCODER_PHASE_1: ENCODER_SPIN(ENCODER_PHASE_0, ENCODER_PHASE_2); break; + case ENCODER_PHASE_2: ENCODER_SPIN(ENCODER_PHASE_1, ENCODER_PHASE_3); break; + case ENCODER_PHASE_3: ENCODER_SPIN(ENCODER_PHASE_2, ENCODER_PHASE_0); break; } #if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL) external_encoder(); @@ -1483,7 +1454,8 @@ void MarlinUI::update() { #if ENABLED(STATUS_MESSAGE_SCROLLING) status_scroll_offset = 0; #endif - + #else // HAS_SPI_LCD + UNUSED(persist); #endif TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); @@ -1544,7 +1516,7 @@ void MarlinUI::update() { 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 + pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress queue.inject_P(PSTR("M25 P\nM24")); #elif ENABLED(SDSUPPORT) queue.inject_P(PSTR("M25")); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 8e968abda0af..2e55c9ad1d29 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -23,6 +23,10 @@ #include "../inc/MarlinConfig.h" +#include "../module/motion.h" + +#include "buttons.h" + #if HAS_BUZZER #include "../libs/buzzer.h" #endif @@ -38,33 +42,21 @@ #if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY) #define HAS_ENCODER_ACTION 1 #endif -#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL - #define HAS_ENCODER_WHEEL 1 -#endif -#if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT) - #define HAS_DIGITAL_BUTTONS 1 -#endif -#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) - #define HAS_SHIFT_ENCODER 1 -#endif - -// I2C buttons must be read in the main thread -#if ANY(LCD_I2C_VIKI, LCD_I2C_PANELOLU2, IS_TFTGLCD_PANEL) - #define HAS_SLOW_BUTTONS 1 -#endif #if E_MANUAL > 1 #define MULTI_MANUAL 1 #endif -#if HAS_WIRED_LCD +#if HAS_DISPLAY + #include "../module/printcounter.h" +#endif - #include "../MarlinCore.h" +#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) + #include "../feature/pause.h" + #include "../module/motion.h" // for active_extruder +#endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" - #include "../module/motion.h" // for active_extruder - #endif +#if HAS_WIRED_LCD enum LCDViewAction : uint8_t { LCDVIEW_NONE, @@ -93,12 +85,6 @@ typedef void (*screenFunc_t)(); typedef void (*menuAction_t)(); - #if ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_pause_show_message(const PauseMessage message, - const PauseMode mode=PAUSE_MODE_SAME, - const uint8_t extruder=active_extruder); - #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) void lcd_mesh_edit_setup(const float &initial); float lcd_mesh_edit(); @@ -108,130 +94,6 @@ #endif // HAS_WIRED_LCD -#if IS_RRW_KEYPAD - #define BTN_OFFSET 0 // Bit offset into buttons for shift register values - - #define BLEN_KEYPAD_F3 0 - #define BLEN_KEYPAD_F2 1 - #define BLEN_KEYPAD_F1 2 - #define BLEN_KEYPAD_DOWN 3 - #define BLEN_KEYPAD_RIGHT 4 - #define BLEN_KEYPAD_MIDDLE 5 - #define BLEN_KEYPAD_UP 6 - #define BLEN_KEYPAD_LEFT 7 - - #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) - #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) - #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) - #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) - #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) - #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) - #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) - #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) - - #define RRK(B) (keypad_buttons & (B)) - - #ifdef EN_C - #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) - #else - #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) - #endif - -#endif // IS_RRW_KEYPAD - -#if HAS_DIGITAL_BUTTONS - - // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) - #define BLEN_A 0 - #define BLEN_B 1 - - #define EN_A _BV(BLEN_A) - #define EN_B _BV(BLEN_B) - - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - - #if BUTTON_EXISTS(ENC) || HAS_TOUCH_BUTTONS - #define BLEN_C 2 - #define EN_C _BV(BLEN_C) - #endif - - #if ENABLED(LCD_I2C_VIKI) - - #include - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) - - #if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used - #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name - #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented. - #else - #define BUTTON_CLICK() (buttons & (B_MI|B_RI)) - #endif - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later - - #define BUTTON_CLICK() (buttons & B_MI) - - #endif - - #endif - -#else - - #undef BUTTON_EXISTS - #define BUTTON_EXISTS(...) false - - // Shift register bits correspond to buttons: - #define BL_LE 7 // Left - #define BL_UP 6 // Up - #define BL_MI 5 // Middle - #define BL_DW 4 // Down - #define BL_RI 3 // Right - #define BL_ST 2 // Red Button - #define B_LE _BV(BL_LE) - #define B_UP _BV(BL_UP) - #define B_MI _BV(BL_MI) - #define B_DW _BV(BL_DW) - #define B_RI _BV(BL_RI) - #define B_ST _BV(BL_ST) - - #ifndef BUTTON_CLICK - #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) - #endif - -#endif - -#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) -#else - #define LCD_BACK_CLICKED() false -#endif - -#ifndef BUTTON_CLICK - #ifdef EN_C - #define BUTTON_CLICK() (buttons & EN_C) - #else - #define BUTTON_CLICK() false - #endif -#endif - #if HAS_MARLINUI_U8GLIB enum MarlinFont : uint8_t { FONT_STATUSMENU = 1, @@ -258,21 +120,35 @@ // Manual Movement class class ManualMove { - public: + private: + static AxisEnum axis; + #if MULTI_MANUAL + static int8_t e_index; + #else + static int8_t constexpr e_index = 0; + #endif static millis_t start_time; + TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination); + public: static float menu_scale; TERN_(IS_KINEMATIC, static float offset); + template + void set_destination(const T& dest) { + #if IS_KINEMATIC + // Moves are segmented, so the entire move is not submitted at once. + // Using a separate variable prevents corrupting the in-progress move. + all_axes_destination = current_position; + all_axes_destination.set(dest); + #else + // Moves are submitted as single line to the planner using buffer_line. + current_position.set(dest); + #endif + } #if IS_KINEMATIC static bool processing; #else static bool constexpr processing = false; #endif - #if MULTI_MANUAL - static int8_t e_index; - #else - static int8_t constexpr e_index = 0; - #endif - static uint8_t axis; static void task(); static void soon(AxisEnum axis #if MULTI_MANUAL @@ -294,6 +170,17 @@ class MarlinUI { TERN_(HAS_LCD_MENU, currentScreen = status_screen); } + #if HAS_MULTI_LANGUAGE + static uint8_t language; + static inline void set_language(const uint8_t lang) { + if (lang < NUM_LANGUAGES) { + language = lang; + return_to_status(); + refresh(); + } + } + #endif + #if ENABLED(SOUND_MENU_ITEM) static bool buzzer_enabled; // Initialized by settings.load() #else @@ -357,11 +244,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(); @@ -527,6 +423,8 @@ class MarlinUI { #if HAS_TOUCH_BUTTONS static uint8_t touch_buttons; static uint8_t repeat_delay; + #else + static constexpr uint8_t touch_buttons = 0; #endif #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -600,6 +498,13 @@ class MarlinUI { #endif + #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) + static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); + #else + static inline void _pause_show_message() {} + #define pause_show_message(...) _pause_show_message() + #endif + // // EEPROM: Reset / Init / Load / Store // 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.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_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 3f2a6da11b50..cb7827168b9e 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -140,22 +140,22 @@ void menu_backlash(); #if ENABLED(ADVANCED_PAUSE_FEATURE) constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999); - EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); + EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); #if HAS_MULTI_EXTRUDER LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength); + EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength); #endif - EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); + EDIT_ITEM_FAST(float4, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); #if HAS_MULTI_EXTRUDER LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength); + EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength); #endif #endif #if HAS_FILAMENT_RUNOUT_DISTANCE editable.decimal = runout.runout_distance(); - EDIT_ITEM(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, float(FILAMENT_RUNOUT_DISTANCE_MM) * 1.5f, + EDIT_ITEM_FAST(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, 999, []{ runout.set_runout_distance(editable.decimal); }, true ); #endif @@ -279,7 +279,7 @@ void menu_backlash(); #if ENABLED(PID_EXTRUSION_SCALING) #define _PID_BASE_MENU_ITEMS(N) \ __PID_BASE_MENU_ITEMS(N); \ - EDIT_ITEM_N(float3, N, MSG_PID_C_E, &PID_PARAM(Kc, N), 1, 9990) + EDIT_ITEM_N(float4, N, MSG_PID_C_E, &PID_PARAM(Kc, N), 1, 9990) #else #define _PID_BASE_MENU_ITEMS(N) __PID_BASE_MENU_ITEMS(N) #endif @@ -287,7 +287,7 @@ void menu_backlash(); #if ENABLED(PID_FAN_SCALING) #define _PID_EDIT_MENU_ITEMS(N) \ _PID_BASE_MENU_ITEMS(N); \ - EDIT_ITEM_N(float3, N, MSG_PID_F_E, &PID_PARAM(Kf, N), 1, 9990) + EDIT_ITEM_N(float4, N, MSG_PID_F_E, &PID_PARAM(Kf, N), 1, 9990) #else #define _PID_EDIT_MENU_ITEMS(N) _PID_BASE_MENU_ITEMS(N) #endif @@ -348,7 +348,7 @@ void menu_backlash(); #elif ENABLED(LIMITED_MAX_FR_EDITING) DEFAULT_MAX_FEEDRATE #else - { 999, 999, 999, 999 } + { 9999, 9999, 9999, 9999 } #endif ; #if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES) @@ -360,24 +360,24 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_VMAX(N) EDIT_ITEM_FAST(float3, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) + #define EDIT_VMAX(N) EDIT_ITEM_FAST(float5, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) EDIT_VMAX(A); EDIT_VMAX(B); EDIT_VMAX(C); #if E_STEPPERS - EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); + EDIT_ITEM_FAST(float5, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); #endif #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) - EDIT_ITEM_FAST_N(float3, n, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(n)], 1, max_fr_edit_scaled.e); + EDIT_ITEM_FAST_N(float5, n, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(n)], 1, max_fr_edit_scaled.e); #endif // M205 S Min Feedrate - EDIT_ITEM_FAST(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); + EDIT_ITEM_FAST(float5, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 9999); // M205 T Min Travel Feedrate - EDIT_ITEM_FAST(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); + EDIT_ITEM_FAST(float5, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 9999); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 16f9992c1852..efa5454d8c7b 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -39,49 +39,297 @@ #ifndef LEVEL_CORNERS_Z_HOP #define LEVEL_CORNERS_Z_HOP 4.0 #endif - #ifndef LEVEL_CORNERS_HEIGHT #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.2 + #endif + float last_z; + int good_points; + bool corner_probing_done, wait_for_probe; + + #if HAS_MARLINUI_U8GLIB + #include "../dogm/marlinui_DOGM.h" + #endif + #define GOOD_POINTS_TO_STR(N) ui8tostr2(N) + #define LAST_Z_TO_STR(N) ftostr53_63(N) //ftostr42_52(N) + +#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 +#ifndef LEVEL_CORNERS_LEVELING_ORDER + #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, LB, RB } // Default + //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points + //#define LEVEL_CORNERS_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear + //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right + //#define LEVEL_CORNERS_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left + //#define LEVEL_CORNERS_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front +#endif + +#define LF 1 +#define RF 2 +#define RB 3 +#define LB 4 +constexpr int lco[] = LEVEL_CORNERS_LEVELING_ORDER; +constexpr bool level_corners_3_points = COUNT(lco) == 2; +static_assert(level_corners_3_points || COUNT(lco) == 4, "LEVEL_CORNERS_LEVELING_ORDER must have exactly 2 or 4 corners."); + +constexpr int lcodiff = abs(lco[0] - lco[1]); +static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two LEVEL_CORNERS_LEVELING_ORDER corners must be on the same edge."); + +constexpr int nr_edge_points = level_corners_3_points ? 3 : 4; +constexpr int available_points = nr_edge_points + ENABLED(LEVEL_CENTER_TOO); +constexpr int center_index = TERN(LEVEL_CENTER_TOO, available_points - 1, -1); +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] }; + +static int8_t bed_corner; + /** - * Level corners, starting in the front-left corner. + * Select next corner coordinates */ -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; - #endif +static inline void _lcd_level_bed_corners_get_next_position() { + + if (level_corners_3_points) { + if (bed_corner >= available_points) bed_corner = 0; // Above max position -> move back to first corner + switch (bed_corner) { + case 0 ... 1: + // First two corners set explicitly by the configuration + current_position = lf; // Left front + switch (lco[bed_corner]) { + case RF: current_position.x = rb.x; break; // Right Front + case RB: current_position = rb; break; // Right Back + case LB: current_position.y = rb.y; break; // Left Back + } + break; + + case 2: + // Determine which edge to probe for 3rd point + current_position.set(lf.x + (rb.x - lf.x) / 2, lf.y + (rb.y - lf.y) / 2); + if ((lco[0] == LB && lco[1] == RB) || (lco[0] == RB && lco[1] == LB)) current_position.y = lf.y; // Front Center + if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) current_position.x = rb.x; // Center Right + if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) current_position.x = lf.x; // Left Center + if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) current_position.y = rb.y; // Center Back + #if DISABLED(LEVEL_CENTER_TOO) && ENABLED(LEVEL_CORNERS_USE_PROBE) + bed_corner++; // Must increment the count to ensure it resets the loop if the 3rd point is out of tolerance + #endif + break; + + #if ENABLED(LEVEL_CENTER_TOO) + case 3: + current_position.set(X_CENTER, Y_CENTER); + break; + #endif + } + } + else { + // Four-Corner Bed Tramming with optional center + if (TERN0(LEVEL_CENTER_TOO, bed_corner == center_index)) { + current_position.set(X_CENTER, Y_CENTER); + TERN_(LEVEL_CORNERS_USE_PROBE, good_points--); // Decrement to allow one additional probe point + } + else { + current_position = lf; // Left front + switch (lco[bed_corner]) { + case RF: current_position.x = rb.x; break; // Right front + case RB: current_position = rb; break; // Right rear + case LB: current_position.y = rb.y; break; // Left rear + } + } } - 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; } +/** + * Level corners, starting in the front-left corner. + */ +#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"); + + #ifndef PAGE_CONTAINS + #define PAGE_CONTAINS(...) true + #endif + + void _lcd_draw_probing() { + if (!ui.should_draw()) return; + + TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info + + MenuItem_static::draw(0, GET_TEXT(MSG_PROBING_MESH), SS_INVERT); // "Probing Mesh" heading + + uint8_t cy = LCD_HEIGHT - 1, y = LCD_ROW_Y(cy); + + // Display # of good points found vs total needed + if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) { + SETCURSOR(0, cy); + lcd_put_u8str_P(GET_TEXT(MSG_LEVEL_CORNERS_GOOD_POINTS)); + lcd_put_u8str(GOOD_POINTS_TO_STR(good_points)); + lcd_put_wchar('/'); + lcd_put_u8str(GOOD_POINTS_TO_STR(nr_edge_points)); + } + + --cy; + y -= MENU_FONT_HEIGHT; + + // Display the Last Z value + if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) { + SETCURSOR(0, cy); + lcd_put_u8str_P(GET_TEXT(MSG_LEVEL_CORNERS_LAST_Z)); + lcd_put_u8str(LAST_Z_TO_STR(last_z)); + } + } + + 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("") + ); + } + + void _lcd_draw_level_prompt() { + if (!ui.should_draw()) return; + MenuItem_confirm::confirm_screen( + []{ queue.inject_P(TERN(HAS_LEVELING, PSTR("G29N"), G28_STR)); + ui.return_to_status(); + } + , []{ ui.goto_previous_screen_no_defer(); } + , GET_TEXT(MSG_LEVEL_CORNERS_IN_RANGE) + , (const char*)nullptr, PSTR("?") + ); + } + + 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, MMM_TO_MMS(Z_PROBE_SPEED_SLOW)); // 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 + } + + 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)); + } + idle(); + } + TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); + ui.goto_screen(_lcd_draw_probing); + return (probe_triggered); + } + + void _lcd_test_corners() { + bed_corner = TERN(LEVEL_CENTER_TOO, center_index, 0); + last_z = LEVEL_CORNERS_HEIGHT; + endstops.enable_z_probe(true); + good_points = 0; + ui.goto_screen(_lcd_draw_probing); + do { + ui.refresh(LCDVIEW_REDRAW_NOW); + _lcd_draw_probing(); // update screen with # of good points + do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // clearance + + _lcd_level_bed_corners_get_next_position(); // Select next corner coordinates + current_position -= probe.offset_xy; // Account for probe offsets + do_blocking_move_to_xy(current_position); // Goto corner + + 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 + } + } + #endif + } + else if (corner_probing_done) // Done was selected + return; + } + + if (bed_corner != center_index) good_points++; // ignore center + if (++bed_corner > 3) bed_corner = 0; + + } while (good_points < nr_edge_points); // loop until all points within tolerance + + ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling + ui.set_selection(true); + } + +#else // !LEVEL_CORNERS_USE_PROBE + + static inline void _lcd_goto_next_corner() { + line_to_z(LEVEL_CORNERS_Z_HOP); + + // Select next corner coordinates + _lcd_level_bed_corners_get_next_position(); + + line_to_current_position(manual_feedrate_mm_s.x); + line_to_z(LEVEL_CORNERS_HEIGHT); + if (++bed_corner >= available_points) bed_corner = 0; + } + +#endif // !LEVEL_CORNERS_USE_PROBE + static inline void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); - if (all_axes_homed()) { + 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 , []{ + line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); ui.goto_previous_screen_no_defer(); } @@ -91,12 +339,12 @@ static inline void _lcd_level_bed_corners_homing() { }); ui.set_selection(true); _lcd_goto_next_corner(); - } + #endif } 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..6a9f89f118ba 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -103,9 +103,9 @@ ui.wait_for_move = true; ui.goto_screen(_lcd_level_bed_done); #if ENABLED(MESH_BED_LEVELING) - queue.inject_P(PSTR("G29 S2")); + queue.inject_P(PSTR("G29S2")); #elif ENABLED(PROBE_MANUALLY) - queue.inject_P(PSTR("G29 V1")); + queue.inject_P(PSTR("G29V1")); #endif } else @@ -155,9 +155,9 @@ // G29 Records Z, moves, and signals when it pauses ui.wait_for_move = true; #if ENABLED(MESH_BED_LEVELING) - queue.inject_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); + queue.inject_P(manual_probe_index ? PSTR("G29S2") : PSTR("G29S1")); #elif ENABLED(PROBE_MANUALLY) - queue.inject_P(PSTR("G29 V1")); + queue.inject_P(PSTR("G29V1")); #endif } @@ -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(); @@ -254,7 +254,7 @@ void menu_bed_leveling() { SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue); #else // Automatic leveling can just run the G-code - GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); + GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G29N")); #endif #if ENABLED(MESH_EDIT_MENU) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 2c3af1e5ee2d..39752a6fe5a7 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -161,10 +161,12 @@ void menu_advanced_settings(); #include "../../module/motion.h" #include "../../gcode/queue.h" + extern const char G28_STR[]; + 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_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index 4efcb7c8eded..7411bb1ac21c 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -53,6 +53,7 @@ void _man_probe_pt(const xy_pos_t &xy) { #if ENABLED(DELTA_AUTO_CALIBRATION) + #include "../../MarlinCore.h" // for wait_for_user_response() #include "../../gcode/gcode.h" #if ENABLED(HOST_PROMPT_SUPPORT) @@ -81,6 +82,7 @@ void _man_probe_pt(const xy_pos_t &xy) { } void _lcd_delta_calibrate_home() { + extern const char G28_STR[]; queue.inject_P(G28_STR); ui.goto_screen(_lcd_calibrate_homing); } diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index af8a4fc2b504..19601d678e05 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -86,18 +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 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); #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; } /** @@ -105,6 +107,8 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { */ #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + bool printingIsPaused(); + void menu_change_filament() { // Say "filament change" when no print is active editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT; @@ -313,7 +317,7 @@ FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) { return nullptr; } -void lcd_pause_show_message( +void MarlinUI::pause_show_message( const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/ diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 6430021223c1..6873f209b480 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 @@ -132,6 +133,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(uint16_5 ,uint16_t ,ui16tostr5rj , 0.01f ); DEFINE_MENU_EDIT_ITEM_TYPE(float3 ,float ,ftostr3 , 1 ); // 123 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float42_52 ,float ,ftostr42_52 , 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 DEFINE_MENU_EDIT_ITEM_TYPE(float43 ,float ,ftostr43sign ,1000 ); // -1.234, _1.234, +1.234 +DEFINE_MENU_EDIT_ITEM_TYPE(float4 ,float ,ftostr4sign , 1 ); // 1234 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) DEFINE_MENU_EDIT_ITEM_TYPE(float51 ,float ,ftostr51rj , 10 ); // 1234.5 right-justified @@ -483,7 +485,7 @@ class MenuItem_bool : public MenuEditItemBase { #if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7) #define DEFINE_SINGLENOZZLE_ITEM() \ auto singlenozzle_item = [&](const uint8_t f) { \ - editable.uint8 = singlenozzle_fan_speed[f]; \ + editable.uint8 = thermalManager.singlenozzle_fan_speed[f]; \ EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update); \ } #else diff --git a/Marlin/src/lcd/menu/menu_language.cpp b/Marlin/src/lcd/menu/menu_language.cpp new file mode 100644 index 000000000000..26660f22f80b --- /dev/null +++ b/Marlin/src/lcd/menu/menu_language.cpp @@ -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 . + * + */ + +// +// Language Selection Menu +// + +#include "../../inc/MarlinConfig.h" + +#if HAS_MULTI_LANGUAGE + +#include "menu_item.h" +#include "../../MarlinCore.h" +#include "../../module/settings.h" + +static void set_lcd_language(const uint8_t inlang) { + ui.set_language(inlang); + (void)settings.save(); +} + +void menu_language() { + START_MENU(); + BACK_ITEM(MSG_MAIN); + + MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE )::LANGUAGE, []{ set_lcd_language(0); }); + MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_2)::LANGUAGE, []{ set_lcd_language(1); }); + #if NUM_LANGUAGES > 2 + MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_3)::LANGUAGE, []{ set_lcd_language(2); }); + #if NUM_LANGUAGES > 3 + MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_4)::LANGUAGE, []{ set_lcd_language(3); }); + #if NUM_LANGUAGES > 4 + MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_5)::LANGUAGE, []{ set_lcd_language(4); }); + #endif + #endif + #endif + + END_MENU(); +} + +#endif // HAS_MULTI_LANGUAGE diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index cda11bfc57cc..24d048cafdac 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(); @@ -93,6 +97,10 @@ void menu_configuration(); void menu_spindle_laser(); #endif +#if HAS_MULTI_LANGUAGE + void menu_language(); +#endif + extern const char M21_STR[]; void menu_main() { @@ -120,6 +128,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) @@ -136,7 +149,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) { @@ -170,7 +183,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 @@ -238,7 +251,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) { @@ -316,6 +329,10 @@ void menu_main() { } #endif + #if HAS_MULTI_LANGUAGE + SUBMENU(LANGUAGE, menu_language); + #endif + END_MENU(); } 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/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 478608e9b313..5206cf4fe846 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -51,6 +51,8 @@ float manual_move_e_origin = 0; #endif +extern const char G28_STR[]; + // // "Motion" > "Move Axis" submenu // @@ -143,8 +145,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 +182,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 } } @@ -365,8 +367,6 @@ void menu_motion() { // #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 // @@ -384,7 +384,7 @@ void menu_motion() { #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) #if DISABLED(PROBE_MANUALLY) - GCODES_ITEM(MSG_LEVEL_BED, PSTR("G28\nG29")); + GCODES_ITEM(MSG_LEVEL_BED, PSTR("G29N")); #endif if (all_axes_homed() && leveling_is_valid()) { @@ -400,11 +400,11 @@ 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) - GCODES_ITEM(MSG_M48_TEST, PSTR("G28 O\nM48 P10")); + GCODES_ITEM(MSG_M48_TEST, PSTR("G28O\nM48 P10")); #endif // 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/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index f2b08afd79aa..5b88c8e805cc 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 } @@ -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 @@ -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) || 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)); + if (ui.wait_for_move) return; + #ifndef PROBE_OFFSET_WIZARD_XY_POS #define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER #endif @@ -133,18 +133,25 @@ 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 // 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; + 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(); @@ -173,7 +180,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(); diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index f1bf433c21ef..93ef224e6f6d 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,26 @@ 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 ENABLED(LASER_FEATURE) + // Setup and fire a test pulse using the current PWM power level for for a duration of test_pulse_min to test_pulse_max ms. + EDIT_ITEM_FAST(CUTTER_MENU_PULSE_TYPE, MSG_LASER_PULSE_MS, &cutter.testPulse, LASER_TEST_PULSE_MIN, LASER_TEST_PULSE_MAX); + ACTION_ITEM(MSG_LASER_FIRE_PULSE, cutter.test_fire_pulse); + #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(); } diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 7b6d7f1a1db6..01c1f8f5472f 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -35,7 +35,7 @@ #include "../../module/motion.h" #endif -#if ENABLED(SINGLENOZZLE) +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) #include "../../module/tool_change.h" #endif @@ -159,7 +159,7 @@ void menu_temperature() { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) LOOP_S_L_N(e, 1, EXTRUDERS) - EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - (HOTEND_OVERSHOOT)); + EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - (HOTEND_OVERSHOOT)); #endif // 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); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index c9043a118bd8..da7afd86ef79 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -42,37 +42,33 @@ 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); +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" +#endif + +static bool probe_single_point() { + do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES)); + // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety + const float z_probed_height = probe.probe_at_point(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; - - #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 + move_to_tramming_wait_pos(); return !isnan(z_probed_height); } -void _menu_single_probe(const uint8_t point) { +static 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 + ACTION_ITEM(MSG_BUTTON_DONE, []{ ui.goto_previous_screen(); }); // Back END_MENU(); } -void tramming_wizard_menu() { +static void tramming_wizard_menu() { DEBUG_ECHOLNPAIR("Screen: tramming_wizard_menu"); START_MENU(); STATIC_ITEM(MSG_SELECT_ORIGIN); @@ -81,7 +77,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(); } @@ -90,11 +89,11 @@ 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); + queue.inject_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR)); + ui.goto_screen([]{ _lcd_draw_homing(); if (all_axes_homed()) diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 87168ba1e769..cccb352d8ff0 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -34,12 +34,12 @@ #include "../../module/temperature.h" #include "../../MarlinCore.h" -#if HAS_LEVELING - #include "../../feature/bedlevel/bedlevel.h" +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + #include "../../module/tool_change.h" #endif -#if ENABLED(SINGLENOZZLE) - #include "../../module/tool_change.h" +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" #endif #if ENABLED(BABYSTEPPING) @@ -127,7 +127,7 @@ void menu_tune() { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) LOOP_S_L_N(e, 1, EXTRUDERS) - EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - HOTEND_OVERSHOOT); + EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - HOTEND_OVERSHOOT); #endif // diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 5dce47eec294..95e64a0d82ff 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -139,9 +139,9 @@ void _lcd_ubl_custom_mesh() { * UBL Adjust Mesh Height Command */ void _lcd_ubl_adjust_height_cmd() { - char ubl_lcd_gcode[16]; - const int ind = ubl_height_amount > 0 ? 9 : 10; - strcpy_P(ubl_lcd_gcode, PSTR("G29 P6 C -")); + char ubl_lcd_gcode[13]; + const int ind = ubl_height_amount > 0 ? 6 : 7; + strcpy_P(ubl_lcd_gcode, PSTR("G29P6C-")); sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount)); queue.inject(ubl_lcd_gcode); } @@ -174,8 +174,8 @@ void _menu_ubl_height_adjust() { void _lcd_ubl_edit_mesh() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29P4R999T")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29P4T")); SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -187,8 +187,8 @@ void _lcd_ubl_edit_mesh() { * UBL Validate Custom Mesh Command */ void _lcd_ubl_validate_custom_mesh() { - char ubl_lcd_gcode[24]; - sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C P H%" PRIi16 TERN_(HAS_HEATED_BED, " B%" PRIi16)) + char ubl_lcd_gcode[20]; + sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26CPH%" PRIi16 TERN_(HAS_HEATED_BED, "B%" PRIi16)) , custom_hotend_temp #if HAS_HEATED_BED , custom_bed_temp @@ -211,10 +211,10 @@ void _lcd_ubl_edit_mesh() { #if PREHEAT_COUNT #if HAS_HEATED_BED #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26 C P I" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))) #else #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26 C P B0 I" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))) #endif VALIDATE_MESH_GCODE_ITEM(0); @@ -251,7 +251,7 @@ void _lcd_ubl_grid_level() { EDIT_ITEM(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); ACTION_ITEM(MSG_UBL_MESH_LEVEL, []{ char ubl_lcd_gcode[12]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 J%i"), side_points); + sprintf_P(ubl_lcd_gcode, PSTR("G29J%i"), side_points); queue.inject(ubl_lcd_gcode); }); END_MENU(); @@ -268,7 +268,7 @@ void _lcd_ubl_grid_level() { void _lcd_ubl_mesh_leveling() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); + GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29J0")); SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -279,7 +279,7 @@ void _lcd_ubl_mesh_leveling() { */ void _lcd_ubl_fillin_amount_cmd() { char ubl_lcd_gcode[18]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); + sprintf_P(ubl_lcd_gcode, PSTR("G29P3RC.%i"), ubl_fillin_amount); gcode.process_subcommands_now(ubl_lcd_gcode); } @@ -297,8 +297,8 @@ void _menu_ubl_fillin() { START_MENU(); BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); + GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29P3T0")); + GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29P2BT0")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -326,7 +326,7 @@ void _lcd_ubl_build_mesh() { BACK_ITEM(MSG_UBL_TOOLS); #if PREHEAT_COUNT #if HAS_HEATED_BED - #define PREHEAT_BED_GCODE(M) "M190 I" STRINGIFY(M) "\n" + #define PREHEAT_BED_GCODE(M) "M190I" STRINGIFY(M) "\n" #else #define PREHEAT_BED_GCODE(M) "" #endif @@ -334,10 +334,10 @@ void _lcd_ubl_build_mesh() { PSTR( \ "G28\n" \ PREHEAT_BED_GCODE(M) \ - "M109 I" STRINGIFY(M) "\n" \ - "G29 P1\n" \ - "M104 S0\n" \ - "M140 S0" \ + "M109I" STRINGIFY(M) "\n" \ + "G29P1\n" \ + "M104S0\n" \ + "M140S0" \ ) ) BUILD_MESH_GCODE_ITEM(0); #if PREHEAT_COUNT > 1 @@ -355,11 +355,11 @@ void _lcd_ubl_build_mesh() { #endif // PREHEAT_COUNT SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); + GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G29NP1")); SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); - GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); + GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29P1C")); ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); + GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29I")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -369,7 +369,7 @@ void _lcd_ubl_build_mesh() { */ inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) { char ubl_lcd_gcode[40]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 %c%i\nM117 "), loadsave, ubl_storage_slot); + sprintf_P(ubl_lcd_gcode, PSTR("G29%c%i\nM117 "), loadsave, ubl_storage_slot); sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot); gcode.process_subcommands_now(ubl_lcd_gcode); } @@ -405,7 +405,7 @@ void _lcd_ubl_map_edit_cmd() { char ubl_lcd_gcode[50], str[10], str2[10]; dtostrf(ubl.mesh_index_to_xpos(x_plot), 0, 2, str); dtostrf(ubl.mesh_index_to_ypos(y_plot), 0, 2, str2); - snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29 P4 X%s Y%s R%i"), str, str2, int(n_edit_pts)); + snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29P4X%sY%sR%i"), str, str2, int(n_edit_pts)); queue.inject(ubl_lcd_gcode); } @@ -413,6 +413,10 @@ void _lcd_ubl_map_edit_cmd() { * UBL LCD Map Movement */ void ubl_map_move_to_xy() { + const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; + + // Some printers have unreachable areas in the mesh. Skip the move if unreachable. + if (!position_is_reachable(xy)) return; #if ENABLED(DELTA) if (current_position.z > delta_clip_start_height) { // Make sure the delta has fully free motion @@ -422,10 +426,8 @@ void ubl_map_move_to_xy() { } #endif - // Set the nozzle position to the mesh point - current_position.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); - - // Use the built-in manual move handler + // Use the built-in manual move handler to move to the mesh point. + ui.manual_move.set_destination(xy); ui.manual_move.soon(ALL_AXES); } @@ -524,7 +526,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); } @@ -542,9 +544,9 @@ void _ubl_goto_map_screen() { void _lcd_ubl_output_map() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29T0")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29T1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29S-1")); END_MENU(); } @@ -561,7 +563,7 @@ void _menu_ubl_tools() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); + GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29I999\nG29P2BT0")); #if ENABLED(G26_MESH_VALIDATION) SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); #endif @@ -587,12 +589,12 @@ void _menu_ubl_tools() { void _lcd_ubl_step_by_step() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29 P3 T0")); + GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G29NP1")); + GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29P3T0")); SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29P4R999T")); SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29P4R999T")); ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); END_MENU(); } @@ -616,9 +618,9 @@ void _lcd_ubl_level_bed() { START_MENU(); BACK_ITEM(MSG_MOTION); if (planner.leveling_active) - GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); + GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29D")); else - GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); + GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29A")); #if ENABLED(G26_MESH_VALIDATION) SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); #endif @@ -626,7 +628,7 @@ void _lcd_ubl_level_bed() { SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools); - GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29 W")); + GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29W")); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) editable.decimal = planner.z_fade_height; EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); 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..99d335d135f6 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -30,12 +30,22 @@ #include "../../inc/MarlinConfig.h" +#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 + #define ENDIAN_COLOR(C) (C) +#endif + #if HAS_UI_320x240 #define TFT_WIDTH 320 #define TFT_HEIGHT 240 #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 @@ -86,6 +96,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/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/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index 0b538ef4a87d..3f604005f9e5 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -142,7 +142,6 @@ void TFT_Queue::canvas(queueTask_t *task) { if (Canvas.ToScreen()) task->state = TASK_STATE_COMPLETED; } - void TFT_Queue::fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { finish_sketch(); @@ -158,7 +157,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 +199,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 +226,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 +260,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 +326,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 +344,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 45a91cd5e5c2..4c09d9803e4d 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -88,25 +88,31 @@ void MarlinUI::clear_lcd() { } #if ENABLED(SHOW_BOOTSCREEN) - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 1500 - #endif - void MarlinUI::show_bootscreen() { 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(); safe_delay(BOOTSCREEN_TIMEOUT); clear_lcd(); } -#endif // SHOW_BOOTSCREEN +#endif void MarlinUI::draw_kill_screen() { tft.queue.reset(); @@ -257,42 +263,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('%'); @@ -423,24 +424,28 @@ 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 } + 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); @@ -657,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_320x240.h b/Marlin/src/lcd/tft/ui_320x240.h index c9822f11cc69..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] = { - 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.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index d152acdf7726..b6ffb4592f63 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 @@ -90,29 +90,31 @@ void MarlinUI::clear_lcd() { } #if ENABLED(SHOW_BOOTSCREEN) - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 1500 - #endif - - #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(); safe_delay(BOOTSCREEN_TIMEOUT); clear_lcd(); } -#endif // SHOW_BOOTSCREEN +#endif void MarlinUI::draw_kill_screen() { tft.queue.reset(); @@ -257,48 +259,46 @@ 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); - - uint16_t color; - uint16_t offset; - bool is_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"); 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); - TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 4, 132, TFT_WIDTH - 8, 34)); + 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, 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); - 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('%'); @@ -306,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); @@ -315,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. @@ -448,10 +450,14 @@ 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); - 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 } @@ -480,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 } @@ -540,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); @@ -548,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); @@ -556,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); @@ -565,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(); @@ -585,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 @@ -643,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); } @@ -660,10 +666,27 @@ 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 } +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 @@ -844,17 +867,16 @@ static void moveAxis(AxisEnum axis, const int8_t direction) { NOMORE(ui.manual_move.offset, max - current_position[axis]); #else current_position[axis] += diff; + const char *msg = PSTR(""); // clear the error if (direction < 0 && current_position[axis] < min) { current_position[axis] = min; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS); } else if (direction > 0 && current_position[axis] > max) { current_position[axis] = max; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); - } - else { - drawMessage(""); // clear the error + msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS); } + drawMessage(msg); #endif ui.manual_move.soon(axis diff --git a/Marlin/src/lcd/tft/ui_480x320.h b/Marlin/src/lcd/tft/ui_480x320.h index 053ee78158cb..e3a688f112b1 100644 --- a/Marlin/src/lcd/tft/ui_480x320.h +++ b/Marlin/src/lcd/tft/ui_480x320.h @@ -38,13 +38,22 @@ 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 const tImage Images[imgCount] = { - MarlinLogo195x59x16, + TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16), NoLogo), HotEnd_64x64x4, Bed_64x64x4, Bed_Heated_64x64x4, 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/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 50b0ce446383..245635857186 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 @@ -109,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/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp index e4ad8f215ba8..3c24d427342b 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.cpp +++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp @@ -23,28 +23,53 @@ #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; 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); - 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(); + 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"); @@ -52,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"); } } @@ -65,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/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); }; diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 8e231ca9abfe..975de58211f8 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -31,7 +31,9 @@ XPT2046 touchIO; #include "../tft_io/touch_calibration.h" #endif -#include "../marlinui.h" // For EN_C bit mask +#include "../buttons.h" // For EN_C bit mask +#include "../marlinui.h" // For ui.refresh +#include "../tft_io/tft_io.h" #define DOGM_AREA_LEFT TFT_PIXEL_OFFSET_X #define DOGM_AREA_TOP TFT_PIXEL_OFFSET_Y @@ -49,7 +51,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(); @@ -64,7 +67,6 @@ uint8_t TouchButtons::read_buttons() { 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 diff --git a/Marlin/src/libs/BL24CXX.cpp b/Marlin/src/libs/BL24CXX.cpp index d34ed8340f83..8de320d57619 100644 --- a/Marlin/src/libs/BL24CXX.cpp +++ b/Marlin/src/libs/BL24CXX.cpp @@ -1,6 +1,5 @@ /** * 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 diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index 8914bc560eee..7d36a02d673f 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -60,16 +60,11 @@ uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction comma const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR - , (INVERT_X_DIR) // X2 - #if ENABLED(X_DUAL_STEPPER_DRIVERS) - ^ ENABLED(INVERT_X2_VS_X_DIR) - #endif - , (INVERT_Y_DIR) // Y2 - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - ^ ENABLED(INVERT_Y2_VS_Y_DIR) - #endif - , INVERT_Z_DIR, INVERT_Z_DIR, INVERT_Z_DIR // Z2,Z3,Z4 - + , (INVERT_X_DIR) ^ BOTH(X_DUAL_STEPPER_DRIVERS, INVERT_X2_VS_X_DIR) // X2 + , (INVERT_Y_DIR) ^ BOTH(Y_DUAL_STEPPER_DRIVERS, INVERT_Y2_VS_Y_DIR) // Y2 + , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2 + , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z3_VS_Z_DIR) // Z3 + , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z4_VS_Z_DIR) // Z4 , INVERT_E0_DIR, INVERT_E1_DIR, INVERT_E2_DIR, INVERT_E3_DIR , INVERT_E4_DIR, INVERT_E5_DIR, INVERT_E6_DIR, INVERT_E7_DIR }; diff --git a/Marlin/src/libs/L64XX/README.md b/Marlin/src/libs/L64XX/README.md index c68d8ca0edbc..d28bec5e67f5 100644 --- a/Marlin/src/libs/L64XX/README.md +++ b/Marlin/src/libs/L64XX/README.md @@ -16,7 +16,7 @@ This software assumes that all drivers are in one SPI daisy chain. - SDO of the last device is tied to MISO of the controller -- All devices share the same `SCK` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). +- All devices share the same `SCK_PIN` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). - Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). diff --git a/Marlin/src/libs/W25Qxx.cpp b/Marlin/src/libs/W25Qxx.cpp index ebf326f2e5f2..be5b4290dd1a 100644 --- a/Marlin/src/libs/W25Qxx.cpp +++ b/Marlin/src/libs/W25Qxx.cpp @@ -49,6 +49,8 @@ MarlinSPI W25QXXFlash::mySPI(SPI_FLASH_MOSI_PIN, SPI_FLASH_MISO_PIN, SPI_FLASH_S #define W25QXX_CS_H OUT_WRITE(SPI_FLASH_CS_PIN, HIGH) #define W25QXX_CS_L OUT_WRITE(SPI_FLASH_CS_PIN, LOW) +bool flash_dma_mode = true; + void W25QXXFlash::init(uint8_t spiRate) { OUT_WRITE(SPI_FLASH_CS_PIN, HIGH); @@ -144,11 +146,11 @@ uint16_t W25QXXFlash::W25QXX_ReadID(void) { } void W25QXXFlash::SPI_FLASH_WriteEnable(void) { - /* Select the FLASH: Chip Select low */ + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send "Write Enable" instruction */ + // Send "Write Enable" instruction spi_flash_Send(W25X_WriteEnable); - /* Deselect the FLASH: Chip Select high */ + // Deselect the FLASH: Chip Select high W25QXX_CS_H; } @@ -164,54 +166,54 @@ void W25QXXFlash::SPI_FLASH_WriteEnable(void) { void W25QXXFlash::SPI_FLASH_WaitForWriteEnd(void) { uint8_t FLASH_Status = 0; - /* Select the FLASH: Chip Select low */ + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send "Read Status Register" instruction */ + // Send "Read Status Register" instruction spi_flash_Send(W25X_ReadStatusReg); - /* Loop as long as the memory is busy with a write cycle */ + // Loop as long as the memory is busy with a write cycle do /* Send a dummy byte to generate the clock needed by the FLASH and put the value of the status register in FLASH_Status variable */ FLASH_Status = spi_flash_Rec(); - while ((FLASH_Status & WIP_Flag) == 0x01); /* Write in progress */ + while ((FLASH_Status & WIP_Flag) == 0x01); // Write in progress - /* Deselect the FLASH: Chip Select high */ + // Deselect the FLASH: Chip Select high W25QXX_CS_H; } void W25QXXFlash::SPI_FLASH_SectorErase(uint32_t SectorAddr) { - /* Send write enable instruction */ + // Send write enable instruction SPI_FLASH_WriteEnable(); - /* Sector Erase */ - /* Select the FLASH: Chip Select low */ + // Sector Erase + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send Sector Erase instruction */ + // Send Sector Erase instruction spi_flash_Send(W25X_SectorErase); - /* Send SectorAddr high nibble address byte */ + // Send SectorAddr high nibble address byte spi_flash_Send((SectorAddr & 0xFF0000) >> 16); - /* Send SectorAddr medium nibble address byte */ + // Send SectorAddr medium nibble address byte spi_flash_Send((SectorAddr & 0xFF00) >> 8); - /* Send SectorAddr low nibble address byte */ + // Send SectorAddr low nibble address byte spi_flash_Send(SectorAddr & 0xFF); - /* Deselect the FLASH: Chip Select high */ + // Deselect the FLASH: Chip Select high W25QXX_CS_H; - /* Wait the end of Flash writing */ + // Wait the end of Flash writing SPI_FLASH_WaitForWriteEnd(); } void W25QXXFlash::SPI_FLASH_BlockErase(uint32_t BlockAddr) { SPI_FLASH_WriteEnable(); W25QXX_CS_L; - /* Send Sector Erase instruction */ + // Send Sector Erase instruction spi_flash_Send(W25X_BlockErase); - /* Send SectorAddr high nibble address byte */ + // Send SectorAddr high nibble address byte spi_flash_Send((BlockAddr & 0xFF0000) >> 16); - /* Send SectorAddr medium nibble address byte */ + // Send SectorAddr medium nibble address byte spi_flash_Send((BlockAddr & 0xFF00) >> 8); - /* Send SectorAddr low nibble address byte */ + // Send SectorAddr low nibble address byte spi_flash_Send(BlockAddr & 0xFF); W25QXX_CS_H; @@ -227,18 +229,18 @@ void W25QXXFlash::SPI_FLASH_BlockErase(uint32_t BlockAddr) { * Return : None *******************************************************************************/ void W25QXXFlash::SPI_FLASH_BulkErase(void) { - /* Send write enable instruction */ + // Send write enable instruction SPI_FLASH_WriteEnable(); - /* Bulk Erase */ - /* Select the FLASH: Chip Select low */ + // Bulk Erase + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send Bulk Erase instruction */ + // Send Bulk Erase instruction spi_flash_Send(W25X_ChipErase); - /* Deselect the FLASH: Chip Select high */ + // Deselect the FLASH: Chip Select high W25QXX_CS_H; - /* Wait the end of Flash writing */ + // Wait the end of Flash writing SPI_FLASH_WaitForWriteEnd(); } @@ -256,34 +258,34 @@ void W25QXXFlash::SPI_FLASH_BulkErase(void) { * Return : None *******************************************************************************/ void W25QXXFlash::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite) { - /* Enable the write access to the FLASH */ + // Enable the write access to the FLASH SPI_FLASH_WriteEnable(); - /* Select the FLASH: Chip Select low */ + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send "Write to Memory " instruction */ + // Send "Write to Memory " instruction spi_flash_Send(W25X_PageProgram); - /* Send WriteAddr high nibble address byte to write to */ + // Send WriteAddr high nibble address byte to write to spi_flash_Send((WriteAddr & 0xFF0000) >> 16); - /* Send WriteAddr medium nibble address byte to write to */ + // Send WriteAddr medium nibble address byte to write to spi_flash_Send((WriteAddr & 0xFF00) >> 8); - /* Send WriteAddr low nibble address byte to write to */ + // Send WriteAddr low nibble address byte to write to spi_flash_Send(WriteAddr & 0xFF); NOMORE(NumByteToWrite, SPI_FLASH_PerWritePageSize); - /* while there is data to be written on the FLASH */ + // While there is data to be written on the FLASH while (NumByteToWrite--) { - /* Send the current byte */ + // Send the current byte spi_flash_Send(*pBuffer); - /* Point on the next byte to be written */ + // Point on the next byte to be written pBuffer++; } - /* Deselect the FLASH: Chip Select high */ + // Deselect the FLASH: Chip Select high W25QXX_CS_H; - /* Wait the end of Flash writing */ + // Wait the end of Flash writing SPI_FLASH_WaitForWriteEnd(); } @@ -306,11 +308,11 @@ void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, ui NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; - if (Addr == 0) { /* WriteAddr is SPI_FLASH_PageSize aligned */ - if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ + if (Addr == 0) { // WriteAddr is SPI_FLASH_PageSize aligned + if (NumOfPage == 0) { // NumByteToWrite < SPI_FLASH_PageSize SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); } - else { /* NumByteToWrite > SPI_FLASH_PageSize */ + else { // NumByteToWrite > SPI_FLASH_PageSize while (NumOfPage--) { SPI_FLASH_PageWrite(pBuffer, WriteAddr, SPI_FLASH_PageSize); WriteAddr += SPI_FLASH_PageSize; @@ -319,20 +321,19 @@ void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, ui SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumOfSingle); } } - else { /* WriteAddr is not SPI_FLASH_PageSize aligned */ - if (NumOfPage == 0) { /* NumByteToWrite < SPI_FLASH_PageSize */ - if (NumOfSingle > count) { /* (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize */ + else { // WriteAddr is not SPI_FLASH_PageSize aligned + if (NumOfPage == 0) { // NumByteToWrite < SPI_FLASH_PageSize + if (NumOfSingle > count) { // (NumByteToWrite + WriteAddr) > SPI_FLASH_PageSize temp = NumOfSingle - count; SPI_FLASH_PageWrite(pBuffer, WriteAddr, count); WriteAddr += count; pBuffer += count; SPI_FLASH_PageWrite(pBuffer, WriteAddr, temp); } - else { + else SPI_FLASH_PageWrite(pBuffer, WriteAddr, NumByteToWrite); - } } - else { /* NumByteToWrite > SPI_FLASH_PageSize */ + else { // NumByteToWrite > SPI_FLASH_PageSize NumByteToWrite -= count; NumOfPage = NumByteToWrite / SPI_FLASH_PageSize; NumOfSingle = NumByteToWrite % SPI_FLASH_PageSize; @@ -364,30 +365,30 @@ void W25QXXFlash::SPI_FLASH_BufferWrite(uint8_t* pBuffer, uint32_t WriteAddr, ui * Return : None *******************************************************************************/ void W25QXXFlash::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { - /* Select the FLASH: Chip Select low */ + // Select the FLASH: Chip Select low W25QXX_CS_L; - /* Send "Read from Memory " instruction */ + // Send "Read from Memory " instruction spi_flash_Send(W25X_ReadData); - /* Send ReadAddr high nibble address byte to read from */ + // Send ReadAddr high nibble address byte to read from spi_flash_Send((ReadAddr & 0xFF0000) >> 16); - /* Send ReadAddr medium nibble address byte to read from */ + // Send ReadAddr medium nibble address byte to read from spi_flash_Send((ReadAddr & 0xFF00) >> 8); - /* Send ReadAddr low nibble address byte to read from */ + // Send ReadAddr low nibble address byte to read from spi_flash_Send(ReadAddr & 0xFF); - if (NumByteToRead < 33) { - while (NumByteToRead--) { /* while there is data to be read */ - /* Read a byte from the FLASH */ + if (NumByteToRead <= 32 || !flash_dma_mode) { + while (NumByteToRead--) { // While there is data to be read + // Read a byte from the FLASH *pBuffer = spi_flash_Rec(); - /* Point to the next location where the byte read will be saved */ + // Point to the next location where the byte read will be saved pBuffer++; } } - else { + else spi_flash_Read(pBuffer, NumByteToRead); - } + W25QXX_CS_H; } 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 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/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/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/Marlin/src/libs/private_spi.h b/Marlin/src/libs/private_spi.h index 9c0ffe7486d7..1d8eacd22d04 100644 --- a/Marlin/src/libs/private_spi.h +++ b/Marlin/src/libs/private_spi.h @@ -35,12 +35,12 @@ class SPIclass { // Hardware SPI template<> -class SPIclass { +class SPIclass { public: FORCE_INLINE static void init() { - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); + OUT_WRITE(SD_SCK_PIN, LOW); + OUT_WRITE(SD_MOSI_PIN, HIGH); + SET_INPUT_PULLUP(SD_MISO_PIN); } FORCE_INLINE static uint8_t receive() { #if defined(__AVR__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 697ced783379..b9d2c1cdf561 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -27,7 +27,6 @@ #include "endstops.h" #include "stepper.h" -#include "../MarlinCore.h" #include "../sd/cardreader.h" #include "temperature.h" #include "../lcd/marlinui.h" @@ -48,6 +47,10 @@ #include "../feature/joystick.h" #endif +#if HAS_BED_PROBE + #include "probe.h" +#endif + Endstops endstops; // private: @@ -276,6 +279,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 @@ -454,8 +463,11 @@ 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(probe_switch_activated(), PSTR(STR_PROBE_EN)); + #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 @@ -578,7 +590,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 @@ -603,9 +615,10 @@ 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 (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/motion.cpp b/Marlin/src/module/motion.cpp index 03c8ddc46296..f7fc66b27af3 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; @@ -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 /** @@ -246,8 +236,17 @@ void report_current_position_projected() { } /** - * sync_plan_position - * + * Run out the planner buffer and re-sync the current + * position from the last-updated stepper positions. + */ +void quickstop_stepper() { + planner.quick_stop(); + planner.synchronize(); + set_current_from_steppers_for_axis(ALL_AXES); + sync_plan_position(); +} + +/** * Set the planner/stepper positions directly from current_position with * no kinematic translation. Used for homing axes and cartesian/core syncing. */ @@ -506,11 +505,11 @@ 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))); + do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, z_probe_fast_mm_s, homing_feedrate(Z_AXIS))); } // @@ -605,16 +604,17 @@ void restore_feedrate_and_scaling() { // Software endstops are relative to the tool 0 workspace, so // the movement limits must be shifted by the tool offset to // retain the same physical limit when other tools are selected. - if (old_tool_index != new_tool_index) { - const float offs = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; - soft_endstop.min[axis] += offs; - soft_endstop.max[axis] += offs; - } - else { - const float offs = hotend_offset[active_extruder][axis]; + + if (new_tool_index == old_tool_index || axis == Z_AXIS) { // The Z axis is "special" and shouldn't be modified + const float offs = (axis == Z_AXIS) ? 0 : hotend_offset[active_extruder][axis]; soft_endstop.min[axis] = base_min_pos(axis) + offs; soft_endstop.max[axis] = base_max_pos(axis) + offs; } + else { + const float diff = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; + soft_endstop.min[axis] += diff; + soft_endstop.max[axis] += diff; + } #else @@ -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 @@ -998,7 +998,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { if (delayed_move_time != 0xFFFFFFFFUL) { current_position = destination; NOLESS(raised_parked_position.z, destination.z); - delayed_move_time = millis(); + delayed_move_time = millis() + 1000UL; return true; } } @@ -1016,7 +1016,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { line_to_current_position(fr_zfast); } } - planner.synchronize(); // paranoia stepper.set_directions(); idex_set_parked(false); @@ -1124,10 +1123,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; } @@ -1299,26 +1299,20 @@ feedRate_t get_homing_bump_feedrate(const AxisEnum axis) { /** * Home an individual linear axis */ -void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0) { +void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0, const bool final_approach=true) { DEBUG_SECTION(log_move, "do_homing_move", DEBUGGING(LEVELING)); - const feedRate_t real_fr_mm_s = fr_mm_s ?: homing_feedrate(axis); + const feedRate_t home_fr_mm_s = fr_mm_s ?: homing_feedrate(axis); if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR("...(", axis_codes[axis], ", ", distance, ", "); if (fr_mm_s) DEBUG_ECHO(fr_mm_s); else - DEBUG_ECHOPAIR("[", real_fr_mm_s, "]"); + DEBUG_ECHOPAIR("[", home_fr_mm_s, "]"); DEBUG_ECHOLNPGM(")"); } - #if ALL(HOMING_Z_WITH_PROBE, HAS_HEATED_BED, WAIT_FOR_BED_HEATER) - // Wait for bed to heat back up between probing points - if (axis == Z_AXIS && distance < 0) - thermalManager.wait_for_bed_heating(); - #endif - // Only do some things when moving towards an endstop const int8_t axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS) ? x_home_dir(active_extruder) : home_dir(axis); @@ -1330,9 +1324,14 @@ 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 (axis == Z_AXIS) probe.set_probing_paused(true); - #endif + if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS)) { + #if ALL(HAS_HEATED_BED, WAIT_FOR_BED_HEATER) + // Wait for bed to heat back up between probing points + thermalManager.wait_for_bed_heating(); + #endif + + TERN_(HAS_QUIET_PROBING, if (final_approach) probe.set_probing_paused(true)); + } // Disable stealthChop if used. Enable diag1 pin on driver. TERN_(SENSORLESS_HOMING, stealth_states = start_sensorless_homing_per_axis(axis)); @@ -1343,7 +1342,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t current_position[axis] = 0; sync_plan_position(); current_position[axis] = distance; - line_to_current_position(real_fr_mm_s); + line_to_current_position(home_fr_mm_s); #else // Get the ABC or XYZ positions in mm abce_pos_t target = planner.get_axis_positions_mm(); @@ -1361,7 +1360,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t #if HAS_DIST_MM_ARG , cart_dist_mm #endif - , real_fr_mm_s, active_extruder + , home_fr_mm_s, active_extruder ); #endif @@ -1369,8 +1368,8 @@ 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 (axis == Z_AXIS) probe.set_probing_paused(false); + #if HOMING_Z_WITH_PROBE && HAS_QUIET_PROBING + if (axis == Z_AXIS && final_approach) probe.set_probing_paused(false); #endif endstops.validate_homing_move(); @@ -1388,7 +1387,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 +1400,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 +1461,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], ")"); @@ -1489,10 +1488,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; @@ -1500,7 +1501,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; @@ -1508,7 +1509,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; @@ -1578,7 +1579,9 @@ void homeaxis(const AxisEnum axis) { const int axis_home_dir = TERN0(DUAL_X_CARRIAGE, axis == X_AXIS) ? x_home_dir(active_extruder) : home_dir(axis); - // Homing Z towards the bed? Deploy the Z probe or endstop. + // + // Homing Z with a probe? Raise Z (maybe) and deploy the Z probe. + // if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && probe.deploy())) return; @@ -1593,40 +1596,51 @@ void homeaxis(const AxisEnum axis) { } #endif - // 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 + // + // Deploy BLTouch or tare the probe just before probing + // + #if HOMING_Z_WITH_PROBE + if (axis == Z_AXIS) { + if (TERN0(BLTOUCH, bltouch.deploy())) return; // BLTouch was deployed above, but get the alarm state. + if (TERN0(PROBE_TARE, probe.tare())) return; + } #endif + // + // Back away to prevent an early X/Y sensorless trigger + // #if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM) const xy_float_t backoff = SENSORLESS_BACKOFF_MM; - if (((ENABLED(X_SENSORLESS) && axis == X_AXIS) || (ENABLED(Y_SENSORLESS) && axis == Y_AXIS)) && backoff[axis]) - do_homing_move(axis, -ABS(backoff[axis]) * axis_home_dir, homing_feedrate(axis)); - #endif - - 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 (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE) + if ((TERN0(X_SENSORLESS, axis == X_AXIS) || TERN0(Y_SENSORLESS, axis == Y_AXIS)) && backoff[axis]) { + const float backoff_length = -ABS(backoff[axis]) * axis_home_dir; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Sensorless backoff: ", backoff_length, "mm"); + do_homing_move(axis, backoff_length, homing_feedrate(axis)); + } #endif + // Determine if a homing bump will be done and the bumps distance // When homing Z with probe respect probe clearance const bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(Z_AXIS)); const float bump = axis_home_dir * ( use_probe_bump ? _MAX(TERN0(HOMING_Z_WITH_PROBE, Z_CLEARANCE_BETWEEN_PROBES), home_bump_mm(Z_AXIS)) : home_bump_mm(axis) ); + // + // Fast move towards endstop until triggered + // + const float move_length = 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Home Fast: ", move_length, "mm"); + do_homing_move(axis, move_length, 0.0, !use_probe_bump); + + #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE) + if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE) + #endif + // If a second homing move is configured... if (bump) { // Move away from the endstop by the axis HOMING_BUMP_MM - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:"); - do_homing_move(axis, -bump - #if HOMING_Z_WITH_PROBE - , MMM_TO_MMS(axis == Z_AXIS ? Z_PROBE_SPEED_FAST : 0) - #endif - ); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Move Away: ", -bump, "mm"); + do_homing_move(axis, -bump, TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0, false); #if ENABLED(DETECT_BROKEN_ENDSTOP) // Check for a broken endstop @@ -1643,14 +1657,14 @@ void homeaxis(const AxisEnum axis) { } #endif - // 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 - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); + // Slow move towards endstop until triggered + const float rebump = bump * 2; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Re-bump: ", rebump, "mm"); + do_homing_move(axis, rebump, get_homing_bump_feedrate(axis), true); #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) if (axis == Z_AXIS) bltouch.stow(); // The final STOW @@ -1838,7 +1852,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 abc59f92b886..887da1aa1886 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; @@ -70,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) @@ -78,20 +65,40 @@ 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); +/** + * 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 @@ -205,6 +212,8 @@ void report_current_position_projected(); void get_cartesian_from_steppers(); void set_current_from_steppers_for_axis(const AxisEnum axis); +void quickstop_stepper(); + /** * sync_plan_position * @@ -269,23 +278,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 */ @@ -381,9 +409,6 @@ bool homing_needed_error(uint8_t axis_bits=0x07); */ #if HAS_DUPLICATION_MODE extern bool extruder_duplication_enabled; // Used in Dual X mode 2 - #if ENABLED(MULTI_NOZZLE_DUPLICATION) - extern uint8_t duplication_e_mask; - #endif #endif /** @@ -420,6 +445,7 @@ bool homing_needed_error(uint8_t axis_bits=0x07); #else #if ENABLED(MULTI_NOZZLE_DUPLICATION) + extern uint8_t duplication_e_mask; enum DualXMode : char { DXC_DUPLICATION_MODE = 2 }; FORCE_INLINE void set_duplication_enabled(const bool dupe) { extruder_duplication_enabled = dupe; } #endif 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) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index ac30938f2a4a..cd906c5d134a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -712,7 +712,7 @@ class Planner { private: // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const feedRate_t); + friend void do_homing_move(const AxisEnum, const float, const feedRate_t, const bool); #endif /** @@ -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 f02b90915063..94c409eb721f 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -38,7 +38,7 @@ #include "../gcode/gcode.h" #include "../lcd/marlinui.h" -#include "../MarlinCore.h" // for stop(), disable_e_steppers +#include "../MarlinCore.h" // for stop(), disable_e_steppers(), wait_for_user_response() #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" @@ -73,7 +73,7 @@ #include "../feature/tmc_util.h" #endif -#if QUIET_PROBING +#if HAS_QUIET_PROBING #include "stepper/indirection.h" #endif @@ -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) @@ -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) @@ -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 @@ -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); @@ -331,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 * @@ -349,19 +373,19 @@ bool Probe::set_deployed(const bool deploy) { // Fix-mounted probe should only raise for deploy // unless PAUSE_BEFORE_DEPLOY_STOW is enabled #if EITHER(FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE) && DISABLED(PAUSE_BEFORE_DEPLOY_STOW) - const bool deploy_stow_condition = deploy; + const bool z_raise_wanted = deploy; #else - constexpr bool deploy_stow_condition = true; + constexpr bool z_raise_wanted = true; #endif // 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 z_is_trusted = axis_is_trusted(Z_AXIS); #else - constexpr float unknown_condition = true; + constexpr float z_is_trusted = true; #endif - if (deploy_stow_condition && unknown_condition) + if (z_is_trusted && z_raise_wanted) do_z_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) @@ -375,23 +399,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")); @@ -406,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; @@ -436,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) @@ -451,7 +468,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); @@ -465,7 +482,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) @@ -477,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(); @@ -493,6 +509,43 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { return !probe_triggered; } +#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 + * + * @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 (endstops.probe_switch_activated()) { + SERIAL_ECHOLNPGM("Cannot tare an active probe"); + return true; + } + #endif + + SERIAL_ECHOLNPGM("Taring probe"); + WRITE(PROBE_TARE_PIN, PROBE_TARE_STATE); + delay(PROBE_TARE_TIME); + 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. * @@ -504,7 +557,10 @@ 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 { + // 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? @@ -524,13 +580,16 @@ 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 + // 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, 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; @@ -538,7 +597,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 @@ -547,8 +606,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 @@ -567,6 +626,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; @@ -596,7 +658,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 } @@ -678,18 +740,15 @@ 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; 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? @@ -697,8 +756,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); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index cac106fed681..d28cdff53a8e 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: @@ -45,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 @@ -52,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 @@ -71,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); @@ -79,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); } @@ -95,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) @@ -127,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 @@ -136,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); @@ -196,10 +238,15 @@ class Probe { static void servo_probe_init(); #endif - #if QUIET_PROBING + #if HAS_QUIET_PROBING static void set_probing_paused(const bool p); #endif + #if ENABLED(PROBE_TARE) + static void tare_init(); + 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/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 6614aec35b8a..0a5439facded 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -36,7 +36,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V82" +#define EEPROM_VERSION "V83" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -50,10 +50,6 @@ #include "stepper.h" #include "temperature.h" -#if ENABLED(DWIN_CREALITY_LCD) - #include "../lcd/dwin/e3v2/dwin.h" -#endif - #include "../lcd/marlinui.h" #include "../libs/vector_3.h" // for matrix_3x3 #include "../gcode/gcode.h" @@ -461,6 +457,11 @@ typedef struct SettingsDataStruct { #if ENABLED(SOUND_MENU_ITEM) bool buzzer_enabled; #endif + + #if HAS_MULTI_LANGUAGE + uint8_t ui_language; // M414 S + #endif + } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -559,13 +560,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 ENABLED(DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" #if ENABLED(EEPROM_SETTINGS) @@ -698,7 +697,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); } @@ -1388,6 +1387,13 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(ui.buzzer_enabled); #endif + // + // Selected LCD language + // + #if HAS_MULTI_LANGUAGE + EEPROM_WRITE(ui.language); + #endif + // // Report final CRC and Data Size // @@ -2267,6 +2273,18 @@ void MarlinSettings::postprocess() { EEPROM_READ(ui.buzzer_enabled); #endif + // + // Selected LCD language + // + #if HAS_MULTI_LANGUAGE + { + uint8_t ui_language; + EEPROM_READ(ui_language); + if (ui_language >= NUM_LANGUAGES) ui_language = 0; + ui.set_language(ui_language); + } + #endif + // // Validate Final Size and CRC // @@ -2296,14 +2314,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("."); @@ -2369,7 +2387,7 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_UBL) inline void ubl_invalid_slot(const int s) { - #if ENABLED(EEPROM_CHITCHAT) + #if BOTH(EEPROM_CHITCHAT, DEBUG_OUT) DEBUG_ECHOLNPGM("?Invalid slot."); DEBUG_ECHO(s); DEBUG_ECHOLNPGM(" mesh slots available."); @@ -2387,12 +2405,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) { @@ -2409,9 +2429,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."); @@ -2437,12 +2465,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); @@ -2590,7 +2633,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 @@ -3827,6 +3870,11 @@ void MarlinSettings::reset() { CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M553_report(); CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M554_report(); #endif + + #if HAS_MULTI_LANGUAGE + CONFIG_ECHO_HEADING("UI Language:"); + SERIAL_ECHO_MSG(" M414 S", int(ui.language)); + #endif } #endif // !DISABLE_M503 diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 8b4bc23cb98e..466f4f333afe 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -91,7 +91,6 @@ Stepper stepper; // Singleton #include "planner.h" #include "motion.h" -#include "temperature.h" #include "../lcd/marlinui.h" #include "../gcode/queue.h" #include "../sd/cardreader.h" @@ -381,7 +380,10 @@ xyze_int8_t Stepper::count_direction{0}; #endif #if NUM_Z_STEPPER_DRIVERS == 4 - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); Z3_DIR_WRITE(v); Z4_DIR_WRITE(v); }while(0) + #define Z_APPLY_DIR(v,Q) do{ \ + Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); \ + Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); Z4_DIR_WRITE((v) ^ ENABLED(INVERT_Z4_VS_Z_DIR)); \ + }while(0) #if ENABLED(Z_MULTI_ENDSTOPS) #define Z_APPLY_STEP(v,Q) QUAD_ENDSTOP_APPLY_STEP(Z,v) #elif ENABLED(Z_STEPPER_AUTO_ALIGN) @@ -390,7 +392,9 @@ xyze_int8_t Stepper::count_direction{0}; #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); Z4_STEP_WRITE(v); }while(0) #endif #elif NUM_Z_STEPPER_DRIVERS == 3 - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); Z3_DIR_WRITE(v); }while(0) + #define Z_APPLY_DIR(v,Q) do{ \ + Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); \ + }while(0) #if ENABLED(Z_MULTI_ENDSTOPS) #define Z_APPLY_STEP(v,Q) TRIPLE_ENDSTOP_APPLY_STEP(Z,v) #elif ENABLED(Z_STEPPER_AUTO_ALIGN) @@ -399,7 +403,7 @@ xyze_int8_t Stepper::count_direction{0}; #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); }while(0) #endif #elif NUM_Z_STEPPER_DRIVERS == 2 - #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0) + #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); }while(0) #if ENABLED(Z_MULTI_ENDSTOPS) #define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v) #elif ENABLED(Z_STEPPER_AUTO_ALIGN) 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) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d704ebc85bfd..00a048736a6b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -27,14 +27,17 @@ // Useful when debugging thermocouples //#define IGNORE_THERMOCOUPLE_ERRORS +#include "../MarlinCore.h" +#include "../HAL/shared/Delay.h" +#include "../lcd/marlinui.h" + #include "temperature.h" #include "endstops.h" - -#include "../MarlinCore.h" #include "planner.h" -#include "../HAL/shared/Delay.h" -#include "../lcd/marlinui.h" +#if ENABLED(EMERGENCY_PARSER) + #include "motion.h" +#endif #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/dwin/e3v2/dwin.h" @@ -53,7 +56,7 @@ #define MAX31865_CS2_PIN MAX6675_SS2_PIN #endif #ifndef MAX31865_MOSI_PIN - #define MAX31865_MOSI_PIN MOSI_PIN + #define MAX31865_MOSI_PIN SD_MOSI_PIN #endif #ifndef MAX31865_MISO_PIN #define MAX31865_MISO_PIN MAX6675_DO_PIN @@ -377,6 +380,13 @@ volatile bool Temperature::raw_temps_ready = false; Temperature::soft_pwm_count_fan[FAN_COUNT]; #endif +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + uint16_t Temperature::singlenozzle_temp[EXTRUDERS]; + #if HAS_FAN + uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS]; + #endif +#endif + #if ENABLED(PROBING_HEATERS_OFF) bool Temperature::paused; #endif @@ -793,9 +803,16 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) { marlin_state = MF_KILLED; #if USE_BEEPER + thermalManager.disable_all_heaters(); for (uint8_t i = 20; i--;) { - WRITE(BEEPER_PIN, HIGH); delay(25); - WRITE(BEEPER_PIN, LOW); delay(80); + WRITE(BEEPER_PIN, HIGH); + delay(25); + watchdog_refresh(); + WRITE(BEEPER_PIN, LOW); + delay(40); + watchdog_refresh(); + delay(40); + watchdog_refresh(); } WRITE(BEEPER_PIN, HIGH); #endif @@ -820,6 +837,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms } disable_all_heaters(); // always disable (even for bogus temp) + watchdog_refresh(); #if BOGUS_TEMPERATURE_GRACE_PERIOD const millis_t ms = millis(); @@ -923,8 +941,8 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { } #endif // PID_EXTRUSION_SCALING #if ENABLED(PID_FAN_SCALING) - if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { - work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder]; + if (fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { + work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * fan_speed[active_extruder]; pid_output += work_pid[ee].Kf; } //pid_output -= work_pid[ee].Ki; @@ -1234,7 +1252,7 @@ void Temperature::manage_heater() { #if ENABLED(CHAMBER_FAN) #if CHAMBER_FAN_MODE == 0 - fan_chamber_pwm = CHAMBER_FAN_BASE + fan_chamber_pwm = CHAMBER_FAN_BASE; #elif CHAMBER_FAN_MODE == 1 fan_chamber_pwm = (temp_chamber.celsius > temp_chamber.target) ? (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target) : 0; #elif CHAMBER_FAN_MODE == 2 @@ -1243,7 +1261,7 @@ void Temperature::manage_heater() { fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2; #endif NOMORE(fan_chamber_pwm, 225); - thermalManager.set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan + set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan #endif #if ENABLED(CHAMBER_VENT) @@ -1274,7 +1292,7 @@ void Temperature::manage_heater() { else if (!flag_chamber_off) { #if ENABLED(CHAMBER_FAN) flag_chamber_off = true; - thermalManager.set_fan_speed(2, 0); + set_fan_speed(2, 0); #endif #if ENABLED(CHAMBER_VENT) flag_chamber_excess_heat = false; @@ -1355,7 +1373,7 @@ void Temperature::manage_heater() { user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load() void Temperature::reset_user_thermistors() { - user_thermistor_t user_thermistor[USER_THERMISTORS] = { + user_thermistor_t default_user_thermistor[USER_THERMISTORS] = { #if HEATER_0_USER_THERMISTOR { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, #endif @@ -1387,7 +1405,7 @@ void Temperature::manage_heater() { { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 } #endif }; - COPY(thermalManager.user_thermistor, user_thermistor); + COPY(user_thermistor, default_user_thermistor); } void Temperature::log_user_thermistor(const uint8_t t_index, const bool eprom/*=false*/) { @@ -1396,8 +1414,7 @@ void Temperature::manage_heater() { SERIAL_ECHOPGM(" M305 "); else SERIAL_ECHO_START(); - SERIAL_CHAR('P'); - SERIAL_CHAR('0' + t_index); + SERIAL_CHAR('P', '0' + t_index); const user_thermistor_t &t = user_thermistor[t_index]; @@ -1662,7 +1679,7 @@ void Temperature::updateTemperaturesFromRawValues() { #if MAX6675_SEPARATE_SPI template SoftSPI SPIclass::softSPI; - SPIclass max6675_spi; + SPIclass max6675_spi; #endif // Init fans according to whether they're native PWM or Software PWM @@ -2188,6 +2205,24 @@ void Temperature::disable_all_heaters() { #endif // PROBING_HEATERS_OFF +#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + + void Temperature::singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool) { + #if HAS_FAN + singlenozzle_fan_speed[old_tool] = fan_speed[0]; + fan_speed[0] = singlenozzle_fan_speed[new_tool]; + #endif + singlenozzle_temp[old_tool] = temp_hotend[0].target; + if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { + setTargetHotend(singlenozzle_temp[new_tool], 0); + TERN_(AUTOTEMP, planner.autotemp_update()); + TERN_(HAS_DISPLAY, set_heating_message(0)); + (void)wait_for_hotend(0, false); // Wait for heating or cooling + } + } + +#endif + #if HAS_MAX6675 #ifndef THERMOCOUPLE_MAX_ERRORS @@ -2423,7 +2458,7 @@ void Temperature::readings_ready() { #endif // HAS_HOTEND - #if HAS_HEATED_BED + #if ENABLED(THERMAL_PROTECTION_BED) #if TEMPDIR(BED) < 0 #define BEDCMP(A,B) ((A)<(B)) #else @@ -2434,7 +2469,7 @@ void Temperature::readings_ready() { if (bed_on && BEDCMP(mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED); #endif - #if HAS_HEATED_CHAMBER + #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) #if TEMPDIR(CHAMBER) < 0 #define CHAMBERCMP(A,B) ((A)<(B)) #else @@ -2529,6 +2564,8 @@ void Temperature::tick() { static SoftPWM soft_pwm_chamber; #endif + #define WRITE_FAN(n, v) WRITE(FAN##n##_PIN, (v) ^ FAN_INVERTING) + #if DISABLED(SLOW_PWM_HEATERS) #if ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_HEATED_CHAMBER, FAN_SOFT_PWM) @@ -2993,14 +3030,19 @@ void Temperature::tick() { default: k = 'B'; break; #endif } - SERIAL_CHAR(' '); - SERIAL_CHAR(k); + SERIAL_CHAR(' ', k); #if HAS_MULTI_HOTEND if (e >= 0) SERIAL_CHAR('0' + e); #endif + #ifdef SERIAL_FLOAT_PRECISION + #define SFP _MIN(SERIAL_FLOAT_PRECISION, 2) + #else + #define SFP 2 + #endif SERIAL_CHAR(':'); - SERIAL_ECHO(c); - SERIAL_ECHOPAIR(" /" , t); + SERIAL_PRINT(c, SFP); + SERIAL_ECHOPGM(" /"); + SERIAL_PRINT(t, SFP); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_ECHOPAIR(" (", r * RECIPROCAL(OVERSAMPLENR)); SERIAL_CHAR(')'); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 33f38c303608..86c202cadca3 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -69,7 +69,7 @@ hotend_pid_t; typedef IF<(LPQ_MAX_LEN > 255), uint16_t, uint8_t>::type lpq_ptr_t; #endif -#define PID_PARAM(F,H) _PID_##F(TERN(PID_PARAMS_PER_HOTEND, H, 0)) +#define PID_PARAM(F,H) _PID_##F(TERN(PID_PARAMS_PER_HOTEND, H, 0 & H)) // Always use 'H' to suppress warning #define _PID_Kp(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kp, NAN) #define _PID_Ki(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Ki, NAN) #define _PID_Kd(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kd, NAN) @@ -335,6 +335,14 @@ class Temperature { FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } + #if ENABLED(SINGLENOZZLE_STANDBY_FAN) + static uint16_t singlenozzle_temp[EXTRUDERS]; + #if HAS_FAN + static uint8_t singlenozzle_fan_speed[EXTRUDERS]; + #endif + static void singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool); + #endif + #if HEATER_IDLE_HANDLER // Heater idle handling. Marlin creates one per hotend and one for the heated bed. @@ -696,7 +704,7 @@ class Temperature { static bool wait_for_chamber(const bool no_wait_for_cooling=true); #endif - #endif // HAS_TEMP_CHAMBER + #endif #if WATCH_CHAMBER static void start_watching_chamber(); @@ -715,7 +723,7 @@ class Temperature { ; start_watching_chamber(); } - #endif // HAS_HEATED_CHAMBER + #endif /** * The software PWM power for a heater 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/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index a98193191758..052b8cd34a64 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -49,14 +49,6 @@ bool toolchange_extruder_ready[EXTRUDERS]; #endif -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - uint16_t singlenozzle_temp[EXTRUDERS]; -#endif - -#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) - uint8_t singlenozzle_fan_speed[EXTRUDERS]; -#endif - #if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) #include "../gcode/gcode.h" #endif @@ -259,15 +251,10 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a #elif ENABLED(PARKING_EXTRUDER) void pe_solenoid_init() { - LOOP_LE_N(n, 1) - #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_solenoid(n); - #else - pe_deactivate_solenoid(n); - #endif + LOOP_LE_N(n, 1) pe_solenoid_set_pin_state(n, !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE); } - void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state) { + void pe_solenoid_set_pin_state(const uint8_t extruder_num, const uint8_t state) { switch (extruder_num) { case 1: OUT_WRITE(SOL1_PIN, state); break; default: OUT_WRITE(SOL0_PIN, state); break; @@ -277,6 +264,26 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a #endif } + bool extruder_parked = true, do_solenoid_activation = true; + + // Modifies tool_change() behavior based on homing side + bool parking_extruder_unpark_after_homing(const uint8_t final_tool, bool homed_towards_final_tool) { + do_solenoid_activation = false; // Tell parking_extruder_tool_change to skip solenoid activation + + if (!extruder_parked) return false; // nothing to do + + if (homed_towards_final_tool) { + pe_solenoid_magnet_off(1 - final_tool); + DEBUG_ECHOLNPAIR("Disengage magnet", (int)(1 - final_tool)); + pe_solenoid_magnet_on(final_tool); + DEBUG_ECHOLNPAIR("Engage magnet", (int)final_tool); + parking_extruder_set_parked(false); + return false; + } + + return true; + } + inline void parking_extruder_tool_change(const uint8_t new_tool, bool no_move) { if (!no_move) { @@ -304,27 +311,30 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a DEBUG_POS("Start PE Tool-Change", current_position); - current_position.x = parkingposx[active_extruder] + x_offset; + // Don't park the active_extruder unless unparked + if (!extruder_parked) { + current_position.x = parkingposx[active_extruder] + x_offset; - DEBUG_ECHOLNPAIR("(1) Park extruder ", int(active_extruder)); - DEBUG_POS("Moving ParkPos", current_position); + DEBUG_ECHOLNPAIR("(1) Park extruder ", int(active_extruder)); + DEBUG_POS("Moving ParkPos", current_position); - fast_line_to_current(X_AXIS); + fast_line_to_current(X_AXIS); - // STEP 2 + // STEP 2 - planner.synchronize(); - DEBUG_ECHOLNPGM("(2) Disengage magnet"); - pe_deactivate_solenoid(active_extruder); + planner.synchronize(); + DEBUG_ECHOLNPGM("(2) Disengage magnet"); + pe_solenoid_magnet_off(active_extruder); - // STEP 3 + // STEP 3 - current_position.x += active_extruder ? -10 : 10; // move 10mm away from parked extruder + current_position.x += active_extruder ? -10 : 10; // move 10mm away from parked extruder - DEBUG_ECHOLNPGM("(3) Move near new extruder"); - DEBUG_POS("Move away from parked extruder", current_position); + DEBUG_ECHOLNPGM("(3) Move near new extruder"); + DEBUG_POS("Move away from parked extruder", current_position); - fast_line_to_current(X_AXIS); + fast_line_to_current(X_AXIS); + } // STEP 4 @@ -332,8 +342,8 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a DEBUG_ECHOLNPGM("(4) Engage magnetic field"); // Just save power for inverted magnets - TERN_(PARKING_EXTRUDER_SOLENOIDS_INVERT, pe_activate_solenoid(active_extruder)); - pe_activate_solenoid(new_tool); + TERN_(PARKING_EXTRUDER_SOLENOIDS_INVERT, pe_solenoid_magnet_on(active_extruder)); + pe_solenoid_magnet_on(new_tool); // STEP 5 @@ -358,13 +368,16 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a planner.synchronize(); // Always sync the final move DEBUG_POS("PE Tool-Change done.", current_position); + parking_extruder_set_parked(false); } - else { // nomove == true - // Only engage magnetic field for new extruder - pe_activate_solenoid(new_tool); - // Just save power for inverted magnets - TERN_(PARKING_EXTRUDER_SOLENOIDS_INVERT, pe_activate_solenoid(active_extruder)); + else if (do_solenoid_activation) { // && nomove == true + // Deactivate current extruder solenoid + pe_solenoid_set_pin_state(active_extruder, !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE); + // Engage new extruder magnetic field + pe_solenoid_set_pin_state(new_tool, PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE); } + + do_solenoid_activation = true; // Activate solenoid for subsequent tool_change() } #endif // PARKING_EXTRUDER @@ -770,75 +783,76 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a */ #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) -void tool_change_prime() { - if (toolchange_settings.extra_prime > 0 - && TERN(PREVENT_COLD_EXTRUSION, !thermalManager.targetTooColdToExtrude(active_extruder), 1) - ) { - destination = current_position; // Remember the old position - - const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park); + void tool_change_prime() { + if (toolchange_settings.extra_prime > 0 + && TERN(PREVENT_COLD_EXTRUSION, !thermalManager.targetTooColdToExtrude(active_extruder), 1) + ) { + destination = current_position; // Remember the old position - #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 - // Store and stop fan. Restored on any exit. - REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0); - #endif + const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park); - // Z raise - if (ok) { - // Do a small lift to avoid the workpiece in the move back (below) - current_position.z += toolchange_settings.z_raise; - #if HAS_SOFTWARE_ENDSTOPS - NOMORE(current_position.z, soft_endstop.max.z); + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + // Store and stop fan. Restored on any exit. + REMEMBER(fan, thermalManager.fan_speed[TOOLCHANGE_FS_FAN], 0); #endif - fast_line_to_current(Z_AXIS); - planner.synchronize(); - } - // Park - #if ENABLED(TOOLCHANGE_PARK) + // Z raise if (ok) { - 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); + // Do a small lift to avoid the workpiece in the move back (below) + current_position.z += toolchange_settings.z_raise; + #if HAS_SOFTWARE_ENDSTOPS + NOMORE(current_position.z, soft_endstop.max.z); + #endif + fast_line_to_current(Z_AXIS); planner.synchronize(); } - #endif - // Prime (All distances are added and slowed down to ensure secure priming in all circumstances) - unscaled_e_move(toolchange_settings.swap_length + toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); + // Park + #if ENABLED(TOOLCHANGE_PARK) + if (ok) { + 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(); + } + #endif + + // Prime (All distances are added and slowed down to ensure secure priming in all circumstances) + unscaled_e_move(toolchange_settings.swap_length + toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); - // Cutting retraction - #if TOOLCHANGE_FS_WIPE_RETRACT - unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); - #endif + // Cutting retraction + #if TOOLCHANGE_FS_WIPE_RETRACT + unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); + #endif - // Cool down with fan - #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; - gcode.dwell(toolchange_settings.fan_time * 1000); - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; - #endif + // Cool down with fan + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; + gcode.dwell(toolchange_settings.fan_time * 1000); + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; + #endif - // Move back - #if ENABLED(TOOLCHANGE_PARK) - if (ok) { - #if ENABLED(TOOLCHANGE_NO_RETURN) - do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); - #else - do_blocking_move_to(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); - #endif - } - #endif + // Move back + #if ENABLED(TOOLCHANGE_PARK) + if (ok) { + #if ENABLED(TOOLCHANGE_NO_RETURN) + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); + #else + do_blocking_move_to(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); + #endif + } + #endif - // Cutting recover - unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); + // Cutting recover + unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); - planner.synchronize(); - current_position.e = destination.e; - sync_plan_position_e(); // Resume at the old E position + planner.synchronize(); + current_position.e = destination.e; + sync_plan_position_e(); // Resume at the old E position + } } -} -#endif + +#endif // TOOLCHANGE_FILAMENT_SWAP /** * Perform a tool-change, which may result in moving the @@ -896,7 +910,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { DEBUG_ECHOLNPGM("No move (not homed)"); } - TERN_(HAS_LCD_MENU, if (!no_move) ui.return_to_status()); + TERN_(HAS_LCD_MENU, if (!no_move) ui.update()); #if ENABLED(DUAL_X_CARRIAGE) const bool idex_full_control = dual_x_carriage_mode == DXC_FULL_CONTROL_MODE; @@ -922,7 +936,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } #endif - if (new_tool != old_tool) { + if (new_tool != old_tool || TERN0(PARKING_EXTRUDER, extruder_parked)) { // PARKING_EXTRUDER may need to attach old_tool when homing destination = current_position; #if BOTH(TOOLCHANGE_FILAMENT_SWAP, HAS_FAN) && TOOLCHANGE_FS_FAN >= 0 @@ -1059,20 +1073,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { const bool should_move = safe_to_move && !no_move && IsRunning(); if (should_move) { - #if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) - singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0]; - thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool]; - #endif - - #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - singlenozzle_temp[old_tool] = thermalManager.temp_hotend[0].target; - if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { - thermalManager.setTargetHotend(singlenozzle_temp[new_tool], 0); - TERN_(AUTOTEMP, planner.autotemp_update()); - TERN_(HAS_DISPLAY, thermalManager.set_heating_message(0)); - (void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling - } - #endif + TERN_(SINGLENOZZLE_STANDBY_TEMP, thermalManager.singlenozzle_change(old_tool, new_tool)); #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) if (should_swap && !too_cold) { @@ -1125,10 +1126,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Just move back down DEBUG_ECHOLNPGM("Move back Z only"); - #if ENABLED(TOOLCHANGE_PARK) - if (toolchange_settings.enable_park) - #endif - do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); + if (TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); #else // Move back to the original (or adjusted) position diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 0b22f8b6f1cc..4f88ca7432b4 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -86,13 +86,17 @@ #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE #endif - void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state); + void pe_solenoid_set_pin_state(const uint8_t extruder_num, const uint8_t state); - inline void pe_activate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, PE_MAGNET_ON_STATE); } - inline void pe_deactivate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, !PE_MAGNET_ON_STATE); } + inline void pe_solenoid_magnet_on(const uint8_t extruder_num) { pe_solenoid_set_pin_state(extruder_num, PE_MAGNET_ON_STATE); } + inline void pe_solenoid_magnet_off(const uint8_t extruder_num) { pe_solenoid_set_pin_state(extruder_num, !PE_MAGNET_ON_STATE); } void pe_solenoid_init(); + extern bool extruder_parked; + inline void parking_extruder_set_parked(const bool parked) { extruder_parked = parked; } + bool parking_extruder_unpark_after_homing(const uint8_t final_tool, bool homed_towards_final_tool); + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) typedef struct MPESettings { @@ -110,14 +114,6 @@ #endif -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - extern uint16_t singlenozzle_temp[EXTRUDERS]; -#endif - -#if BOTH(HAS_FAN, SINGLENOZZLE_STANDBY_FAN) - extern uint8_t singlenozzle_fan_speed[EXTRUDERS]; -#endif - TERN_(ELECTROMAGNETIC_SWITCHING_TOOLHEAD, void est_init()); TERN_(SWITCHING_TOOLHEAD, void swt_init()); diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 2a1f070ddaaf..4a5a2bf9b0a8 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" @@ -100,8 +100,8 @@ // // MicroSD card on SPI // -#define MOSI_PIN 23 -#define MISO_PIN 19 -#define SCK_PIN 18 +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/esp32/pins_FYSETC_E4.h b/Marlin/src/pins/esp32/pins_FYSETC_E4.h index af179256e136..50a8587b1ecf 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" @@ -104,9 +104,9 @@ // // MicroSD card // -#define MOSI_PIN 23 -#define MISO_PIN 19 -#define SCK_PIN 18 +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index 52837df741c2..fe67f7537204 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" @@ -93,9 +93,9 @@ // // MicroSD card // -#define MOSI_PIN 23 -#define MISO_PIN 19 -#define SCK_PIN 18 +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 0c489dd7b473..3f9a6a0af3a6 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 @@ -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" @@ -112,9 +112,9 @@ // // MicroSD card // -#define MOSI_PIN 23 -#define MISO_PIN 19 -#define SCK_PIN 18 +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index ce2ee2579abb..ab1446f07c9f 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -459,10 +459,10 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK_PIN 38 + //#define SHIFT_LD_PIN 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_EN_PIN 17 #endif #endif @@ -608,9 +608,9 @@ // Buttons are directly attached to AUX-2 #if IS_RRW_KEYPAD - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_CLK_PIN 44 + #define SHIFT_LD_PIN 42 #define BTN_EN1 64 #define BTN_EN2 59 #define BTN_ENC 63 diff --git a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h index 78e742667497..70682ad1518b 100644 --- a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h @@ -102,16 +102,16 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN LCD_SDSS + #define SD_SCK_PIN P0_15 + #define SD_MISO_PIN P0_17 + #define SD_MOSI_PIN P0_18 + #define SD_SS_PIN LCD_SDSS #define SD_DETECT_PIN P3_25 #elif SD_CONNECTION_IS(ONBOARD) - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN ONBOARD_SD_CS_PIN #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index 8c1c124d90a7..5ac119f398b1 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -155,11 +155,11 @@ * Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board. */ #if ENABLED(SDSUPPORT) - #define SCK_PIN P0_15 // EXP1-5 - #define MISO_PIN P0_16 // EXP1-4 - #define MOSI_PIN P0_18 // EXP1-3 - #define SS_PIN P1_30 // EXP1-2 - #define SDSS SS_PIN + #define SD_SCK_PIN P0_15 // EXP1-5 + #define SD_MISO_PIN P0_16 // EXP1-4 + #define SD_MOSI_PIN P0_18 // EXP1-3 + #define SD_SS_PIN P1_30 // EXP1-2 + #define SDSS SD_SS_PIN #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h index d92d5e578f62..3b2137b400fd 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h @@ -127,11 +127,11 @@ */ #if ENABLED(SDSUPPORT) - #define SCK_PIN P0_15 // EXP1-5 - #define MISO_PIN P0_16 // EXP1-4 - #define MOSI_PIN P0_18 // EXP1-3 - #define SS_PIN P1_30 // EXP1-2 - #define SDSS SS_PIN + #define SD_SCK_PIN P0_15 // EXP1-5 + #define SD_MISO_PIN P0_16 // EXP1-4 + #define SD_MOSI_PIN P0_18 // EXP1-3 + #define SD_SS_PIN P1_30 // EXP1-2 + #define SDSS SD_SS_PIN #endif // SDSUPPORT diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 0701e45992eb..8c1396d3fe2f 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -107,7 +107,7 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SS_PIN P1_23 + #define SD_SS_PIN P1_23 #endif // Trinamic driver support 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 c621f93a2ac5..e5b78024cbf8 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -375,7 +375,7 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SS_PIN EXPA2_07_PIN + #define SD_SS_PIN EXPA2_07_PIN #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 04e9a2f80ad9..dfe86b12b724 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 // @@ -60,6 +60,13 @@ #else #define X_MIN_PIN P1_26 // E0DET #endif +#elif ENABLED(X_DUAL_ENDSTOPS) + #ifndef X_MIN_PIN + #define X_MIN_PIN P1_29 // X-STOP + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN P1_26 // E0DET + #endif #else #define X_STOP_PIN P1_29 // X-STOP #endif @@ -71,6 +78,13 @@ #else #define Y_MIN_PIN P1_25 // E1DET #endif +#elif ENABLED(Y_DUAL_ENDSTOPS) + #ifndef Y_MIN_PIN + #define Y_MIN_PIN P1_28 // Y-STOP + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN P1_25 // E1DET + #endif #else #define Y_STOP_PIN P1_28 // Y-STOP #endif @@ -82,6 +96,13 @@ #else #define Z_MIN_PIN P1_00 // PWRDET #endif +#elif ENABLED(Z_MULTI_ENDSTOPS) + #ifndef Z_MIN_PIN + #define Z_MIN_PIN P1_27 // Z-STOP + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN P1_00 // PWRDET + #endif #else #ifndef Z_STOP_PIN #define Z_STOP_PIN P1_27 // Z-STOP @@ -244,7 +265,7 @@ // SD Connection // #if SD_CONNECTION_IS(LCD) - #define SS_PIN EXPA2_07_PIN + #define SD_SS_PIN EXPA2_07_PIN #endif /** @@ -258,9 +279,51 @@ * EXP2 EXP1 */ -#if HAS_WIRED_LCD && !HAS_BTT_EXP_MOT +#if ENABLED(DWIN_CREALITY_LCD) + + // RET6 DWIN ENCODER LCD + #define BTN_ENC P1_20 + #define BTN_EN1 P1_23 + #define BTN_EN2 P1_22 + + #ifndef BEEPER_PIN + #define BEEPER_PIN P1_21 + #undef SPEAKER + #endif + +#elif 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." @@ -286,24 +349,26 @@ * 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 + #define BEEPER_PIN EXPA1_10_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 +383,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 SD_SCK_PIN EXPA2_09_PIN + #define SD_MISO_PIN EXPA2_10_PIN + #define SD_MOSI_PIN EXPA2_05_PIN // Disable any LCD related PINs config #define LCD_PINS_ENABLE -1 @@ -358,72 +423,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 e6cfc0afaf76..a43940f8f037 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 @@ -33,8 +33,12 @@ // 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." +#if BOTH(HAS_WIRED_LCD, HAS_BTT_EXP_MOT) + #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #define EXP_MOT_USE_EXP2_ONLY 1 + #else + #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time." + #endif #endif // Ignore temp readings during development. @@ -100,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 @@ -110,59 +114,75 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 + #define SD_SCK_PIN P0_15 + #define SD_MISO_PIN P0_17 + #define SD_MOSI_PIN P0_18 #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN ONBOARD_SD_CS_PIN #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 - */ + + /** _____ _____ + * 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_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_STEP_PIN EXPA2_05_PIN + #define E2_DIR_PIN EXPA2_06_PIN + #define E2_ENABLE_PIN EXPA2_04_PIN + #if !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 + #define E3_STEP_PIN EXPA2_08_PIN + #define E3_DIR_PIN EXPA2_07_PIN + #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 + #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 + #define E4_STEP_PIN EXPA2_10_PIN + #define E4_DIR_PIN EXPA2_09_PIN + #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 + #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 diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 997723009489..1970c0c479fd 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -154,15 +154,15 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #if 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_SCK_PIN P0_15 + #define SD_MISO_PIN P0_17 + #define SD_MOSI_PIN P0_18 + #define SD_SS_PIN P0_16 #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN ONBOARD_SD_CS_PIN #endif diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index b993e3846087..ea9748ca5486 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -182,26 +182,25 @@ * SD_DETECT_PIN entirely and remove that wire from the the custom cable. */ #define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) - #define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) - #define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) - #define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9) - #define SS_PIN P0_28 + #define SD_SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) + #define SD_MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) + #define SD_MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9) + #define SD_SS_PIN P0_28 #define LPC_SOFTWARE_SPI // With a custom cable we need software SPI because the // selected pins are not on a hardware SPI controller -#elif SD_CONNECTION_IS(LCD) - // use standard cable and header, SPI and SD detect sre shared with on-board SD card - // hardware SPI is used for both SD cards. The detect pin is shred between the - // LCD and onboard SD readers so we disable it. - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_28 -#elif SD_CONNECTION_IS(ONBOARD) - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN +#elif SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #if SD_CONNECTION_IS(LCD) + // Use standard cable and header, SPI and SD detect are shared with onboard SD card. + // Hardware SPI is used for both SD cards. The detect pin is shared between the + // LCD and onboard SD readers so we disable it. + #define SD_SS_PIN P0_28 + #else + #define SD_DETECT_PIN P0_27 + #define SD_SS_PIN ONBOARD_SD_CS_PIN + #endif #endif /** @@ -238,8 +237,8 @@ #define LCD_PINS_ENABLE P0_18 // EXP1.3 #define LCD_PINS_D4 P0_15 // EXP1.5 #if ANY(VIKI2, miniVIKI) - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN + #define DOGLCD_SCK SD_SCK_PIN + #define DOGLCD_MOSI SD_MOSI_PIN #endif #if ENABLED(FYSETC_MINI_12864) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 68cfe65601d1..b919ecad85a1 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 @@ -375,13 +375,13 @@ #if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 #if SD_CONNECTION_IS(ONBOARD) - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SS_PIN ONBOARD_SD_CS_PIN #else - #define SS_PIN P0_28 + #define SD_SS_PIN P0_28 #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index f746064991c8..7d0f494c34fc 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -336,11 +336,6 @@ #elif HAS_WIRED_LCD - //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - #if ENABLED(FYSETC_MINI_12864) #define BEEPER_PIN P1_01 #define BTN_ENC P1_04 @@ -359,15 +354,15 @@ #if IS_NEWPANEL #if IS_RRW_KEYPAD - #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) + #define SHIFT_OUT_PIN P0_18 // (51) (MOSI) J3-10 & AUX-3 + #define SHIFT_CLK_PIN P0_15 // (52) (SCK) J3-9 & AUX-3 + #define SHIFT_LD_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) #endif #else - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 + //#define SHIFT_CLK_PIN P3_26 // (31) J3-2 & AUX-4 + //#define SHIFT_LD_PIN P3_25 // (33) J3-4 & AUX-4 + //#define SHIFT_OUT_PIN P2_11 // (35) J3-3 & AUX-4 + //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif #if ANY(VIKI2, miniVIKI) @@ -375,8 +370,8 @@ #define DOGLCD_CS P0_16 // (16) #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN + #define DOGLCD_SCK SD_SCK_PIN + #define DOGLCD_MOSI SD_MOSI_PIN #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes @@ -464,16 +459,16 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - #define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - #define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - #define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin + #define SD_SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 + #define SD_MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 + #define SD_MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 + #define SD_SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN ONBOARD_SD_CS_PIN #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index ac1d9f690680..fdd64878fbc6 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -147,14 +147,14 @@ #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 #if IS_RRW_KEYPAD - #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3 + #define SHIFT_OUT_PIN P0_18 // (51) (MOSI) J3-10 & AUX-3 + #define SHIFT_CLK_PIN P0_15 // (52) (SCK) J3-9 & AUX-3 + #define SHIFT_LD_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 #elif !IS_NEWPANEL - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 + //#define SHIFT_OUT_PIN P2_11 // (35) J3-3 & AUX-4 + //#define SHIFT_CLK_PIN P3_26 // (31) J3-2 & AUX-4 + //#define SHIFT_LD_PIN P3_25 // (33) J3-4 & AUX-4 + //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif #if ANY(VIKI2, miniVIKI) @@ -162,8 +162,8 @@ #define BEEPER_PIN P1_30 // (37) may change if cable changes #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN + #define DOGLCD_SCK SD_SCK_PIN + #define DOGLCD_MOSI SD_MOSI_PIN #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes @@ -204,16 +204,16 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN P1_23 + #define SD_SCK_PIN P0_15 + #define SD_MISO_PIN P0_17 + #define SD_MOSI_PIN P0_18 + #define SD_SS_PIN P1_23 #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN ONBOARD_SD_CS_PIN #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 6d6d7557f57d..6e498ba6aa8b 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -70,7 +70,9 @@ #endif // LED driving pin -#define NEOPIXEL_PIN P1_24 +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN P1_24 +#endif // // Power Loss Detection @@ -173,6 +175,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 @@ -249,10 +255,10 @@ #if SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN P2_00 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_06 + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN P0_06 #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "SD CUSTOM_CABLE is not compatible with SKR E3 Turbo." #endif diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h index 66604ef6359f..edf13cee298d 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h @@ -233,17 +233,16 @@ #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card -#if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_07 // (52) system defined J3-9 & AUX-3 - #define MISO_PIN P0_08 // (50) system defined J3-10 & AUX-3 - #define MOSI_PIN P0_09 // (51) system defined J3-10 & AUX-3 - #define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN +#if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) + #define SD_SCK_PIN P0_07 // (52) system defined J3-9 & AUX-3 + #define SD_MISO_PIN P0_08 // (50) system defined J3-10 & AUX-3 + #define SD_MOSI_PIN P0_09 // (51) system defined J3-10 & AUX-3 + #if SD_CONNECTION_IS(LCD) + #define SD_SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin + #else + #undef SD_DETECT_PIN + #define SD_SS_PIN ONBOARD_SD_CS_PIN + #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h index b678917734cb..3982d76a012d 100644 --- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h +++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h @@ -26,14 +26,13 @@ #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 // #define SERVO0_PIN P1_26 - // // Limit Switches // @@ -45,7 +44,6 @@ #define Z_MIN_PIN P1_22 // Z- #define Z_MAX_PIN P0_27 // Z+ - // // Steppers // @@ -106,7 +104,6 @@ #endif #endif - #if HAS_TMC_UART #define X_SERIAL_TX_PIN P1_04 #define X_SERIAL_RX_PIN P1_04 @@ -130,8 +127,6 @@ #define TMC_BAUD_RATE 19200 #endif - - // // Temperature Sensors // @@ -153,7 +148,6 @@ #define FAN1_PIN P1_21 #define FAN2_PIN P1_24 - // // LCD / Controller // @@ -168,21 +162,20 @@ #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_SS_PIN P0_06 + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_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_SCK_PIN P0_15 + #define SD_MISO_PIN P0_17 + #define SD_MOSI_PIN P0_18 + #define SD_SS_PIN P0_16 #define SD_DETECT_PIN P2_06 #endif 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 638268a546a4..79c79c591457 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -394,13 +394,13 @@ #if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 #if SD_CONNECTION_IS(ONBOARD) - #define SS_PIN ONBOARD_SD_CS_PIN + #define SD_SS_PIN ONBOARD_SD_CS_PIN #else - #define SS_PIN P0_28 + #define SD_SS_PIN P0_28 #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index 4e10d8d1da3a..c5ce3f879582 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -124,10 +124,10 @@ */ #define SD_DETECT_PIN P0_27 // EXP2 Pin 7 (SD_CD, SD_DET) - #define MISO_PIN P0_08 // EXP2 Pin 1 (PB3, SD_MISO) - #define SCK_PIN P0_07 // EXP2 Pin 2 (SD_SCK) - #define SS_PIN P0_28 // EXP2 Pin 4 (SD_CSEL, SD_CS) - #define MOSI_PIN P0_09 // EXP2 Pin 6 (PB2, SD_MOSI) + #define SD_MISO_PIN P0_08 // EXP2 Pin 1 (PB3, SD_MISO) + #define SD_SCK_PIN P0_07 // EXP2 Pin 2 (SD_SCK) + #define SD_SS_PIN P0_28 // EXP2 Pin 4 (SD_CSEL, SD_CS) + #define SD_MOSI_PIN P0_09 // EXP2 Pin 6 (PB2, SD_MOSI) /** * The Smoothieboard supports the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with either diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index c11cd9e9da94..d4f3e5bc21b5 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -141,11 +141,11 @@ #define SDCARD_CONNECTION ONBOARD -#define SCK_PIN P0_07 -#define MISO_PIN P0_08 -#define MOSI_PIN P0_09 +#define SD_SCK_PIN P0_07 +#define SD_MISO_PIN P0_08 +#define SD_MOSI_PIN P0_09 #define ONBOARD_SD_CS_PIN P0_06 -#define SS_PIN ONBOARD_SD_CS_PIN +#define SD_SS_PIN ONBOARD_SD_CS_PIN // // LCD / Controller diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 0e75aa4a3734..f80e6144ce18 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -149,9 +149,9 @@ #define BTN_ENC 27 // Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 19 -#define SHIFT_LD 18 -#define SHIFT_CLK 17 +#define SHIFT_OUT_PIN 19 +#define SHIFT_LD_PIN 18 +#define SHIFT_CLK_PIN 17 //#define UI1 31 //#define UI2 22 diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 35426a453139..540f5c29f517 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -156,9 +156,9 @@ #define BTN_ENC 38 // Hardware buttons for manual movement of XYZ -#define SHIFT_OUT 42 -#define SHIFT_LD 41 -#define SHIFT_CLK 40 +#define SHIFT_OUT_PIN 42 +#define SHIFT_LD_PIN 41 +#define SHIFT_CLK_PIN 40 //#define UI1 43 //#define UI2 37 diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index e1752c1f8564..dcd829f7a7ae 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -146,10 +146,10 @@ #else // !IS_NEWPANEL - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 + #define SHIFT_CLK_PIN 38 + #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_EN_PIN 17 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 5 diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index fa2027fb7825..d507d20ca7ab 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -156,10 +156,10 @@ #else // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 + #define SHIFT_CLK_PIN 38 + #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_EN_PIN 17 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 5 diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h index 67ec24ed6f79..ef4605edd437 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h @@ -146,10 +146,10 @@ #define BTN_ENC 43 #else // Buttons attached to shift register of reprapworld keypad v1.1 - #define SHIFT_CLK 63 - #define SHIFT_LD 42 - #define SHIFT_OUT 17 - #define SHIFT_EN 17 + #define SHIFT_CLK_PIN 63 + #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN 17 + #define SHIFT_EN_PIN 17 #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h index 45ebd163a79f..9f85d46a544b 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h @@ -162,10 +162,10 @@ #define LCD_PINS_D6 39 #define LCD_PINS_D7 15 - #define SHIFT_CLK 43 - #define SHIFT_LD 35 - #define SHIFT_OUT 34 - #define SHIFT_EN 44 + #define SHIFT_CLK_PIN 43 + #define SHIFT_LD_PIN 35 + #define SHIFT_OUT_PIN 34 + #define SHIFT_EN_PIN 44 #if MB(MEGATRONICS_31, MEGATRONICS_32) #define SD_DETECT_PIN 56 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/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h index 52e757c53408..715e823393cf 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 @@ -82,7 +82,7 @@ // // SD Card // -#define SD_DETECT_PIN -1 +#define SD_DETECT_PIN 83 #define SDSS 53 // diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 676e1133102a..f57e8e7dac32 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) +#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_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) - #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 @@ -189,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) @@ -214,14 +188,10 @@ #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) +#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_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 @@ -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) - #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) +#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_DUO_EFB) - #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug -#elif MB(RAMPS_DUO_EEB) - #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) +#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(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 @@ -572,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) @@ -590,8 +530,16 @@ #include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103 #elif MB(CREALITY_V4) #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality +#elif MB(CREALITY_V4210) + #include "stm32f1/pins_CREALITY_V4210.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) + #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) @@ -616,9 +564,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 @@ -627,29 +573,37 @@ #elif MB(STEVAL_3DP001V1) #include "stm32f4/pins_STEVAL_3DP001V1.h" // STM32F4 env:STM32F401VE_STEVAL #elif MB(BTT_SKR_PRO_V1_1) - #include "stm32f4/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO + #include "stm32f4/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO env:BIGTREE_SKR_PRO_usb_flash_drive #elif MB(BTT_SKR_PRO_V1_2) - #include "stm32f4/pins_BTT_SKR_PRO_V1_2.h" // STM32F4 env:BIGTREE_SKR_PRO + #include "stm32f4/pins_BTT_SKR_PRO_V1_2.h" // STM32F4 env:BIGTREE_SKR_PRO env:BIGTREE_SKR_PRO_usb_flash_drive #elif MB(BTT_GTR_V1_0) - #include "stm32f4/pins_BTT_GTR_V1_0.h" // STM32F4 env:BIGTREE_GTR_V1_0 + #include "stm32f4/pins_BTT_GTR_V1_0.h" // STM32F4 env:BIGTREE_GTR_V1_0 env:BIGTREE_GTR_V1_0_usb_flash_drive #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:LERDGEK + #include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:LERDGEK env:LERDGEK_usb_flash_drive #elif MB(LERDGE_S) - #include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGES + #include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGES env:LERDGES_usb_flash_drive #elif MB(LERDGE_X) - #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGEX + #include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGEX env:LERDGEX_usb_flash_drive #elif MB(VAKE403D) #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 +#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 env:mks_robin_nano_v3_usb_flash_drive +#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 @@ -727,6 +681,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." @@ -772,6 +727,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 @@ -797,6 +754,7 @@ #undef BOARD_RUMBA32 #undef BOARD_RUMBA32_AUS3D #undef BOARD_RAMPS_DAGOMA + #undef BOARD_RAMPS_LONGER3D_LK4PRO #endif diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index cf839e2abd98..79a67c34f870 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -702,7 +702,7 @@ // REPORT_NAME_DIGITAL(__LINE__, MISO) // #endif #if PIN_EXISTS(MISO) - REPORT_NAME_DIGITAL(__LINE__, MISO_PIN) + REPORT_NAME_DIGITAL(__LINE__, SD_MISO_PIN) #endif #if PIN_EXISTS(MOSFET_A) REPORT_NAME_DIGITAL(__LINE__, MOSFET_A_PIN) @@ -720,7 +720,7 @@ // REPORT_NAME_DIGITAL(__LINE__, MOSI) // #endif #if PIN_EXISTS(MOSI) - REPORT_NAME_DIGITAL(__LINE__, MOSI_PIN) + REPORT_NAME_DIGITAL(__LINE__, SD_MOSI_PIN) #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) REPORT_NAME_DIGITAL(__LINE__, MOTOR_CURRENT_PWM_E_PIN) @@ -801,7 +801,7 @@ // REPORT_NAME_DIGITAL(__LINE__, SCK) // #endif #if PIN_EXISTS(SCK) - REPORT_NAME_DIGITAL(__LINE__, SCK_PIN) + REPORT_NAME_DIGITAL(__LINE__, SD_SCK_PIN) #endif // #if defined(SCL) && SCL >= 0 // REPORT_NAME_DIGITAL(__LINE__, SCL) @@ -833,17 +833,17 @@ #if PIN_EXISTS(SERVO3) REPORT_NAME_DIGITAL(__LINE__, SERVO3_PIN) #endif -#if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK) +#if PIN_EXISTS(SHIFT_CLK) + REPORT_NAME_DIGITAL(__LINE__, SHIFT_CLK_PIN) #endif -#if defined(SHIFT_EN) && SHIFT_EN >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN) +#if PIN_EXISTS(SHIFT_EN) + REPORT_NAME_DIGITAL(__LINE__, SHIFT_EN_PIN) #endif -#if defined(SHIFT_LD) && SHIFT_LD >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD) +#if PIN_EXISTS(SHIFT_LD) + REPORT_NAME_DIGITAL(__LINE__, SHIFT_LD_PIN) #endif -#if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT) +#if PIN_EXISTS(SHIFT_OUT) + REPORT_NAME_DIGITAL(__LINE__, SHIFT_OUT_PIN) #endif #if PIN_EXISTS(SLED) REPORT_NAME_DIGITAL(__LINE__, SLED_PIN) @@ -909,7 +909,7 @@ REPORT_NAME_DIGITAL(__LINE__, SR_STROBE_PIN) #endif #if PIN_EXISTS(SS) - REPORT_NAME_DIGITAL(__LINE__, SS_PIN) + REPORT_NAME_DIGITAL(__LINE__, SD_SS_PIN) #endif #if PIN_EXISTS(STAT_LED_BLUE) REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 7dcaeb8e57e4..be2317b146bd 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -239,10 +239,10 @@ // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK_PIN 38 + //#define SHIFT_LD_PIN 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_EN_PIN 17 #define LCD_PINS_RS 75 #define LCD_PINS_ENABLE 17 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_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index e919b30cf982..6ddd2a5165e6 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -72,7 +72,7 @@ // // Misc // -#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT, STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN +#if ENABLED(CASE_LIGHT_ENABLE) && PINS_EXIST(CASE_LIGHT, STAT_LED_RED) && STAT_LED_RED_PIN == CASE_LIGHT_PIN #undef STAT_LED_RED_PIN #endif diff --git a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h index 87d24890c99c..93ec3d607026 100644 --- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h +++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h @@ -80,9 +80,9 @@ #define SDSS 53 // PB0 / SS #define LED_PIN 13 // PB7 / PWM13 -#define MISO_PIN 50 // PB3 -#define MOSI_PIN 51 // PB2 -#define SCK_PIN 52 // PB1 +#define SD_MISO_PIN 50 // PB3 +#define SD_MOSI_PIN 51 // PB2 +#define SD_SCK_PIN 52 // PB1 // // LCDs and Controllers 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/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_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/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h new file mode 100644 index 000000000000..6fcb7b94e0c2 --- /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 one 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 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 57d4c047e2e2..ab5711bd5c53 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -504,10 +504,10 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK_PIN 38 + //#define SHIFT_LD_PIN 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_EN_PIN 17 #endif #endif @@ -722,9 +722,9 @@ #endif // HAS_WIRED_LCD #if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_CLK_PIN 44 + #define SHIFT_LD_PIN 42 #ifndef BTN_EN1 #define BTN_EN1 64 #endif 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/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/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index e6a95fdab9ee..ca402553e112 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -342,10 +342,10 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK_PIN 38 + //#define SHIFT_LD_PIN 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_EN_PIN 17 #endif #endif @@ -491,9 +491,9 @@ // Buttons are directly attached to AUX-2 #if IS_RRW_KEYPAD - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_CLK_PIN 44 + #define SHIFT_LD_PIN 42 #define BTN_EN1 64 #define BTN_EN2 59 #define BTN_ENC 63 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..22c7fd95b47e 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 @@ -142,10 +142,10 @@ #else // !IS_NEWPANEL - Old style panel with shift register // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 + #define SHIFT_CLK_PIN 38 + #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_EN_PIN 17 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 5 diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 9b17384aaf55..37c28ece4ce4 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 @@ -197,10 +197,10 @@ #else // !IS_NEWPANEL - Old style panel with shift register // Buttons attached to a shift register - #define SHIFT_CLK 38 - #define SHIFT_LD 42 - #define SHIFT_OUT 40 - #define SHIFT_EN 17 + #define SHIFT_CLK_PIN 38 + #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_EN_PIN 17 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 5 diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h index 90433c62d751..6c4b28d0b874 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V20.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V20.h @@ -69,9 +69,9 @@ #undef ADC_KEYPAD_PIN #undef BEEPER_PIN - #undef SHIFT_OUT - #undef SHIFT_CLK - #undef SHIFT_LD + #undef SHIFT_OUT_PIN + #undef SHIFT_CLK_PIN + #undef SHIFT_LD_PIN #undef BTN_EN1 #undef BTN_EN2 #undef BTN_ENC diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h index 1fda0ccb44f4..57bbeb62a280 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -170,9 +170,9 @@ #define INT_SDSS 55 // D55 PA24/MCDA3 // External SD card reader on SC2 -#define SCK_PIN 76 // D76 PA27 -#define MISO_PIN 74 // D74 PA25 -#define MOSI_PIN 75 // D75 PA26 +#define SD_SCK_PIN 76 // D76 PA27 +#define SD_MISO_PIN 74 // D74 PA25 +#define SD_MOSI_PIN 75 // D75 PA26 #define SDSS 87 // D87 PA29 // 2MB SPI Flash diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h index 5923ea0f8f84..3776cf8bb548 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM2.h +++ b/Marlin/src/pins/sam/pins_ARCHIM2.h @@ -192,9 +192,9 @@ #define INT_SDSS 55 // D55 PA24/MCDA3 // External SD card reader on SC2 -#define SCK_PIN 76 // D76 PA27 -#define MISO_PIN 74 // D74 PA25 -#define MOSI_PIN 75 // D75 PA26 +#define SD_SCK_PIN 76 // D76 PA27 +#define SD_MISO_PIN 74 // D74 PA25 +#define SD_MOSI_PIN 75 // D75 PA26 #define SDSS 87 // D87 PA29 // Unused Digital GPIO J20 Pins diff --git a/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h b/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h index fcd2bb4c67bf..5bf31450b707 100644 --- a/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h +++ b/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h @@ -117,9 +117,9 @@ // // SD card // -#define SCK_PIN 76 -#define MISO_PIN 74 -#define MOSI_PIN 75 +#define SD_SCK_PIN 76 +#define SD_MISO_PIN 74 +#define SD_MOSI_PIN 75 #define SDSS 53 #define SD_DETECT_PIN 40 diff --git a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h index ea4b950a1793..424d858a8512 100644 --- a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h +++ b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h @@ -151,9 +151,9 @@ ///////////////////////////////////////////////////////// -#define MISO_PIN 68 // set to unused pins for now -#define MOSI_PIN 69 // set to unused pins for now -#define SCK_PIN 70 // set to unused pins for now +#define SD_MISO_PIN 68 // set to unused pins for now +#define SD_MOSI_PIN 69 // set to unused pins for now +#define SD_SCK_PIN 70 // set to unused pins for now #define SDSS 71 // set to unused pins for now /** diff --git a/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h index 0b91ba61d6df..ea096187f713 100644 --- a/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h +++ b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h @@ -147,9 +147,9 @@ #define SPI_EEPROM2_CS -1 #define SPI_FLASH_CS -1 -#define SCK_PIN 76 -#define MISO_PIN 74 -#define MOSI_PIN 75 +#define SD_SCK_PIN 76 +#define SD_MISO_PIN 74 +#define SD_MOSI_PIN 75 // SPI for Max6675 or Max31855 Thermocouple #define MAX6675_SS_PIN 65 diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index d72b55d3afe0..7a72ef651f1d 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -363,10 +363,10 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK_PIN 38 + //#define SHIFT_LD_PIN 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_EN_PIN 17 #endif #endif @@ -567,9 +567,9 @@ // Buttons are directly attached to AUX-2 #if IS_RRW_KEYPAD // TO TEST - //#define SHIFT_OUT 40 - //#define SHIFT_CLK 44 - //#define SHIFT_LD 42 + //#define SHIFT_OUT_PIN 40 + //#define SHIFT_CLK_PIN 44 + //#define SHIFT_LD_PIN 42 //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 10fee8bcf17e..fb1b6dbb3c0c 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -198,14 +198,8 @@ #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 - #endif #ifndef FIL_RUNOUT_PIN diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index f110fe5794c4..97db36dd5421 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -91,13 +91,13 @@ PIN: 3 Port: B3 Z_STEP_PIN protected PIN: 4 Port: B4 AVR_SS_PIN protected . FAN_PIN protected - . SS_PIN protected + . SD_SS_PIN protected PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 - . MOSI_PIN Output = 1 + . SD_MOSI_PIN Output = 1 PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . MISO_PIN Input = 0 + . SD_MISO_PIN Input = 0 PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SCK_PIN Output = 0 + . SD_SCK_PIN Output = 0 PIN: 8 Port: D0 RXD Input = 1 PIN: 9 Port: D1 TXD Input = 0 PIN: 10 Port: D2 BTN_EN2 Input = 1 diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 69b351e3fced..ffed79de7986 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -106,10 +106,10 @@ #else #define HEATER_BED_PIN 14 // (bed) - #define X_ENABLE_PIN -1 - #define Y_ENABLE_PIN -1 - #define Z_ENABLE_PIN -1 - #define E0_ENABLE_PIN -1 + #define X_ENABLE_PIN 4 + #define Y_ENABLE_PIN 4 + #define Z_ENABLE_PIN 4 + #define E0_ENABLE_PIN 4 #endif diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 4257b2c40e1e..d064d801329d 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 @@ -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 @@ -49,11 +49,11 @@ * PIN: 4 Port: B4 SDSS * PIN: 4 Port: B4 V1: EXP1_6 * PIN: 5 Port: B5 AVR_MOSI_PIN - * . MOSI_PIN + * . SD_MOSI_PIN * PIN: 6 Port: B6 AVR_MISO_PIN - * . EXP1_9(MISO_PIN) + * . EXP1_9(SD_MISO_PIN) * PIN: 7 Port: B7 AVR_SCK_PIN - * . EXP1_10(SCK_PIN) + * . EXP1_10(SD_SCK_PIN) * PIN: 8 Port: D0 RXD * PIN: 9 Port: D1 TXD * PIN: 10 Port: D2 EXP1_8 diff --git a/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h index a0e035a91688..2717439f24f4 100644 --- a/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h +++ b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h @@ -41,7 +41,7 @@ // // SD CARD SPI // -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // // Timers diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index ccb8a31ab727..bf2cf6463a26 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -123,16 +123,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -141,144 +132,27 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif #if IS_NEWPANEL - #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif #endif // IS_NEWPANEL 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..73a18faf05b2 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -0,0 +1,183 @@ +/** + * 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 + +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PA8 +#endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index c748dbbed3cf..0426e80fd2db 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 // @@ -280,7 +280,7 @@ #define SD_DETECT_PIN PC4 #elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) #define SD_DETECT_PIN PA15 - #define SS_PIN PA10 + #define SD_SS_PIN PA10 #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP." #endif 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_V1_2.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h index 165c41ffe7b3..4951d697a72f 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,9 @@ #define BOARD_INFO_NAME "BTT SKR Mini E3 V1.2" -#define NEOPIXEL_PIN PC7 // LED driving pin +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PC7 // LED driving pin +#endif /** * TMC2208/TMC2209 stepper drivers 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..af2821f8098b 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 @@ -39,9 +39,13 @@ // Release PA13/PA14 (led, usb control) from SWD pins #define DISABLE_DEBUG -#define NEOPIXEL_PIN PA8 // LED driving pin +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PA8 // LED driving pin +#endif -#define PS_ON_PIN PC13 // Power Supply Control +#ifndef PS_ON_PIN + #define PS_ON_PIN PC13 // Power Supply Control +#endif #define FAN1_PIN PC7 @@ -49,13 +53,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_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index b65411be8a3b..bab662d1be63 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 // @@ -188,7 +188,7 @@ * Board Display * _____ _____ * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) GLCD_CS | 3 4 | SD_CS (PA10) + * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10) * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI) * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE) * (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V @@ -274,7 +274,7 @@ #define SD_DETECT_PIN PC4 #elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL) #define SD_DETECT_PIN PB5 - #define SS_PIN PA10 + #define SD_SS_PIN PA10 #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3." #endif 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 410424f6b551..8668e1defd2d 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 @@ -217,16 +217,16 @@ #if SD_CONNECTION_IS(LCD) #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 + #define SD_SCK_PIN PB3 + #define SD_MISO_PIN PB4 + #define SD_MOSI_PIN PB5 + #define SD_SS_PIN PA15 #elif SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN PA3 - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #define MOSI_PIN PA7 - #define SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_SS_PIN PA4 #endif #define ONBOARD_SPI_DEVICE 1 // SPI1 #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 0e94249a993c..43dfdece44ae 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 @@ -166,10 +166,10 @@ // #if SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN -1 - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #define MOSI_PIN PA7 - #define SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_SS_PIN PA4 #endif #define ONBOARD_SPI_DEVICE 1 // SPI1 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index b18c9dd91406..bb6f5719246e 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -146,10 +146,10 @@ #define BEEPER_PIN PC1 // 33 // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK PC6 // 38 - //#define SHIFT_LD PC10 // 42 - //#define SHIFT_OUT PC8 // 40 - //#define SHIFT_EN PA1 // 17 + //#define SHIFT_CLK_PIN PC6 // 38 + //#define SHIFT_LD_PIN PC10 // 42 + //#define SHIFT_OUT_PIN PC8 // 40 + //#define SHIFT_EN_PIN PA1 // 17 #endif #endif @@ -260,9 +260,9 @@ #define BTN_EN1 PE0 // 64 #define BTN_EN2 PD11 // 59 #define BTN_ENC PD15 // 63 - #define SHIFT_OUT PC8 // 40 - #define SHIFT_CLK PC12 // 44 - #define SHIFT_LD PC10 // 42 + #define SHIFT_OUT_PIN PC8 // 40 + #define SHIFT_CLK_PIN PC12 // 44 + #define SHIFT_LD_PIN PC10 // 42 #elif ENABLED(PANEL_ONE) #define BTN_EN1 PD11 // 59 // AUX2 PIN 3 #define BTN_EN2 PD15 // 63 // AUX2 PIN 4 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index 32d4e0c9d478..c90ae84acbb9 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -175,10 +175,10 @@ // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available // Needs to use SPI2 #define SPI_DEVICE 2 -#define SCK_PIN PB13 -#define MISO_PIN PB14 -#define MOSI_PIN PB15 -#define SS_PIN PB12 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN PB14 +#define SD_MOSI_PIN PB15 +#define SD_SS_PIN PB12 // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index 066a6cc8aa03..96cf36629a5b 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -190,10 +190,10 @@ // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available // so SPI2 is required. #define SPI_DEVICE 2 -#define SCK_PIN PB13 -#define MISO_PIN PB14 -#define MOSI_PIN PB15 -#define SS_PIN PB12 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN PB14 +#define SD_MOSI_PIN PB15 +#define SD_SS_PIN PB12 // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index c6f2dd8b8081..8b5b8562a2bb 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 @@ -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 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 @@ -43,36 +43,26 @@ // 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 // // 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 @@ -170,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) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h new file mode 100644 index 000000000000..025e68d4da05 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -0,0 +1,208 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 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 4.2.10 (STM32F103) board pin assignments + */ + +#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." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Creality V4.2.10" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "3DPrintMill" +#endif + +#define BOARD_NO_NATIVE_USB + +// +// 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 ? + + // 32Mb FLASH + //#define SPI_FLASH_CS ? +#endif + +// +// Servos +// +#define SERVO0_PIN PB0 // BLTouch OUT + +// +// Limit Switches +// +#define X_STOP_PIN PA3 +#define Y_STOP_PIN PA7 +#define Z_STOP_PIN PA5 + +#define Z_MIN_PROBE_PIN PA5 // BLTouch IN + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA6 // "Pulled-high" +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC3 +#ifndef X_STEP_PIN + #define X_STEP_PIN PC2 +#endif +#ifndef X_DIR_PIN + #define X_DIR_PIN PB9 +#endif + +#define Y_ENABLE_PIN PC3 +#ifndef Y_STEP_PIN + #define Y_STEP_PIN PB8 +#endif +#ifndef Y_DIR_PIN + #define Y_DIR_PIN PB7 +#endif + +#define Z_ENABLE_PIN PC3 +#ifndef Z_STEP_PIN + #define Z_STEP_PIN PB6 +#endif +#ifndef Z_DIR_PIN + #define Z_DIR_PIN PB5 +#endif + +#define E0_ENABLE_PIN PC3 +#ifndef E0_STEP_PIN + #define E0_STEP_PIN PB4 +#endif +#ifndef E0_DIR_PIN + #define E0_DIR_PIN PB3 +#endif + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC5 // TH1 +#define TEMP_BED_PIN PC4 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA0 // HEATER1 +#define HEATER_BED_PIN PA1 // HOT BED + +#define FAN_PIN PA2 // FAN +#define FAN_SOFT_PWM + +// +// SD Card +// +#define SD_DETECT_PIN PC7 +#define SDCARD_CONNECTION ONBOARD +#define ONBOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PA4 // SDSS +#define SDIO_SUPPORT +#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer + +#if ENABLED(CR10_STOCKDISPLAY) && NONE(RET6_12864_LCD, VET6_12864_LCD) + #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller." +#endif + +#if ENABLED(RET6_12864_LCD) + + // RET6 12864 LCD + #define LCD_PINS_RS PB12 + #define LCD_PINS_ENABLE PB15 + #define LCD_PINS_D4 PB13 + + #define BTN_ENC PB2 + #define BTN_EN1 PB10 + #define BTN_EN2 PB14 + + #define BEEPER_PIN PC6 + +#elif ENABLED(VET6_12864_LCD) + + // VET6 12864 LCD + #define LCD_PINS_RS PA4 + #define LCD_PINS_ENABLE PA7 + #define LCD_PINS_D4 PA5 + + #define BTN_ENC PC5 + #define BTN_EN1 PB10 + #define BTN_EN2 PA6 + +#elif ENABLED(DWIN_CREALITY_LCD) + + // RET6 DWIN ENCODER LCD + #define BTN_ENC PB14 + #define BTN_EN1 PB15 + #define BTN_EN2 PB12 + + //#define LCD_LED_PIN PB2 + #ifndef BEEPER_PIN + #define BEEPER_PIN PB13 + #undef SPEAKER + #endif + +#elif ENABLED(DWIN_VET6_CREALITY_LCD) + + // VET6 DWIN ENCODER LCD + #define BTN_ENC PA6 + #define BTN_EN1 PA7 + #define BTN_EN2 PA4 + + #define BEEPER_PIN PA5 + +#endif diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h index 5b51ece07f08..64ef046bd3ad 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 @@ -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" 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..9acbb42a88f4 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.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.2 (STM32F103RET6) board pin assignments + */ + +#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 HEATER_0_PIN PA1 // HEATER1 +#define HEATER_BED_PIN PA2 // HOT BED +#define FAN_PIN PA0 // FAN +#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 new file mode 100644 index 000000000000..f990b2f7b474 --- /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_ACTIVATION_SWITCH_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 diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 05b8b19a8a54..c49c31e741c1 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" @@ -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 // @@ -59,6 +62,9 @@ // SPI // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // +#define SD_SCK_PIN PB13 // SPI2 +#define SD_MISO_PIN PB14 // SPI2 +#define SD_MOSI_PIN PB15 // SPI2 #define SPI_DEVICE 2 // SPI Flash @@ -114,11 +120,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 @@ -127,7 +129,7 @@ #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 + #define TMC_BAUD_RATE 19200 #else // Motor current PWM pins #define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY @@ -137,20 +139,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 @@ -208,7 +210,7 @@ */ //#define SW_DIO PA13 //#define SW_CLK PA14 -//#define SW_RST NRST // (14) +//#define SW_RST NRST // (14) // // Power Supply Control @@ -243,11 +245,11 @@ #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 +#if SD_CONNECTION_IS(CUSTOM_CABLE) + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 + #define SD_SS_PIN -1 #define SD_DETECT_PIN PD12 // SD_CD (if -1 no detection) #else #define SDIO_SUPPORT @@ -269,43 +271,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 + #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 +314,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/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 859f9fab1ecd..2278d558702e 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -133,12 +133,12 @@ // LCD / Controller // #define SPI_DEVICE 2 -#define SS_PIN PB12 -#define SCK_PIN PB13 -#define MISO_PIN PB14 -#define MOSI_PIN PB15 +#define SD_SS_PIN PB12 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN PB14 +#define SD_MOSI_PIN PB15 -#define SDSS SS_PIN +#define SDSS SD_SS_PIN #define SD_DETECT_PIN PB11 #define BEEPER_PIN PC14 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/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 52b857ac0ab9..5b97e7f202de 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -216,23 +216,23 @@ // // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 + #define SD_SS_PIN PC11 + #define SD_SCK_PIN PC12 + #define SD_MOSI_PIN PD2 + #define SD_MISO_PIN PC8 #define SD_DETECT_PIN PC7 #else // // Use the on-board card socket labeled TF_CARD_SOCKET // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 + #define SD_SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MOSI_PIN PA7 + #define SD_MISO_PIN PA6 #define SD_DETECT_PIN -1 // Card detect is not connected #endif -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // // ESP WiFi can be soldered to J9 connector which is wired to USART2. diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index 85d0be6d6b70..173eb67f0d09 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -210,23 +210,23 @@ // // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 + #define SD_SS_PIN PC11 + #define SD_SCK_PIN PC12 + #define SD_MOSI_PIN PD2 + #define SD_MISO_PIN PC8 #define SD_DETECT_PIN PC7 #else // // Use the on-board card socket labeled TF_CARD_SOCKET // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 + #define SD_SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MOSI_PIN PA7 + #define SD_MISO_PIN PA6 #define SD_DETECT_PIN -1 // Card detect is not connected #endif -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // // ESP WiFi can be soldered to J9 connector which is wired to USART2. diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 52b857ac0ab9..5b97e7f202de 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -216,23 +216,23 @@ // // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector // - #define SS_PIN PC11 - #define SCK_PIN PC12 - #define MOSI_PIN PD2 - #define MISO_PIN PC8 + #define SD_SS_PIN PC11 + #define SD_SCK_PIN PC12 + #define SD_MOSI_PIN PD2 + #define SD_MISO_PIN PC8 #define SD_DETECT_PIN PC7 #else // // Use the on-board card socket labeled TF_CARD_SOCKET // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 + #define SD_SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MOSI_PIN PA7 + #define SD_MISO_PIN PA6 #define SD_DETECT_PIN -1 // Card detect is not connected #endif -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // // ESP WiFi can be soldered to J9 connector which is wired to USART2. diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 292119ce024e..b4a34a4b1e4b 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -212,24 +212,24 @@ // // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector // - #define SS_PIN PB12 // PC11 - #define SCK_PIN PB13 // PC12 // PC1 - #define MOSI_PIN PB15 // PD2 // PD2 - #define MISO_PIN PB14 // PC8 + #define SD_SS_PIN PB12 // PC11 + #define SD_SCK_PIN PB13 // PC12 // PC1 + #define SD_MOSI_PIN PB15 // PD2 // PD2 + #define SD_MISO_PIN PB14 // PC8 #define SD_DETECT_PIN PC7 #else // // Use the on-board card socket labeled TF_CARD_SOCKET // - #define SS_PIN PA4 - #define SCK_PIN PA5 - #define MOSI_PIN PA7 - #define MISO_PIN PA6 // PA6 + #define SD_SS_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MOSI_PIN PA7 + #define SD_MISO_PIN PA6 // PA6 #define SD_DETECT_PIN -1 // Card detect is not connected #endif -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // // ESP WiFi can be soldered to J9 connector which is wired to USART2. 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_MALYAN_M200.h b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h index 95e7e92174fa..e33e029deb96 100644 --- a/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h +++ b/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h @@ -41,7 +41,7 @@ #define FLASH_EEPROM_EMULATION #endif -#define SDSS SS_PIN +#define SDSS SD_SS_PIN // Based on PWM timer usage, we have to use these timers and soft PWM for the fans // On STM32F103: diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 581dd5375ba4..99e0f0be2abd 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 */ @@ -43,15 +42,20 @@ #define DISABLE_JTAG // -// Enable SD EEPROM to prevent infinite boot loop +// EEPROM // -#ifdef ARDUINO_ARCH_STM32 - #define FLASH_EEPROM_EMULATION +#if NO_EEPROM_SELECTED + #ifdef ARDUINO_ARCH_STM32 + #define FLASH_EEPROM_EMULATION + #else + #define SDCARD_EEPROM_EMULATION + #endif +#endif + +#if ENABLED(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) -#else - #define SDCARD_EEPROM_EMULATION #endif // @@ -103,36 +107,56 @@ #define TEMP_BED_PIN PC0 // TB1 // -// Heaters / Fans +// Heaters // #define HEATER_0_PIN PC7 // HEATER1 #define HEATER_1_PIN PA6 // HEATER2 #define HEATER_BED_PIN PC6 // HOT BED +// +// Fan +// #define FAN_PIN PA7 // FAN -/** - * Note: MKS Robin board is using SPI2 interface. Make sure your stm32duino library is configured accordingly - */ +// +// Thermocouples +// //#define MAX6675_SS_PIN PE5 // TC1 - CS1 //#define MAX6675_SS_PIN PE6 // TC2 - CS2 +// +// Filament runout sensor +// +#define FIL_RUNOUT_PIN PF11 // MT_DET + +// +// Power loss detection +// #define POWER_LOSS_PIN PA2 // PW_DET + +// +// Power supply control +// #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 +// +// Piezzoelectric speaker +// +#define BEEPER_PIN PC13 + +// +// Activity LED +// #define LED_PIN PB2 -#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT - #define TFT_CS_PIN PG12 // NE4 - #define TFT_RS_PIN PF0 // A0 -#endif +// +// ESP12-S Wi-Fi module +// +#define WIFI_IO0_PIN PG1 +// +// LCD screen +// #if HAS_FSMC_TFT /** * Note: MKS Robin TFT screens use various TFT controllers @@ -140,23 +164,28 @@ * 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 + #define TFT_BUFFER_SIZE 14400 #endif #if NEED_TOUCH_PINS @@ -167,50 +196,88 @@ #define TOUCH_INT_PIN -1 #endif +// SPI2 is shared by LCD touch driver and flash // SPI1(PA7) & SPI3(PB5) not available #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 - #define MOSI_PIN PB15 // SPI2 - #define SD_DETECT_PIN PF12 // SD_CD + #define SD_SCK_PIN PB13 // SPI2 + #define SD_MISO_PIN PB14 // SPI2 + #define SD_MOSI_PIN PB15 // SPI2 + /** + * MKS Robin has a few hardware revisions + * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware + * + * MKS Robin <= V2.3 have no SD_DETECT_PIN. + * MKS Robin >= V2.4 have SD_DETECT_PIN on PF12. + * + * Uncomment here or add SD_DETECT_PIN to 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 - #define MISO_PIN PC8 - #define MOSI_PIN PD2 - #define SS_PIN -1 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 + #define SD_SS_PIN -1 #define ONBOARD_SD_CS_PIN PC11 #define SDSS PD2 #define SD_DETECT_PIN -1 #endif +// +// Trinamic TMC2208/2209 UART +// #if HAS_TMC_UART /** - * TMC2208/TMC2209 stepper drivers + * This board does not have dedicated TMC UART pins. Custom wiring is needed. + * You may uncomment one of the options below, or add it to your Configuration.h. + * + * When using up to four TMC2209 drivers, hardware serial is recommented on + * MSerial0 or MSerial1. * - * Hardware serial communication ports. - * If undefined software serial is used according to the pins below + * When using TMC2208 or more than four drivers, SoftwareSerial will be needed, + * to provide dedicated pins for each drier. */ - //#define X_HARDWARE_SERIAL MSerial1 - //#define Y_HARDWARE_SERIAL MSerial1 - //#define Z_HARDWARE_SERIAL MSerial1 - //#define E0_HARDWARE_SERIAL MSerial1 - //#define E1_HARDWARE_SERIAL MSerial1 - - // Unused servo pins may be repurposed with SoftwareSerialM - //#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6 - //#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5 - //#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6 - //#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5 - //#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - //#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - //#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - //#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - - // Reduce baud rate for software serial reliability - #if HAS_TMC_SW_SERIAL + + //#define TMC_HARDWARE_SERIAL + #if ENABLED(TMC_HARDWARE_SERIAL) + #define X_HARDWARE_SERIAL MSerial0 + #define X2_HARDWARE_SERIAL MSerial0 + #define Y_HARDWARE_SERIAL MSerial0 + #define Y2_HARDWARE_SERIAL MSerial0 + #define Z_HARDWARE_SERIAL MSerial0 + #define Z2_HARDWARE_SERIAL MSerial0 + #define E0_HARDWARE_SERIAL MSerial0 + #define E1_HARDWARE_SERIAL MSerial0 + #endif + + //#define TMC_SOFTWARE_SERIAL + #if ENABLED(TMC_SOFTWARE_SERIAL) + #define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6 + #define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5 + #define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6 + #define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN #define TMC_BAUD_RATE 19200 #endif #endif + +// +// W25Q64 64Mb (8MB) SPI flash +// +#define HAS_SPI_FLASH 1 +#if HAS_SPI_FLASH + #define SPI_FLASH_SIZE 0x800000 // 8MB + #define W25QXX_CS_PIN PG9 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif 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..3118a521bbeb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -28,19 +28,18 @@ #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 // // 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_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index 1362d2208619..c4a7e9f40861 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 * @@ -180,10 +180,10 @@ // #define SPI_DEVICE 2 #define SD_DETECT_PIN PC10 -#define SCK_PIN PB13 -#define MISO_PIN PB14 -#define MOSI_PIN PB15 -#define SS_PIN PA15 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN PB14 +#define SD_MOSI_PIN PB15 +#define SD_SS_PIN PA15 #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 DELAY_NS(125) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index d7c4aebe37dc..13c2d41d577b 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 @@ -142,7 +142,7 @@ // SPI // #define SPI_DEVICE 2 -#define SCK_PIN PB13 -#define MISO_PIN P1B4 -#define MOSI_PIN P1B5 -#define SS_PIN PA15 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN P1B4 +#define SD_MOSI_PIN P1B5 +#define SD_SS_PIN PA15 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 27bd4033cd98..f814052fa800 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -153,7 +153,7 @@ // SPI // #define SPI_DEVICE 2 -#define SCK_PIN PB13 -#define MISO_PIN PB14 -#define MOSI_PIN PB15 -#define SS_PIN PA15 +#define SD_SCK_PIN PB13 +#define SD_MISO_PIN PB14 +#define SD_MOSI_PIN PB15 +#define SD_SS_PIN PA15 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index ae6835758993..b3cfe5b6baa7 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" @@ -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/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 760f27060ec2..ea3a7a1eea8e 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) @@ -35,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 // @@ -52,6 +56,11 @@ #define SPI_DEVICE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -144,8 +153,6 @@ #define FIL_RUNOUT2_PIN PE6 #endif -#define SERVO0_PIN PA8 // Enable BLTOUCH support - //#define LED_PIN PB2 // @@ -167,18 +174,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 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..6ef3a0804384 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -37,10 +37,12 @@ #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 // - #define DISABLE_DEBUG // @@ -59,6 +61,11 @@ // #define SPI_DEVICE 2 +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + // // Limit Switches // @@ -160,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 @@ -215,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..39676bf9d789 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 @@ -193,10 +193,10 @@ #if SD_CONNECTION_IS(LCD) #define SD_DETECT_PIN PG3 - #define SCK_PIN PB13 - #define MISO_PIN PB14 - #define MOSI_PIN PB15 - #define SS_PIN PG6 + #define SD_SCK_PIN PB13 + #define SD_MISO_PIN PB14 + #define SD_MOSI_PIN PB15 + #define SD_SS_PIN PG6 #elif SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT #define SD_DETECT_PIN PD12 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 diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index 6f252fbef612..d666755c6ffa 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -100,16 +100,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -118,145 +109,29 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif #if IS_NEWPANEL - #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif - #endif // IS_NEWPANEL + #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index ef82b71f560b..4f8183caf4c1 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -115,16 +115,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -133,13 +124,7 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif @@ -154,132 +139,23 @@ #elif IS_NEWPANEL #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif - #endif // IS_NEWPANEL + + #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 543a90b66b91..e09bbff324f3 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -56,8 +56,8 @@ // // Limit Switches // -#define X_MAX_PIN PG10 -#define Y_MAX_PIN PA12 +#define X_STOP_PIN PG10 +#define Y_STOP_PIN PA12 #define Z_MAX_PIN PA14 #define Z_MIN_PIN PA13 @@ -166,17 +166,17 @@ #define SPI_DEVICE 2 #if ENABLED(SDIO_SUPPORT) - #define SCK_PIN PB13 // SPI2 ok - #define MISO_PIN PB14 // SPI2 ok - #define MOSI_PIN PB15 // SPI2 ok - #define SS_PIN PC11 // PB12 is X- ok + #define SD_SCK_PIN PB13 // SPI2 ok + #define SD_MISO_PIN PB14 // SPI2 ok + #define SD_MOSI_PIN PB15 // SPI2 ok + #define SD_SS_PIN PC11 // PB12 is X- ok #define SD_DETECT_PIN -1 // SD_CD ok #else // SD as custom software SPI (SDIO pins) - #define SCK_PIN PC12 - #define MISO_PIN PC8 - #define MOSI_PIN PD2 - #define SS_PIN -1 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 + #define SD_SS_PIN -1 #define ONBOARD_SD_CS_PIN PC11 #define SDSS PD2 #define SD_DETECT_PIN -1 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..487080f46b67 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -0,0 +1,222 @@ +/** + * 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 + +#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 NEED_TOUCH_PINS + #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 + +#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 SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_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..f5ebf82a4858 --- /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/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index 4b981c92519e..c2ad907e0470 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -156,8 +156,8 @@ #ifndef SDIO_SUPPORT #define SOFTWARE_SPI // Use soft SPI for onboard SD #define SDSS SDIO_D3_PIN - #define SCK_PIN SDIO_CK_PIN - #define MISO_PIN SDIO_D0_PIN - #define MOSI_PIN SDIO_CMD_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index 19ff2a34e222..939bc1eccd08 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. Comment out this line to continue." #endif #define BOARD_INFO_NAME "BTT BTT002 V1.0" @@ -175,10 +175,10 @@ // HAL SPI1 pins #define CUSTOM_SPI_PINS #if ENABLED(CUSTOM_SPI_PINS) - #define SCK_PIN PA5 // SPI1 SCLK - #define SS_PIN PA4 // SPI1 SSEL - #define MISO_PIN PA6 // SPI1 MISO - #define MOSI_PIN PA7 // SPI1 MOSI + #define SD_SCK_PIN PA5 // SPI1 SCLK + #define SD_SS_PIN PA4 // SPI1 SSEL + #define SD_MISO_PIN PA6 // SPI1 MISO + #define SD_MOSI_PIN PA7 // SPI1 MOSI #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 6c475faeb558..981064fa4d59 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 // @@ -46,15 +49,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 @@ -299,10 +341,10 @@ // Instruct the STM32 HAL to override the default SPI pins from the variant.h file #define CUSTOM_SPI_PINS #define SDSS PA4 - #define SS_PIN SDSS - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #define MOSI_PIN PA7 + #define SD_SS_PIN SDSS + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 #define SD_DETECT_PIN PC4 #elif SD_CONNECTION_IS(CUSTOM_CABLE) 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..54153beb1e79 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 // @@ -300,9 +303,9 @@ // so force Software SPI to work around this issue. #define SOFTWARE_SPI #define SDSS PA4 - #define SCK_PIN PA5 - #define MISO_PIN PA6 - #define MOSI_PIN PB5 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PB5 #define SD_DETECT_PIN PB11 #elif SD_CONNECTION_IS(CUSTOM_CABLE) diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 808751d7a53d..7965d262c3dc 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 // @@ -192,16 +196,16 @@ #ifndef SDIO_SUPPORT #define SOFTWARE_SPI // Use soft SPI for onboard SD #define SDSS SDIO_D3_PIN - #define SCK_PIN SDIO_CK_PIN - #define MISO_PIN SDIO_D0_PIN - #define MOSI_PIN SDIO_CMD_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN #endif #elif SD_CONNECTION_IS(LCD) - #define SCK_PIN PB13 - #define MISO_PIN PB14 - #define MOSI_PIN PB15 + #define SD_SCK_PIN PB13 + #define SD_MISO_PIN PB14 + #define SD_MOSI_PIN PB15 #define SDSS PF11 #define SD_DETECT_PIN PB2 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index a8105c37a244..a28077564634 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 // @@ -181,9 +180,9 @@ // // SPI // -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 +#define SD_SCK_PIN PA5 +#define SD_MISO_PIN PA6 +#define SD_MOSI_PIN PA7 // // Misc. Functions @@ -199,7 +198,27 @@ // // LCD / Controller // -#if HAS_WIRED_LCD +#if ENABLED(FYSETC_242_OLED_12864) + + #define BTN_EN1 PC9 + #define BTN_EN2 PD1 + #define BTN_ENC PA8 + + #define BEEPER_PIN PC6 + + #define LCD_PINS_DC PC12 + #define LCD_PINS_RS PC7 // LCD_RST + #define DOGLCD_CS PD2 + #define DOGLCD_MOSI PC10 + #define DOGLCD_SCK PC11 + #define DOGLCD_A0 LCD_PINS_DC + #define FORCE_SOFT_SPI + + #define KILL_PIN -1 // NC + #define NEOPIXEL_PIN PD0 + +#elif HAS_WIRED_LCD + #define BEEPER_PIN PC9 #define BTN_ENC PA8 @@ -212,11 +231,6 @@ #define LCD_PINS_ENABLE PD1 #define LCD_PINS_D4 PC12 - // CR10_STOCKDISPLAY default timing is too fast - #undef BOARD_ST7920_DELAY_1 - #undef BOARD_ST7920_DELAY_2 - #undef BOARD_ST7920_DELAY_3 - #else #define LCD_PINS_RS PD2 @@ -230,7 +244,7 @@ #define LCD_PINS_D4 PC10 #if ENABLED(FYSETC_MINI_12864) - // See https://wiki.fysetc.com/Mini12864_Panel + // See https://wiki.fysetc.com/Mini12864_Panel #define DOGLCD_CS PC11 #define DOGLCD_A0 PD2 #if ENABLED(FYSETC_GENERIC_12864_1_1) @@ -250,36 +264,34 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) #define NEOPIXEL_PIN PC12 #endif - #endif // !FYSETC_MINI_12864 + #endif #if IS_ULTIPANEL #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 - // Alter timing for graphical display - #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(600) - #endif - #endif - #endif // HAS_WIRED_LCD +// Alter timing for graphical display +#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(640) + #endif +#endif + #ifndef RGB_LED_R_PIN #define RGB_LED_R_PIN PB6 #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 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index 48973688a058..bf6df0356237 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -29,6 +29,9 @@ #define I2C_EEPROM +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + // // Servos // @@ -142,6 +145,7 @@ // SD support // #define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 // // Misc. Functions @@ -152,10 +156,10 @@ #define KILL_PIN -1 #define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT -#define SCK_PIN PC12 -#define MISO_PIN PC8 -#define MOSI_PIN PD2 -#define SS_PIN PC11 +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 #define SD_DETECT_PIN PA8 #define BEEPER_PIN PC7 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index 0600ed43389f..c6cfa98831e2 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -32,64 +32,67 @@ //#define I2C_EEPROM +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + // // Servos // -#define SERVO0_PIN PD12 //confirmed +#define SERVO0_PIN PD12 //#define SERVO1_PIN -1 // // Limit Switches // -#define X_MIN_PIN PG9 //confirmed -#define Y_MIN_PIN PG10 //confirmed -#define Z_MIN_PIN PG11 //confirmed +#define X_MIN_PIN PG9 +#define Y_MIN_PIN PG10 +#define Z_MIN_PIN PG11 -#define X_MAX_PIN PG12 //confirmed -#define Y_MAX_PIN PG13 //confirmed -#define Z_MAX_PIN PG14 //confirmed +#define X_MAX_PIN PG12 +#define Y_MAX_PIN PG13 +#define Z_MAX_PIN PG14 // // Filament runout // -#define FIL_RUNOUT_PIN PC5 //confirmed +#define FIL_RUNOUT_PIN PC5 // // Z Probe (when not Z_MIN_PIN) // #ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PG8 //confirmed + #define Z_MIN_PROBE_PIN PG8 #endif // // Steppers // -#define X_STEP_PIN PF7 //confirmed -#define X_DIR_PIN PF8 //confirmed -#define X_ENABLE_PIN PF6 //confirmed +#define X_STEP_PIN PF7 +#define X_DIR_PIN PF8 +#define X_ENABLE_PIN PF6 -#define Y_STEP_PIN PF10 //confirmed -#define Y_DIR_PIN PF11 //confirmed -#define Y_ENABLE_PIN PF9 //confirmed +#define Y_STEP_PIN PF10 +#define Y_DIR_PIN PF11 +#define Y_ENABLE_PIN PF9 -#define Z_STEP_PIN PF13 //confirmed -#define Z_DIR_PIN PF14 //confirmed -#define Z_ENABLE_PIN PF12 //confirmed +#define Z_STEP_PIN PF13 +#define Z_DIR_PIN PF14 +#define Z_ENABLE_PIN PF12 -#define E0_STEP_PIN PG0 //confirmed -#define E0_DIR_PIN PG1 //confirmed -#define E0_ENABLE_PIN PF15 //confirmed +#define E0_STEP_PIN PG0 +#define E0_DIR_PIN PG1 +#define E0_ENABLE_PIN PF15 -#define E1_STEP_PIN PG3 //confirmed -#define E1_DIR_PIN PG4 //confirmed -#define E1_ENABLE_PIN PG2 //confirmed +#define E1_STEP_PIN PG3 +#define E1_DIR_PIN PG4 +#define E1_ENABLE_PIN PG2 // // Temperature Sensors // #define TEMP_0_PIN PC0 // See below for activation of thermistor readings #define TEMP_1_PIN PC1 // See below for activation of thermistor readings -#define TEMP_BED_PIN PC3 //confirmed +#define TEMP_BED_PIN PC3 // Lergde-S can choose thermocouple/thermistor mode in software. // For use with thermistors, these pins must be OUT/LOW. @@ -114,13 +117,13 @@ // // Heaters / Fans // -#define HEATER_0_PIN PA0 //confirmed -#define HEATER_1_PIN PA1 //confirmed -#define HEATER_BED_PIN PA3 //confirmed +#define HEATER_0_PIN PA0 +#define HEATER_1_PIN PA1 +#define HEATER_BED_PIN PA3 -#define FAN_PIN PA15 // heater 0 fan 1 //confirmed -#define FAN1_PIN PB10 // heater 1 fan 2 //confirmed -#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) //confirmed +#define FAN_PIN PA15 // heater 0 fan 1 +#define FAN1_PIN PB10 // heater 1 fan 2 +#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) #ifndef E0_AUTO_FAN_PIN #define E0_AUTO_FAN_PIN PF5 @@ -136,19 +139,19 @@ // LED / Lighting // //Lerdge-S board has two LED connectors (this is the one on the mainboard) -#define CASE_LIGHT_PIN PC7 //confirmed +#define CASE_LIGHT_PIN PC7 //on the dual extrusion addon board is a RGB connector -#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN), confirmed -#define RGB_LED_G_PIN PB0 //confirmed -#define RGB_LED_B_PIN PB1 //confirmed +#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN) +#define RGB_LED_G_PIN PB0 +#define RGB_LED_B_PIN PB1 // // Misc. Functions // #define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed? -#define LED_PIN PC6 // Mainboard soldered green LED, confirmed -#define PS_ON_PIN PB2 // Board has a power module connector, confirmed +#define LED_PIN PC6 // Mainboard soldered green LED +#define PS_ON_PIN PB2 // Board has a power module connector #define KILL_PIN -1 // There is no reset button on the LCD #define POWER_LOSS_PIN -1 // PB2 could be used for this as well @@ -156,13 +159,14 @@ // SD support // #define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 -#define SCK_PIN PC12 //confirmed working -#define MISO_PIN PC8 //confirmed working -#define MOSI_PIN PD2 //confirmed working -#define SS_PIN PC11 //confirmed working +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 -#define SD_DETECT_PIN PG15 //confirmed +#define SD_DETECT_PIN PG15 // // Persistent Storage @@ -189,14 +193,14 @@ // // The LCD is initialized in FSMC mode -#define BEEPER_PIN PD13 //confirmed +#define BEEPER_PIN PD13 -#define BTN_EN1 PC14 //confirmed -#define BTN_EN2 PC15 //confirmed -#define BTN_ENC PC13 //confirmed +#define BTN_EN1 PC14 +#define BTN_EN2 PC15 +#define BTN_ENC PC13 -#define TFT_RESET_PIN PD6 //confirmed -#define TFT_BACKLIGHT_PIN PD3 //confirmed +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 #define TFT_CS_PIN PD7 // TFT works #define TFT_RS_PIN PD11 // TFT works diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index bed51ca660cf..606d932c5739 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-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "Lerdge X" @@ -32,6 +32,9 @@ #define I2C_EEPROM +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + // // Servos // @@ -117,16 +120,17 @@ // Lerdge supports auto-power off and power loss sense through a single pin. #define POWER_LOSS_PIN PC14 // Power-loss / nAC_FAULT -#define SCK_PIN PC12 -#define MISO_PIN PC8 -#define MOSI_PIN PD2 -#define SS_PIN PC11 +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 // // SD support // #define SDIO_SUPPORT #define SD_DETECT_PIN PA8 +#define SDIO_CLOCK 4800000 // // LCD / Controller 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..49ee420aaee1 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -0,0 +1,358 @@ +/** + * 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" + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 10 + +// 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 +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +// +// Release PB4 (Z_DIR_PIN) from JTAG NRST role +// +//#define DISABLE_DEBUG + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + +// +// 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 supports SW SPI for stepper drivers +// +#if HAS_TMC_SPI + #define TMC_USE_SW_SPI +#endif +#if ENABLED(TMC_USE_SW_SPI) + #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1 + #define TMC_SW_MOSI PD14 + #endif + #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1 + #define TMC_SW_MISO PD1 + #endif + #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1 + #define TMC_SW_SCK PD0 + #endif +#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 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 SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #define SD_DETECT_PIN 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 SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_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 ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) + #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 +#endif // HAS_SPI_LCD 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..5533e35f07cf --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -0,0 +1,371 @@ +/** + * 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" + +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 10 + +// 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 +#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 +// +//#define DISABLE_DEBUG + +// +// Note: MKS Robin board is using SPI2 interface. +// +//#define SPI_MODULE 2 + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + +// +// 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 // HAS_TMC_UART + +// +// 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 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 SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_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 SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_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 ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) + #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 +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 24c32d6d818c..2a0cfa897cf4 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -126,9 +126,9 @@ // // SPI // -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 +#define SD_SCK_PIN PA5 +#define SD_MISO_PIN PA6 +#define SD_MOSI_PIN PA7 // // Misc. Functions @@ -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 diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h index 0278dd8434b6..25679517c269 100644 --- a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h +++ b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h @@ -120,13 +120,13 @@ #define L6470_CHAIN_MOSI_PIN 19 // PA7 #define L6470_CHAIN_SS_PIN 16 // PA4 - //#define SCK_PIN L6470_CHAIN_SCK_PIN - //#define MISO_PIN L6470_CHAIN_MISO_PIN - //#define MOSI_PIN L6470_CHAIN_MOSI_PIN + //#define SD_SCK_PIN L6470_CHAIN_SCK_PIN + //#define SD_MISO_PIN L6470_CHAIN_MISO_PIN + //#define SD_MOSI_PIN L6470_CHAIN_MOSI_PIN #else - //#define SCK_PIN 13 // PB13 SPI_S - //#define MISO_PIN 12 // PB14 SPI_M - //#define MOSI_PIN 11 // PB15 SPI_M + //#define SD_SCK_PIN 13 // PB13 SPI_S + //#define SD_MISO_PIN 12 // PB14 SPI_M + //#define SD_MOSI_PIN 11 // PB15 SPI_M #endif /** @@ -249,9 +249,9 @@ #define SOFTWARE_SPI // Use soft SPI for onboard SD #undef SDSS #define SDSS SDIO_D3_PIN - #define SCK_PIN SDIO_CK_PIN - #define MISO_PIN SDIO_D0_PIN - #define MOSI_PIN SDIO_CMD_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index e2463fd47e6f..1135af847fa0 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -99,16 +99,16 @@ #define E1_CS_PIN PB0 #endif -#define SCK_PIN PE12 // PA5 // SPI1 for SD card -#define MISO_PIN PE13 // PA6 -#define MOSI_PIN PE14 // PA7 +#define SD_SCK_PIN PE12 // PA5 // SPI1 for SD card +#define SD_MISO_PIN PE13 // PA6 +#define SD_MOSI_PIN PE14 // PA7 // added for SD card : optional or not ??? //#define SD_CHIP_SELECT_PIN SDSS // The default chip select pin for the SD card is SS. // The following three pins must not be redefined for hardware SPI. -//#define SPI_MOSI_PIN MOSI_PIN // SPI Master Out Slave In pin -//#define SPI_MISO_PIN MISO_PIN // SPI Master In Slave Out pin -//#define SPI_SCK_PIN SCK_PIN // SPI Clock pin +//#define SPI_MOSI_PIN SD_MOSI_PIN // SPI Master Out Slave In pin +//#define SPI_MISO_PIN SD_MISO_PIN // SPI Master In Slave Out pin +//#define SPI_SCK_PIN SD_SCK_PIN // SPI Clock pin // // Temperature Sensors (Analog inputs) @@ -159,7 +159,7 @@ #if ENABLED(SDSUPPORT) #define SD_DETECT_PIN PB7 - #define SS_PIN PB_15 // USD_CS -> CS for onboard SD + #define SD_SS_PIN PB_15 // USD_CS -> CS for onboard SD #endif // diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 90dcfc46e424..5e50548c9b5c 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 /** @@ -170,10 +170,10 @@ #define SERVO1_PIN PB5 // PWM Capable, TIM3_CH2 // SPI for external SD Card (Not entirely sure this will work) -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 -#define SS_PIN PA4 +#define SD_SCK_PIN PA5 +#define SD_MISO_PIN PA6 +#define SD_MOSI_PIN PA7 +#define SD_SS_PIN PA4 #define SDSS PA4 #define LED_PIN LED_BLUE @@ -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/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index c3dc004728d8..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 supports only one hotend / E-stepper." + #error "RemRam only supports one hotend / E-stepper. Comment out this line to continue." #endif // 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 diff --git a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h index b8a0ffe2c80b..71c348536a7f 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h @@ -146,7 +146,7 @@ #endif #if IS_RRW_KEYPAD - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 + #define SHIFT_OUT_PIN 40 + #define SHIFT_CLK_PIN 44 + #define SHIFT_LD_PIN 42 #endif diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index db2a9e2de9c5..270053be3e04 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -401,8 +401,8 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { // Fail for illegal characters PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; - if (i > n || c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters - name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name + if (i > n || c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters + name[i++] = c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0); // Uppercase required for 8.3 name } } *ptr = str; // Set passed pointer to the end @@ -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; } diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 4416f4e90792..7b162f734335 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 @@ -378,9 +379,9 @@ void CardReader::mount() { flag.mounted = false; if (root.isOpen()) root.close(); - if (!sd2card.init(SPI_SPEED, SDSS) + if (!sd2card.init(SD_SPI_SPEED, SDSS) #if defined(LCD_SDSS) && (LCD_SDSS != SDSS) - && !sd2card.init(SPI_SPEED, LCD_SDSS) + && !sd2card.init(SD_SPI_SPEED, LCD_SDSS) #endif ) SERIAL_ECHO_MSG(STR_SD_INIT_FAIL); else if (!volume.init(&sd2card)) @@ -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)); } // @@ -662,14 +665,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; } // @@ -699,8 +712,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); } @@ -726,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 an auto file was started + */ + bool CardReader::autofile_check() { + if (!autofile_index) return false; + + 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 true; } } + autofile_cancel(); + return false; } - autostart_index = -1; -} - -void CardReader::beginautostart() { - autostart_index = 0; - cdroot(); -} +#endif void CardReader::closefile(const bool store_location/*=false*/) { file.sync(); @@ -1232,7 +1250,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); } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index c6fe37400c2d..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); @@ -159,9 +161,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 +246,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/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 539d31654265..c6e3c73f5287 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -44,12 +44,13 @@ #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 - #define UHS_MAX3421E_SPD 8000000 >> SPI_SPEED + #define UHS_MAX3421E_SPD 8000000 >> SD_SPI_SPEED #define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1 #define UHS_HOST_MAX_INTERFACE_DRIVERS 2 #define MASS_MAX_SUPPORTED_LUN 1 @@ -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..5789121367ad 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 SD_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*) { return true; } + uint32_t cardSize(); static bool isInserted(); - static bool ready(); + bool isReady(); }; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 358b49d5b422..190a0f1a9e01 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -114,13 +114,7 @@ bool MAX3421e::start() { ncs(); spiBegin(); - spiInit( - #ifdef SPI_SPEED - SPI_SPEED - #else - SPI_FULL_SPEED - #endif - ); + spiInit(SD_SPI_SPEED); // MAX3421e - full-duplex, level interrupt, vbus off. regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | GPX_VBDET)); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h index c5458208d2da..fb2e8b38718c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -144,169 +144,7 @@ e-mail : support@circuitsathome.com #define UHS_GET_DPI(x) (x) #endif -#ifndef __AVR__ -#ifndef __PGMSPACE_H_ -// This define should prevent reading the system pgmspace.h if included elsewhere -// This is not normally needed. -#define __PGMSPACE_H_ 1 -#endif - -#ifndef PROGMEM -#define PROGMEM -#endif -#ifndef PGM_P -#define PGM_P const char * -#endif -#ifndef PSTR -#define PSTR(str) (str) -#endif -#ifndef F -#define F(str) (str) -#endif -#ifndef _SFR_BYTE -#define _SFR_BYTE(n) (n) -#endif -#ifndef memchr_P -#define memchr_P(str, c, len) memchr((str), (c), (len)) -#endif -#ifndef memcmp_P -#define memcmp_P(a, b, n) memcmp((a), (b), (n)) -#endif -#ifndef memcpy_P -#define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) -#endif -#ifndef memmem_P -#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen)) -#endif -#ifndef memrchr_P -#define memrchr_P(str, val, len) memrchr((str), (val), (len)) -#endif -#ifndef strcat_P -#define strcat_P(dest, src) strcat((dest), (src)) -#endif -#ifndef strchr_P -#define strchr_P(str, c) strchr((str), (c)) -#endif -#ifndef strchrnul_P -#define strchrnul_P(str, c) strchrnul((str), (c)) -#endif -#ifndef strcmp_P -#define strcmp_P(a, b) strcmp((a), (b)) -#endif -#ifndef strcpy_P -#define strcpy_P(dest, src) strcpy((dest), (src)) -#endif -#ifndef strcasecmp_P -#define strcasecmp_P(a, b) strcasecmp((a), (b)) -#endif -#ifndef strcasestr_P -#define strcasestr_P(a, b) strcasestr((a), (b)) -#endif -#ifndef strlcat_P -#define strlcat_P(dest, src, len) strlcat((dest), (src), (len)) -#endif -#ifndef strlcpy_P -#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len)) -#endif -#ifndef strlen_P -#define strlen_P(s) strlen((const char *)(s)) -#endif -#ifndef strnlen_P -#define strnlen_P(str, len) strnlen((str), (len)) -#endif -#ifndef strncmp_P -#define strncmp_P(a, b, n) strncmp((a), (b), (n)) -#endif -#ifndef strncasecmp_P -#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n)) -#endif -#ifndef strncat_P -#define strncat_P(a, b, n) strncat((a), (b), (n)) -#endif -#ifndef strncpy_P -#define strncpy_P(a, b, n) strncmp((a), (b), (n)) -#endif -#ifndef strpbrk_P -#define strpbrk_P(str, chrs) strpbrk((str), (chrs)) -#endif -#ifndef strrchr_P -#define strrchr_P(str, c) strrchr((str), (c)) -#endif -#ifndef strsep_P -#define strsep_P(strp, delim) strsep((strp), (delim)) -#endif -#ifndef strspn_P -#define strspn_P(str, chrs) strspn((str), (chrs)) -#endif -#ifndef strstr_P -#define strstr_P(a, b) strstr((a), (b)) -#endif -#ifndef sprintf_P -#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__) -#endif -#ifndef vfprintf_P -#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__) -#endif -#ifndef printf_P -#define printf_P(...) printf(__VA_ARGS__) -#endif -#ifndef snprintf_P -#define snprintf_P(s, n, ...) ((s), (n), __VA_ARGS__) -#endif -#ifndef vsprintf_P -#define vsprintf_P(s, ...) ((s),__VA_ARGS__) -#endif -#ifndef vsnprintf_P -#define vsnprintf_P(s, n, ...) ((s), (n),__VA_ARGS__) -#endif -#ifndef fprintf_P -#define fprintf_P(s, ...) ((s), __VA_ARGS__) -#endif - -#ifndef pgm_read_byte -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#endif -#ifndef pgm_read_word -#define pgm_read_word(addr) (*(const unsigned short *)(addr)) -#endif -#ifndef pgm_read_dword -#define pgm_read_dword(addr) (*(const unsigned long *)(addr)) -#endif -#ifndef pgm_read_float -#define pgm_read_float(addr) (*(const float *)(addr)) -#endif - -#ifndef pgm_read_byte_near -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#endif -#ifndef pgm_read_word_near -#define pgm_read_word_near(addr) pgm_read_word(addr) -#endif -#ifndef pgm_read_dword_near -#define pgm_read_dword_near(addr) pgm_read_dword(addr) -#endif -#ifndef pgm_read_float_near -#define pgm_read_float_near(addr) pgm_read_float(addr) -#endif -#ifndef pgm_read_byte_far -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#endif -#ifndef pgm_read_word_far -#define pgm_read_word_far(addr) pgm_read_word(addr) -#endif -#ifndef pgm_read_dword_far -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#endif -#ifndef pgm_read_float_far -#define pgm_read_float_far(addr) pgm_read_float(addr) -#endif - -#ifndef pgm_read_pointer -#define pgm_read_pointer -#endif - -#endif - +#include "../../../../HAL/shared/progmem.h" //////////////////////////////////////////////////////////////////////////////// // HANDY MACROS 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/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/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/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index f3bc2b9b0283..2f4ad3e502a4 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()) @@ -51,7 +75,7 @@ def add_to_feat_cnf(feature, flines): parts = dep.split('=') name = parts.pop(0) rest = '='.join(parts) - if name in ['extra_scripts', 'src_filter', 'lib_ignore']: + if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']: feat[name] = rest else: feat['lib_deps'] += [dep] @@ -108,8 +132,7 @@ def force_ignore_unused_libs(): known_libs = get_all_known_libs() diff = (list(set(known_libs) - set(env_libs))) lib_ignore = env.GetProjectOption('lib_ignore') + diff - if verbose: - print("Ignore libraries:", lib_ignore) + blab("Ignore libraries: %s" % lib_ignore) set_env_field('lib_ignore', lib_ignore) def apply_features_config(): @@ -148,6 +171,12 @@ def apply_features_config(): # Only add the missing dependencies set_env_field('lib_deps', deps + list(deps_to_add.values())) + if 'build_flags' in feat: + f = feat['build_flags'] + blab("Adding build_flags for %s: %s" % (feature, f)) + new_flags = env.GetProjectOption('build_flags') + [ f ] + env.Replace(BUILD_FLAGS=new_flags) + if 'extra_scripts' in feat: blab("Running extra_scripts for %s... " % feature) env.SConscript(feat['extra_scripts'], exports="env") @@ -179,13 +208,13 @@ def apply_features_config(): def search_compiler(): try: filepath = env.GetProjectOption('custom_gcc') - blab('Getting compiler from env') + blab("Getting compiler from env") return filepath except: pass if os.path.exists(GCC_PATH_CACHE): - blab('Getting g++ path from cache') + blab("Getting g++ path from cache") with open(GCC_PATH_CACHE, 'r') as f: return f.read() @@ -212,7 +241,7 @@ def search_compiler(): 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') + blab("Caching g++ for current env") with open(GCC_PATH_CACHE, 'w+') as f: f.write(filepath) @@ -276,6 +305,16 @@ def MarlinFeatureIsEnabled(env, feature): return some_on +# +# Check for Configfiles in two common incorrect places +# +def check_configfile_locations(): + for p in [ env['PROJECT_DIR'], os.path.join(env['PROJECT_DIR'], "config") ]: + for f in [ "Configuration.h", "Configuration_adv.h" ]: + if os.path.isfile(os.path.join(p, f)): + err = 'ERROR: Config files found in directory ' + str(p) + '. Please move them into the Marlin subdirectory.' + raise SystemExit(err) + # # Add a method for other PIO scripts to query enabled features # @@ -284,5 +323,6 @@ def MarlinFeatureIsEnabled(env, feature): # # Add dependencies for enabled Marlin features # +check_configfile_locations() apply_features_config() force_ignore_unused_libs() 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/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/share/PlatformIO/variants/CHITU_F103/board/board.h b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h index 20fd9d379f19..a1e33467434a 100755 --- a/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h @@ -69,14 +69,11 @@ #define BOARD_SPI1_MISO_PIN PA6 #define BOARD_SPI1_MOSI_PIN PA7 - - #define BOARD_SPI2_NSS_PIN PB12 #define BOARD_SPI2_SCK_PIN PB13 #define BOARD_SPI2_MISO_PIN PB14 #define BOARD_SPI2_MOSI_PIN PB15 - #define BOARD_SPI3_NSS_PIN PA15 #define BOARD_SPI3_SCK_PIN PB3 #define BOARD_SPI3_MISO_PIN PB4 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..51ebf605811b --- /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/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h index ee4b1ef29608..4bd5b63dfe56 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h @@ -114,8 +114,10 @@ extern "C" { #define NUM_ANALOG_INPUTS 7 #define NUM_ANALOG_FIRST 80 +//#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/buildroot/share/fonts/genallfont.sh b/buildroot/share/fonts/genallfont.sh index 66f8e2c84f78..0a66990212d7 100755 --- a/buildroot/share/fonts/genallfont.sh +++ b/buildroot/share/fonts/genallfont.sh @@ -57,12 +57,12 @@ OLDWD=`pwd` # # Compile the 'genpages' command in-place # -(cd ${DN_EXEC}; gcc -o genpages genpages.c getline.c) +(cd ${DN_EXEC}; cc -o genpages genpages.c getline.c) # # By default loop through all languages # -LANGS_DEFAULT="an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana ko_KR nl pl pt pt_br ro ru sk tr uk vi zh_CN zh_TW test" +LANGS_DEFAULT="an bg ca cz da de el el_gr en es eu fi fr gl hr hu it jp_kana ko_KR nl pl pt pt_br ro ru sk sv tr uk vi zh_CN zh_TW test" # # Generate data for language list MARLIN_LANGS or all if not provided diff --git a/buildroot/share/git/mftest b/buildroot/share/git/mftest index fda864672ac6..11d0ac38814a 100755 --- a/buildroot/share/git/mftest +++ b/buildroot/share/git/mftest @@ -138,6 +138,15 @@ if ((AUTO_BUILD)); then # # List environments that apply to the current MOTHERBOARD. # + case $(uname | tr '[:upper:]' '[:lower:]') in + darwin) SYS='mac' ;; + *linux) SYS='lin' ;; + win*) SYS='win' ;; + msys*) SYS='win' ;; + cygwin*) SYS='win' ;; + mingw*) SYS='win' ;; + *) SYS='uni' ;; + esac echo ; echo -n "Auto " ; ((AUTO_BUILD == 2)) && echo "Upload..." || echo "Build..." MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//' ) [[ -z $MB ]] && { echo "Error - Can't read MOTHERBOARD setting." ; exit 1 ; } @@ -145,7 +154,7 @@ if ((AUTO_BUILD)); then 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://' ) ) + ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | $SED -E "s/(env|$SYS)://" ) ) [[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; } ECOUNT=${#ENVS[*]} 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/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 diff --git a/buildroot/tests/BIGTREE_SKR_PRO-tests b/buildroot/tests/BIGTREE_SKR_PRO-tests index ff4a8d734e73..8dc433deb27b 100644 --- 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 diff --git a/buildroot/tests/DUE-tests b/buildroot/tests/DUE-tests index 009688ce210f..d4c49a3185bc 100755 --- a/buildroot/tests/DUE-tests +++ b/buildroot/tests/DUE-tests @@ -14,7 +14,8 @@ 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 ASSISTED_TRAMMING_WIZARD \ + FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ + ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \ 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/buildroot/tests/FYSETC_F6-tests b/buildroot/tests/FYSETC_F6-tests new file mode 100644 index 000000000000..e1eb6684a539 --- /dev/null +++ b/buildroot/tests/FYSETC_F6-tests @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega FYSETC F6 1.3 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +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" "$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 LCD_LANGUAGE_2 fr +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/FYSETC_F6_13-tests b/buildroot/tests/FYSETC_F6_13-tests deleted file mode 100644 index a3e9f4ef39a6..000000000000 --- a/buildroot/tests/FYSETC_F6_13-tests +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for AVR ATmega FYSETC F6 1.3 -# - -# exit on first failure -set -e - -# -# Build with the default configurations -# -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" "$3" - -# clean up -restore_configs 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/LPC1769-tests b/buildroot/tests/LPC1769-tests index 702f8035ecb3..0a61d4280002 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -12,21 +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 \ - 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 @@ -34,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 @@ -66,7 +51,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 diff --git a/buildroot/tests/STM32F103RC_btt-tests b/buildroot/tests/STM32F103RC_btt-tests index 5d695c9296b1..0084f59a0ce8 100644 --- 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" diff --git a/buildroot/tests/STM32F103RET6_creality-tests b/buildroot/tests/STM32F103RET6_creality-tests index 954827ddd9ca..199bd6a9c2d8 100644 --- a/buildroot/tests/STM32F103RET6_creality-tests +++ b/buildroot/tests/STM32F103RET6_creality-tests @@ -13,4 +13,18 @@ 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 +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_TARE PROBE_TARE_ONLY_WHILE_INACTIVE +exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" + +# clean up restore_configs diff --git a/buildroot/tests/STM32F103RE_btt_USB-tests b/buildroot/tests/STM32F103RE_btt_USB-tests index e35d68898cf4..43162b68a4b3 100644 --- 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 diff --git a/buildroot/tests/STM32F103VE_longer-tests b/buildroot/tests/STM32F103VE_longer-tests index 461f128873b8..1c90744c0110 100755 --- a/buildroot/tests/STM32F103VE_longer-tests +++ b/buildroot/tests/STM32F103VE_longer-tests @@ -8,7 +8,16 @@ 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 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 +opt_enable BAUD_RATE_GCODE +exec_test $1 $2 "BLTouch U20 config" # cleanup restore_configs diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index a968a5d21316..4125bf87fa47 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 \ @@ -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 \ - 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 @@ -261,11 +200,11 @@ exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home # #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" "$3"; 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 sv 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" "$3"; 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 sv 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 ############## # @@ -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 100644 --- 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..6e2f9f1b0c32 100644 --- a/buildroot/tests/mks_robin_nano35-tests +++ b/buildroot/tests/mks_robin_nano35-tests @@ -24,24 +24,15 @@ 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) # 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" "$3" +opt_disable TFT_INTERFACE_FSMC TFT_COLOR_UI TOUCH_SCREEN TFT_RES_320x240 SERIAL_PORT_2 +opt_enable TFT_INTERFACE_SPI TFT_LVGL_UI TFT_RES_480x320 MKS_WIFI_MODULE +exec_test $1 $2 "MKS Robin v2 nano LVGL SPI w/ WiFi" "$3" # # MKS Robin v2 nano New Color UI 480x320 SPI diff --git a/buildroot/tests/rambo-tests b/buildroot/tests/rambo-tests index 6d2ef4f58a6d..d471f4201c80 100644 --- a/buildroot/tests/rambo-tests +++ b/buildroot/tests/rambo-tests @@ -25,12 +25,12 @@ 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 \ PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \ - PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS LEVEL_CENTER_TOO \ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \ PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \ @@ -53,10 +53,12 @@ opt_set EXTRUDERS 0 opt_set TEMP_SENSOR_0 999 opt_set DUMMY_THERMISTOR_999_VALUE 170 opt_set DIGIPOT_MOTOR_CURRENT '{ 120, 120, 120, 120, 120 }' +opt_set LEVEL_CORNERS_LEVELING_ORDER '{ LF, RF }' opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ 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 + ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \ + LEVEL_BED_CORNERS LEVEL_CENTER_TOO opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS exec_test $1 $2 "Rambo CNC Configuration" "$3" @@ -81,5 +83,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 100644 --- 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/platformio.ini b/platformio.ini index 062514c882e5..6b1543fa53f2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,6 +39,7 @@ default_src_filter = + - - + - - - + - - - - @@ -59,8 +60,12 @@ default_src_filter = + - - + - - - - - - + - - + - + - - - - - - - - + - + - - - - - @@ -77,7 +82,7 @@ default_src_filter = + - - + - - - - - - + - - - - - - - @@ -101,16 +106,18 @@ default_src_filter = + - - + - - - - - + - - - - - - - - - + - - - - - - - - + - - - - - @@ -137,6 +144,7 @@ default_src_filter = + - - + - - - + - - - - @@ -182,12 +190,13 @@ default_src_filter = + - - + - - - + - - - - - - - - - - + - - - - - - - @@ -196,12 +205,13 @@ default_src_filter = + - - + - - - - + - - - 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 = # @@ -211,6 +221,7 @@ lib_deps = HAS_TFT_LVGL_UI = lvgl=https://github.com/makerbase-mks/LVGL-6.1.1-MKS/archive/master.zip src_filter=+ extra_scripts=download_mks_assets.py +MKS_WIFI_MODULE = QRCode=https://github.com/makerbase-mks/QRCode/archive/master.zip HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1 src_filter=+ + + + + HAS_STEALTHCHOP = src_filter=+ @@ -220,7 +231,7 @@ HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter=+ HAS_L64XX = Arduino-L6470@0.8.0 - src_filter=+ + + + src_filter=+ + + + NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 src_filter=+ MAX6675_._IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 @@ -234,6 +245,8 @@ HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.4.1 HAS_(FSMC|SPI)_TFT = src_filter=+ + + HAS_FSMC_TFT = src_filter=+ + HAS_SPI_TFT = src_filter=+ + +I2C_EEPROM = src_filter=+ +SPI_EEPROM = src_filter=+ HAS_GRAPHICAL_TFT = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ IS_TFTGLCD_PANEL = src_filter=+ @@ -252,6 +265,7 @@ HAS_MENU_DELTA_CALIBRATE = src_filter=+ HAS_MENU_FILAMENT = src_filter=+ LCD_INFO_MENU = src_filter=+ HAS_MENU_JOB_RECOVERY = src_filter=+ +HAS_MULTI_LANGUAGE = src_filter=+ HAS_MENU_LED = src_filter=+ HAS_MENU_MEDIA = src_filter=+ HAS_MENU_MIXER = src_filter=+ @@ -270,7 +284,9 @@ 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=+ +USB_FLASH_DRIVE_SUPPORT = src_filter=+ AUTO_BED_LEVELING_BILINEAR = src_filter=+ AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+ MESH_BED_LEVELING = src_filter=+ + @@ -289,7 +305,7 @@ EMERGENCY_PARSER = src_filter=+ - IIC_BL24CXX_EEPROM = src_filter=+ HAS_SPI_FLASH = src_filter=+ -HAS_ETHERNET = src_filter=+ +HAS_ETHERNET = src_filter=+ + HAS_FANMUX = src_filter=+ FILAMENT_WIDTH_SENSOR = src_filter=+ + FWRETRACT = src_filter=+ + @@ -320,9 +336,9 @@ 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=+ +ASSISTED_TRAMMING = src_filter=+ + HAS_MESH = src_filter=+ -HAS_LEVELING = src_filter=+ +HAS_LEVELING = src_filter=+ + DELTA_AUTO_CALIBRATION = src_filter=+ CALIBRATION_GCODE = src_filter=+ Z_MIN_PROBE_REPEATABILITY_TEST = src_filter=+ @@ -372,8 +388,9 @@ BABYSTEPPING = src_filter=+ + G38_PROBE_TARGET = src_filter=+ MAGNETIC_PARKING_EXTRUDER = src_filter=+ -SDSUPPORT = 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=+ @@ -387,7 +404,9 @@ BEZIER_CURVE_SUPPORT = src_filter=+ + HAS_BED_PROBE = src_filter=+ + + + IS_SCARA = src_filter=+ +HAS_SERVOS = src_filter=+ + MORGAN_SCARA = src_filter=+ +HAS_MICROSTEPS = src_filter=+ (ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer ESP3DLib=https://github.com/luc-github/ESP3DLib.git arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git @@ -454,7 +473,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 @@ -468,24 +486,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 = megaatmega1280 # -# 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 @@ -496,20 +521,12 @@ extends = common_avr8 board = reprap_rambo # -# FYSETC F6 V1.3 -# -[env:FYSETC_F6_13] -platform = atmelavr -extends = common_avr8 -board = fysetc_f6_13 - -# -# FYSETC F6 V1.4 +# FYSETC F6 V1.3 / V1.4 # -[env:FYSETC_F6_14] +[env:FYSETC_F6] platform = atmelavr extends = common_avr8 -board = fysetc_f6_14 +board = fysetc_f6 # # Sanguinololu (ATmega644p) @@ -680,7 +697,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 @@ -719,11 +736,12 @@ 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 -DTIM_IRQ_PRIO=13 + -DADC_RESOLUTION=12 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + + @@ -731,14 +749,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 @@ -747,7 +768,6 @@ lib_deps = ${common.lib_deps} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC -platform_packages = tool-stm32duino monitor_speed = 115200 # @@ -757,7 +777,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 @@ -839,7 +858,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 # @@ -919,7 +937,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) @@ -940,7 +957,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} @@ -971,9 +987,10 @@ 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 + -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC extra_scripts = ${common.extra_scripts} @@ -1021,7 +1038,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} @@ -1144,19 +1160,26 @@ 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 -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 +[env:flsun_hispeedv1] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 +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_build.encrypt = Yes +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 @@ -1192,7 +1215,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} @@ -1230,6 +1252,32 @@ 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 +# 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 +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/anet_et4_openblt.py + # # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # @@ -1246,6 +1294,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) # @@ -1258,6 +1323,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) # @@ -1278,19 +1351,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 + -DHAL_SRAM_MODULE_ENABLED +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 # # Lerdge X @@ -1299,6 +1373,14 @@ build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSB extends = lerdge_common board_build.firmware = Lerdge_X_firmware_force.bin +# +# Lerdge X with USB Flash Drive Support +# +[env:LERDGEX_usb_flash_drive] +extends = LERDGEX +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + # # Lerdge S # @@ -1306,6 +1388,14 @@ board_build.firmware = Lerdge_X_firmware_force.bin extends = lerdge_common board_build.firmware = Lerdge_firmware_force.bin +# +# Lerdge S with USB Flash Drive Support +# +[env:LERDGES_usb_flash_drive] +extends = LERDGES +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + # # Lerdge K # @@ -1315,6 +1405,14 @@ board_build.firmware = Lerdge_K_firmware_force.bin build_flags = ${lerdge_common.build_flags} -DLERDGEK +# +# Lerdge K with USB Flash Drive Support +# +[env:LERDGEK_usb_flash_drive] +extends = LERDGEK +platform_packages = ${stm32_flash_drive.platform_packages} +build_flags = ${stm32_flash_drive.build_flags} + # # RUMBA32 # @@ -1337,12 +1435,13 @@ 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 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 @@ -1353,6 +1452,64 @@ 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} +platform_packages = ${stm32_flash_drive.platform_packages} +extends = common_stm32 +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 +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 +# +[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 + +# +# 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 # @@ -1363,12 +1520,13 @@ extra_scripts = ${common.extra_scripts} # Espressif ESP32 # [env:esp32] -platform = espressif32@1.11.2 +platform = espressif32@2.1.0 board = esp32dev build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 src_filter = ${common.default_src_filter} + lib_ignore = NativeEthernet -upload_speed = 115200 +upload_speed = 500000 +monitor_speed = 250000 #upload_port = marlinesp.local #board_build.flash_mode = qio From 6b3c6e89822c4105afabfa8474b0d2d45910ed7d Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 16:47:56 +0800 Subject: [PATCH 27/33] MKS Robin Nano V2/V3 support MKS MINI12864 V3 --- Marlin/Configuration.h | 12 +++++- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 6 ++- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 39 ++++++++++++++++--- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 13 +++++++ ini/stm32f1.ini | 1 + 5 files changed, 62 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3b3087e46f9b..0e848f81a868 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -102,7 +102,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#define SERIAL_PORT -1 /** * Serial Port Baud Rate @@ -2392,6 +2392,14 @@ // //#define MKS_MINI_12864 +// +// MKS MINI12864 V3 use YSETC_MINI_12864_2_1's method, Type A/B. NeoPixel RGB Backlight +// +//#define MKS_MINI_12864_V3 +#if ENABLED(MKS_MINI_12864_V3) + #define FYSETC_MINI_12864_2_1 +#endif + // // MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout. // https://www.aliexpress.com/item/33018110072.html @@ -2811,7 +2819,7 @@ #endif // Support for Adafruit NeoPixel LED driver -//#define NEOPIXEL_LED +#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) //#define NEOPIXEL_PIN 4 // LED driving pin diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 726eb2cc39d8..02b02b1c8c50 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -86,7 +86,11 @@ U8G_CLASS u8g; void MarlinUI::set_contrast(const int16_t value) { contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(contrast); + #if ENABLED(MKS_MINI_12864_V3) + u8g.setContrast(255); + #else + u8g.setContrast(contrast); + #endif } #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 6ef3a0804384..334ca6e55e8e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -231,10 +231,19 @@ #define SDCARD_CONNECTION ONBOARD #endif -#define SDIO_SUPPORT -#define SDIO_CLOCK 4500000 // 4.5 MHz -#define SD_DETECT_PIN PD12 -#define ONBOARD_SD_CS_PIN PC11 +#if SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT + #define SDIO_CLOCK 4500000 // 4.5 MHz + #define SD_DETECT_PIN PD12 + #define ONBOARD_SD_CS_PIN PC11 +#elif SD_CONNECTION_IS(LCD) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 +#endif // // LCD / Controller @@ -291,8 +300,13 @@ #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT - - // NON TFT Displays + #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 #if ENABLED(MKS_MINI_12864) @@ -318,6 +332,19 @@ #ifndef BEEPER_PIN #define BEEPER_PIN -1 #endif + + #elif ENABLED(MKS_MINI_12864_V3) + #define DOGLCD_CS PD13 + #define DOGLCD_A0 PC6 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PE14 + #define NEOPIXEL_PIN PE15 + #define DOGLCD_MOSI PA7 + #define DOGLCD_SCK PA5 + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif #else // !MKS_MINI_12864 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 5a056b97cdfa..aedb63d6a640 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -340,6 +340,19 @@ // Required for MKS_MINI_12864 with this board //#define MKS_LCD12864B //#undef SHOW_BOOTSCREEN + + #elif ENABLED(MKS_MINI_12864_V3) + #define DOGLCD_CS PD13 + #define DOGLCD_A0 PC6 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PE14 + #define NEOPIXEL_PIN PE15 + #define DOGLCD_MOSI PA7 + #define DOGLCD_SCK PA5 + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif #else // !MKS_MINI_12864 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 0b394d173058..f916971e0370 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -135,6 +135,7 @@ board_upload.offset_address = 0x08005000 debug_tool = stlink extra_scripts = ${common_STM32F103RC.extra_scripts} buildroot/share/PlatformIO/scripts/mks_encrypt.py +#custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel # # Creality (STM32F103RET6) From 54946ec1480ddf9bdb8856205549f8e50dbba5c1 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 18:07:52 +0800 Subject: [PATCH 28/33] MKS Robin E3/E3D has supported MKS MINI12864 V3 --- Marlin/Configuration.h | 2 +- Marlin/src/HAL/STM32F1/inc/SanityCheck.h | 2 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 11 ++++++++++ ini/stm32f1.ini | 22 ++++++++----------- platformio.ini | 2 +- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0e848f81a868..d677c29f6e53 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2819,7 +2819,7 @@ #endif // Support for Adafruit NeoPixel LED driver -#define NEOPIXEL_LED +//#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) //#define NEOPIXEL_PIN 4 // LED driving pin diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index 89ee66d6464b..2846155c351d 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -39,7 +39,7 @@ #error "SERIAL_STATS_DROPPED_RX is not supported on the STM32F1 platform." #endif -#if ENABLED(NEOPIXEL_LED) +#if ENABLED(NEOPIXEL_LED) && DISABLED(MKS_MINI_12864_V3) #error "NEOPIXEL_LED (Adafruit NeoPixel) is not supported for HAL/STM32F1. Comment out this line to proceed at your own risk!" #endif 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 b482065666fb..127dfb7c7a17 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -155,6 +155,17 @@ #define DOGLCD_SCK PB13 #define DOGLCD_MOSI PB15 + #elif ENABLED(MKS_MINI_12864_V3) + #define ENABLE_SPI3 + #define DOGLCD_CS PA4 + #define DOGLCD_A0 PA5 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PA6 + #define NEOPIXEL_PIN PA7 + #define DOGLCD_MOSI PB15 + #define DOGLCD_SCK PB13 + #else #define LCD_PINS_D4 PA6 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index f916971e0370..1f93f2fadfba 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -123,19 +123,15 @@ lib_deps = # MKS Robin E3/E3D (STM32F103RCT6) with TMC2209 # [env:mks_robin_e3] -platform = ${common_stm32.platform} -extends = common_STM32F103RC -build_flags = ${common_stm32.build_flags} - -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5 -build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -monitor_speed = 115200 -board_build.offset = 0x5000 -board_build.encrypt = Robin_e3.bin -board_upload.offset_address = 0x08005000 -debug_tool = stlink -extra_scripts = ${common_STM32F103RC.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_encrypt.py -#custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel +platform = ${common_stm32f1.platform} +extends = common_stm32f1 +board = genericSTM32F103RC +extra_scripts = ${common_stm32f1.extra_scripts} + buildroot/share/PlatformIO/scripts/mks_robin_e3.py +build_flags = ${common_stm32f1.build_flags} + -DDEBUG_LEVEL=0 -DSS_TIMER=4 +custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel + # # Creality (STM32F103RET6) diff --git a/platformio.ini b/platformio.ini index f55f5f5a9355..1c2b07b1a3fc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = mega2560 +default_envs = mks_robin_e3 include_dir = Marlin extra_configs = ini/avr.ini From 9bec4609e8a570f440e85785f9ca8b77d35d7cc6 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 18:29:33 +0800 Subject: [PATCH 29/33] Update platformio.ini --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 1c2b07b1a3fc..f55f5f5a9355 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = mks_robin_e3 +default_envs = mega2560 include_dir = Marlin extra_configs = ini/avr.ini From 474ec0b6ea648756828e0da033e2b3f4640618d4 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 19:00:19 +0800 Subject: [PATCH 30/33] Update Configuration.h --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d677c29f6e53..5ff69e5ba554 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -102,7 +102,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT -1 +#define SERIAL_PORT 0 /** * Serial Port Baud Rate From 3d63772b4d0675b9a525a0d5b53b80361492b33d Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 19:36:13 +0800 Subject: [PATCH 31/33] Update stm32f1.ini --- ini/stm32f1.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 1f93f2fadfba..2b02c74ca1ee 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -130,7 +130,6 @@ extra_scripts = ${common_stm32f1.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_e3.py build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 -custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel # From f20e156258427dcb9947e16ac0293b0965638d7b Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Fri, 2 Jul 2021 19:41:11 +0800 Subject: [PATCH 32/33] Update stm32f1.ini --- ini/stm32f1.ini | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 2b02c74ca1ee..89a6ba0c0ba7 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -123,13 +123,18 @@ lib_deps = # MKS Robin E3/E3D (STM32F103RCT6) with TMC2209 # [env:mks_robin_e3] -platform = ${common_stm32f1.platform} -extends = common_stm32f1 -board = genericSTM32F103RC -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_e3.py -build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 -DSS_TIMER=4 +platform = ${common_stm32.platform} +extends = common_STM32F103RC +build_flags = ${common_stm32.build_flags} + -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC +monitor_speed = 115200 +board_build.offset = 0x5000 +board_build.encrypt = Robin_e3.bin +board_upload.offset_address = 0x08005000 +debug_tool = stlink +extra_scripts = ${common_STM32F103RC.extra_scripts} + buildroot/share/PlatformIO/scripts/mks_encrypt.py # From 9580e37e3023906f1c70376553bba63b5101f960 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Jul 2021 21:30:52 -0500 Subject: [PATCH 33/33] Misc fixes --- Marlin/Configuration.h | 5 +--- Marlin/src/inc/Conditionals_LCD.h | 5 ++++ Marlin/src/inc/Conditionals_post.h | 4 ++++ Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 6 +---- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 22 ++++++++--------- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 24 +++++++++---------- ini/stm32f1.ini | 1 - 7 files changed, 34 insertions(+), 33 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5ff69e5ba554..6e10903a854c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2393,12 +2393,9 @@ //#define MKS_MINI_12864 // -// MKS MINI12864 V3 use YSETC_MINI_12864_2_1's method, Type A/B. NeoPixel RGB Backlight +// MKS MINI12864 V3 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight. // //#define MKS_MINI_12864_V3 -#if ENABLED(MKS_MINI_12864_V3) - #define FYSETC_MINI_12864_2_1 -#endif // // MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout. diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 833fe0d2277e..d414588dcba9 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -31,6 +31,11 @@ #define MKS_MINI_12864 #endif +// MKS_MINI_12864_V3 is simply identical to FYSETC_MINI_12864_2_1 +#if ENABLED(MKS_MINI_12864_V3) + #define FYSETC_MINI_12864_2_1 +#endif + /** * General Flags that may be set below by specific LCDs * diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 45271bca72ac..04bf392a9077 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -369,6 +369,10 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 195 +#elif ENABLED(MKS_MINI_12864_V3) + #define _LCD_CONTRAST_MIN 255 + #define _LCD_CONTRAST_INIT 255 + #define _LCD_CONTRAST_MAX 255 #elif ENABLED(FYSETC_MINI_12864) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 02b02b1c8c50..726eb2cc39d8 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -86,11 +86,7 @@ U8G_CLASS u8g; void MarlinUI::set_contrast(const int16_t value) { contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - #if ENABLED(MKS_MINI_12864_V3) - u8g.setContrast(255); - #else - u8g.setContrast(contrast); - #endif + u8g.setContrast(contrast); } #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 334ca6e55e8e..c788216e450f 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -233,9 +233,9 @@ #if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT - #define SDIO_CLOCK 4500000 // 4.5 MHz - #define SD_DETECT_PIN PD12 - #define ONBOARD_SD_CS_PIN PC11 + #define SDIO_CLOCK 4500000 // 4.5 MHz + #define SD_DETECT_PIN PD12 + #define ONBOARD_SD_CS_PIN PC11 #elif SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 #define SDSS PE10 @@ -334,14 +334,14 @@ #endif #elif ENABLED(MKS_MINI_12864_V3) - #define DOGLCD_CS PD13 - #define DOGLCD_A0 PC6 - #define LCD_PINS_DC DOGLCD_A0 - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PE14 - #define NEOPIXEL_PIN PE15 - #define DOGLCD_MOSI PA7 - #define DOGLCD_SCK PA5 + #define DOGLCD_CS PD13 + #define DOGLCD_A0 PC6 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PE14 + #define NEOPIXEL_PIN PE15 + #define DOGLCD_MOSI PA7 + #define DOGLCD_SCK PA5 #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif 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 aedb63d6a640..fc7915c6d4c4 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -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) @@ -342,17 +342,17 @@ //#undef SHOW_BOOTSCREEN #elif ENABLED(MKS_MINI_12864_V3) - #define DOGLCD_CS PD13 - #define DOGLCD_A0 PC6 - #define LCD_PINS_DC DOGLCD_A0 - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PE14 - #define NEOPIXEL_PIN PE15 - #define DOGLCD_MOSI PA7 - #define DOGLCD_SCK PA5 - #if SD_CONNECTION_IS(ONBOARD) - #define FORCE_SOFT_SPI - #endif + #define DOGLCD_CS PD13 + #define DOGLCD_A0 PC6 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PE14 + #define NEOPIXEL_PIN PE15 + #define DOGLCD_MOSI PA7 + #define DOGLCD_SCK PA5 + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif #else // !MKS_MINI_12864 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 89a6ba0c0ba7..0b394d173058 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -136,7 +136,6 @@ debug_tool = stlink extra_scripts = ${common_STM32F103RC.extra_scripts} buildroot/share/PlatformIO/scripts/mks_encrypt.py - # # Creality (STM32F103RET6) #