diff --git a/.gitignore b/.gitignore index 32c77dc2a6a55..3ddc860274423 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ bdf2u8g marlin_config.json mczip.h *.gen +*.sublime-workspace # # OS @@ -156,6 +157,7 @@ spi_flash.bin CMakeLists.txt src/CMakeLists.txt CMakeListsPrivate.txt +build/ # CLion cmake-build-* diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index eb3937c752dde..935d582a4461a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -101,6 +101,11 @@ // @section machine +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif + /** * Select the serial port on the board to use for communication with the host. * This allows the connection of wireless adapters (for instance) to non-default port pins. @@ -176,8 +181,7 @@ //#define MOTHERBOARD BOARD_MKS_ROBIN_MINI //#define MOTHERBOARD BOARD_MKS_SGEN_L #define BAUD_RATE_GCODE - #endif - + #endif #ifdef Q5 #define MOTHERBOARD BOARD_MKS_ROBIN_NANO //#define MOTHERBOARD BOARD_MKS_ROBIN_NANO_V1_3_F4 @@ -2204,6 +2208,7 @@ #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. + //#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build. #endif // @@ -3247,9 +3252,6 @@ // :[1,2,3,4,5,6,7,8] //#define NUM_M106_FANS 1 -// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino -//#define FAST_PWM_FAN - // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 68e33bc835bad..3773b7a370cd1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -563,18 +563,21 @@ //#define FAN_MAX_PWM 128 /** - * FAST PWM FAN Settings + * Fan Fast PWM * - * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) - * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a - * frequency as close as possible to the desired frequency. + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally + * to produce a frequency as close as possible to the desired frequency. * - * FAST_PWM_FAN_FREQUENCY [undefined by default] + * FAST_PWM_FAN_FREQUENCY * Set this to your desired frequency. - * If left undefined this defaults to F = F_CPU/(2*255*1) - * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers. - * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * For AVR, if left undefined this defaults to F = F_CPU/(2*255*1) + * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers. + * For non AVR, if left undefined this defaults to F = 1Khz. + * This F value is only to protect the hardware from an absence of configuration + * and not to complete it when users are not aware that the frequency must be specifically set to support the target board. + * * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * Setting very high frequencies can damage your hardware. * * USE_OCR2A_AS_TOP [undefined by default] * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: @@ -584,9 +587,17 @@ * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. */ +//#define FAST_PWM_FAN // Increase the fan PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino #if ENABLED(FAST_PWM_FAN) - //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define FAST_PWM_FAN_FREQUENCY 31400 // Define here to override the defaults below //#define USE_OCR2A_AS_TOP + #ifndef FAST_PWM_FAN_FREQUENCY + #ifdef __AVR__ + #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) + #else + #define FAST_PWM_FAN_FREQUENCY 1000U + #endif + #endif #endif /** @@ -918,10 +929,12 @@ //#define BLTOUCH_FORCE_MODE_SET /** - * Use "HIGH SPEED" mode for probing. + * Enable "HIGH SPEED" option for probing. * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. * This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians * might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM. + * + * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset. */ //#define BLTOUCH_HS_MODE true @@ -2760,6 +2773,7 @@ #define X_RSENSE 0.11 #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis + //#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis #endif #if AXIS_IS_TMC(X2) @@ -2769,6 +2783,7 @@ #define X2_RSENSE 0.11 #define X2_CHAIN_POS -1 //#define X2_INTERPOLATE true + //#define X2_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Y) @@ -2778,6 +2793,7 @@ #define Y_RSENSE 0.11 #define Y_CHAIN_POS -1 //#define Y_INTERPOLATE true + //#define Y_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Y2) @@ -2787,6 +2803,7 @@ #define Y2_RSENSE 0.11 #define Y2_CHAIN_POS -1 //#define Y2_INTERPOLATE true + //#define Y2_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Z) @@ -2796,6 +2813,7 @@ #define Z_RSENSE 0.11 #define Z_CHAIN_POS -1 //#define Z_INTERPOLATE true + //#define Z_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Z2) @@ -2805,6 +2823,7 @@ #define Z2_RSENSE 0.11 #define Z2_CHAIN_POS -1 //#define Z2_INTERPOLATE true + //#define Z2_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Z3) @@ -2814,6 +2833,7 @@ #define Z3_RSENSE 0.11 #define Z3_CHAIN_POS -1 //#define Z3_INTERPOLATE true + //#define Z3_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(Z4) @@ -2823,6 +2843,7 @@ #define Z4_RSENSE 0.11 #define Z4_CHAIN_POS -1 //#define Z4_INTERPOLATE true + //#define Z4_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(I) @@ -2832,6 +2853,7 @@ #define I_RSENSE 0.11 #define I_CHAIN_POS -1 //#define I_INTERPOLATE true + //#define I_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(J) @@ -2841,6 +2863,7 @@ #define J_RSENSE 0.11 #define J_CHAIN_POS -1 //#define J_INTERPOLATE true + //#define J_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(K) @@ -2850,6 +2873,7 @@ #define K_RSENSE 0.11 #define K_CHAIN_POS -1 //#define K_INTERPOLATE true + //#define K_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E0) @@ -2858,6 +2882,7 @@ #define E0_RSENSE 0.11 #define E0_CHAIN_POS -1 //#define E0_INTERPOLATE true + //#define E0_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E1) @@ -2866,6 +2891,7 @@ #define E1_RSENSE 0.11 #define E1_CHAIN_POS -1 //#define E1_INTERPOLATE true + //#define E1_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E2) @@ -2874,6 +2900,7 @@ #define E2_RSENSE 0.11 #define E2_CHAIN_POS -1 //#define E2_INTERPOLATE true + //#define E2_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E3) @@ -2882,6 +2909,7 @@ #define E3_RSENSE 0.11 #define E3_CHAIN_POS -1 //#define E3_INTERPOLATE true + //#define E3_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E4) @@ -2890,6 +2918,7 @@ #define E4_RSENSE 0.11 #define E4_CHAIN_POS -1 //#define E4_INTERPOLATE true + //#define E4_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E5) @@ -2898,6 +2927,7 @@ #define E5_RSENSE 0.11 #define E5_CHAIN_POS -1 //#define E5_INTERPOLATE true + //#define E5_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E6) @@ -2906,6 +2936,7 @@ #define E6_RSENSE 0.11 #define E6_CHAIN_POS -1 //#define E6_INTERPOLATE true + //#define E6_HOLD_MULTIPLIER 0.5 #endif #if AXIS_IS_TMC(E7) @@ -2914,6 +2945,7 @@ #define E7_RSENSE 0.11 #define E7_CHAIN_POS -1 //#define E7_INTERPOLATE true + //#define E7_HOLD_MULTIPLIER 0.5 #endif /** diff --git a/Marlin/Version.h b/Marlin/Version.h index 679b420035c42..250cc47fbc619 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2021-12-20" +//#define STRING_DISTRIBUTION_DATE "2021-12-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/sdio.cpp similarity index 98% rename from Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp rename to Marlin/src/HAL/STM32/sdio.cpp index 54e1820c78e6b..18b4434dfa73e 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -28,6 +28,8 @@ #if ENABLED(SDIO_SUPPORT) +#include "sdio.h" + #include #include @@ -49,14 +51,6 @@ #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, or STM32F7xx." #endif -// Fixed -#define SDIO_D0_PIN PC8 -#define SDIO_D1_PIN PC9 -#define SDIO_D2_PIN PC10 -#define SDIO_D3_PIN PC11 -#define SDIO_CK_PIN PC12 -#define SDIO_CMD_PIN PD2 - SD_HandleTypeDef hsd; // create SDIO structure // F4 supports one DMA for RX and another for TX, but Marlin will never // do read and write at same time, so we use the same DMA for both. diff --git a/Marlin/src/HAL/STM32/sdio.h b/Marlin/src/HAL/STM32/sdio.h new file mode 100644 index 0000000000000..cf5539c3c76d8 --- /dev/null +++ b/Marlin/src/HAL/STM32/sdio.h @@ -0,0 +1,29 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define SDIO_D0_PIN PC8 +#define SDIO_D1_PIN PC9 +#define SDIO_D2_PIN PC10 +#define SDIO_D3_PIN PC11 +#define SDIO_CK_PIN PC12 +#define SDIO_CMD_PIN PD2 diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 674d203027ddc..aee9b3c49287c 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -433,6 +433,7 @@ #define BOARD_FYSETC_E4 6005 // FYSETC E4 #define BOARD_PANDA_ZHU 6006 // Panda_ZHU #define BOARD_PANDA_M4 6007 // Panda_M4 +#define BOARD_MKS_TINYBEE 6008 // MKS TinyBee based on ESP32 (with I2S stepper stream) // // SAMD51 ARM Cortex M4 diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index 49a10f62b1559..b1cc30bee0d99 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -28,7 +28,12 @@ BLTouch bltouch; -bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain +bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain +#ifdef BLTOUCH_HS_MODE + bool BLTouch::high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed +#else + constexpr bool BLTouch::high_speed_mode; +#endif #include "../module/servo.h" #include "../module/probe.h" @@ -63,18 +68,17 @@ void BLTouch::init(const bool set_voltage/*=false*/) { #else - if (DEBUGGING(LEVELING)) { - DEBUG_ECHOLNPGM("last_written_mode - ", last_written_mode); - DEBUG_ECHOLNPGM("config mode - " - #if ENABLED(BLTOUCH_SET_5V_MODE) - "BLTOUCH_SET_5V_MODE" - #else - "OD" - #endif - ); - } + #ifdef DEBUG_OUT + if (DEBUGGING(LEVELING)) { + PGMSTR(mode0, "OD"); + PGMSTR(mode1, "5V"); + DEBUG_ECHOPGM("BLTouch Mode: "); + DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0); + DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")"); + } + #endif - const bool should_set = last_written_mode != ENABLED(BLTOUCH_SET_5V_MODE); + const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE); #endif @@ -193,7 +197,7 @@ void BLTouch::mode_conv_proc(const bool M5V) { _mode_store(); if (M5V) _set_5V_mode(); else _set_OD_mode(); _stow(); - last_written_mode = M5V; + od_5v_mode = M5V; } #endif // BLTOUCH diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index 9ecccb4256f40..ae3ab66300365 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -23,10 +23,6 @@ #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; @@ -70,8 +66,17 @@ typedef unsigned char BLTCommand; class BLTouch { public: + static void init(const bool set_voltage=false); - static bool last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain + static bool od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain + + #ifdef BLTOUCH_HS_MODE + static bool high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed + #else + static constexpr bool high_speed_mode = false; + #endif + + static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; } // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing static bool deploy() { return deploy_proc(); } diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index e45e18b7fbc2b..8cabb923825a7 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -33,6 +33,10 @@ #include "../../module/tool_change.h" #endif +#if ENABLED(BLTOUCH) + #include "../../feature/bltouch.h" +#endif + #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" @@ -102,7 +106,7 @@ void GcodeSuite::G35() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G35 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7)); + do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance())); const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true); if (isnan(z_probed_height)) { diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 8f4eab2c9715b..328a40dbb46a1 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -45,6 +45,10 @@ #include "../../libs/least_squares_fit.h" #endif +#if ENABLED(BLTOUCH) + #include "../../feature/bltouch.h" +#endif + #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" @@ -149,7 +153,7 @@ void GcodeSuite::G34() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G34 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE)) + #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance())) // Compute a worst-case clearance height to probe from. After the first // iteration this will be re-calculated based on the actual bed position diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp index bd9bb44c4061f..7cbae76f4b88e 100644 --- a/Marlin/src/gcode/probe/M401_M402.cpp +++ b/Marlin/src/gcode/probe/M401_M402.cpp @@ -28,13 +28,27 @@ #include "../../module/motion.h" #include "../../module/probe.h" +#ifdef BLTOUCH_HS_MODE + #include "../../feature/bltouch.h" +#endif + /** * M401: Deploy and activate the Z probe + * + * With BLTOUCH_HS_MODE: + * S Set High Speed (HS) Mode and exit without deploy */ void GcodeSuite::M401() { - probe.deploy(); - TERN_(PROBE_TARE, probe.tare()); - report_current_position(); + if (parser.seen('S')) { + #ifdef BLTOUCH_HS_MODE + bltouch.high_speed_mode = parser.value_bool(); + #endif + } + else { + probe.deploy(); + TERN_(PROBE_TARE, probe.tare()); + report_current_position(); + } } /** diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 971318518d0f7..a5c9d20eda9ea 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1861,231 +1861,332 @@ #undef Z3_STALL_SENSITIVITY #undef Z4_STALL_SENSITIVITY #endif - #if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X) - #define X_SENSORLESS 1 - #endif - #if defined(X2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2) - #define X2_SENSORLESS 1 - #endif - #if defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y) - #define Y_SENSORLESS 1 - #endif - #if defined(Y2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2) - #define Y2_SENSORLESS 1 - #endif - #if defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z) - #define Z_SENSORLESS 1 - #endif - #if defined(Z2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2) - #define Z2_SENSORLESS 1 - #endif - #if defined(Z3_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3) - #define Z3_SENSORLESS 1 - #endif - #if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4) - #define Z4_SENSORLESS 1 - #endif - #if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I) - #define I_SENSORLESS 1 - #endif - #if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J) - #define J_SENSORLESS 1 - #endif - #if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K) - #define K_SENSORLESS 1 - #endif - #if AXIS_HAS_STEALTHCHOP(X) - #define X_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - #define X2_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - #define Y_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - #define Y2_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - #define Z_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - #define Z2_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - #define Z3_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(Z4) - #define Z4_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(I) - #define I_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(J) - #define J_HAS_STEALTHCHOP 1 - #endif - #if AXIS_HAS_STEALTHCHOP(K) - #define K_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 0 && AXIS_HAS_STEALTHCHOP(E0) - #define E0_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) - #define E1_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2) - #define E2_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3) - #define E3_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4) - #define E4_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5) - #define E5_HAS_STEALTHCHOP 1 - #endif - #if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6) - #define E6_HAS_STEALTHCHOP 1 + #if AXIS_IS_TMC(X) + #if defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X) + #define X_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(X) + #define X_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) + #define X_SPI_SENSORLESS X_SENSORLESS + #endif + #ifndef X_INTERPOLATE + #define X_INTERPOLATE INTERPOLATE + #endif + #ifndef X_HOLD_MULTIPLIER + #define X_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif #endif - #if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7) - #define E7_HAS_STEALTHCHOP 1 + + #if AXIS_IS_TMC(X2) + #if defined(X2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2) + #define X2_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(X2) + #define X2_HAS_STEALTHCHOP 1 + #endif + #ifndef X2_INTERPOLATE + #define X2_INTERPOLATE X_INTERPOLATE + #endif + #ifndef X2_HOLD_MULTIPLIER + #define X2_HOLD_MULTIPLIER X_HOLD_MULTIPLIER + #endif + #ifndef X2_SLAVE_ADDRESS + #define X2_SLAVE_ADDRESS 0 + #endif #endif - #if ENABLED(SPI_ENDSTOPS) - #define X_SPI_SENSORLESS X_SENSORLESS - #if HAS_Y_AXIS + #if AXIS_IS_TMC(Y) + #if defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y) + #define Y_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Y) + #define Y_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) #define Y_SPI_SENSORLESS Y_SENSORLESS #endif - #if HAS_Z_AXIS - #define Z_SPI_SENSORLESS Z_SENSORLESS + #ifndef Y_INTERPOLATE + #define Y_INTERPOLATE INTERPOLATE #endif - #if LINEAR_AXES >= 4 - #define I_SPI_SENSORLESS I_SENSORLESS + #ifndef Y_HOLD_MULTIPLIER + #define Y_HOLD_MULTIPLIER HOLD_MULTIPLIER #endif - #if LINEAR_AXES >= 5 - #define J_SPI_SENSORLESS J_SENSORLESS + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 0 #endif - #if LINEAR_AXES >= 6 - #define K_SPI_SENSORLESS K_SENSORLESS + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #if defined(Y2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2) + #define Y2_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Y2) + #define Y2_HAS_STEALTHCHOP 1 + #endif + #ifndef Y2_INTERPOLATE + #define Y2_INTERPOLATE Y_INTERPOLATE + #endif + #ifndef Y2_HOLD_MULTIPLIER + #define Y2_HOLD_MULTIPLIER Y_HOLD_MULTIPLIER + #endif + #ifndef Y2_SLAVE_ADDRESS + #define Y2_SLAVE_ADDRESS 0 + #endif #endif #endif - #ifndef X_INTERPOLATE - #define X_INTERPOLATE INTERPOLATE - #endif - #ifndef X2_INTERPOLATE - #define X2_INTERPOLATE INTERPOLATE - #endif - #ifndef Y_INTERPOLATE - #define Y_INTERPOLATE INTERPOLATE - #endif - #ifndef Y2_INTERPOLATE - #define Y2_INTERPOLATE INTERPOLATE - #endif - #ifndef Z_INTERPOLATE - #define Z_INTERPOLATE INTERPOLATE - #endif - #ifndef Z2_INTERPOLATE - #define Z2_INTERPOLATE INTERPOLATE - #endif - #ifndef Z3_INTERPOLATE - #define Z3_INTERPOLATE INTERPOLATE - #endif - #ifndef Z4_INTERPOLATE - #define Z4_INTERPOLATE INTERPOLATE - #endif - #if LINEAR_AXES >= 4 && !defined(I_INTERPOLATE) - #define I_INTERPOLATE INTERPOLATE - #endif - #if LINEAR_AXES >= 5 && !defined(J_INTERPOLATE) - #define J_INTERPOLATE INTERPOLATE - #endif - #if LINEAR_AXES >= 6 && !defined(K_INTERPOLATE) - #define K_INTERPOLATE INTERPOLATE - #endif - #ifndef E0_INTERPOLATE - #define E0_INTERPOLATE INTERPOLATE - #endif - #ifndef E1_INTERPOLATE - #define E1_INTERPOLATE INTERPOLATE - #endif - #ifndef E2_INTERPOLATE - #define E2_INTERPOLATE INTERPOLATE - #endif - #ifndef E3_INTERPOLATE - #define E3_INTERPOLATE INTERPOLATE - #endif - #ifndef E4_INTERPOLATE - #define E4_INTERPOLATE INTERPOLATE - #endif - #ifndef E5_INTERPOLATE - #define E5_INTERPOLATE INTERPOLATE - #endif - #ifndef E6_INTERPOLATE - #define E6_INTERPOLATE INTERPOLATE - #endif - #ifndef E7_INTERPOLATE - #define E7_INTERPOLATE INTERPOLATE - #endif - #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 I_SLAVE_ADDRESS - #define I_SLAVE_ADDRESS 0 - #endif - #ifndef J_SLAVE_ADDRESS - #define J_SLAVE_ADDRESS 0 - #endif - #ifndef K_SLAVE_ADDRESS - #define K_SLAVE_ADDRESS 0 - #endif - #ifndef X2_SLAVE_ADDRESS - #define X2_SLAVE_ADDRESS 0 - #endif - #ifndef Y2_SLAVE_ADDRESS - #define Y2_SLAVE_ADDRESS 0 + + #if AXIS_IS_TMC(Z) + #if defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z) + #define Z_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Z) + #define Z_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) + #define Z_SPI_SENSORLESS Z_SENSORLESS + #endif + #ifndef Z_INTERPOLATE + #define Z_INTERPOLATE INTERPOLATE + #endif + #ifndef Z_HOLD_MULTIPLIER + #define Z_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 0 + #endif + #if NUM_Z_STEPPER_DRIVERS >= 2 + #if defined(Z2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2) + #define Z2_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Z2) + #define Z2_HAS_STEALTHCHOP 1 + #endif + #ifndef Z2_INTERPOLATE + #define Z2_INTERPOLATE Z_INTERPOLATE + #endif + #ifndef Z2_HOLD_MULTIPLIER + #define Z2_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER + #endif + #ifndef Z2_SLAVE_ADDRESS + #define Z2_SLAVE_ADDRESS 0 + #endif + #endif + #if NUM_Z_STEPPER_DRIVERS >= 3 + #if defined(Z3_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3) + #define Z3_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Z3) + #define Z3_HAS_STEALTHCHOP 1 + #endif + #ifndef Z3_INTERPOLATE + #define Z3_INTERPOLATE Z_INTERPOLATE + #endif + #ifndef Z3_HOLD_MULTIPLIER + #define Z3_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER + #endif + #ifndef Z3_SLAVE_ADDRESS + #define Z3_SLAVE_ADDRESS 0 + #endif + #endif + #if NUM_Z_STEPPER_DRIVERS >= 4 + #if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4) + #define Z4_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(Z4) + #define Z4_HAS_STEALTHCHOP 1 + #endif + #ifndef Z4_INTERPOLATE + #define Z4_INTERPOLATE Z_INTERPOLATE + #endif + #ifndef Z4_HOLD_MULTIPLIER + #define Z4_HOLD_MULTIPLIER Z_HOLD_MULTIPLIER + #endif + #ifndef Z4_SLAVE_ADDRESS + #define Z4_SLAVE_ADDRESS 0 + #endif + #endif #endif - #ifndef Z2_SLAVE_ADDRESS - #define Z2_SLAVE_ADDRESS 0 + + #if AXIS_IS_TMC(I) + #if defined(I_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(I) + #define I_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(I) + #define I_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) + #define I_SPI_SENSORLESS I_SENSORLESS + #endif + #ifndef I_INTERPOLATE + #define I_INTERPOLATE INTERPOLATE + #endif + #ifndef I_HOLD_MULTIPLIER + #define I_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef I_SLAVE_ADDRESS + #define I_SLAVE_ADDRESS 0 + #endif #endif - #ifndef Z3_SLAVE_ADDRESS - #define Z3_SLAVE_ADDRESS 0 + + #if AXIS_IS_TMC(J) + #if defined(J_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(J) + #define J_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(J) + #define J_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) + #define J_SPI_SENSORLESS J_SENSORLESS + #endif + #ifndef J_INTERPOLATE + #define J_INTERPOLATE INTERPOLATE + #endif + #ifndef J_HOLD_MULTIPLIER + #define J_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef J_SLAVE_ADDRESS + #define J_SLAVE_ADDRESS 0 + #endif #endif - #ifndef Z4_SLAVE_ADDRESS - #define Z4_SLAVE_ADDRESS 0 + + #if AXIS_IS_TMC(K) + #if defined(K_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(K) + #define K_SENSORLESS 1 + #endif + #if AXIS_HAS_STEALTHCHOP(K) + #define K_HAS_STEALTHCHOP 1 + #endif + #if ENABLED(SPI_ENDSTOPS) + #define K_SPI_SENSORLESS K_SENSORLESS + #endif + #ifndef K_INTERPOLATE + #define K_INTERPOLATE INTERPOLATE + #endif + #ifndef K_HOLD_MULTIPLIER + #define K_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef K_SLAVE_ADDRESS + #define K_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 0 + + #if AXIS_IS_TMC(E0) + #if AXIS_HAS_STEALTHCHOP(E0) + #define E0_HAS_STEALTHCHOP 1 + #endif + #ifndef E0_INTERPOLATE + #define E0_INTERPOLATE INTERPOLATE + #endif + #ifndef E0_HOLD_MULTIPLIER + #define E0_HOLD_MULTIPLIER HOLD_MULTIPLIER + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E1_SLAVE_ADDRESS - #define E1_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E1) + #if AXIS_HAS_STEALTHCHOP(E1) + #define E1_HAS_STEALTHCHOP 1 + #endif + #ifndef E1_INTERPOLATE + #define E1_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E1_HOLD_MULTIPLIER + #define E1_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E2_SLAVE_ADDRESS - #define E2_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E2) + #if AXIS_HAS_STEALTHCHOP(E2) + #define E2_HAS_STEALTHCHOP 1 + #endif + #ifndef E2_INTERPOLATE + #define E2_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E2_HOLD_MULTIPLIER + #define E2_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E2_SLAVE_ADDRESS + #define E2_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E3_SLAVE_ADDRESS - #define E3_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E3) + #if AXIS_HAS_STEALTHCHOP(E3) + #define E3_HAS_STEALTHCHOP 1 + #endif + #ifndef E3_INTERPOLATE + #define E3_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E3_HOLD_MULTIPLIER + #define E3_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E3_SLAVE_ADDRESS + #define E3_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E4_SLAVE_ADDRESS - #define E4_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E4) + #if AXIS_HAS_STEALTHCHOP(E4) + #define E4_HAS_STEALTHCHOP 1 + #endif + #ifndef E4_INTERPOLATE + #define E4_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E4_HOLD_MULTIPLIER + #define E4_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E4_SLAVE_ADDRESS + #define E4_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E5_SLAVE_ADDRESS - #define E5_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E5) + #if AXIS_HAS_STEALTHCHOP(E5) + #define E5_HAS_STEALTHCHOP 1 + #endif + #ifndef E5_INTERPOLATE + #define E5_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E5_HOLD_MULTIPLIER + #define E5_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E5_SLAVE_ADDRESS + #define E5_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E6_SLAVE_ADDRESS - #define E6_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E6) + #if AXIS_HAS_STEALTHCHOP(E6) + #define E6_HAS_STEALTHCHOP 1 + #endif + #ifndef E6_INTERPOLATE + #define E6_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E6_HOLD_MULTIPLIER + #define E6_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E6_SLAVE_ADDRESS + #define E6_SLAVE_ADDRESS 0 + #endif #endif - #ifndef E7_SLAVE_ADDRESS - #define E7_SLAVE_ADDRESS 0 + #if AXIS_IS_TMC(E7) + #if AXIS_HAS_STEALTHCHOP(E7) + #define E7_HAS_STEALTHCHOP 1 + #endif + #ifndef E7_INTERPOLATE + #define E7_INTERPOLATE E0_INTERPOLATE + #endif + #ifndef E7_HOLD_MULTIPLIER + #define E7_HOLD_MULTIPLIER E0_HOLD_MULTIPLIER + #endif + #ifndef E7_SLAVE_ADDRESS + #define E7_SLAVE_ADDRESS 0 + #endif #endif -#endif +#endif // HAS_TRINAMIC_CONFIG #if ANY_AXIS_HAS(HW_SERIAL) #define HAS_TMC_HW_SERIAL 1 @@ -2667,13 +2768,6 @@ #error "FAN_OFF_PWM must be less than or equal to FAN_MIN_PWM." #endif -/** - * FAST PWM FAN Settings - */ -#if ENABLED(FAST_PWM_FAN) && !defined(FAST_PWM_FAN_FREQUENCY) - #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) // Fan frequency default -#endif - /** * Controller Fan Settings */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a809fad132b30..ab1a6adec5601 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1070,7 +1070,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR) #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU - #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled." + #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI." + #elif ENABLED(MMU2_MENUS) && !HAS_LCD_MENU + #error "MMU2_MENUS requires an LCD supporting MarlinUI." #elif DISABLED(ADVANCED_PAUSE_FEATURE) static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S)."); #endif @@ -1577,6 +1579,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif + #if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0 + #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state." + #endif #if BLTOUCH_DELAY < 200 #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported." #endif @@ -2760,6 +2765,20 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW." #endif +#if ENABLED(ANYCUBIC_LCD_CHIRON) + #if !defined(BEEPER_PIN) + #error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN" + #elif DISABLED(SDSUPPORT) + #error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT" + #elif TEMP_SENSOR_BED == 0 + #error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)" + #elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) + #error "ANYCUBIC_LCD_CHIRON requires one of: AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING" + #elif DISABLED(BABYSTEPPING) + #error "ANYCUBIC_LCD_CHIRON requires BABYSTEPPING" + #endif +#endif + #if EITHER(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD) #error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader." #endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a6019419b1d61..d2b7a93775656 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-12-20" + #define STRING_DISTRIBUTION_DATE "2021-12-26" #endif /** diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 9f558e3a98677..6db5972fa70f1 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -243,7 +243,7 @@ void ChironTFT::StatusChange(const char * const msg) { case AC_printer_probing: { // If probing completes ok save the mesh and park // Ignore the custom machine name - if (strcmp_P(msg + strlen(CUSTOM_MACHINE_NAME), MARLIN_msg_ready) == 0) { + if (strcmp_P(msg + strlen(MACHINE_NAME), MARLIN_msg_ready) == 0) { injectCommands(F("M500\nG27")); SendtoTFTLN(AC_msg_probing_complete); printer_state = AC_printer_idle; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp index 6cb85e47c49c8..43e5c333651a3 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp @@ -69,8 +69,8 @@ void AboutScreen::onRedraw(draw_mode_t) { #endif draw_text_box(cmd, HEADING_POS, - #ifdef CUSTOM_MACHINE_NAME - F(CUSTOM_MACHINE_NAME) + #ifdef MACHINE_NAME + F(MACHINE_NAME) #else GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) #endif diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 89b8fd7d77874..1d8861b2c700d 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -491,6 +491,7 @@ namespace Language_en { LSTR MSG_BLTOUCH_STOW = _UxGT("Stow"); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Deploy"); LSTR MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode"); + LSTR MSG_BLTOUCH_SPEED_MODE = _UxGT("High Speed"); LSTR MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode"); LSTR MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode"); LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("Mode-Store"); diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 7bf247f40be29..38a074eb0128b 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -217,13 +217,13 @@ static void _lcd_level_bed_corners_get_next_position() { 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 + TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered endstops.hit_on_purpose(); set_current_from_steppers_for_axis(Z_AXIS); sync_plan_position(); - TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger + TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger // Triggered outside tolerance range? if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners. @@ -249,7 +249,7 @@ static void _lcd_level_bed_corners_get_next_position() { } idle(); } - TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); + TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); ui.goto_screen(_lcd_draw_probing); return (probe_triggered); } @@ -263,13 +263,14 @@ static void _lcd_level_bed_corners_get_next_position() { do { ui.refresh(LCDVIEW_REDRAW_NOW); _lcd_draw_probing(); // update screen with # of good points - do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance + + do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // 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 - TERN_(BLTOUCH_HS_MODE, bltouch.deploy()); // Deploy in HIGH SPEED MODE + TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify @@ -290,10 +291,12 @@ static void _lcd_level_bed_corners_get_next_position() { } while (good_points < nr_edge_points); // loop until all points within tolerance - #if ENABLED(BLTOUCH_HS_MODE) - // In HIGH SPEED MODE do clearance and stow at the very end - do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); - bltouch.stow(); + #if ENABLED(BLTOUCH) + if (bltouch.high_speed_mode) { + // In HIGH SPEED MODE do clearance and stow at the very end + do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); + bltouch.stow(); + } #endif ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index cd8bad9c8ba4c..4cd43e787aca4 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -53,6 +53,8 @@ #include "../../libs/buzzer.h" #endif +#include "../../core/debug_out.h" + #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) void menu_advanced_settings(); @@ -217,11 +219,14 @@ void menu_advanced_settings(); #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) void bltouch_report() { - SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode); - SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD")); + PGMSTR(mode0, "OD"); + PGMSTR(mode1, "5V"); + DEBUG_ECHOPGM("BLTouch Mode: "); + DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0); + DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")"); char mess[21]; - strcpy_P(mess, PSTR("BLTouch Mode - ")); - strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD")); + strcpy_P(mess, PSTR("BLTouch Mode: ")); + strcpy_P(&mess[15], bltouch.od_5v_mode ? mode1 : mode0); ui.set_status(mess); ui.return_to_status(); } @@ -235,6 +240,9 @@ void menu_advanced_settings(); ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy); ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow); ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode); + #ifdef BLTOUCH_HS_MODE + EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode); + #endif #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index 8e9d4b3942b65..4033421b5673d 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -36,6 +36,10 @@ #include "../../module/probe.h" #include "../../gcode/queue.h" +#if ENABLED(BLTOUCH) + #include "../../feature/bltouch.h" +#endif + //#define DEBUG_OUT 1 #include "../../core/debug_out.h" @@ -51,7 +55,7 @@ static int8_t reference_index; // = 0 static bool probe_single_point() { do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES)); // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety - const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true); + const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true); z_measured[tram_index] = z_probed_height; if (reference_index < 0) reference_index = tram_index; move_to_tramming_wait_pos(); diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index 2528bcdbff89c..df2c9cd099c10 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -127,11 +127,11 @@ struct duration_t { * 59s */ char* toString(char * const buffer) const { - int y = this->year(), - d = this->day() % 365, - h = this->hour() % 24, - m = this->minute() % 60, - s = this->second() % 60; + const uint16_t y = this->year(), + d = this->day() % 365, + h = this->hour() % 24, + m = this->minute() % 60, + s = this->second() % 60; if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); @@ -149,23 +149,29 @@ struct duration_t { * * Output examples: * 123456789 (strlen) + * 12'34 * 99:59 * 11d 12:33 */ uint8_t toDigital(char *buffer, bool with_days=false) const { - uint16_t h = uint16_t(this->hour()), - m = uint16_t(this->minute() % 60UL); + const uint16_t h = uint16_t(this->hour()), + m = uint16_t(this->minute() % 60UL); if (with_days) { - uint16_t d = this->day(); - sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m); + const uint16_t d = this->day(); + sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m); // 1d 23:45 return d >= 10 ? 9 : 8; } + else if (!h) { + const uint16_t s = uint16_t(this->second() % 60UL); + sprintf_P(buffer, PSTR("%02hu'%02hu"), m, s); // 12'34 + return 5; + } else if (h < 100) { - sprintf_P(buffer, PSTR("%02hu:%02hu"), h, m); + sprintf_P(buffer, PSTR("%02hu:%02hu"), h, m); // 12:34 return 5; } else { - sprintf_P(buffer, PSTR("%hu:%02hu"), h, m); + sprintf_P(buffer, PSTR("%hu:%02hu"), h, m); // 123:45 return 6; } } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 9ff668bf30d25..2248c52d85d91 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1803,8 +1803,8 @@ void prepare_line_to_destination() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("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) + #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) + if (axis == Z_AXIS && !bltouch.high_speed_mode) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE) #endif // If a second homing move is configured... @@ -1837,8 +1837,9 @@ void prepare_line_to_destination() { } #endif - #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE) - if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE) + #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) + if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy()) + return; // Intermediate DEPLOY (in LOW SPEED MODE) #endif // Slow move towards endstop until triggered diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 7e08db7a5b6e3..540b4e1ae6a46 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -489,8 +489,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND) thermalManager.wait_for_hotend_heating(active_extruder); #endif - - if (TERN0(BLTOUCH_SLOW_MODE, bltouch.deploy())) return true; // Deploy in LOW SPEED MODE on every probe action + #if ENABLED(BLTOUCH) + if (!bltouch.high_speed_mode && bltouch.deploy()) + return true; // Deploy in LOW SPEED MODE on every probe action + #endif // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) @@ -531,8 +533,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { set_homing_current(false); #endif - if (probe_triggered && TERN0(BLTOUCH_SLOW_MODE, bltouch.stow())) // Stow in LOW SPEED MODE on every trigger - return true; + #if ENABLED(BLTOUCH) + if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow()) + return true; // Stow in LOW SPEED MODE on every trigger + #endif // Clear endstop flags endstops.hit_on_purpose(); @@ -762,8 +766,9 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai DEBUG_POS("", current_position); } - #if BOTH(BLTOUCH, BLTOUCH_HS_MODE) - if (bltouch.triggered()) bltouch._reset(); + #if ENABLED(BLTOUCH) + if (bltouch.high_speed_mode && bltouch.triggered()) + bltouch._reset(); #endif // On delta keep Z below clip height or do_blocking_move_to will abort diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 8ccf773adc287..5fda608e38390 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 "V85" +#define EEPROM_VERSION "V86" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -198,20 +198,32 @@ static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE; */ typedef struct SettingsDataStruct { char version[4]; // Vnn\0 + #if ENABLED(EEPROM_INIT_NOW) + uint32_t build_hash; // Unique build hash + #endif uint16_t crc; // Data Checksum // // DISTINCT_E_FACTORS // - uint8_t esteppers; // DISTINCT_AXES - LINEAR_AXES + uint8_t e_factors; // DISTINCT_AXES - LINEAR_AXES + // + // Planner settings + // planner_settings_t planner_settings; xyze_float_t planner_max_jerk; // M205 XYZE planner.max_jerk float planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm + // + // Home Offset + // xyz_pos_t home_offset; // M206 XYZ / M665 TPZ + // + // Hotend Offset + // #if HAS_HOTEND_OFFSET xyz_pos_t hotend_offset[HOTENDS - 1]; // M218 XYZ #endif @@ -289,7 +301,10 @@ typedef struct SettingsDataStruct { // // BLTOUCH // - bool bltouch_last_written_mode; + bool bltouch_od_5v_mode; + #ifdef BLTOUCH_HS_MODE + bool bltouch_high_speed_mode; // M401 S + #endif // // Kinematic Settings @@ -649,13 +664,24 @@ void MarlinSettings::postprocess() { const char version[4] = EEPROM_VERSION; + #if ENABLED(EEPROM_INIT_NOW) + constexpr uint32_t strhash32(const char *s, const uint32_t h=0) { + return *s ? strhash32(s + 1, ((h + *s) << (*s & 3)) ^ *s) : h; + } + constexpr uint32_t build_hash = strhash32(__DATE__ __TIME__); + #endif + bool MarlinSettings::eeprom_error, MarlinSettings::validating; int MarlinSettings::eeprom_index; uint16_t MarlinSettings::working_crc; bool MarlinSettings::size_error(const uint16_t size) { if (size != datasize()) { - DEBUG_ERROR_MSG("EEPROM datasize error."); + DEBUG_ERROR_MSG("EEPROM datasize error." + #if ENABLED(MARLIN_DEV_MODE) + " (Actual:", size, " Expected:", datasize(), ")" + #endif + ); return true; } return false; @@ -675,13 +701,17 @@ void MarlinSettings::postprocess() { // Write or Skip version. (Flash doesn't allow rewrite without erase.) TERN(FLASH_EEPROM_EMULATION, EEPROM_SKIP, EEPROM_WRITE)(ver); - EEPROM_SKIP(working_crc); // Skip the checksum slot + #if ENABLED(EEPROM_INIT_NOW) + EEPROM_SKIP(build_hash); // Skip the hash slot + #endif + + EEPROM_SKIP(working_crc); // Skip the checksum slot working_crc = 0; // clear before first "real data" - const uint8_t esteppers = COUNT(planner.settings.axis_steps_per_mm) - LINEAR_AXES; - _FIELD_TEST(esteppers); - EEPROM_WRITE(esteppers); + const uint8_t e_factors = DISTINCT_AXES - (LINEAR_AXES); + _FIELD_TEST(e_factors); + EEPROM_WRITE(e_factors); // // Planner Motion @@ -891,9 +921,15 @@ void MarlinSettings::postprocess() { // BLTOUCH // { - _FIELD_TEST(bltouch_last_written_mode); - const bool bltouch_last_written_mode = TERN(BLTOUCH, bltouch.last_written_mode, false); - EEPROM_WRITE(bltouch_last_written_mode); + _FIELD_TEST(bltouch_od_5v_mode); + const bool bltouch_od_5v_mode = TERN0(BLTOUCH, bltouch.od_5v_mode); + EEPROM_WRITE(bltouch_od_5v_mode); + + #ifdef BLTOUCH_HS_MODE + _FIELD_TEST(bltouch_high_speed_mode); + const bool bltouch_high_speed_mode = TERN0(BLTOUCH, bltouch.high_speed_mode); + EEPROM_WRITE(bltouch_high_speed_mode); + #endif } // @@ -1494,6 +1530,9 @@ void MarlinSettings::postprocess() { eeprom_index = EEPROM_OFFSET; EEPROM_WRITE(version); + #if ENABLED(EEPROM_INIT_NOW) + EEPROM_WRITE(build_hash); + #endif EEPROM_WRITE(final_crc); // Report storage size @@ -1527,9 +1566,6 @@ void MarlinSettings::postprocess() { char stored_ver[4]; EEPROM_READ_ALWAYS(stored_ver); - uint16_t stored_crc; - EEPROM_READ_ALWAYS(stored_crc); - // Version has to match or defaults are used if (strncmp(version, stored_ver, 3) != 0) { if (stored_ver[3] != '\0') { @@ -1543,14 +1579,25 @@ void MarlinSettings::postprocess() { eeprom_error = true; } else { + + // Optionally reset on the first boot after flashing + #if ENABLED(EEPROM_INIT_NOW) + uint32_t stored_hash; + EEPROM_READ_ALWAYS(stored_hash); + if (stored_hash != build_hash) { EEPROM_FINISH(); return true; } + #endif + + uint16_t stored_crc; + EEPROM_READ_ALWAYS(stored_crc); + float dummyf = 0; working_crc = 0; // Init to 0. Accumulated by EEPROM_READ - _FIELD_TEST(esteppers); + _FIELD_TEST(e_factors); - // Number of esteppers may change - uint8_t esteppers; - EEPROM_READ_ALWAYS(esteppers); + // Number of e_factors may change + uint8_t e_factors; + EEPROM_READ_ALWAYS(e_factors); // // Planner Motion @@ -1558,16 +1605,16 @@ void MarlinSettings::postprocess() { { // Get only the number of E stepper parameters previously stored // Any steppers added later are set to their defaults - uint32_t tmp1[LINEAR_AXES + esteppers]; - float tmp2[LINEAR_AXES + esteppers]; - feedRate_t tmp3[LINEAR_AXES + esteppers]; + uint32_t tmp1[LINEAR_AXES + e_factors]; + float tmp2[LINEAR_AXES + e_factors]; + feedRate_t tmp3[LINEAR_AXES + e_factors]; EEPROM_READ((uint8_t *)tmp1, sizeof(tmp1)); // max_acceleration_mm_per_s2 EEPROM_READ(planner.settings.min_segment_time_us); EEPROM_READ((uint8_t *)tmp2, sizeof(tmp2)); // axis_steps_per_mm EEPROM_READ((uint8_t *)tmp3, sizeof(tmp3)); // max_feedrate_mm_s if (!validating) LOOP_DISTINCT_AXES(i) { - const bool in = (i < esteppers + LINEAR_AXES); + const bool in = (i < e_factors + LINEAR_AXES); planner.settings.max_acceleration_mm_per_s2[i] = in ? tmp1[i] : pgm_read_dword(&_DMA[ALIM(i, _DMA)]); planner.settings.axis_steps_per_mm[i] = in ? tmp2[i] : pgm_read_float(&_DASU[ALIM(i, _DASU)]); planner.settings.max_feedrate_mm_s[i] = in ? tmp3[i] : pgm_read_float(&_DMF[ALIM(i, _DMF)]); @@ -1772,13 +1819,23 @@ void MarlinSettings::postprocess() { // BLTOUCH // { - _FIELD_TEST(bltouch_last_written_mode); + _FIELD_TEST(bltouch_od_5v_mode); #if ENABLED(BLTOUCH) - const bool &bltouch_last_written_mode = bltouch.last_written_mode; + const bool &bltouch_od_5v_mode = bltouch.od_5v_mode; #else - bool bltouch_last_written_mode; + bool bltouch_od_5v_mode; + #endif + EEPROM_READ(bltouch_od_5v_mode); + + #ifdef BLTOUCH_HS_MODE + _FIELD_TEST(bltouch_high_speed_mode); + #if ENABLED(BLTOUCH) + const bool &bltouch_high_speed_mode = bltouch.high_speed_mode; + #else + bool bltouch_high_speed_mode; + #endif + EEPROM_READ(bltouch_high_speed_mode); #endif - EEPROM_READ(bltouch_last_written_mode); } // @@ -2496,7 +2553,7 @@ void MarlinSettings::postprocess() { return success; } reset(); - #if ENABLED(EEPROM_AUTO_INIT) + #if EITHER(EEPROM_AUTO_INIT, EEPROM_INIT_NOW) (void)save(); SERIAL_ECHO_MSG("EEPROM Initialized"); #endif @@ -2789,11 +2846,11 @@ void MarlinSettings::reset() { TERN_(HAS_PTC, ptc.reset()); // - // BLTOUCH + // BLTouch // - //#if ENABLED(BLTOUCH) - // bltouch.last_written_mode; - //#endif + #ifdef BLTOUCH_HS_MODE + bltouch.high_speed_mode = ENABLED(BLTOUCH_HS_MODE); + #endif // // Kinematic settings @@ -3114,12 +3171,13 @@ void MarlinSettings::reset() { // Announce current units, in case inches are being displayed // CONFIG_ECHO_HEADING("Linear Units"); + CONFIG_ECHO_START(); #if ENABLED(INCH_MODE_SUPPORT) - SERIAL_ECHO_MSG(" G2", AS_DIGIT(parser.linear_unit_factor == 1.0), " ;"); + SERIAL_ECHOPGM(" G2", AS_DIGIT(parser.linear_unit_factor == 1.0), " ;"); #else - SERIAL_ECHO_MSG(" G21 ;"); + SERIAL_ECHOPGM(" G21 ;"); #endif - gcode.say_units(); + gcode.say_units(); // " (in/mm)" // // M149 Temperature units diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index e8ecbf1c762ae..7baa2108f06ac 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -38,7 +38,7 @@ enum StealthIndex : uint8_t { LOGICAL_AXIS_LIST(STEALTH_AXIS_E, STEALTH_AXIS_X, STEALTH_AXIS_Y, STEALTH_AXIS_Z, STEALTH_AXIS_I, STEALTH_AXIS_J, STEALTH_AXIS_K) }; -#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST, ST##_INTERPOLATE) +#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST, ST##_INTERPOLATE, ST##_HOLD_MULTIPLIER) // IC = TMC model number // ST = Stepper object letter @@ -200,7 +200,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC2130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { st.begin(); CHOPCONF_t chopconf{0}; @@ -212,7 +212,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current @@ -235,7 +235,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC2160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { st.begin(); CHOPCONF_t chopconf{0}; @@ -247,7 +247,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current @@ -604,7 +604,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC2208) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -622,7 +622,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current @@ -646,7 +646,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC2209) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART @@ -664,7 +664,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current @@ -688,7 +688,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC2660) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { st.begin(); TMC2660_n::CHOPCONF_t chopconf{0}; @@ -710,7 +710,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC5130) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { st.begin(); CHOPCONF_t chopconf{0}; @@ -722,7 +722,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current @@ -745,7 +745,7 @@ enum StealthIndex : uint8_t { #if HAS_DRIVER(TMC5160) template - void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) { + void tmc_init(TMCMarlin &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate, float hold_multiplier) { st.begin(); CHOPCONF_t chopconf{0}; @@ -757,7 +757,7 @@ enum StealthIndex : uint8_t { TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true); st.CHOPCONF(chopconf.sr); - st.rms_current(mA, HOLD_MULTIPLIER); + st.rms_current(mA, hold_multiplier); st.microsteps(microsteps); st.iholddelay(10); st.TPOWERDOWN(128); // ~2s until driver lowers to hold current diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h new file mode 100644 index 0000000000000..bfa38adadf73d --- /dev/null +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -0,0 +1,207 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * MRR ESPE pin assignments + * MRR ESPE is a 3D printer control board based on the ESP32 microcontroller. + * Supports 5 stepper drivers (using I2S stepper stream), heated bed, + * single hotend, and LCD controller. + */ + +#include "env_validate.h" + +#if EXTRUDERS > 2 || E_STEPPERS > 2 + #error "MKS ESP Nano only supports two E Steppers. Comment out this line to continue." +#elif HOTENDS > 2 + #error "MKS ESP Nano only supports two hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "MKS TinyBee" +#define BOARD_WEBSITE_URL "https://github.com/makerbase-mks" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Servos +// +#define SERVO0_PIN 2 + +// +// Limit Switches +// +#define X_STOP_PIN 33 +#define Y_STOP_PIN 32 +#define Z_STOP_PIN 22 +//#define FIL_RUNOUT_PIN 35 + +// +// Enable I2S stepper stream +// +#define I2S_STEPPER_STREAM +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 26 + #define I2S_BCK 25 + #define I2S_DATA 27 + #if ENABLED(LIN_ADVANCE) + #error "I2S stream is currently incompatible with LIN_ADVANCE." + #endif +#endif + +// +// Steppers +// +#define X_STEP_PIN 129 +#define X_DIR_PIN 130 +#define X_ENABLE_PIN 128 + +#define Y_STEP_PIN 132 +#define Y_DIR_PIN 133 +#define Y_ENABLE_PIN 131 + +#define Z_STEP_PIN 135 +#define Z_DIR_PIN 136 +#define Z_ENABLE_PIN 134 + +#define E0_STEP_PIN 138 +#define E0_DIR_PIN 139 +#define E0_ENABLE_PIN 137 + +#define E1_STEP_PIN 141 +#define E1_DIR_PIN 142 +#define E1_ENABLE_PIN 140 + +#define Z2_STEP_PIN 141 +#define Z2_DIR_PIN 142 +#define Z2_ENABLE_PIN 140 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 36 // Analog Input +#define TEMP_1_PIN 34 // Analog Input, you need set R6=0Ω and R7=NC +#define TEMP_BED_PIN 39 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 145 +#define HEATER_1_PIN 146 +#define FAN_PIN 147 +#define FAN1_PIN 148 +#define HEATER_BED_PIN 144 + +//#define CONTROLLER_FAN_PIN 148 +//#define E0_AUTO_FAN_PIN 148 // need to update Configuration_adv.h @section extruder +//#define E1_AUTO_FAN_PIN 149 // need to update Configuration_adv.h @section extruder + +// +// MicroSD card +// +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 +#define SDSS 5 +#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal(Jump to SDDET) +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers + +/** + * ------ ------ + * (BEEPER) 149 |10 9 | 13 (BTN_ENC) (SPI MISO) 19 |10 9 | 18 (SPI SCK) + * (LCD_EN) 21 | 8 7 | 4 (LCD_RS) (BTN_EN1) 14 | 8 7 | 5 (SPI CS) + * (LCD_D4) 0 | 6 5 16 (LCD_D5) (BTN_EN2) 12 | 6 5 23 (SPI MOSI) + * (LCD_D6) 15 | 4 3 | 17 (LCD_D7) (SPI_DET) 34 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ + +#define EXP1_03_PIN 17 +#define EXP1_04_PIN 15 +#define EXP1_05_PIN 16 +#define EXP1_06_PIN 0 +#define EXP1_07_PIN 4 +#define EXP1_08_PIN 21 +#define EXP1_09_PIN 13 +#define EXP1_10_PIN 149 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN 34 +#define EXP2_05_PIN 23 +#define EXP2_06_PIN 12 +#define EXP2_07_PIN 5 +#define EXP2_08_PIN 14 +#define EXP2_09_PIN 18 +#define EXP2_10_PIN 19 + +#if HAS_WIRED_LCD + + #define BEEPER_PIN 149 + #define BTN_ENC 13 + #define LCD_PINS_ENABLE 21 + #define LCD_PINS_RS 4 + #define BTN_EN1 14 + #define BTN_EN2 12 + #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 15 + #define DOGLCD_CS 16 + //#define DOGLCD_SCK 19 + //#define DOGLCD_MOSI 23 + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + + #elif ENABLED(MKS_MINI_12864_V3) + + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 0 + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #define LCD_PINS_D5 16 + #define LCD_PINS_D6 15 + #define LCD_PINS_D7 17 + #endif + + #define BOARD_ST7920_DELAY_1 96 + #define BOARD_ST7920_DELAY_2 48 + #define BOARD_ST7920_DELAY_3 600 + + #endif // !MKS_MINI_12864 + +#endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 0884d8ecb5142..98f8da571940d 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -49,7 +49,7 @@ #define Z_MIN_PROBE_PIN 46 // JP4, Tfeed1 #endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN 44 // JP3, Tfeed2 #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index d5f5c874351c9..d385277b2891b 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -711,6 +711,8 @@ #include "esp32/pins_PANDA_ZHU.h" // ESP32 env:PANDA #elif MB(PANDA_M4) #include "esp32/pins_PANDA_M4.h" // ESP32 env:PANDA +#elif MB(MKS_TINYBEE) + #include "esp32/pins_MKS_TINYBEE.h" // ESP32 env:mks_tinybee // // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index 1e6703fd4a3a4..fe8c4c6c41aaf 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -546,14 +546,17 @@ #undef K_MAX_PIN #endif -// Filament Sensor first pin alias #if HAS_FILAMENT_SENSOR - #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN + #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN // Filament Sensor first pin alias #else #undef FIL_RUNOUT_PIN #undef FIL_RUNOUT1_PIN #endif +#if NUM_RUNOUT_SENSORS < 2 + #undef FIL_RUNOUT2_PIN +#endif + #ifndef LCD_PINS_D4 #define LCD_PINS_D4 -1 #endif diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 79ac308ce71cb..0a94a582d43c4 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -134,7 +134,6 @@ #define FAN_PIN 9 #define FAN1_PIN 12 -#define NUM_RUNOUT_SENSORS 2 #define FIL_RUNOUT_PIN 22 #define FIL_RUNOUT2_PIN 21 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 5e612d3e8c22c..65ecd37e62da3 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -121,10 +121,8 @@ #define Z_MIN_PROBE_PIN 49 #endif -#if HAS_FILAMENT_SENSOR - #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN Y_MIN_PIN - #endif +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN Y_MIN_PIN #endif // diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 37a76c5278211..76a2d5a3985fd 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -109,10 +109,8 @@ #define Z_MIN_PROBE_PIN 49 #endif -#if HAS_FILAMENT_SENSOR - #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN Y_MIN_PIN - #endif +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN Y_MIN_PIN #endif // diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 1b37940e2a0a6..a450515a79ffc 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -68,7 +68,7 @@ #if SERVO0_PIN == BEEPER_PIN #undef BEEPER_PIN #endif -#elif ENABLED(FILAMENT_RUNOUT_SENSOR) +#elif HAS_FILAMENT_SENSOR #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN 27 #endif diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index afe58df803d69..53b6797e91d27 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -23,6 +23,6 @@ #define BOARD_INFO_NAME "Chitu3D V5" -#define Z_STOP_PIN PG9 +#define Z_STOP_PIN PA14 #include "pins_CHITU3D_common.h" diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index c6f1e014e0760..15c6955a83a81 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -95,7 +95,6 @@ #define FAN_MAX_PWM 255 #else #define FAST_PWM_FAN // STM32 Variant allow TIMER2 Hardware PWM - #define FAST_PWM_FAN_FREQUENCY 31400 // This frequency allow a good range, fan starts at 3%, half noise at 50% #define FAN_MIN_PWM 5 #define FAN_MAX_PWM 255 #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 c30bb0ac9e99f..e02d1db7863d5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -64,11 +64,6 @@ #define Z_MIN_PROBE_PIN PB1 #endif -// LED driving pin -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA2 -#endif - // // Steppers // @@ -245,6 +240,11 @@ #endif #endif +// LED driving pin +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PA2 +#endif + // // SD Card // diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index eb3af65f32eb7..43aefe97f51df 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -203,19 +203,12 @@ #if ENABLED(SDSUPPORT) - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif #ifndef SD_DETECT_PIN diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index d8a83bef3a891..061680aa79cd0 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -140,25 +140,17 @@ // // Onboard SD support // -#define SDIO_D0_PIN PC8 -#define SDIO_D1_PIN PC9 -#define SDIO_D2_PIN PC10 -#define SDIO_D3_PIN PC11 -#define SDIO_CK_PIN PC12 -#define SDIO_CMD_PIN PD2 - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif #if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD - - #ifndef SDIO_SUPPORT + #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index d1f38f5c8098f..e63b534effa5f 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -338,13 +338,6 @@ #if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - //#define SDIO_CLOCK 48000000 #define SD_DETECT_PIN PC4 #elif SD_CONNECTION_IS(CUSTOM_CABLE) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index 196ca46319989..6d23bc8b208eb 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -365,24 +365,14 @@ // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 // #if SD_CONNECTION_IS(LCD) - #define SDSS EXP2_07_PIN #define SD_SS_PIN SDSS #define SD_SCK_PIN EXP2_09_PIN #define SD_MISO_PIN EXP2_10_PIN #define SD_MOSI_PIN EXP2_05_PIN #define SD_DETECT_PIN EXP2_04_PIN - #elif SD_CONNECTION_IS(ONBOARD) - #define SDIO_SUPPORT // Use SDIO for onboard SD - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 034e4453fe3ff..bbf162bb0d980 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -145,10 +145,10 @@ #endif #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PA4 // MT_DET//MT_DET_1_PIN + #define FIL_RUNOUT_PIN PA4 #endif #ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN MT_DET_2_PIN + #define FIL_RUNOUT2_PIN PE6 #endif #ifndef POWER_LOSS_PIN diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h index 7ccb57e2387b1..98d222087839c 100644 --- a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h +++ b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h @@ -48,13 +48,13 @@ // // Limit Switches // -#define X_MIN_PIN 39 // PD8 X_STOP -#define Y_MIN_PIN 40 // PD9 Y_STOP -#define Z_MIN_PIN 41 // PD10 Z_STOP +#define X_MIN_PIN PD8 // X_STOP +#define Y_MIN_PIN PD9 // Y_STOP +#define Z_MIN_PIN PD10 // Z_STOP -#define X_MAX_PIN 44 // PD0 W_STOP -#define Y_MAX_PIN 43 // PA8 V_STOP -#define Z_MAX_PIN 42 // PD11 U_STOP +#define X_MAX_PIN PD0 // W_STOP +#define Y_MAX_PIN PA8 // V_STOP +#define Z_MAX_PIN PD11 // U_STOP // // Z Probe (when not Z_MIN_PIN) @@ -66,64 +66,64 @@ // // Filament runout // -//#define FIL_RUNOUT_PIN 53 // PA3 BED_THE +//#define FIL_RUNOUT_PIN PA3 // BED_THE // // Steppers // -#define X_STEP_PIN 61 // PE14 X_PWM -#define X_DIR_PIN 62 // PE15 X_DIR -#define X_ENABLE_PIN 60 // PE13 X_RES -#define X_CS_PIN 16 // PA4 SPI_CS +#define X_STEP_PIN PE14 // X_PWM +#define X_DIR_PIN PE15 // X_DIR +#define X_ENABLE_PIN PE13 // X_RES +#define X_CS_PIN PA4 // SPI_CS -#define Y_STEP_PIN 64 // PB10 Y_PWM -#define Y_DIR_PIN 65 // PE9 Y_DIR -#define Y_ENABLE_PIN 63 // PE10 Y_RES -#define Y_CS_PIN 16 // PA4 SPI_CS +#define Y_STEP_PIN PB10 // Y_PWM +#define Y_DIR_PIN PE9 // Y_DIR +#define Y_ENABLE_PIN PE10 // Y_RES +#define Y_CS_PIN PA4 // SPI_CS -#define Z_STEP_PIN 67 // PC6 Z_PWM -#define Z_DIR_PIN 68 // PC0 Z_DIR -#define Z_ENABLE_PIN 66 // PC15 Z_RES -#define Z_CS_PIN 16 // PA4 SPI_CS +#define Z_STEP_PIN PC6 // Z_PWM +#define Z_DIR_PIN PC0 // Z_DIR +#define Z_ENABLE_PIN PC15 // Z_RES +#define Z_CS_PIN PA4 // SPI_CS -#define E0_STEP_PIN 71 // PD12 E1_PW -#define E0_DIR_PIN 70 // PC13 E1_DIR -#define E0_ENABLE_PIN 69 // PC14 E1_RE -#define E0_CS_PIN 16 // PA4 SPI_CS +#define E0_STEP_PIN PD12 // E1_PW +#define E0_DIR_PIN PC13 // E1_DIR +#define E0_ENABLE_PIN PC14 // E1_RE +#define E0_CS_PIN PA4 // SPI_CS -#define E1_STEP_PIN 73 // PE5 E2_PWM -#define E1_DIR_PIN 74 // PE6 E2_DIR -#define E1_ENABLE_PIN 72 // PE4 E2_RESE -#define E1_CS_PIN 16 // PA4 SPI_CS +#define E1_STEP_PIN PE5 // E2_PWM +#define E1_DIR_PIN PE6 // E2_DIR +#define E1_ENABLE_PIN PE4 // E2_RESE +#define E1_CS_PIN PA4 // SPI_CS -#define E2_STEP_PIN 77 // PB8 E3_PWM -#define E2_DIR_PIN 76 // PE2 E3_DIR -#define E2_ENABLE_PIN 75 // PE3 E3_RESE -#define E2_CS_PIN 16 // PA4 SPI_CS +#define E2_STEP_PIN PB8 // E3_PWM +#define E2_DIR_PIN PE2 // E3_DIR +#define E2_ENABLE_PIN PE3 // E3_RESE +#define E2_CS_PIN PA4 // SPI_CS // needed to pass a sanity check -#define X2_CS_PIN 16 // PA4 SPI_CS -#define Y2_CS_PIN 16 // PA4 SPI_CS -#define Z2_CS_PIN 16 // PA4 SPI_CS -#define Z3_CS_PIN 16 // PA4 SPI_CS -#define E3_CS_PIN 16 // PA4 SPI_CS -#define E4_CS_PIN 16 // PA4 SPI_CS -#define E5_CS_PIN 16 // PA4 SPI_CS +#define X2_CS_PIN PA4 // SPI_CS +#define Y2_CS_PIN PA4 // SPI_CS +#define Z2_CS_PIN PA4 // SPI_CS +#define Z3_CS_PIN PA4 // SPI_CS +#define E3_CS_PIN PA4 // SPI_CS +#define E4_CS_PIN PA4 // SPI_CS +#define E5_CS_PIN PA4 // SPI_CS #if HAS_L64XX - #define L6470_CHAIN_SCK_PIN 17 // PA5 - #define L6470_CHAIN_MISO_PIN 18 // PA6 - #define L6470_CHAIN_MOSI_PIN 19 // PA7 - #define L6470_CHAIN_SS_PIN 16 // PA4 + #define L6470_CHAIN_SCK_PIN PA5 + #define L6470_CHAIN_MISO_PIN PA6 + #define L6470_CHAIN_MOSI_PIN PA7 + #define L6470_CHAIN_SS_PIN PA4 //#define SD_SCK_PIN L6470_CHAIN_SCK_PIN //#define SD_MISO_PIN L6470_CHAIN_MISO_PIN //#define SD_MOSI_PIN L6470_CHAIN_MOSI_PIN #else - //#define SD_SCK_PIN 13 // PB13 SPI_S - //#define SD_MISO_PIN 12 // PB14 SPI_M - //#define SD_MOSI_PIN 11 // PB15 SPI_M + //#define SD_SCK_PIN PB13 // SPI_S + //#define SD_MISO_PIN PB14 // SPI_M + //#define SD_MOSI_PIN PB15 // SPI_M #endif /** @@ -144,114 +144,109 @@ // // Temperature Sensors // -#define TEMP_0_PIN 3 // Analog input 3, digital pin 54 PA0 E1_THERMISTOR -#define TEMP_1_PIN 4 // Analog input 4, digital pin 55 PA1 E2_THERMISTOR -#define TEMP_2_PIN 5 // Analog input 5, digital pin 56 PA2 E3_THERMISTOR -#define TEMP_BED_PIN 0 // Analog input 0, digital pin 51 PC2 BED_THERMISTOR_1 -#define TEMP_BED_1_PIN 1 // Analog input 1, digital pin 52 PC3 BED_THERMISTOR_2 -#define TEMP_BED_2_PIN 2 // Analog input 2, digital pin 53 PA3 BED_THERMISTOR_3 +#define TEMP_0_PIN PA0 // Analog input 3, digital pin 54 PA0 E1_THERMISTOR +#define TEMP_1_PIN PA1 // Analog input 4, digital pin 55 PA1 E2_THERMISTOR +#define TEMP_2_PIN PA2 // Analog input 5, digital pin 56 PA2 E3_THERMISTOR +#define TEMP_BED_PIN PC2 // Analog input 0, digital pin 51 PC2 BED_THERMISTOR_1 +#define TEMP_BED_1_PIN PC3 // Analog input 1, digital pin 52 PC3 BED_THERMISTOR_2 +#define TEMP_BED_2_PIN PA3 // Analog input 2, digital pin 53 PA3 BED_THERMISTOR_3 // // Heaters / Fans // -#define HEATER_0_PIN 48 // PC7 E1_HEAT_PWM -#define HEATER_1_PIN 49 // PB0 E2_HEAT_PWM -#define HEATER_2_PIN 50 // PB1 E3_HEAT_PWM -#define HEATER_BED_PIN 46 // PD14 (BED_HEAT_1 FET -#define HEATER_BED_1_PIN 45 // PD13 (BED_HEAT_2 FET -#define HEATER_BED_2_PIN 47 // PD15 (BED_HEAT_3 FET +#define HEATER_0_PIN PC7 // E1_HEAT_PWM +#define HEATER_1_PIN PB0 // E2_HEAT_PWM +#define HEATER_2_PIN PB1 // E3_HEAT_PWM +#define HEATER_BED_PIN PD14 // (BED_HEAT_1 FET +#define HEATER_BED_1_PIN PD13 // (BED_HEAT_2 FET +#define HEATER_BED_2_PIN PD15 // (BED_HEAT_3 FET -#define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET -#define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET -#define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET +#define FAN_PIN PC4 // E1_FAN PWM pin, Part cooling fan FET +#define FAN1_PIN PC5 // E2_FAN PWM pin, Extruder fan FET +#define FAN2_PIN PE8 // E3_FAN PWM pin, Controller fan FET #ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 58 // FAN1_PIN + #define E0_AUTO_FAN_PIN PC5 // FAN1_PIN #endif // // Misc functions // -#define LED_PIN -1 // 9 // PE1 green LED Heart beat -#define PS_ON_PIN -1 -#define KILL_PIN -1 -#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT +#define LED_PIN -1 // 9 // PE1 green LED Heart beat +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT // // LCD / Controller // -//#define SD_DETECT_PIN 66 // PA15 SD_CA -//#define BEEPER_PIN 24 // PC9 SDIO_D1 -//#define LCD_PINS_RS 65 // PE9 Y_DIR -//#define LCD_PINS_ENABLE 59 // PE8 E3_FAN -//#define LCD_PINS_D4 10 // PB12 SPI_C -//#define LCD_PINS_D5 13 // PB13 SPI_S -//#define LCD_PINS_D6 12 // PB14 SPI_M -//#define LCD_PINS_D7 11 // PB15 SPI_M -//#define BTN_EN1 57 // PC4 E1_FAN -//#define BTN_EN2 58 // PC5 E2_FAN -//#define BTN_ENC 52 // PC3 BED_THE +//#define SD_DETECT_PIN PA15 // SD_CA +//#define BEEPER_PIN PC9 // SDIO_D1 +//#define LCD_PINS_RS PE9 // Y_DIR +//#define LCD_PINS_ENABLE PE8 // E3_FAN +//#define LCD_PINS_D4 PB12 // SPI_C +//#define LCD_PINS_D5 PB13 // SPI_S +//#define LCD_PINS_D6 PB14 // SPI_M +//#define LCD_PINS_D7 PB15 // SPI_M +//#define BTN_EN1 PC4 // E1_FAN +//#define BTN_EN2 PC5 // E2_FAN +//#define BTN_ENC PC3 // BED_THE // // Extension pins // -//#define EXT0_PIN 49 // PB0 E2_HEAT -//#define EXT1_PIN 50 // PB1 E3_HEAT -//#define EXT2_PIN // PB2 not used (tied to ground -//#define EXT3_PIN 39 // PD8 X_STOP -//#define EXT4_PIN 40 // PD9 Y_STOP -//#define EXT5_PIN 41 // PD10 Z_STOP -//#define EXT6_PIN 42 // PD11 -//#define EXT7_PIN 71 // PD12 E1_PW -//#define EXT8_PIN 64 // PB10 Y_PWM +//#define EXT0_PIN PB0 //E2_HEAT +//#define EXT1_PIN PB1 //E3_HEAT +//#define EXT2_PIN PB2 //not used (tied to ground +//#define EXT3_PIN PD8 //X_STOP +//#define EXT4_PIN PD9 //Y_STOP +//#define EXT5_PIN PD10 //Z_STOP +//#define EXT6_PIN PD11 +//#define EXT7_PIN PD12 //E1_PW +//#define EXT8_PIN PB10 //Y_PWM // WIFI -// 2 // PD3 CTS -// 3 // PD4 RTS -// 4 // PD5 TX -// 5 // PD6 RX -// 6 // PB5 WIFI_WAKEUP -// 7 // PE11 WIFI_RESET -// 8 // PE12 WIFI_BOOT +// PD3 CTS +// PD4 RTS +// PD5 TX +// PD6 RX +// PB5 WIFI_WAKEUP +// PE11 WIFI_RESET +// PE12 WIFI_BOOT // I2C USER -// 14 // PB7 SDA -// 15 // PB6 SCL +// PB7 SDA +// PB6 SCL // JTAG -// 20 // PA13 JTAG_TMS/SWDIO -// 21 // PA14 JTAG_TCK/SWCLK -// 22 // PB3 JTAG_TDO/SWO +// PA13 JTAG_TMS/SWDIO +// PA14 JTAG_TCK/SWCLK +// PB3 JTAG_TDO/SWO // // Onboard SD support // -#define SDIO_D0_PIN 23 // PC8 SDIO_D0 -#define SDIO_D1_PIN 24 // PC9 SDIO_D1 -//#define SD_CARD_DETECT_PIN 25 // PA15 SD_CARD_DETECT -#define SDIO_D2_PIN 26 // PC10 SDIO_D2 -#define SDIO_D3_PIN 27 // PC11 SDIO_D3 -#define SDIO_CK_PIN 28 // PC12 SDIO_CK -#define SDIO_CMD_PIN 29 // PD2 SDIO_CMD - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif #if SD_CONNECTION_IS(ONBOARD) - #define SDIO_SUPPORT // Use SDIO for onboard SD - #ifndef SDIO_SUPPORT + #define SDIO_SUPPORT // Use SDIO for onboard SD + #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif + + //#define SD_CARD_DETECT_PIN PA15 // SD_CARD_DETECT + #endif #ifndef SDSS - #define SDSS 16 // PA4 SPI_CS + #define SDSS PA4 // SPI_CS #endif // OTG diff --git a/buildroot/share/PlatformIO/scripts/marlin.py b/buildroot/share/PlatformIO/scripts/marlin.py index b8a6283cedf1b..2114a05fb388c 100644 --- a/buildroot/share/PlatformIO/scripts/marlin.py +++ b/buildroot/share/PlatformIO/scripts/marlin.py @@ -48,6 +48,15 @@ def encrypt_mks(source, target, env, new_name): key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + # If FIRMWARE_BIN is defined by config, override all + import re + patt = re.compile("^\\s*#define\\s+FIRMWARE_BIN\\s+\"?(.+)\"?") + with open(join("Marlin", "Configuration.h"), encoding="utf-8") as f: + for line in f: + m = patt.search(line) + if m != None: + new_name = m.group(1) + fwpath = target[0].path fwfile = open(fwpath, "rb") enfile = open(target[0].dir.path + "/" + new_name, "wb") diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 1837a7580d242..9f38ffe8bfa2b 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -81,10 +81,19 @@ def sanity_check_target(): # # Give warnings on every build # - warnfile = os.path.join(env['PROJECT_BUILD_DIR'], build_env, "src", "src", "inc", "Warnings.cpp.o") + srcpath = os.path.join(env['PROJECT_BUILD_DIR'], build_env, "src", "src") + warnfile = os.path.join(srcpath, "inc", "Warnings.cpp.o") if os.path.exists(warnfile): os.remove(warnfile) + # + # Rebuild 'settings.cpp' for EEPROM_INIT_NOW + # + if 'EEPROM_INIT_NOW' in env['MARLIN_FEATURES']: + setfile = os.path.join(srcpath, "module", "settings.cpp.o") + if os.path.exists(setfile): + os.remove(setfile) + # # Check for old files indicating an entangled Marlin (mixing old and new code) # diff --git a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive index 197ece5dfd66e..34bf77be27a48 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive +++ b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive @@ -10,8 +10,8 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT 3 \ EXTRUDERS 8 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 TEMP_SENSOR_5 1 TEMP_SENSOR_6 1 TEMP_SENSOR_7 1 opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST \ - REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING \ - FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH LEVEL_BED_CORNERS LEVEL_CORNERS_USE_PROBE \ + NEOPIXEL_LED Z_SAFE_HOMING FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE # Not necessary to enable auto-fan for all extruders to hit problematic code paths opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_PIN PF13 \ X_DRIVER_TYPE TMC2208 Y_DRIVER_TYPE TMC2130 \ diff --git a/ini/esp32.ini b/ini/esp32.ini index 9c0c44db67b97..0815486cc9935 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -37,3 +37,8 @@ lib_deps = ${common.lib_deps} board_build.partitions = Marlin/src/HAL/ESP32/esp32.csv upload_speed = 115200 monitor_speed = 115200 + +[env:mks_tinybee] +extends = env:esp32 +platform = espressif32@2.1.0 +board_build.partitions = default_8MB.csv