diff --git a/.gitignore b/.gitignore index 1ac1abbe15..4e4412f5e7 100755 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,6 @@ cmake-build-* #Python __pycache__ + +#IOLogger logs +*_log.csv diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 719e11b899..374a420539 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -344,9 +344,10 @@ #define AUTO_POWER_E_FANS #define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CHAMBER_FAN - //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature - //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature - #define POWER_TIMEOUT 30 + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature + #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration + //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif #endif @@ -435,11 +436,11 @@ #define DUMMY_THERMISTOR_998_VALUE 25 #define DUMMY_THERMISTOR_999_VALUE 100 -// Resistor values when using a MAX31865 (sensor -5) -// Sensor value is typically 100 (PT100) or 1000 (PT1000) -// Calibration value is typically 430 ohm for AdaFruit PT100 modules and 4300 ohm for AdaFruit PT1000 modules. -//#define MAX31865_SENSOR_OHMS 100 -//#define MAX31865_CALIBRATION_OHMS 430 +// Resistor values when using MAX31865 sensors (-5) on TEMP_SENSOR_0 / 1 +//#define MAX31865_SENSOR_OHMS_0 100 // (Ω) Typically 100 or 1000 (PT100 or PT1000) +//#define MAX31865_CALIBRATION_OHMS_0 430 // (Ω) Typically 430 for AdaFruit PT100; 4300 for AdaFruit PT1000 +//#define MAX31865_SENSOR_OHMS_1 100 +//#define MAX31865_CALIBRATION_OHMS_1 430 // Use temp sensor 1 as a redundant sensor with sensor 0. If the readings // from the two sensors differ too much the print will be aborted. @@ -747,7 +748,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } /** * Default Max Feed Rate (mm/s) @@ -1185,9 +1186,27 @@ #if ENABLED(FILAMENT_RUNOUT_SENSOR) #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. - #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. - //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FIL_RUNOUT_PULL // Use internal pullup / pulldown for filament runout pins. + + // Override individually if the runout sensors vary + //#define FIL_RUNOUT1_STATE LOW + //#define FIL_RUNOUT1_PULL + //#define FIL_RUNOUT2_STATE LOW + //#define FIL_RUNOUT2_PULL + //#define FIL_RUNOUT3_STATE LOW + //#define FIL_RUNOUT3_PULL + //#define FIL_RUNOUT4_STATE LOW + //#define FIL_RUNOUT4_PULL + //#define FIL_RUNOUT5_STATE LOW + //#define FIL_RUNOUT5_PULL + //#define FIL_RUNOUT6_STATE LOW + //#define FIL_RUNOUT6_PULL + //#define FIL_RUNOUT7_STATE LOW + //#define FIL_RUNOUT7_PULL + //#define FIL_RUNOUT8_STATE LOW + //#define FIL_RUNOUT8_PULL // Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index cd8a055ffb..0acf2e5f77 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -660,6 +660,7 @@ //#define QUICK_HOME // If G28 contains XY do a diagonal move first //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X +//#define HOME_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first // @section bltouch @@ -811,6 +812,7 @@ //#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item to run G35 Assisted Tramming (MarlinUI) //#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu + //#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment /** * Screw thread: @@ -1171,6 +1173,7 @@ // Enable this option and set to HIGH if your SD cards are incorrectly detected. //#define SD_DETECT_STATE HIGH + //#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up //#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash) #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls @@ -1255,6 +1258,10 @@ // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif + // Allow international symbols in long filenames. To display correctly, the + // LCD's font must contain the characters. Check your selected LCD language. + #define UTF_FILENAME_SUPPORT + // This allows hosts to request long names for files and folders with M33 //#define LONG_FILENAME_HOST_SUPPORT diff --git a/Marlin/src/HAL/DUE/fastio.h b/Marlin/src/HAL/DUE/fastio.h index 119d0005af..5fb8b4d015 100644 --- a/Marlin/src/HAL/DUE/fastio.h +++ b/Marlin/src/HAL/DUE/fastio.h @@ -163,6 +163,9 @@ #define SET_INPUT(IO) _SET_INPUT(IO) // Set pin as input with pullup (wrapper) #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) +// Set pin as input with pulldown (substitution) +#define SET_INPUT_PULLDOWN SET_INPUT + // Set pin as output (wrapper) - reads the pin and sets the output to that value #define SET_OUTPUT(IO) _SET_OUTPUT(IO) // Set pin as PWM diff --git a/Marlin/src/HAL/ESP32/fastio.h b/Marlin/src/HAL/ESP32/fastio.h index 2ded3a5f62..8db89dca12 100644 --- a/Marlin/src/HAL/ESP32/fastio.h +++ b/Marlin/src/HAL/ESP32/fastio.h @@ -52,6 +52,9 @@ // Set pin as input with pullup wrapper #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0) +// Set pin as input with pulldown (substitution) +#define SET_INPUT_PULLDOWN SET_INPUT + // Set pin as output wrapper #define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0) diff --git a/Marlin/src/HAL/LINUX/main.cpp b/Marlin/src/HAL/LINUX/main.cpp index 481f059030..eadc409324 100644 --- a/Marlin/src/HAL/LINUX/main.cpp +++ b/Marlin/src/HAL/LINUX/main.cpp @@ -19,22 +19,23 @@ */ #ifdef __PLAT_LINUX__ -extern void setup(); -extern void loop(); - -#include - -#include -#include +//#define GPIO_LOGGING // Full GPIO and Positional Logging #include "../../inc/MarlinConfig.h" -#include -#include #include "../shared/Delay.h" #include "hardware/IOLoggerCSV.h" #include "hardware/Heater.h" #include "hardware/LinearAxis.h" +#include +#include +#include +#include +#include + +extern void setup(); +extern void loop(); + // simple stdout / stdin implementation for fake serial port void write_serial_thread() { for (;;) { @@ -64,8 +65,6 @@ void simulation_loop() { LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN); LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC); - //#define GPIO_LOGGING // Full GPIO and Positional Logging - #ifdef GPIO_LOGGING IOLoggerCSV logger("all_gpio_log.csv"); Gpio::attachLogger(&logger); @@ -88,7 +87,7 @@ void simulation_loop() { #ifdef GPIO_LOGGING if (x_axis.position != x || y_axis.position != y || z_axis.position != z) { - uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update); + uint64_t update = _MAX(x_axis.last_update, y_axis.last_update, z_axis.last_update); position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl; position_log.flush(); x = x_axis.position; diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index fd05b1aeb4..da11b88a60 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -20,6 +20,8 @@ * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #include "MarlinSPI.h" static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) { @@ -159,3 +161,5 @@ uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) HAL_DMA_DeInit(&_dmaTx); return 1; } + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index be3dcdd109..f38ba35dd5 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -509,7 +509,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { kill(); } - // M18 / M94 : Handle steppers inactive time timeout + // M18 / M84 : Handle steppers inactive time timeout if (gcode.stepper_inactive_time) { static bool already_shutdown_steppers; // = false @@ -991,6 +991,14 @@ void setup() { SETUP_RUN(HAL_init()); + // Init and disable SPI thermocouples + #if HEATER_0_USES_MAX6675 + OUT_WRITE(MAX6675_SS_PIN, HIGH); // Disable + #endif + #if HEATER_1_USES_MAX6675 + OUT_WRITE(MAX6675_SS2_PIN, HIGH); // Disable + #endif + #if HAS_L64XX SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers #endif diff --git a/Marlin/src/MarlinCore.h b/Marlin/src/MarlinCore.h index 69afc7f30e..908636e967 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -92,11 +92,13 @@ extern bool wait_for_heatup; #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); powersupply_on = true; }while(0) #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); powersupply_on = false; }while(0) #if ENABLED(AUTO_POWER_CONTROL) - #define PSU_ON() powerManager.power_on() - #define PSU_OFF() powerManager.power_off() + #define PSU_ON() powerManager.power_on() + #define PSU_OFF() powerManager.power_off() + #define PSU_OFF_SOON() powerManager.power_off_soon() #else - #define PSU_ON() PSU_PIN_ON() - #define PSU_OFF() PSU_PIN_OFF() + #define PSU_ON() PSU_PIN_ON() + #define PSU_OFF() PSU_PIN_OFF() + #define PSU_OFF_SOON PSU_OFF #endif #endif diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index fa5a86b019..0206467752 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -34,6 +34,8 @@ uint8_t ControllerFan::speed; #if ENABLED(CONTROLLER_FAN_EDITABLE) controllerFan_settings_t ControllerFan::settings; // {0} + #else + const controllerFan_settings_t &ControllerFan::settings = controllerFan_defaults; #endif void ControllerFan::setup() { diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index d1d39f21f3..55f2d5cfc7 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -58,7 +58,7 @@ class ControllerFan { #if ENABLED(CONTROLLER_FAN_EDITABLE) static controllerFan_settings_t settings; #else - static const controllerFan_settings_t constexpr &settings = controllerFan_defaults; + static const controllerFan_settings_t &settings; #endif static inline bool state() { return speed > 0; } static inline void init() { reset(); } diff --git a/Marlin/src/feature/mmu2/mmu2.cpp b/Marlin/src/feature/mmu2/mmu2.cpp index c5cf485850..d76476e719 100644 --- a/Marlin/src/feature/mmu2/mmu2.cpp +++ b/Marlin/src/feature/mmu2/mmu2.cpp @@ -163,7 +163,7 @@ uint8_t MMU2::get_current_tool() { } #if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) - #define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) + #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif void MMU2::mmu_loop() { diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 9427f684e7..8d05d14698 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -126,4 +126,12 @@ void Power::power_off() { } } +void Power::power_off_soon() { + #if POWER_OFF_DELAY + lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY); + #else + power_off(); + #endif +} + #endif // AUTO_POWER_CONTROL diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 8b988907e6..2462b9231b 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -32,6 +32,7 @@ class Power { static void check(); static void power_on(); static void power_off(); + static void power_off_soon(); private: static millis_t lastPowerOn; static bool is_power_needed(); diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 874bcff46d..bef2309449 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -433,13 +433,15 @@ void PrintJobRecovery::resume() { #endif // Restore print cooling fan speeds - FANS_LOOP(i) { - uint8_t f = info.fan_speed[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - gcode.process_subcommands_now(cmd); + #if HAS_FAN + FANS_LOOP(i) { + const int f = info.fan_speed[i]; + if (f) { + sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); + gcode.process_subcommands_now(cmd); + } } - } + #endif // Restore retract and hop state #if ENABLED(FWRETRACT) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index a5abf057d1..aa1ccc9cc5 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -149,18 +149,34 @@ class FilamentSensorBase { public: static inline void setup() { - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #elif ENABLED(FIL_RUNOUT_PULLDOWN) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) + #define _INIT_RUNOUT_PIN(P,S,U) do{ if (DISABLED(U)) SET_INPUT(P); else if (S) SET_INPUT_PULLDOWN(P); else SET_INPUT_PULLUP(P); }while(0) + #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULL) + #if NUM_RUNOUT_SENSORS >= 1 + INIT_RUNOUT_PIN(1); #endif - - #define _INIT_RUNOUT(N) INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN); - REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _INIT_RUNOUT) - #undef _INIT_RUNOUT - #undef INIT_RUNOUT_PIN + #if NUM_RUNOUT_SENSORS >= 2 + INIT_RUNOUT_PIN(2); + #endif + #if NUM_RUNOUT_SENSORS >= 3 + INIT_RUNOUT_PIN(3); + #endif + #if NUM_RUNOUT_SENSORS >= 4 + INIT_RUNOUT_PIN(4); + #endif + #if NUM_RUNOUT_SENSORS >= 5 + INIT_RUNOUT_PIN(5); + #endif + #if NUM_RUNOUT_SENSORS >= 6 + INIT_RUNOUT_PIN(6); + #endif + #if NUM_RUNOUT_SENSORS >= 7 + INIT_RUNOUT_PIN(7); + #endif + #if NUM_RUNOUT_SENSORS >= 8 + INIT_RUNOUT_PIN(8); + #endif + #undef _INIT_RUNOUT_PIN + #undef INIT_RUNOUT_PIN } // Return a bitmask of runout pin states @@ -172,11 +188,32 @@ class FilamentSensorBase { // Return a bitmask of runout flag states (1 bits always indicates runout) static inline uint8_t poll_runout_states() { - return poll_runout_pins() - #if FIL_RUNOUT_STATE == LOW - ^ uint8_t(_BV(NUM_RUNOUT_SENSORS) - 1) + return poll_runout_pins() ^ uint8_t(0 + #if NUM_RUNOUT_SENSORS >= 1 + | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1)) #endif - ; + #if NUM_RUNOUT_SENSORS >= 2 + | (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 3 + | (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 4 + | (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 5 + | (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 6 + | (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 7 + | (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1)) + #endif + #if NUM_RUNOUT_SENSORS >= 8 + | (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1)) + #endif + ); } }; diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index f0abc543cb..789d8bcf19 100755 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -120,8 +120,7 @@ void GcodeSuite::G35() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G35 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE)); - + do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7)); const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true); if (isnan(z_probed_height)) { diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index a91dd82a2a..ef39290d2d 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -313,7 +313,7 @@ void GcodeSuite::G28() { home_all = homeX == homeY && homeX == homeZ, // All or None doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ; - #if Z_HOME_DIR > 0 // If homing away from BED do Z first + #if ENABLED(HOME_Z_FIRST) if (doZ) homeaxis(Z_AXIS); @@ -373,18 +373,13 @@ void GcodeSuite::G28() { TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing)); // Home Z last if homing towards the bed - #if Z_HOME_DIR < 0 - + #if DISABLED(HOME_Z_FIRST) if (doZ) { TERN_(BLTOUCH, bltouch.init()); - TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS)); - probe.move_z_after_homing(); - - } // doZ - - #endif // Z_HOME_DIR < 0 + } + #endif sync_plan_position(); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index a8f7f7c10b..ea0f9c2b13 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -105,7 +105,7 @@ void GcodeSuite::M81() { #if HAS_SUICIDE suicide(); #elif ENABLED(PSU_CONTROL) - PSU_OFF(); + PSU_OFF_SOON(); #endif LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF ".")); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 0af68333ca..e676ed38a4 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -88,7 +88,7 @@ void GcodeSuite::M600() { // In this case, for duplicating modes set DXC_ext to the extruder that ran out. #if HAS_FILAMENT_SENSOR && NUM_RUNOUT_SENSORS > 1 if (idex_is_duplicating()) - DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_STATE) ? 1 : 0; + DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0; #else DXC_ext = active_extruder; #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index e2c70ad3ae..1d6bd94231 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -431,7 +431,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 28: M28(); break; // M28: Start SD write case 29: M29(); break; // M29: Stop SD write case 30: M30(); break; // M30 Delete File - case 32: M32(); break; // M32: Select file and start SD print + + #if HAS_MEDIA_SUBCALLS + case 32: M32(); break; // M32: Select file and start SD print + #endif #if ENABLED(LONG_FILENAME_HOST_SUPPORT) case 33: M33(); break; // M33: Get the long full path to a file or folder diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 34df51e517..5db8b08e08 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -541,7 +541,7 @@ private: static void M31(); #if ENABLED(SDSUPPORT) - static void M32(); + TERN_(HAS_MEDIA_SUBCALLS, static void M32()); TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33()); #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE) static void M34(); diff --git a/Marlin/src/gcode/sd/M32.cpp b/Marlin/src/gcode/sd/M32.cpp index 55ec6ea497..ea893c9232 100644 --- a/Marlin/src/gcode/sd/M32.cpp +++ b/Marlin/src/gcode/sd/M32.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA_SUBCALLS #include "../gcode.h" #include "../../sd/cardreader.h" @@ -56,4 +56,4 @@ void GcodeSuite::M32() { } } -#endif // SDSUPPORT +#endif // HAS_MEDIA_SUBCALLS diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 98aa4afb8c..0bb98e9e06 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -675,6 +675,73 @@ #define HAS_BED_PROBE 1 #endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if NUM_RUNOUT_SENSORS >= 1 + #ifndef FIL_RUNOUT1_STATE + #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT1_PULL + #define FIL_RUNOUT1_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 2 + #ifndef FIL_RUNOUT2_STATE + #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT2_PULL + #define FIL_RUNOUT2_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 3 + #ifndef FIL_RUNOUT3_STATE + #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT3_PULL + #define FIL_RUNOUT3_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 4 + #ifndef FIL_RUNOUT4_STATE + #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT4_PULL + #define FIL_RUNOUT4_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 5 + #ifndef FIL_RUNOUT5_STATE + #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT5_PULL + #define FIL_RUNOUT5_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 6 + #ifndef FIL_RUNOUT6_STATE + #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT6_PULL + #define FIL_RUNOUT6_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 7 + #ifndef FIL_RUNOUT7_STATE + #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT7_PULL + #define FIL_RUNOUT7_PULL FIL_RUNOUT_PULL + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 8 + #ifndef FIL_RUNOUT8_STATE + #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT8_PULL + #define FIL_RUNOUT8_PULL FIL_RUNOUT_PULL + #endif + #endif +#endif // FILAMENT_RUNOUT_SENSOR + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #undef PROBE_MANUALLY #endif @@ -711,6 +778,10 @@ #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #endif +#if Z_HOME_DIR > 0 + #define HOME_Z_FIRST // If homing away from BED do Z first +#endif + /** * Set granular options based on the specific type of leveling */ diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 2a898d6084..02513e3eaa 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -146,6 +146,10 @@ #define HAS_PRINT_PROGRESS 1 #endif +#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH + #define HAS_MEDIA_SUBCALLS 1 +#endif + #if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME) #define HAS_PRINT_PROGRESS_PERMYRIAD 1 #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index bbbcf6fb2f..9fb3e53c4e 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -416,8 +416,13 @@ #endif #endif -#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) - #define PSU_POWERUP_DELAY 250 +#if ENABLED(PSU_CONTROL) + #ifndef PSU_POWERUP_DELAY + #define PSU_POWERUP_DELAY 250 + #endif + #ifndef POWER_OFF_DELAY + #define POWER_OFF_DELAY 0 + #endif #endif /** @@ -431,7 +436,7 @@ #endif #if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 + #define HEATER_0_USES_MAX6675 1 #if TEMP_SENSOR_0 == -3 #define HEATER_0_MAX6675_TMIN -270 #define HEATER_0_MAX6675_TMAX 1800 @@ -440,19 +445,19 @@ #define HEATER_0_MAX6675_TMAX 1024 #endif #if TEMP_SENSOR_0 == -5 - #define MAX6675_IS_MAX31865 + #define MAX6675_0_IS_MAX31865 1 #elif TEMP_SENSOR_0 == -3 - #define MAX6675_IS_MAX31855 + #define MAX6675_0_IS_MAX31855 1 #endif #elif TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 + #define HEATER_0_USES_AD8495 1 #elif TEMP_SENSOR_0 == -1 - #define HEATER_0_USES_AD595 + #define HEATER_0_USES_AD595 1 #elif TEMP_SENSOR_0 > 0 #define THERMISTOR_HEATER_0 TEMP_SENSOR_0 - #define HEATER_0_USES_THERMISTOR + #define HEATER_0_USES_THERMISTOR 1 #if TEMP_SENSOR_0 == 1000 - #define HEATER_0_USER_THERMISTOR + #define HEATER_0_USER_THERMISTOR 1 #endif #else #undef HEATER_0_MINTEMP @@ -460,7 +465,7 @@ #endif #if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2 - #define HEATER_1_USES_MAX6675 + #define HEATER_1_USES_MAX6675 1 #if TEMP_SENSOR_1 == -3 #define HEATER_1_MAX6675_TMIN -270 #define HEATER_1_MAX6675_TMAX 1800 @@ -468,6 +473,11 @@ #define HEATER_1_MAX6675_TMIN 0 #define HEATER_1_MAX6675_TMAX 1024 #endif + #if TEMP_SENSOR_1 == -5 + #define MAX6675_1_IS_MAX31865 1 + #elif TEMP_SENSOR_1 == -3 + #define MAX6675_1_IS_MAX31855 1 + #endif #if TEMP_SENSOR_1 != TEMP_SENSOR_0 #if TEMP_SENSOR_1 == -5 #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." @@ -478,14 +488,14 @@ #endif #endif #elif TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 + #define HEATER_1_USES_AD8495 1 #elif TEMP_SENSOR_1 == -1 - #define HEATER_1_USES_AD595 + #define HEATER_1_USES_AD595 1 #elif TEMP_SENSOR_1 > 0 #define THERMISTOR_HEATER_1 TEMP_SENSOR_1 - #define HEATER_1_USES_THERMISTOR + #define HEATER_1_USES_THERMISTOR 1 #if TEMP_SENSOR_1 == 1000 - #define HEATER_1_USER_THERMISTOR + #define HEATER_1_USER_THERMISTOR 1 #endif #else #undef HEATER_1_MINTEMP @@ -493,18 +503,18 @@ #endif #if TEMP_SENSOR_2 == -4 - #define HEATER_2_USES_AD8495 + #define HEATER_2_USES_AD8495 1 #elif TEMP_SENSOR_2 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2." #elif TEMP_SENSOR_2 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2." #elif TEMP_SENSOR_2 == -1 - #define HEATER_2_USES_AD595 + #define HEATER_2_USES_AD595 1 #elif TEMP_SENSOR_2 > 0 #define THERMISTOR_HEATER_2 TEMP_SENSOR_2 - #define HEATER_2_USES_THERMISTOR + #define HEATER_2_USES_THERMISTOR 1 #if TEMP_SENSOR_2 == 1000 - #define HEATER_2_USER_THERMISTOR + #define HEATER_2_USER_THERMISTOR 1 #endif #else #undef HEATER_2_MINTEMP @@ -512,18 +522,18 @@ #endif #if TEMP_SENSOR_3 == -4 - #define HEATER_3_USES_AD8495 + #define HEATER_3_USES_AD8495 1 #elif TEMP_SENSOR_3 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3." #elif TEMP_SENSOR_3 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3." #elif TEMP_SENSOR_3 == -1 - #define HEATER_3_USES_AD595 + #define HEATER_3_USES_AD595 1 #elif TEMP_SENSOR_3 > 0 #define THERMISTOR_HEATER_3 TEMP_SENSOR_3 - #define HEATER_3_USES_THERMISTOR + #define HEATER_3_USES_THERMISTOR 1 #if TEMP_SENSOR_3 == 1000 - #define HEATER_3_USER_THERMISTOR + #define HEATER_3_USER_THERMISTOR 1 #endif #else #undef HEATER_3_MINTEMP @@ -531,18 +541,18 @@ #endif #if TEMP_SENSOR_4 == -4 - #define HEATER_4_USES_AD8495 + #define HEATER_4_USES_AD8495 1 #elif TEMP_SENSOR_4 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4." #elif TEMP_SENSOR_4 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4." #elif TEMP_SENSOR_4 == -1 - #define HEATER_4_USES_AD595 + #define HEATER_4_USES_AD595 1 #elif TEMP_SENSOR_4 > 0 #define THERMISTOR_HEATER_4 TEMP_SENSOR_4 - #define HEATER_4_USES_THERMISTOR + #define HEATER_4_USES_THERMISTOR 1 #if TEMP_SENSOR_4 == 1000 - #define HEATER_4_USER_THERMISTOR + #define HEATER_4_USER_THERMISTOR 1 #endif #else #undef HEATER_4_MINTEMP @@ -550,18 +560,18 @@ #endif #if TEMP_SENSOR_5 == -4 - #define HEATER_5_USES_AD8495 + #define HEATER_5_USES_AD8495 1 #elif TEMP_SENSOR_5 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5." #elif TEMP_SENSOR_5 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5." #elif TEMP_SENSOR_5 == -1 - #define HEATER_5_USES_AD595 + #define HEATER_5_USES_AD595 1 #elif TEMP_SENSOR_5 > 0 #define THERMISTOR_HEATER_5 TEMP_SENSOR_5 - #define HEATER_5_USES_THERMISTOR + #define HEATER_5_USES_THERMISTOR 1 #if TEMP_SENSOR_5 == 1000 - #define HEATER_5_USER_THERMISTOR + #define HEATER_5_USER_THERMISTOR 1 #endif #else #undef HEATER_5_MINTEMP @@ -569,18 +579,18 @@ #endif #if TEMP_SENSOR_6 == -4 - #define HEATER_6_USES_AD8495 + #define HEATER_6_USES_AD8495 1 #elif TEMP_SENSOR_6 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6." #elif TEMP_SENSOR_6 == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6." #elif TEMP_SENSOR_6 == -1 - #define HEATER_6_USES_AD595 + #define HEATER_6_USES_AD595 1 #elif TEMP_SENSOR_6 > 0 #define THERMISTOR_HEATER_6 TEMP_SENSOR_6 - #define HEATER_6_USES_THERMISTOR + #define HEATER_6_USES_THERMISTOR 1 #if TEMP_SENSOR_6 == 1000 - #define HEATER_6_USER_THERMISTOR + #define HEATER_6_USER_THERMISTOR 1 #endif #else #undef HEATER_6_MINTEMP @@ -588,18 +598,18 @@ #endif #if TEMP_SENSOR_7 == -4 - #define HEATER_7_USES_AD8495 + #define HEATER_7_USES_AD8495 1 #elif TEMP_SENSOR_7 == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7." #elif TEMP_SENSOR_7 == -2 #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7." #elif TEMP_SENSOR_7 == -1 - #define HEATER_7_USES_AD595 + #define HEATER_7_USES_AD595 1 #elif TEMP_SENSOR_7 > 0 #define THERMISTOR_HEATER_7 TEMP_SENSOR_7 - #define HEATER_7_USES_THERMISTOR + #define HEATER_7_USES_THERMISTOR 1 #if TEMP_SENSOR_7 == 1000 - #define HEATER_7_USER_THERMISTOR + #define HEATER_7_USER_THERMISTOR 1 #endif #else #undef HEATER_7_MINTEMP @@ -607,18 +617,18 @@ #endif #if TEMP_SENSOR_BED == -4 - #define HEATER_BED_USES_AD8495 + #define HEATER_BED_USES_AD8495 1 #elif TEMP_SENSOR_BED == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED." #elif TEMP_SENSOR_BED == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED." #elif TEMP_SENSOR_BED == -1 - #define HEATER_BED_USES_AD595 + #define HEATER_BED_USES_AD595 1 #elif TEMP_SENSOR_BED > 0 #define THERMISTORBED TEMP_SENSOR_BED - #define HEATER_BED_USES_THERMISTOR + #define HEATER_BED_USES_THERMISTOR 1 #if TEMP_SENSOR_BED == 1000 - #define HEATER_BED_USER_THERMISTOR + #define HEATER_BED_USER_THERMISTOR 1 #endif #else #undef BED_MINTEMP @@ -626,18 +636,18 @@ #endif #if TEMP_SENSOR_CHAMBER == -4 - #define HEATER_CHAMBER_USES_AD8495 + #define HEATER_CHAMBER_USES_AD8495 1 #elif TEMP_SENSOR_CHAMBER == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER." #elif TEMP_SENSOR_CHAMBER == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER." #elif TEMP_SENSOR_CHAMBER == -1 - #define HEATER_CHAMBER_USES_AD595 + #define HEATER_CHAMBER_USES_AD595 1 #elif TEMP_SENSOR_CHAMBER > 0 #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER - #define HEATER_CHAMBER_USES_THERMISTOR + #define HEATER_CHAMBER_USES_THERMISTOR 1 #if TEMP_SENSOR_CHAMBER == 1000 - #define HEATER_CHAMBER_USER_THERMISTOR + #define HEATER_CHAMBER_USER_THERMISTOR 1 #endif #else #undef CHAMBER_MINTEMP @@ -645,25 +655,21 @@ #endif #if TEMP_SENSOR_PROBE == -4 - #define HEATER_PROBE_USES_AD8495 + #define HEATER_PROBE_USES_AD8495 1 #elif TEMP_SENSOR_PROBE == -3 #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE." #elif TEMP_SENSOR_PROBE == -2 #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE." #elif TEMP_SENSOR_PROBE == -1 - #define HEATER_PROBE_USES_AD595 + #define HEATER_PROBE_USES_AD595 1 #elif TEMP_SENSOR_PROBE > 0 #define THERMISTORPROBE TEMP_SENSOR_PROBE - #define PROBE_USES_THERMISTOR + #define HEATER_PROBE_USES_THERMISTOR 1 #if TEMP_SENSOR_PROBE == 1000 - #define PROBE_USER_THERMISTOR + #define HEATER_PROBE_USER_THERMISTOR 1 #endif #endif -#define HOTEND_USES_THERMISTOR ANY( \ - HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \ - HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR ) - /** * X_DUAL_ENDSTOPS endstop reassignment */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b6ff725470..2ef4cbb785 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -79,9 +79,9 @@ * Warnings for old configurations */ #ifndef MOTHERBOARD - #error "MOTHERBOARD is required. Please update your configuration." + #error "MOTHERBOARD is required." #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) - #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration." + #error "X_BED_SIZE and Y_BED_SIZE are now required!" #elif WATCH_TEMP_PERIOD > 500 #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) @@ -93,41 +93,41 @@ #elif defined(X_HOME_RETRACT_MM) #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." #elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH). Please update your configuration." + #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)." #elif defined(SD_DETECT_INVERTED) - #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH). Please update your configuration." + #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)." #elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." + #error "BTENABLED is now BLUETOOTH." #elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." + #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME." #elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." + #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE." #elif defined(USE_AUTOMATIC_VERSIONING) - #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." + #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE." #elif defined(SDSLOW) #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." #elif defined(SDEXTRASLOW) #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." #elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration." + #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR." #elif defined(ENDSTOPPULLUP_FIL_RUNOUT) - #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration." + #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULL." #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." #elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." + #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE." #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." #elif defined(PID_PARAMS_PER_EXTRUDER) #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) - #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." + #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed." #elif defined(SERVO_ENDSTOP_ANGLES) #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #elif defined(Z_ENDSTOP_SERVO_NR) - #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration." + #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR." #elif defined(DEFAULT_XYJERK) #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." #elif defined(XY_TRAVEL_SPEED) @@ -135,57 +135,57 @@ #elif defined(PROBE_SERVO_DEACTIVATION_DELAY) #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." #elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." + #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY." #elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." + #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE." #elif ENABLED(FILAMENT_CHANGE_FEATURE) - #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration." + #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE." #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS) - #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT." #elif defined(FILAMENT_CHANGE_Z_ADD) - #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT." #elif defined(FILAMENT_CHANGE_XY_FEEDRATE) - #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE." #elif defined(FILAMENT_CHANGE_Z_FEEDRATE) - #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE." #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS) - #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT." #elif defined(PAUSE_PARK_Z_ADD) - #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration." + #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT." #elif defined(PAUSE_PARK_XY_FEEDRATE) - #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration." + #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE." #elif defined(PAUSE_PARK_Z_FEEDRATE) - #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration." + #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE." #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE) - #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE." #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH) - #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH." #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE) - #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE." #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE) - #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration." + #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE." #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) - #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH." #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH) - #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration." + #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH." #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT) - #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." + #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT." #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) - #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." + #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS." #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) - #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." + #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT." #elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." + #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND." #elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." + #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED." #elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." + #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED." #elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." + #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND." #elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." + #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED." #elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." + #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED." #elif defined(ENDSTOPS_ONLY_FOR_HOMING) #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #elif defined(HOMING_FEEDRATE) @@ -193,111 +193,111 @@ #elif defined(MANUAL_HOME_POSITIONS) #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." #elif defined(PID_ADD_EXTRUSION_RATE) - #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." + #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default." #elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." + #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT." #elif defined(MIN_Z_HEIGHT_FOR_HOMING) - #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." + #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT." #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) - #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." + #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES." #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) - #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." + #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES." #elif defined(MANUAL_BED_LEVELING) - #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration." + #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING." #elif defined(MESH_HOME_SEARCH_Z) - #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration." + #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE." #elif defined(MANUAL_PROBE_Z_RANGE) - #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration." + #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE." #elif !defined(MIN_STEPS_PER_SEGMENT) - #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h. + #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)." #elif MIN_STEPS_PER_SEGMENT <= 0 - #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h." + #error "MIN_STEPS_PER_SEGMENT must be at least 1." #elif defined(PREVENT_DANGEROUS_EXTRUDE) - #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration." + #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION." #elif defined(SCARA) - #error "SCARA is now MORGAN_SCARA. Please update your configuration." + #error "SCARA is now MORGAN_SCARA." #elif defined(ENABLE_AUTO_BED_LEVELING) #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #elif defined(AUTO_BED_LEVELING_FEATURE) #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." + #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y." #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]." #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) - #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]." #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) - #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]." #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) - #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]." #elif defined(UBL_G26_MESH_VALIDATION) - #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION." #elif defined(UBL_MESH_EDIT_ENABLED) - #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION." #elif defined(UBL_MESH_EDITING) - #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration." + #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION." #elif defined(BLTOUCH_HEATERS_OFF) - #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration." + #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF." #elif defined(BLTOUCH_V3) - #error "BLTOUCH_V3 is obsolete. Please update your configuration." + #error "BLTOUCH_V3 is obsolete." #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE) - #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete. Please update your configuration." + #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete." #elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." + #error "BEEPER is now BEEPER_PIN." #elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." + #error "SDCARDDETECT is now SD_DETECT_PIN." #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE) - #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions." + #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN." #elif defined(LCD_PIN_BL) - #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions." + #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN." #elif defined(LCD_PIN_RESET) - #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." + #error "LCD_PIN_RESET is now LCD_RESET_PIN." #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) - #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." + #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN." #elif defined(PID_FAN_SCALING) && !HAS_FAN #error "PID_FAN_SCALING needs at least one fan enabled." #elif defined(min_software_endstops) || defined(max_software_endstops) - #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." + #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS." #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." #elif defined(CONTROLLERFAN_PIN) - #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN." #elif defined(CONTROLLERFAN_SPEED) - #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE." #elif defined(CONTROLLERFAN_SECS) - #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME. Please update your Configuration_adv.h." + #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME." #elif defined(MIN_RETRACT) - #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h." + #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT." #elif defined(ADVANCE) - #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE." + #error "ADVANCE is now LIN_ADVANCE." #elif defined(LIN_ADVANCE_E_D_RATIO) - #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration." + #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO." #elif defined(NEOPIXEL_RGBW_LED) - #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration." + #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED." #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS) #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead." #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS) #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead." #elif defined(UBL_MESH_INSET) - #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration." + #error "UBL_MESH_INSET is now just MESH_INSET." #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y) - #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration." + #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]." #elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y) - #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." + #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it." #elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y) - #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." + #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it." #elif defined(MIN_PROBE_EDGE) - #error "MIN_PROBE_EDGE is now called PROBING_MARGIN. Please update your configuration." + #error "MIN_PROBE_EDGE is now called PROBING_MARGIN." #elif defined(MIN_PROBE_EDGE_LEFT) - #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT. Please update your configuration." + #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT." #elif defined(MIN_PROBE_EDGE_RIGHT) - #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT. Please update your configuration." + #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT." #elif defined(MIN_PROBE_EDGE_FRONT) - #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT. Please update your configuration." + #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT." #elif defined(MIN_PROBE_EDGE_BACK) - #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK. Please update your configuration." + #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK." #elif defined(LEFT_PROBE_BED_POSITION) #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead." #elif defined(RIGHT_PROBE_BED_POSITION) @@ -307,239 +307,229 @@ #elif defined(BACK_PROBE_BED_POSITION) #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead." #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY) - #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration." + #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY." #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE) - #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations." + #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE." #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN) - #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration." + #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES." #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1)) - #error "K1 is now PID_K1. Please update your configuration." + #error "K1 is now PID_K1." #elif defined(PROBE_DOUBLE_TOUCH) - #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration." + #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING." #elif defined(ANET_KEYPAD_LCD) - #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration." + #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD." #elif defined(LCD_I2C_SAINSMART_YWROBOT) - #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration." + #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)." #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) - #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration." + #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN." #elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(STEALTHCHOP) - #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h." + #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)." #elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(HAVE_TMC2130) - #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." + #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." #elif defined(HAVE_TMC2208) - #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." + #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." #elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." + #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470." #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \ || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \ || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." + #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." #elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \ || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130) - #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." + #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." #elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) || defined(Z3_IS_TMC2208) \ || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208) - #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." + #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." #elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) || defined(Z3_IS_L6470) \ || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) || defined(E6_IS_L6470) || defined(E7_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." + #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470." #elif defined(AUTOMATIC_CURRENT_CONTROL) - #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." + #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS." #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) - #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration." + #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH." #elif defined(LEVEL_CORNERS_INSET) - #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB . Please update your Configuration.h." + #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB." #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB) - #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h." + #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values." #elif defined(BEZIER_JERK_CONTROL) - #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration." + #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION." #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR) - #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration." + #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM." #elif defined(JUNCTION_ACCELERATION_FACTOR) #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h." #elif defined(JUNCTION_ACCELERATION) #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h." #elif defined(MAX7219_DEBUG_STEPPER_HEAD) - #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD." #elif defined(MAX7219_DEBUG_STEPPER_TAIL) - #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL." #elif defined(MAX7219_DEBUG_STEPPER_QUEUE) - #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." + #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE." #elif defined(ENDSTOP_NOISE_FILTER) - #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration." + #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]." #elif defined(RETRACT_ZLIFT) - #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h." + #error "RETRACT_ZLIFT is now RETRACT_ZRAISE." #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT) - #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE." #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE) - #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE." #elif defined(SINGLENOZZLE_SWAP_LENGTH) - #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration." + #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH." #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED) - #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration." + #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED." #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED) - #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration." + #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED." #elif defined(SINGLENOZZLE_SWAP_PARK) - #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration." + #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK." #elif defined(SINGLENOZZLE_TOOLCHANGE_XY) - #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration." + #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY." #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE) - #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration." + #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE." #elif defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE." #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE) - #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." + #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE." #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0 - #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration." + #error "G0_FEEDRATE is now used to set the G0 feedrate." #elif defined(MBL_Z_STEP) - #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration." + #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP." #elif defined(CHDK) - #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h." -#elif defined(MAX6675_SS) - #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." -#elif defined(MAX6675_SS2) - #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." + #error "CHDK is now CHDK_PIN." +#elif defined(MAX6675_SS) || defined(MAX6675_SS2) + #error "MAX6675_SS / MAX6675_SS2 is now MAX6675_SS_PIN / MAX6675_SS2_PIN." +#elif defined(MAX31865_SENSOR_OHMS) + #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0." +#elif defined(MAX31865_CALIBRATION_OHMS) + #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0." #elif defined(SPINDLE_LASER_ENABLE) - #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE." #elif defined(SPINDLE_LASER_ENABLE_PIN) - #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins." + #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN." #elif defined(SPINDLE_DIR_CHANGE) - #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h." + #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR." #elif defined(SPINDLE_STOP_ON_DIR_CHANGE) - #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h." + #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP." #elif defined(SPINDLE_LASER_ACTIVE_HIGH) - #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE." #elif defined(SPINDLE_LASER_ENABLE_INVERT) - #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE. Please update your Configuration_adv.h." + #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE." #elif defined(CUTTER_POWER_DISPLAY) - #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT. Please update your Configuration_adv.h." + #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT." #elif defined(CHAMBER_HEATER_PIN) - #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins." + #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN." #elif defined(TMC_Z_CALIBRATION) - #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION. Please update your configuration." + #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION." #elif defined(Z_MIN_PROBE_ENDSTOP) - #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h." + #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it." #elif defined(DUAL_NOZZLE_DUPLICATION_MODE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration." + #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION." #elif defined(MENU_ITEM_CASE_LIGHT) - #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU. Please update your configuration." + #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU." #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT. Please update your Configuration_adv.h." + #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT." #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE) - #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION. Please update your Configuration_adv.h." + #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION." #elif defined(USB_SD_DISABLED) - #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE. Please update your Configuration_adv.h." + #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE." #elif defined(USB_SD_ONBOARD) #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead." #elif defined(PSU_ACTIVE_HIGH) - #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE. Please update your configuration." + #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE." #elif POWER_SUPPLY == 1 #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'." #elif POWER_SUPPLY == 2 #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'." #elif defined(POWER_SUPPLY) - #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h." + #error "POWER_SUPPLY is now obsolete. Please remove it." #elif defined(MKS_ROBIN_TFT) - #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration." + #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT." #elif defined(SDPOWER) - #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." + #error "SDPOWER is now SDPOWER_PIN." #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) - #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h." + #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them." #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X) - #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting. Please update your configuration." + #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting." #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER) - #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET. Please update your configuration." + #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET." #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y) - #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them from Configuration.h." + #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them." #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X) - #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY. Please update your Configuration_adv.h." + #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY." #elif defined(JUNCTION_DEVIATION) - #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it from Configuration.h." + #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it." #elif defined(BABYSTEP_MULTIPLICATOR) - #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]. Please update Configuration_adv.h." + #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]." #elif defined(LULZBOT_TOUCH_UI) - #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE. Please update your configuration." + #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE." #elif defined(PS_DEFAULT_OFF) - #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF. Please update your configuration." + #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF." #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH) - #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT. Please update Configuration_adv.h." + #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT." #elif defined(FILAMENT_UNLOAD_DELAY) - #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY. Please update Configuration_adv.h." + #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY." #elif defined(HOME_USING_SPREADCYCLE) - #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it from Configuration_adv.h." + #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it." #elif defined(DGUS_LCD) - #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY). Please update your configuration." + #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)." #elif defined(DGUS_SERIAL_PORT) - #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT." #elif defined(DGUS_BAUDRATE) - #error "DGUS_BAUDRATE is now LCD_BAUDRATE. Please update your configuration." + #error "DGUS_BAUDRATE is now LCD_BAUDRATE." #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS) - #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS. Please update your configuration." -#elif defined(DGUS_SERIAL_PORT) - #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS." #elif defined(ANYCUBIC_LCD_SERIAL_PORT) - #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration." + #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT." #elif defined(INTERNAL_SERIAL_PORT) - #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT. Please update your configuration." -#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) - #error "X_DUAL_ENDSTOPS_ADJUSTMENT is now X2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." -#elif defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) - #error "Y_DUAL_ENDSTOPS_ADJUSTMENT is now Y2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." -#elif defined(Z_DUAL_ENDSTOPS_ADJUSTMENT) - #error "Z_DUAL_ENDSTOPS_ADJUSTMENT is now Z2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT." +#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT) + #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT." #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3) - #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT." #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4) - #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h." + #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT." #elif defined(Z_DUAL_STEPPER_DRIVERS) - #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2. Please update Configuration_adv.h." + #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2." #elif defined(Z_TRIPLE_STEPPER_DRIVERS) - #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3. Please update Configuration_adv.h." + #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3." #elif defined(Z_QUAD_STEPPER_DRIVERS) - #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4. Please update Configuration_adv.h." -#elif defined(Z_DUAL_ENDSTOPS) - #error "Z_DUAL_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." -#elif defined(Z_TRIPLE_ENDSTOPS) - #error "Z_TRIPLE_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." -#elif defined(Z_QUAD_ENDSTOPS) - #error "Z_QUAD_ENDSTOPS is now Z_MULTI_ENDSTOPS. Please update Configuration_adv.h." + #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4." +#elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS) + #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS." #elif defined(DUGS_UI_MOVE_DIS_OPTION) - #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION. Please update Configuration_adv.h." + #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION." #elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN) - #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN. Make sure your pins are up to date." + #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN." #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN) - #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN. Make sure your pins are up to date." + #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN." #elif defined(HOMING_BACKOFF_MM) - #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM. Please update Configuration_adv.h." + #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM." #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM) - #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM. Please update Configuration_adv.h." + #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM." #elif defined(DIGIPOT_I2C) - #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018). Please update Configuration_adv.h." + #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)." #elif defined(TOUCH_BUTTONS) - #error "TOUCH_BUTTONS is now TOUCH_SCREEN. Please update your Configuration.h." -#elif defined(LCD_FULL_PIXEL_HEIGHT) - #error "LCD_FULL_PIXEL_HEIGHT is deprecated and should be removed. Please update your Configuration.h." -#elif defined(LCD_FULL_PIXEL_WIDTH) - #error "LCD_FULL_PIXEL_WIDTH is deprecated and should be removed. Please update your Configuration.h." + #error "TOUCH_BUTTONS is now TOUCH_SCREEN." +#elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH) + #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed." #elif defined(FSMC_UPSCALE) - #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE. Please update your Configuration.h." + #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE." #elif defined(ANYCUBIC_TFT_MODEL) - #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA. Please update your Configuration.h." + #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA." #elif defined(EVENT_GCODE_SD_STOP) - #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT. Please update your Configuration.h." + #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT." #elif defined(GRAPHICAL_TFT_ROTATE_180) - #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180. Please update your Configuration.h." + #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180." #elif defined(FIL_RUNOUT_INVERTING) #if FIL_RUNOUT_INVERTING - #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH. Please update your Configuration.h." + #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH." #else - #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW. Please update your Configuration.h." + #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW." #endif #endif @@ -548,11 +538,11 @@ */ #if ENABLED(PROBE_TEMP_COMPENSATION) #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) - #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array). Please update Configuration_adv.h." + #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)." #elif !defined(PTC_PARK_POS) #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS." #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y) - #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array). Please update Configuration_adv.h." + #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)." #elif !defined(PTC_PROBE_POS) #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS." #endif @@ -582,6 +572,15 @@ /** * Serial */ +#ifndef SERIAL_PORT + #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 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops." @@ -594,12 +593,6 @@ #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." #endif -#ifndef SERIAL_PORT - #error "SERIAL_PORT must be defined in Configuration.h" -#elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT. Please update your configuration." -#endif - /** * Multiple Stepper Drivers Per Axis */ @@ -660,8 +653,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." -#elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) - #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN." #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX) #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX." #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX) @@ -814,18 +805,20 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif NUM_RUNOUT_SENSORS > E_STEPPERS #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." - #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN." - #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN." - #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN." - #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN." - #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6) - #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN." - #elif NONE(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." + #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2) + #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2." + #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3) + #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3." + #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4) + #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4." + #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5) + #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5." + #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6) + #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6." + #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7) + #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7." + #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8) + #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8." #elif FILAMENT_RUNOUT_DISTANCE_MM < 0 #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero." #elif DISABLED(ADVANCED_PAUSE_FEATURE) @@ -842,7 +835,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif DISABLED(NOZZLE_PARK_FEATURE) #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE." #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE) - #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE. Please add it to Configuration_adv.h." + #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE." #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER) @@ -889,24 +882,24 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #ifndef TOOLCHANGE_FS_LENGTH - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH." #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED." #elif !defined(TOOLCHANGE_FS_PRIME_SPEED) - #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED. Please update your Configuration_adv.h." + #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED." #endif #endif #if ENABLED(TOOLCHANGE_PARK) #ifndef TOOLCHANGE_PARK_XY - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration." + #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY." #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE) - #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration." + #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE." #endif #endif #ifndef TOOLCHANGE_ZRAISE - #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration_adv.h." + #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1." #endif #elif ENABLED(MK2_MULTIPLEXER) @@ -919,7 +912,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Sanity checking for the Průša MK2 Multiplexer */ #ifdef SNMM - #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration." + #error "SNMM is now MK2_MULTIPLEXER." #endif /** @@ -1218,7 +1211,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(EXT_SOLENOID) #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." #elif !HAS_SOLENOID_1 - #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." + #error "SOLENOID_PROBE requires SOL1_PIN." #endif #endif @@ -1385,7 +1378,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if IS_SCARA #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." #elif DISABLED(EEPROM_SETTINGS) - #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." + #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." #elif !defined(RESTORE_LEVELING_AFTER_G28) @@ -1545,7 +1538,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. */ #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY." + #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY." #endif /** @@ -1618,34 +1611,41 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal /** * Required custom thermistor settings */ -#if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA)) +#if HEATER_0_USER_THERMISTOR && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA)) #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA)) +#elif HEATER_1_USER_THERMISTOR && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA)) #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA)) +#elif HEATER_2_USER_THERMISTOR && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA)) #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA)) +#elif HEATER_3_USER_THERMISTOR && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA)) #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA)) +#elif HEATER_4_USER_THERMISTOR && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA)) #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) +#elif HEATER_5_USER_THERMISTOR && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_6_USER_THERMISTOR) && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA)) +#elif HEATER_6_USER_THERMISTOR && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA)) #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_7_USER_THERMISTOR) && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA)) +#elif HEATER_7_USER_THERMISTOR && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA)) #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) +#elif HEATER_BED_USER_THERMISTOR && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h." -#elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) +#elif HEATER_CHAMBER_USER_THERMISTOR && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h." #endif /** - * A Sensor ID has to be set for each heater + * Pins and Sensor IDs must be set for each heater */ +#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS) + #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." +#elif HAS_HOTEND && !HAS_TEMP_HOTEND + #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." +#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 + #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." +#endif #if HAS_MULTI_HOTEND - #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2) + #if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2) #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." #elif TEMP_SENSOR_1 == 0 #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." @@ -1767,22 +1767,22 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER) - #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN. Please add it to your configuration." + #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN." #endif #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2)) - #error "CHAMBER_FAN_MODE must be between 0 and 2. Please update your Configuration_adv.h." + #error "CHAMBER_FAN_MODE must be between 0 and 2." #endif #if ENABLED(CHAMBER_VENT) #ifndef CHAMBER_VENT_SERVO_NR - #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO. Update your Configuration_adv.h." + #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO." #elif !NUM_SERVOS #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)." #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS." #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR - #error "CHAMBER SERVO is already used by BLTOUCH. Please change." + #error "CHAMBER SERVO is already used by BLTOUCH." #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0) #error "SERVO0_PIN must be defined for your Heated Chamber vent servo." #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1) @@ -1796,7 +1796,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #if TEMP_SENSOR_PROBE #if !PIN_EXISTS(TEMP_PROBE) - #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN. Please add it to your configuration." + #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." #elif !HAS_TEMP_ADC_PROBE #error "TEMP_PROBE_PIN must be an ADC pin." #elif !ENABLED(FIX_MOUNTED_PROBE) @@ -1808,8 +1808,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif -#if ENABLED(MAX6675_IS_MAX31865) && (!defined(MAX31865_SENSOR_OHMS) || !defined(MAX31865_CALIBRATION_OHMS)) - #error "MAX31865_SENSOR_OHMS and MAX31865_CALIBRATION_OHMS must be set in Configuration.h when using a MAX31865 temperature sensor." +#if MAX6675_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0)) + #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865." +#elif MAX6675_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1)) + #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865." #endif /** @@ -1827,15 +1829,6 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "TEMP_SENSOR_0 is required if there are any extruders." #endif -// Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS) - #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif HAS_HOTEND && !HAS_TEMP_HOTEND - #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." -#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 - #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." -#endif - /** * Temperature status LEDs */ @@ -1962,6 +1955,10 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #error "Enable USE_ZMAX_PLUG when homing Z to MAX." #endif +#if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING) + #error "HOME_Z_FIRST can't be used when homing Z with a probe." +#endif + // Dual/multiple endstops requirements #if ENABLED(X_DUAL_ENDSTOPS) #if !X2_USE_ENDSTOP @@ -2196,6 +2193,14 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal #endif #endif +#if ENABLED(SD_IGNORE_AT_STARTUP) + #if ENABLED(POWER_LOSS_RECOVERY) + #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY." + #elif ENABLED(SDCARD_EEPROM_EMULATION) + #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION." + #endif +#endif + /** * Make sure only one display is enabled */ @@ -2313,17 +2318,17 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal */ #ifdef LCD_SERIAL_PORT #if LCD_SERIAL_PORT == SERIAL_PORT - #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT. Please update your configuration." + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT." #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2 - #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2. Please update your configuration." + #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2." #endif #else #if HAS_DGUS_LCD - #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined." #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON) - #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined." #elif ENABLED(MALYAN_LCD) - #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined in Configuration.h" + #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined." #endif #endif @@ -2812,7 +2817,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) - #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration." + #error "PRINTCOUNTER requires EEPROM_SETTINGS." #endif #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) @@ -2957,11 +2962,11 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1 #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION." #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION) - #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h." + #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION." #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY) - #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h." + #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS." #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS) - #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h." + #error "PHOTO_SWITCH_MS is required with CHDK_PIN." #elif defined(PHOTO_RETRACT_MM) static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0."); #endif @@ -3016,23 +3021,23 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'." #elif !PIN_EXISTS(PS_ON) #error "PSU_CONTROL requires PS_ON_PIN." + #elif POWER_OFF_DELAY < 0 + #error "POWER_OFF_DELAY must be a positive value." #endif -#elif ENABLED(AUTO_POWER_CONTROL) - #error "AUTO_POWER_CONTROL requires PSU_CONTROL." #endif #if HAS_CUTTER #ifndef CUTTER_POWER_UNIT - #error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h." + #error "CUTTER_POWER_UNIT is required with a spindle or laser." #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO) - #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO. Please update your Configuration_adv.h." + #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO." #endif #if ENABLED(LASER_POWER_INLINE) #if ENABLED(SPINDLE_CHANGE_DIR) #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible." #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER) - #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER. Please update your Configuration_adv.h." + #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER." #endif #if ENABLED(LASER_POWER_INLINE_TRAPEZOID) #if DISABLED(SPINDLE_LASER_PWM) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2cabf66bad..ca68856106 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-11-08" + #define STRING_DISTRIBUTION_DATE "2020-11-12" #endif /** diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index c745f971dc..aa5f990898 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -55,7 +55,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_MARLINUI_U8GLIB +#if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI) #include "HAL_LCD_com_defines.h" diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index a1d1217d6e..4725afb8bc 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -76,8 +76,8 @@ namespace Anycubic { #endif // Filament runout is handled by Marlin settings in Configuration.h - // set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. - // enable FIL_RUNOUT_PULLUP + // opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. + // opt_enable FIL_RUNOUT_PULL TFTSer.begin(115200); diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 2aaa0d0e33..6d15d937b9 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -87,7 +87,7 @@ void AnycubicTFTClass::OnSetup() { SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - SET_INPUT_PULLUP(FIL_RUNOUT_PIN); + SET_INPUT_PULLUP(FIL_RUNOUT1_PIN); #endif mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; @@ -935,7 +935,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() { #if ENABLED(FILAMENT_RUNOUT_SENSOR) // NOTE: ExtUI::getFilamentRunoutState() only returns the runout state if the job is printing // we want to actually check the status of the pin here, regardless of printstate - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { if (mediaPrintingState == AMPRINTSTATE_PRINTING || mediaPrintingState == AMPRINTSTATE_PAUSED || mediaPrintingState == AMPRINTSTATE_PAUSE_REQUESTED) { // play tone to indicate filament is out ExtUI::injectCommands_P(PSTR("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567")); @@ -983,7 +983,7 @@ void AnycubicTFTClass::PausePrint() { void AnycubicTFTClass::ResumePrint() { #if ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (READ(FIL_RUNOUT_PIN)) { + if (READ(FIL_RUNOUT1_PIN)) { #if ENABLED(ANYCUBIC_LCD_DEBUG) SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); #endif diff --git a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 41f72e8e53..09561edc02 100644 --- a/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -92,12 +92,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) - PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_STATE) + PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE) #else PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) #endif #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) - PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_STATE) + PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE) #else PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index 8f7279f5dd..befed7a646 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -181,7 +181,7 @@ static void disp_language(uint8_t language, uint8_t state) { strcat_P(public_buf_l, PSTR(".bin")); - lv_obj_set_event_cb_mks(obj, event_handler, id, nullptr, 0); + lv_obj_set_event_cb_mks(obj, event_handler, id, "", 0); lv_imgbtn_set_src_both(obj, public_buf_l); if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index f513ea4d0b..9014e88d75 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -279,7 +279,7 @@ void disp_gcode_icon(uint8_t file_num) { cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m); if (list_file.IsFolder[i]) { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); @@ -298,7 +298,7 @@ void disp_gcode_icon(uint8_t file_num) { strcat(test_public_buf_l, list_file.file_name[i]); char *temp = strstr(test_public_buf_l, ".GCO"); if (temp) strcpy(temp, ".bin"); - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l); if (i < 3) { lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET); @@ -308,7 +308,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -320,7 +320,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_btn_use_label_style(buttonText[i]); lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW); lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF); - //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0); + //lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0); lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100); lv_obj_set_size(buttonText[i], 100, 40); } @@ -328,7 +328,7 @@ void disp_gcode_icon(uint8_t file_num) { lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0); } else { - lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0); + lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0); lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin"); if (i < 3) lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index c7f5f418f5..58b593a128 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1680,7 +1680,7 @@ lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/, lv_style_t *style/*=&style_para_value*/) { lv_obj_t *btn = lv_btn_create(par, nullptr); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + lv_obj_set_event_cb_mks(btn, cb, id, "", 0); else lv_obj_set_event_cb(btn, cb); lv_btn_set_style_both(btn, style); @@ -1748,7 +1748,7 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, con lv_obj_t *btn = lv_imgbtn_create(par, nullptr); if (img) lv_imgbtn_set_src_both(btn, img); if (id) - lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + lv_obj_set_event_cb_mks(btn, cb, id, "", 0); else lv_obj_set_event_cb(btn, cb); lv_imgbtn_use_label_style(btn); @@ -1785,7 +1785,7 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_ lv_obj_t *btn = lv_btn_create(par, nullptr); /*Add a button the current screen*/ lv_obj_set_pos(btn, x, y); /*Set its position*/ lv_obj_set_size(btn, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/ - if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0); + if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, "", 0); lv_btn_use_label_style(btn); lv_btn_set_layout(btn, LV_LAYOUT_OFF); lv_obj_t *label = lv_label_create_empty(btn); /*Add a label to the button*/ diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 313abd4545..6f14c20d29 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -73,7 +73,7 @@ void lv_draw_wifi(void) { buttonReconnect = lv_imgbtn_create(scr, nullptr); - lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, nullptr, 0); + lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, "", 0); lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin"); lv_imgbtn_use_label_style(buttonReconnect); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 097263a655..d67cb8cc29 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -21,7 +21,7 @@ */ #include "../../../../inc/MarlinConfigPre.h" -#if HAS_TFT_LVGL_UI +#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION) #include "draw_ui.h" #include "wifi_module.h" @@ -822,4 +822,4 @@ int32_t wifi_upload(int type) { return esp_upload.uploadResult == success ? 0 : -1; } -#endif // HAS_TFT_LVGL_UI +#endif // HAS_TFT_LVGL_UI && USE_WIFI_FUNCTION diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 22b54c72de..4aaf621844 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -9,6 +9,8 @@ #include "../inc/MarlinConfig.h" +#define MAX_UTF8_CHAR_SIZE 4 + #if HAS_WIRED_LCD #include "marlinui.h" #include "../MarlinCore.h" @@ -79,6 +81,8 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t uint32_t val = 0; uint8_t *p = pstart; + #define NEXT_6_BITS() do{ val <<= 6; p++; valcur = cb_read_byte(p); val |= (valcur & 0x3F); }while(0) + uint8_t valcur = cb_read_byte(p); if (0 == (0x80 & valcur)) { val = valcur; @@ -86,74 +90,51 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t } else if (0xC0 == (0xE0 & valcur)) { val = valcur & 0x1F; - val <<= 6; - p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xE0 == (0xF0 & valcur)) { - val = valcur & 0x0F; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF0 == (0xF8 & valcur)) { - val = valcur & 0x07; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xF8 == (0xFC & valcur)) { - val = valcur & 0x03; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - p++; - } - else if (0xFC == (0xFE & valcur)) { - val = valcur & 0x01; - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); - val <<= 6; p++; - valcur = cb_read_byte(p); - val |= (valcur & 0x3F); + NEXT_6_BITS(); p++; } + #if MAX_UTF8_CHAR_SIZE >= 3 + else if (0xE0 == (0xF0 & valcur)) { + val = valcur & 0x0F; + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 4 + else if (0xF0 == (0xF8 & valcur)) { + val = valcur & 0x07; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 5 + else if (0xF8 == (0xFC & valcur)) { + val = valcur & 0x03; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif + #if MAX_UTF8_CHAR_SIZE >= 6 + else if (0xFC == (0xFE & valcur)) { + val = valcur & 0x01; + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + p++; + } + #endif else if (0x80 == (0xC0 & valcur)) for (; 0x80 == (0xC0 & valcur); ) { p++; valcur = cb_read_byte(p); } else - for (; ((0xFE & valcur) > 0xFC); ) { p++; valcur = cb_read_byte(p); } + for (; 0xFC < (0xFE & valcur); ) { p++; valcur = cb_read_byte(p); } if (pval) *pval = val; diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 6781b81d7c..2c78b14834 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -26,7 +26,7 @@ #include "../inc/MarlinConfigPre.h" -#if HAS_WIRED_LCD +#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT #include "lcdprint.h" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 1994e4094b..17c3c3edfe 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -262,67 +262,71 @@ millis_t MarlinUI::next_button_update_ms; // = 0 #endif - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { - SETCURSOR(col, row); - if (!string) return; + #if !HAS_GRAPHICAL_TFT - auto _newline = [&col, &row]{ - col = 0; row++; // Move col to string len (plus space) - SETCURSOR(0, row); // Simulate carriage return - }; + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { + SETCURSOR(col, row); + if (!string) return; - uint8_t *p = (uint8_t*)string; - wchar_t ch; - if (wordwrap) { - uint8_t *wrd = nullptr, c = 0; - // find the end of the part - for (;;) { - if (!wrd) wrd = p; // Get word start /before/ advancing - p = get_utf8_value_cb(p, cb_read_byte, &ch); - const bool eol = !ch; // zero ends the string - // End or a break between phrases? - if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { - if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces - // Past the right and the word is not too long? - if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? - c += !eol; // +1 so the space will be printed - col += c; // advance col to new position - while (c) { // character countdown - --c; // count down to zero - wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again - lcd_put_wchar(ch); // character to the LCD + auto _newline = [&col, &row]{ + col = 0; row++; // Move col to string len (plus space) + SETCURSOR(0, row); // Simulate carriage return + }; + + uint8_t *p = (uint8_t*)string; + wchar_t ch; + if (wordwrap) { + uint8_t *wrd = nullptr, c = 0; + // find the end of the part + for (;;) { + if (!wrd) wrd = p; // Get word start /before/ advancing + p = get_utf8_value_cb(p, cb_read_byte, &ch); + const bool eol = !ch; // zero ends the string + // End or a break between phrases? + if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { + if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces + // Past the right and the word is not too long? + if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? + c += !eol; // +1 so the space will be printed + col += c; // advance col to new position + while (c) { // character countdown + --c; // count down to zero + wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again + lcd_put_wchar(ch); // character to the LCD + } + if (eol) break; // all done! + wrd = nullptr; // set up for next word } - if (eol) break; // all done! - wrd = nullptr; // set up for next word + else c++; // count word characters + } + } + else { + for (;;) { + p = get_utf8_value_cb(p, cb_read_byte, &ch); + if (!ch) break; + lcd_put_wchar(ch); + col++; + if (col >= LCD_WIDTH) _newline(); } - else c++; // count word characters } } - else { - for (;;) { - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - lcd_put_wchar(ch); - col++; - if (col >= LCD_WIDTH) _newline(); - } - } - } - void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; - uint8_t col = 0, row = 0; - if (!string && plen + slen <= LCD_WIDTH) { - col = (LCD_WIDTH - plen - slen) / 2; - row = LCD_HEIGHT > 3 ? 1 : 0; + void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; + uint8_t col = 0, row = 0; + if (!string && plen + slen <= LCD_WIDTH) { + col = (LCD_WIDTH - plen - slen) / 2; + row = LCD_HEIGHT > 3 ? 1 : 0; + } + wrap_string_P(col, row, pref, true); + if (string) { + if (col) { col = 0; row++; } // Move to the start of the next line + wrap_string(col, row, string); + } + if (suff) wrap_string_P(col, row, suff); } - wrap_string_P(col, row, pref, true); - if (string) { - if (col) { col = 0; row++; } // Move to the start of the next line - wrap_string(col, row, string); - } - if (suff) wrap_string_P(col, row, suff); - } + + #endif // !HAS_GRAPHICAL_TFT #endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index d0b66aee45..ed02f4000b 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -80,12 +80,10 @@ #include "lcdprint.h" - void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); - inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } - inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } - - #if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" + #if !HAS_GRAPHICAL_TFT + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); + inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } + inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } #endif typedef void (*screenFunc_t)(); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index a102fe7e57..c9043a118b 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -43,9 +43,21 @@ float z_measured[G35_PROBE_COUNT] = { 0 }; static uint8_t tram_index = 0; bool probe_single_point() { + // In BLTOUCH HS mode, the probe travels in a deployed state. + // Users of Tramming Wizard might have a badly misaligned bed, so raise Z by the + // length of the deployed pin (BLTOUCH stroke < 7mm) + do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7)); const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true); DEBUG_ECHOLNPAIR("probe_single_point: ", z_probed_height, "mm"); z_measured[tram_index] = z_probed_height; + + #ifdef ASSISTED_TRAMMING_WAIT_POSITION + // Move XY to safe position + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Moving away"); + const xyz_pos_t wait_pos = ASSISTED_TRAMMING_WAIT_POSITION; + do_blocking_move_to(wait_pos, XY_PROBE_FEEDRATE_MM_S); + #endif + return !isnan(z_probed_height); } diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 999cec29ba..559bc5b222 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -649,7 +649,7 @@ void menu_item(const uint8_t row, bool sel ) { menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); #if ENABLED(TOUCH_SCREEN) const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM; - touch.add_control(tct, 0, 2 + 34 * row, 320, 32, encoderTopLine + row); + touch.add_control(tct, 0, 2 + 34 * row, TFT_WIDTH, 32, encoderTopLine + row); #endif } diff --git a/Marlin/src/lcd/touch/touch_buttons.h b/Marlin/src/lcd/touch/touch_buttons.h index bf05d2bae5..a79bb15be4 100644 --- a/Marlin/src/lcd/touch/touch_buttons.h +++ b/Marlin/src/lcd/touch/touch_buttons.h @@ -47,7 +47,7 @@ #define BUTTONC_X_LO BUTTONB_X_HI + BUTTON_SPACING #define BUTTONC_X_HI BUTTONC_X_LO + BUTTON_WIDTH - 1 -#define BUTTON_Y_HI (TFT_HEIGHT) - (BUTTON_SPACING / 2) +#define BUTTON_Y_HI (TFT_HEIGHT) - BUTTON_SPACING #define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT class TouchButtons { diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 825194cf45..697ced7833 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -459,18 +459,19 @@ void _O2 Endstops::report_states() { #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); + print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); #else - #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break; + #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break; LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) { pin_t pin; + uint8_t state; switch (i) { default: continue; REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _CASE_RUNOUT) } SERIAL_ECHOPGM(STR_FILAMENT_RUNOUT_SENSOR); if (i > 1) SERIAL_CHAR(' ', '0' + i); - print_es_state(extDigitalRead(pin) != FIL_RUNOUT_STATE); + print_es_state(extDigitalRead(pin) != state); } #undef _CASE_RUNOUT #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index d008720389..ff80063d65 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -667,8 +667,8 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise if (bltouch.triggered()) bltouch._reset(); #endif - // TODO: Adapt for SCARA, where the offset rotates - xyz_pos_t npos = { rx, ry }; + // On delta keep Z below clip height or do_blocking_move_to will abort + xyz_pos_t npos = { rx, ry, _MIN(TERN(DELTA, delta_clip_start_height, current_position.z), current_position.z) }; if (probe_relative) { // The given position is in terms of the probe if (!can_reach(npos)) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable"); @@ -678,15 +678,6 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise } else if (!position_is_reachable(npos)) return NAN; // The given position is in terms of the nozzle - npos.z = - #if ENABLED(DELTA) - // Move below clip height or xy move will be aborted by do_blocking_move_to - _MIN(current_position.z, delta_clip_start_height) - #else - current_position.z - #endif - ; - const float old_feedrate_mm_s = feedrate_mm_s; feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 4eb7216511..167b35cc2b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -44,30 +44,44 @@ #include "../lcd/extui/ui_api.h" #endif -#if ENABLED(MAX6675_IS_MAX31865) +#if MAX6675_0_IS_MAX31865 || MAX6675_1_IS_MAX31865 #include - #ifndef MAX31865_CS_PIN - #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example + #if MAX6675_0_IS_MAX31865 && !defined(MAX31865_CS_PIN) && PIN_EXISTS(MAX6675_SS) + #define MAX31865_CS_PIN MAX6675_SS_PIN + #endif + #if MAX6675_1_IS_MAX31865 && !defined(MAX31865_CS2_PIN) && PIN_EXISTS(MAX6675_SS2) + #define MAX31865_CS2_PIN MAX6675_SS2_PIN #endif #ifndef MAX31865_MOSI_PIN - #define MAX31865_MOSI_PIN MOSI_PIN // 63 + #define MAX31865_MOSI_PIN MOSI_PIN #endif #ifndef MAX31865_MISO_PIN - #define MAX31865_MISO_PIN MAX6675_DO_PIN // 42 + #define MAX31865_MISO_PIN MAX6675_DO_PIN #endif #ifndef MAX31865_SCK_PIN - #define MAX31865_SCK_PIN MAX6675_SCK_PIN // 40 + #define MAX31865_SCK_PIN MAX6675_SCK_PIN + #endif + #if MAX6675_0_IS_MAX31865 && PIN_EXISTS(MAX31865_CS) + #define HAS_MAX31865 1 + Adafruit_MAX31865 max31865_0 = Adafruit_MAX31865(MAX31865_CS_PIN + #if MAX31865_CS_PIN != MAX6675_SS_PIN + , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK + #endif + ); + #endif + #if MAX6675_1_IS_MAX31865 && PIN_EXISTS(MAX31865_CS2) + #define HAS_MAX31865 1 + Adafruit_MAX31865 max31865_1 = Adafruit_MAX31865(MAX31865_CS2_PIN + #if MAX31865_CS2_PIN != MAX6675_SS2_PIN + , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK + #endif + ); #endif - Adafruit_MAX31865 max31865 = Adafruit_MAX31865(MAX31865_CS_PIN - #if MAX31865_CS_PIN != MAX6675_SS_PIN - , MAX31865_MOSI_PIN // For software SPI also set MOSI/MISO/SCK - , MAX31865_MISO_PIN - , MAX31865_SCK_PIN - #endif - ); #endif -#define MAX6675_SEPARATE_SPI (EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PINS_EXIST(MAX6675_SCK, MAX6675_DO)) +#if EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PINS_EXIST(MAX6675_SCK, MAX6675_DO) + #define MAX6675_SEPARATE_SPI 1 +#endif #if MAX6675_SEPARATE_SPI #include "../libs/private_spi.h" @@ -114,7 +128,13 @@ #if HAS_SERVOS #include "./servo.h" #endif -#if HOTEND_USES_THERMISTOR + +#if ANY(HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \ + HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR ) + #define HAS_HOTEND_THERMISTOR 1 +#endif + +#if HAS_HOTEND_THERMISTOR #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static const temp_entry_t* heater_ttbl_map[2] = { HEATER_0_TEMPTABLE, HEATER_1_TEMPTABLE }; static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; @@ -1046,11 +1066,11 @@ void Temperature::manage_heater() { updateTemperaturesFromRawValues(); // also resets the watchdog #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS) - #if ENABLED(HEATER_0_USES_MAX6675) + #if HEATER_0_USES_MAX6675 if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); #endif - #if ENABLED(HEATER_1_USES_MAX6675) + #if HEATER_1_USES_MAX6675 if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); #endif @@ -1336,34 +1356,34 @@ void Temperature::manage_heater() { void Temperature::reset_user_thermistors() { user_thermistor_t user_thermistor[USER_THERMISTORS] = { - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 }, #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 }, #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 }, #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 }, #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, #endif - #if ENABLED(HEATER_6_USER_THERMISTOR) + #if HEATER_6_USER_THERMISTOR { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 }, #endif - #if ENABLED(HEATER_7_USER_THERMISTOR) + #if HEATER_7_USER_THERMISTOR { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 }, #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 } #endif }; @@ -1462,91 +1482,85 @@ void Temperature::manage_heater() { switch (e) { case 0: - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); - #elif ENABLED(HEATER_0_USES_MAX6675) - return ( - #if ENABLED(MAX6675_IS_MAX31865) - max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS) - #else - raw * 0.25 - #endif - ); - #elif ENABLED(HEATER_0_USES_AD595) + #elif HEATER_0_USES_MAX6675 + return TERN(MAX6675_0_IS_MAX31865, max31865_0.temperature(MAX31865_SENSOR_OHMS_0, MAX31865_CALIBRATION_OHMS_0), raw * 0.25); + #elif HEATER_0_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_0_USES_AD8495) + #elif HEATER_0_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 1: - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); - #elif ENABLED(HEATER_1_USES_MAX6675) - return raw * 0.25; - #elif ENABLED(HEATER_1_USES_AD595) + #elif HEATER_1_USES_MAX6675 + return TERN(MAX6675_1_IS_MAX31865, max31865_1.temperature(MAX31865_SENSOR_OHMS_1, MAX31865_CALIBRATION_OHMS_1), raw * 0.25); + #elif HEATER_1_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_1_USES_AD8495) + #elif HEATER_1_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 2: - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); - #elif ENABLED(HEATER_2_USES_AD595) + #elif HEATER_2_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_2_USES_AD8495) + #elif HEATER_2_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 3: - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); - #elif ENABLED(HEATER_3_USES_AD595) + #elif HEATER_3_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_3_USES_AD8495) + #elif HEATER_3_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 4: - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); - #elif ENABLED(HEATER_4_USES_AD595) + #elif HEATER_4_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_USES_AD8495) + #elif HEATER_4_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 5: - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); - #elif ENABLED(HEATER_5_USES_AD595) + #elif HEATER_5_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_5_USES_AD8495) + #elif HEATER_5_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 6: - #if ENABLED(HEATER_6_USER_THERMISTOR) + #if HEATER_6_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_6, raw); - #elif ENABLED(HEATER_6_USES_AD595) + #elif HEATER_6_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_6_USES_AD8495) + #elif HEATER_6_USES_AD8495 return TEMP_AD8495(raw); #else break; #endif case 7: - #if ENABLED(HEATER_7_USER_THERMISTOR) + #if HEATER_7_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_HOTEND_7, raw); - #elif ENABLED(HEATER_7_USES_AD595) + #elif HEATER_7_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_7_USES_AD8495) + #elif HEATER_7_USES_AD8495 return TEMP_AD8495(raw); #else break; @@ -1554,7 +1568,7 @@ void Temperature::manage_heater() { default: break; } - #if HOTEND_USES_THERMISTOR + #if HAS_HOTEND_THERMISTOR // Thermistor with conversion table? const temp_entry_t(*tt)[] = (temp_entry_t(*)[])(heater_ttbl_map[e]); SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); @@ -1568,13 +1582,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. float Temperature::analog_to_celsius_bed(const int raw) { - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_BED, raw); - #elif ENABLED(HEATER_BED_USES_THERMISTOR) + #elif HEATER_BED_USES_THERMISTOR SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN); - #elif ENABLED(HEATER_BED_USES_AD595) + #elif HEATER_BED_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_BED_USES_AD8495) + #elif HEATER_BED_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1587,13 +1601,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For chamber temperature measurement. float Temperature::analog_to_celsius_chamber(const int raw) { - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_CHAMBER, raw); - #elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR) + #elif HEATER_CHAMBER_USES_THERMISTOR SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN); - #elif ENABLED(HEATER_CHAMBER_USES_AD595) + #elif HEATER_CHAMBER_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(HEATER_CHAMBER_USES_AD8495) + #elif HEATER_CHAMBER_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1606,13 +1620,13 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For probe temperature measurement. float Temperature::analog_to_celsius_probe(const int raw) { - #if ENABLED(PROBE_USER_THERMISTOR) + #if HEATER_PROBE_USER_THERMISTOR return user_thermistor_to_deg_c(CTI_PROBE, raw); - #elif ENABLED(PROBE_USES_THERMISTOR) + #elif HEATER_PROBE_USES_THERMISTOR SCAN_THERMISTOR_TABLE(PROBE_TEMPTABLE, PROBE_TEMPTABLE_LEN); - #elif ENABLED(PROBE_USES_AD595) + #elif HEATER_PROBE_USES_AD595 return TEMP_AD595(raw); - #elif ENABLED(PROBE_USES_AD8495) + #elif HEATER_PROBE_USES_AD8495 return TEMP_AD8495(raw); #else UNUSED(raw); @@ -1628,16 +1642,11 @@ void Temperature::manage_heater() { * as it would block the stepper routine. */ void Temperature::updateTemperaturesFromRawValues() { - #if ENABLED(HEATER_0_USES_MAX6675) - temp_hotend[0].raw = READ_MAX6675(0); - #endif - #if ENABLED(HEATER_1_USES_MAX6675) - temp_hotend[1].raw = READ_MAX6675(1); - #endif + TERN_(HEATER_0_USES_MAX6675, temp_hotend[0].raw = READ_MAX6675(0)); + TERN_(HEATER_1_USES_MAX6675, temp_hotend[1].raw = READ_MAX6675(1)); #if HAS_HOTEND HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); #endif - TERN_(HAS_HEATED_BED, temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw)); TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw)); TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw)); @@ -1690,7 +1699,8 @@ void Temperature::updateTemperaturesFromRawValues() { */ void Temperature::init() { - TERN_(MAX6675_IS_MAX31865, max31865.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE + TERN_(MAX6675_0_IS_MAX31865, max31865_0.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE + TERN_(MAX6675_1_IS_MAX31865, max31865_1.begin(MAX31865_2WIRE)); #if EARLY_WATCHDOG // Flag that the thermalManager should be running @@ -1700,7 +1710,7 @@ void Temperature::init() { #if MB(RUMBA) // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector - #define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495) + #define _AD(N) (HEATER_##N##_USES_AD595 || HEATER_##N##_USES_AD8495) #if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER) MCUCR = _BV(JTD); MCUCR = _BV(JTD); @@ -1789,22 +1799,7 @@ void Temperature::init() { INIT_FAN_PIN(CONTROLLER_FAN_PIN); #endif - #if MAX6675_SEPARATE_SPI - - OUT_WRITE(SCK_PIN, LOW); - OUT_WRITE(MOSI_PIN, HIGH); - SET_INPUT_PULLUP(MISO_PIN); - - max6675_spi.init(); - - OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS_PIN, HIGH); - - #endif - - #if ENABLED(HEATER_1_USES_MAX6675) - OUT_WRITE(MAX6675_SS2_PIN, HIGH); - #endif + TERN_(MAX6675_SEPARATE_SPI, max6675_spi.init()); HAL_adc_init(); @@ -2199,50 +2194,64 @@ void Temperature::disable_all_heaters() { #define THERMOCOUPLE_MAX_ERRORS 15 #endif - int Temperature::read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex - #endif - ) { - #if COUNT_6675 == 1 - constexpr uint8_t hindex = 0; - #else - // Needed to return the correct temp when this is called too soon - static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; - #endif - - static uint8_t max6675_errors[COUNT_6675] = { 0 }; - + int Temperature::read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex/*=0*/)) { #define MAX6675_HEAT_INTERVAL 250UL - #if ENABLED(MAX6675_IS_MAX31855) + #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855 static uint32_t max6675_temp = 2000; #define MAX6675_ERROR_MASK 7 #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 + #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 + #elif HAS_MAX31865 + static uint16_t max6675_temp = 2000; // From datasheet 16 bits D15-D0 + #define MAX6675_ERROR_MASK 1 // D0 Bit not used + #define MAX6675_DISCARD_BITS 1 // Data is in D15-D1 + #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 #else static uint16_t max6675_temp = 2000; #define MAX6675_ERROR_MASK 4 #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 + #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 #endif + #if HAS_MULTI_6675 + // Needed to return the correct temp when this is called between readings + static uint16_t max6675_temp_previous[COUNT_6675] = { 0 }; + #define MAX6675_TEMP(I) max6675_temp_previous[I] + #define MAX6675_SEL(A,B) (hindex ? (B) : (A)) + #define MAX6675_WRITE(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) + #define MAX6675_SET_OUTPUT() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) + #else + constexpr uint8_t hindex = 0; + #define MAX6675_TEMP(I) max6675_temp + #if MAX6675_1_IS_MAX31865 + #define MAX6675_SEL(A,B) B + #else + #define MAX6675_SEL(A,B) A + #endif + #if HEATER_0_USES_MAX6675 + #define MAX6675_WRITE(V) WRITE(MAX6675_SS_PIN, V) + #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS_PIN) + #else + #define MAX6675_WRITE(V) WRITE(MAX6675_SS2_PIN, V) + #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS2_PIN) + #endif + #endif + + static uint8_t max6675_errors[COUNT_6675] = { 0 }; + // Return last-read value between readings static millis_t next_max6675_ms[COUNT_6675] = { 0 }; millis_t ms = millis(); - if (PENDING(ms, next_max6675_ms[hindex])) - return int( - #if COUNT_6675 == 1 - max6675_temp - #else - max6675_temp_previous[hindex] // Need to return the correct previous value - #endif - ); - + if (PENDING(ms, next_max6675_ms[hindex])) return int(MAX6675_TEMP(hindex)); next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; - #if ENABLED(MAX6675_IS_MAX31865) - max6675_temp = int(max31865.temperature(MAX31865_SENSOR_OHMS, MAX31865_CALIBRATION_OHMS)); + #if HAS_MAX31865 + Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1); + max6675_temp = int(maxref.temperature( + MAX6675_SEL(MAX31865_SENSOR_OHMS_0, MAX31865_SENSOR_OHMS_1), + MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1) + )); #endif // @@ -2253,39 +2262,22 @@ void Temperature::disable_all_heaters() { spiInit(MAX6675_SPEED_BITS); #endif - #if COUNT_6675 > 1 - #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) - #define SET_OUTPUT_MAX6675() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN); break; default: SET_OUTPUT(MAX6675_SS_PIN); } }while(0) - #elif ENABLED(HEATER_1_USES_MAX6675) - #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS2_PIN) - #else - #define WRITE_MAX6675(V) WRITE(MAX6675_SS_PIN, V) - #define SET_OUTPUT_MAX6675() SET_OUTPUT(MAX6675_SS_PIN) - #endif - - SET_OUTPUT_MAX6675(); - WRITE_MAX6675(LOW); // enable TT_MAX6675 - + MAX6675_WRITE(LOW); // enable TT_MAX6675 DELAY_NS(100); // Ensure 100ns delay // Read a big-endian temperature value max6675_temp = 0; for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= ( - #if MAX6675_SEPARATE_SPI - max6675_spi.receive() - #else - spiRec() - #endif - ); + max6675_temp |= TERN(MAX6675_SEPARATE_SPI, max6675_spi.receive(), spiRec()); if (i > 0) max6675_temp <<= 8; // shift left if not the last byte } - WRITE_MAX6675(HIGH); // disable TT_MAX6675 + MAX6675_WRITE(HIGH); // disable TT_MAX6675 - if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK)) { - max6675_errors[hindex] += 1; + const uint8_t fault_31865 = TERN1(HAS_MAX31865, maxref.readFault()); + + if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK) && fault_31865) { + max6675_errors[hindex]++; if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) { SERIAL_ERROR_START(); SERIAL_ECHOPGM("Temp measurement error! "); @@ -2297,18 +2289,29 @@ void Temperature::disable_all_heaters() { SERIAL_ECHOLNPGM("Short to GND"); else if (max6675_temp & 4) SERIAL_ECHOLNPGM("Short to VCC"); + #elif HAS_MAX31865 + if (fault_31865) { + maxref.clearFault(); + SERIAL_ECHOPAIR("MAX31865 Fault :(", fault_31865, ") >>"); + if (fault_31865 & MAX31865_FAULT_HIGHTHRESH) + SERIAL_ECHOLNPGM("RTD High Threshold"); + else if (fault_31865 & MAX31865_FAULT_LOWTHRESH) + SERIAL_ECHOLNPGM("RTD Low Threshold"); + else if (fault_31865 & MAX31865_FAULT_REFINLOW) + SERIAL_ECHOLNPGM("REFIN- > 0.85 x Bias"); + else if (fault_31865 & MAX31865_FAULT_REFINHIGH) + SERIAL_ECHOLNPGM("REFIN- < 0.85 x Bias - FORCE- open"); + else if (fault_31865 & MAX31865_FAULT_RTDINLOW) + SERIAL_ECHOLNPGM("REFIN- < 0.85 x Bias - FORCE- open"); + else if (fault_31865 & MAX31865_FAULT_OVUV) + SERIAL_ECHOLNPGM("Under/Over voltage"); + } #else SERIAL_ECHOLNPGM("MAX6675"); #endif // Thermocouple open - max6675_temp = 4 * ( - #if COUNT_6675 > 1 - hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX - #else - TERN(HEATER_1_USES_MAX6675, HEATER_1_MAX6675_TMAX, HEATER_0_MAX6675_TMAX) - #endif - ); + max6675_temp = 4 * MAX6675_SEL(HEATER_0_MAX6675_TMAX, HEATER_1_MAX6675_TMAX); } else max6675_temp >>= MAX6675_DISCARD_BITS; @@ -2318,13 +2321,11 @@ void Temperature::disable_all_heaters() { max6675_errors[hindex] = 0; } - #if ENABLED(MAX6675_IS_MAX31855) + #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855 if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature #endif - #if COUNT_6675 > 1 - max6675_temp_previous[hindex] = max6675_temp; - #endif + MAX6675_TEMP(hindex) = max6675_temp; return int(max6675_temp); } @@ -2336,14 +2337,14 @@ void Temperature::disable_all_heaters() { */ void Temperature::update_raw_temperatures() { - #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) + #if HAS_TEMP_ADC_0 && !HEATER_0_USES_MAX6675 temp_hotend[0].update(); #endif #if HAS_TEMP_ADC_1 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = temp_hotend[1].acc; - #elif DISABLED(HEATER_1_USES_MAX6675) + #elif !HEATER_1_USES_MAX6675 temp_hotend[1].update(); #endif #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index c3c3ce2d8b..edaa1c5384 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -253,31 +253,31 @@ typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t; #if HAS_USER_THERMISTORS enum CustomThermistorIndex : uint8_t { - #if ENABLED(HEATER_0_USER_THERMISTOR) + #if HEATER_0_USER_THERMISTOR CTI_HOTEND_0, #endif - #if ENABLED(HEATER_1_USER_THERMISTOR) + #if HEATER_1_USER_THERMISTOR CTI_HOTEND_1, #endif - #if ENABLED(HEATER_2_USER_THERMISTOR) + #if HEATER_2_USER_THERMISTOR CTI_HOTEND_2, #endif - #if ENABLED(HEATER_3_USER_THERMISTOR) + #if HEATER_3_USER_THERMISTOR CTI_HOTEND_3, #endif - #if ENABLED(HEATER_4_USER_THERMISTOR) + #if HEATER_4_USER_THERMISTOR CTI_HOTEND_4, #endif - #if ENABLED(HEATER_5_USER_THERMISTOR) + #if HEATER_5_USER_THERMISTOR CTI_HOTEND_5, #endif - #if ENABLED(HEATER_BED_USER_THERMISTOR) + #if HEATER_BED_USER_THERMISTOR CTI_BED, #endif - #if ENABLED(HEATER_PROBE_USER_THERMISTOR) + #if HEATER_PROBE_USER_THERMISTOR CTI_PROBE, #endif - #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR) + #if HEATER_CHAMBER_USER_THERMISTOR CTI_CHAMBER, #endif USER_THERMISTORS @@ -811,15 +811,12 @@ class Temperature { #if HAS_MAX6675 #define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) #if COUNT_6675 > 1 + #define HAS_MULTI_6675 1 #define READ_MAX6675(N) read_max6675(N) #else #define READ_MAX6675(N) read_max6675() #endif - static int read_max6675( - #if COUNT_6675 > 1 - const uint8_t hindex=0 - #endif - ); + static int read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex=0)); #endif static void checkExtruderAutoFans(); diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index ab92102de3..340712e22d 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -206,7 +206,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_0 #define HEATER_0_TEMPTABLE TT_NAME(THERMISTOR_HEATER_0) #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) -#elif defined(HEATER_0_USES_THERMISTOR) +#elif HEATER_0_USES_THERMISTOR #error "No heater 0 thermistor table specified" #else #define HEATER_0_TEMPTABLE nullptr @@ -216,7 +216,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_1 #define HEATER_1_TEMPTABLE TT_NAME(THERMISTOR_HEATER_1) #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) -#elif defined(HEATER_1_USES_THERMISTOR) +#elif HEATER_1_USES_THERMISTOR #error "No heater 1 thermistor table specified" #else #define HEATER_1_TEMPTABLE nullptr @@ -226,7 +226,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_2 #define HEATER_2_TEMPTABLE TT_NAME(THERMISTOR_HEATER_2) #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) -#elif defined(HEATER_2_USES_THERMISTOR) +#elif HEATER_2_USES_THERMISTOR #error "No heater 2 thermistor table specified" #else #define HEATER_2_TEMPTABLE nullptr @@ -236,7 +236,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_3 #define HEATER_3_TEMPTABLE TT_NAME(THERMISTOR_HEATER_3) #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) -#elif defined(HEATER_3_USES_THERMISTOR) +#elif HEATER_3_USES_THERMISTOR #error "No heater 3 thermistor table specified" #else #define HEATER_3_TEMPTABLE nullptr @@ -246,7 +246,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_4 #define HEATER_4_TEMPTABLE TT_NAME(THERMISTOR_HEATER_4) #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) -#elif defined(HEATER_4_USES_THERMISTOR) +#elif HEATER_4_USES_THERMISTOR #error "No heater 4 thermistor table specified" #else #define HEATER_4_TEMPTABLE nullptr @@ -256,7 +256,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_5 #define HEATER_5_TEMPTABLE TT_NAME(THERMISTOR_HEATER_5) #define HEATER_5_TEMPTABLE_LEN COUNT(HEATER_5_TEMPTABLE) -#elif defined(HEATER_5_USES_THERMISTOR) +#elif HEATER_5_USES_THERMISTOR #error "No heater 5 thermistor table specified" #else #define HEATER_5_TEMPTABLE nullptr @@ -266,7 +266,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_6 #define HEATER_6_TEMPTABLE TT_NAME(THERMISTOR_HEATER_6) #define HEATER_6_TEMPTABLE_LEN COUNT(HEATER_6_TEMPTABLE) -#elif defined(HEATER_6_USES_THERMISTOR) +#elif HEATER_6_USES_THERMISTOR #error "No heater 6 thermistor table specified" #else #define HEATER_6_TEMPTABLE nullptr @@ -276,7 +276,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #if THERMISTOR_HEATER_7 #define HEATER_7_TEMPTABLE TT_NAME(THERMISTOR_HEATER_7) #define HEATER_7_TEMPTABLE_LEN COUNT(HEATER_7_TEMPTABLE) -#elif defined(HEATER_7_USES_THERMISTOR) +#elif HEATER_7_USES_THERMISTOR #error "No heater 7 thermistor table specified" #else #define HEATER_7_TEMPTABLE nullptr @@ -286,7 +286,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORBED #define BED_TEMPTABLE TT_NAME(THERMISTORBED) #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE) -#elif defined(HEATER_BED_USES_THERMISTOR) +#elif HEATER_BED_USES_THERMISTOR #error "No bed thermistor table specified" #else #define BED_TEMPTABLE_LEN 0 @@ -295,7 +295,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORCHAMBER #define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER) #define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE) -#elif defined(HEATER_CHAMBER_USES_THERMISTOR) +#elif HEATER_CHAMBER_USES_THERMISTOR #error "No chamber thermistor table specified" #else #define CHAMBER_TEMPTABLE_LEN 0 @@ -304,7 +304,7 @@ typedef struct { int16_t value, celsius; } temp_entry_t; #ifdef THERMISTORPROBE #define PROBE_TEMPTABLE TT_NAME(THERMISTORPROBE) #define PROBE_TEMPTABLE_LEN COUNT(PROBE_TEMPTABLE) -#elif defined(HEATER_PROBE_USES_THERMISTOR) +#elif HEATER_PROBE_USES_THERMISTOR #error "No probe thermistor table specified" #else #define PROBE_TEMPTABLE_LEN 0 @@ -402,7 +402,7 @@ static_assert( #endif #ifndef HEATER_0_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_0) || !defined(HEATER_0_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_0) || !HEATER_0_USES_THERMISTOR #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_0_RAW_LO_TEMP 0 #else @@ -411,7 +411,7 @@ static_assert( #endif #endif #ifndef HEATER_1_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_1) || !defined(HEATER_1_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_1) || !HEATER_1_USES_THERMISTOR #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_1_RAW_LO_TEMP 0 #else @@ -420,7 +420,7 @@ static_assert( #endif #endif #ifndef HEATER_2_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_2) || !defined(HEATER_2_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_2) || !HEATER_2_USES_THERMISTOR #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_2_RAW_LO_TEMP 0 #else @@ -429,7 +429,7 @@ static_assert( #endif #endif #ifndef HEATER_3_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_3) || !defined(HEATER_3_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_3) || !HEATER_3_USES_THERMISTOR #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_3_RAW_LO_TEMP 0 #else @@ -438,7 +438,7 @@ static_assert( #endif #endif #ifndef HEATER_4_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_4) || !defined(HEATER_4_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_4) || !HEATER_4_USES_THERMISTOR #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_4_RAW_LO_TEMP 0 #else @@ -447,7 +447,7 @@ static_assert( #endif #endif #ifndef HEATER_5_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_5) || !defined(HEATER_5_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_5) || !HEATER_5_USES_THERMISTOR #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_5_RAW_LO_TEMP 0 #else @@ -456,7 +456,7 @@ static_assert( #endif #endif #ifndef HEATER_6_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_6) || !defined(HEATER_6_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_6) || !HEATER_6_USES_THERMISTOR #define HEATER_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_6_RAW_LO_TEMP 0 #else @@ -465,7 +465,7 @@ static_assert( #endif #endif #ifndef HEATER_7_RAW_HI_TEMP - #if TT_REV(THERMISTOR_HEATER_7) || !defined(HEATER_7_USES_THERMISTOR) + #if TT_REV(THERMISTOR_HEATER_7) || !HEATER_7_USES_THERMISTOR #define HEATER_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_7_RAW_LO_TEMP 0 #else @@ -474,7 +474,7 @@ static_assert( #endif #endif #ifndef HEATER_BED_RAW_HI_TEMP - #if TT_REV(THERMISTORBED) || !defined(HEATER_BED_USES_THERMISTOR) + #if TT_REV(THERMISTORBED) || !HEATER_BED_USES_THERMISTOR #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_BED_RAW_LO_TEMP 0 #else @@ -483,7 +483,7 @@ static_assert( #endif #endif #ifndef HEATER_CHAMBER_RAW_HI_TEMP - #if TT_REV(THERMISTORCHAMBER) || !defined(HEATER_CHAMBER_USES_THERMISTOR) + #if TT_REV(THERMISTORCHAMBER) || !HEATER_CHAMBER_USES_THERMISTOR #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_CHAMBER_RAW_LO_TEMP 0 #else @@ -492,7 +492,7 @@ static_assert( #endif #endif #ifndef HEATER_PROBE_RAW_HI_TEMP - #if TT_REV(THERMISTORPROBE) || !defined(HEATER_PROBE_USES_THERMISTOR) + #if TT_REV(THERMISTORPROBE) || !HEATER_PROBE_USES_THERMISTOR #define HEATER_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_PROBE_RAW_LO_TEMP 0 #else 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 14bac7d723..bb2cacd5ba 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -208,31 +208,57 @@ #define E1_SERIAL_TX_PIN P1_01 #define E1_SERIAL_RX_PIN P1_01 - #define Z2_SERIAL_TX_PIN P1_01 - #define Z2_SERIAL_RX_PIN P1_01 - // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 #endif +/* _____ _____ + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | 1.31 1.23 | 3 4 | 1.22 + * 0.18 | 5 6 3.25 1.21 | 5 6 1.20 + * 0.16 | 7 8 | 3.26 1.19 | 7 8 | 1.18 + * 0.15 | 9 10| 0.17 0.28 | 9 10| 1.30 + * ----- ----- + * EXP2 EXP1 + */ + +#define EXPA1_03_PIN P1_23 +#define EXPA1_04_PIN P1_22 +#define EXPA1_05_PIN P1_21 +#define EXPA1_06_PIN P1_20 +#define EXPA1_07_PIN P1_19 +#define EXPA1_08_PIN P1_18 +#define EXPA1_09_PIN P0_28 +#define EXPA1_10_PIN P1_30 + +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN P1_31 +#define EXPA2_05_PIN P0_18 +#define EXPA2_06_PIN P3_25 +#define EXPA2_07_PIN P0_16 +#define EXPA2_08_PIN P3_26 +#define EXPA2_09_PIN P0_15 +#define EXPA2_10_PIN P0_17 + // // SD Connection // #if SD_CONNECTION_IS(LCD) - #define SS_PIN P0_16 + #define SS_PIN EXPA2_07_PIN #endif /** * _____ _____ * NC | · · | GND 5V | · · | GND * RESET | · · | 1.31 (SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) - * (MOSI) 0.18 | · · | 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) + * (MOSI) 0.18 | · · 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · 1.20 (LCD_D4) * (SD_SS) 0.16 | · · | 3.26 (BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) * (SCK) 0.15 | · · | 0.17 (MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) * ----- ----- * EXP2 EXP1 */ -#if HAS_WIRED_LCD + +#if HAS_WIRED_LCD && !HAS_BTT_EXP_MOT #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." @@ -249,35 +275,35 @@ * * The ANET_FULL_GRAPHICS_LCD connector plug: * - * BEFORE AFTER - * _____ _____ - * GND 1 | 1 2 | 2 5V 5V 1 | 1 2 | 2 GND - * CS 3 | 3 4 | 4 BTN_EN2 CS 3 | 3 4 | 4 BTN_EN2 - * SID 5 | 5 6 6 BTN_EN1 SID 5 | 5 6 6 BTN_EN1 - * open 7 | 7 8 | 8 BTN_ENC CLK 7 | 7 8 | 8 BTN_ENC - * CLK 9 | 9 10| 10 Beeper open 9 | 9 10| 10 Beeper - * ----- ----- - * LCD LCD + * BEFORE AFTER + * _____ _____ + * GND | 1 2 | 5V 5V | 1 2 | GND + * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 + * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 + * open | 7 8 | BTN_ENC CLK | 7 8 | BTN_ENC + * CLK | 9 10| Beeper open | 9 10| Beeper + * ----- ----- + * LCD LCD */ - #define LCD_PINS_RS P1_23 + #define LCD_PINS_RS EXPA1_03_PIN - #define BTN_EN1 P1_20 - #define BTN_EN2 P1_22 - #define BTN_ENC P1_18 + #define BTN_EN1 EXPA1_06_PIN + #define BTN_EN2 EXPA1_04_PIN + #define BTN_ENC EXPA1_08_PIN - #define LCD_PINS_ENABLE P1_21 - #define LCD_PINS_D4 P1_19 + #define LCD_PINS_ENABLE EXPA1_05_PIN + #define LCD_PINS_D4 EXPA1_07_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC P0_28 // (58) open-drain - #define LCD_PINS_RS P1_22 + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_04_PIN - #define BTN_EN1 P1_18 - #define BTN_EN2 P1_20 + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN - #define LCD_PINS_ENABLE P1_23 - #define LCD_PINS_D4 P1_21 + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) @@ -285,43 +311,43 @@ * _____ * 5V | 1 2 | GND * (MOSI) 1.23 | 3 4 | 1.22 (LCD_RS) - * (LCD_A0) 1.21 | 5 6 | 1.20 (BTN_EN2) + * (LCD_A0) 1.21 | 5 6 1.20 (BTN_EN2) * RESET 1.19 | 7 8 | 1.18 (BTN_EN1) * (BTN_ENC) 0.28 | 9 10| 1.30 (SCK) * ----- * EXP1 */ - #define BTN_EN1 P1_18 - #define BTN_EN2 P1_20 - #define BTN_ENC P0_28 + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN - #define DOGLCD_CS P1_22 - #define DOGLCD_A0 P1_21 - #define DOGLCD_SCK P1_30 - #define DOGLCD_MOSI P1_23 + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN P1_22 - #define TFT_A0_PIN P1_23 - #define TFT_DC_PIN P1_23 - #define TFT_MISO_PIN P0_17 - #define TFT_BACKLIGHT_PIN P1_18 - #define TFT_RESET_PIN P1_19 + #define TFT_CS_PIN EXPA1_04_PIN + #define TFT_A0_PIN EXPA1_03_PIN + #define TFT_DC_PIN EXPA1_03_PIN + #define TFT_MISO_PIN EXPA2_10_PIN + #define TFT_BACKLIGHT_PIN EXPA1_08_PIN + #define TFT_RESET_PIN EXPA1_07_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN P1_21 - #define TOUCH_CS_PIN P1_20 + #define TOUCH_INT_PIN EXPA1_05_PIN + #define TOUCH_CS_PIN EXPA1_06_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 // SPI 1 - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 + #define SCK_PIN EXPA2_09_PIN + #define MISO_PIN EXPA2_10_PIN + #define MOSI_PIN EXPA2_05_PIN // Disable any LCD related PINs config #define LCD_PINS_ENABLE -1 @@ -361,72 +387,72 @@ #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS P3_26 + #define TFTGLCD_CS EXPA2_08_PIN #endif - #define SD_DETECT_PIN P1_31 + #define SD_DETECT_PIN EXPA2_04_PIN #else - #define BTN_ENC P0_28 // (58) open-drain - #define LCD_PINS_RS P1_19 + #define BTN_ENC EXPA1_09_PIN // (58) open-drain + #define LCD_PINS_RS EXPA1_07_PIN - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 + #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4 - #define LCD_PINS_ENABLE P1_18 - #define LCD_PINS_D4 P1_20 + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 + #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4 #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant) + #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant) #endif #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P1_18 - #define DOGLCD_A0 P1_19 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN P1_20 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P1_21 + #define RGB_LED_R_PIN EXPA1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_22 + #define RGB_LED_G_PIN EXPA1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_23 + #define RGB_LED_B_PIN EXPA1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_21 + #define NEOPIXEL_PIN EXPA1_05_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P1_21 - #define DOGLCD_A0 P1_22 - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 + #define DOGLCD_CS EXPA1_05_PIN + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define FORCE_SOFT_SPI #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 P1_21 - #define LCD_PINS_D6 P1_22 - #define LCD_PINS_D7 P1_23 + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 820c35a01c..e6cfc0afaf 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -29,6 +29,14 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif +// If you have the Big tree tech driver expantion module, enable HAS_BTT_EXP_MOT +// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT +//#define HAS_BTT_EXP_MOT 1 + +#if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT) + #ERROR "Having a LCD on EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possable." +#endif + // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -115,3 +123,46 @@ #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif + +#if HAS_BTT_EXP_MOT +/* _____ _____ + * NC | · · | GND NC | · · | GND + * NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN) + * (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG) + * (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG) + * (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG) + * ----- ----- + * EXP2 EXP1 + */ + + // M1 on Driver Expansion Module + #define E2_STEP_PIN EXPA2_05_PIN + #define E2_DIR_PIN EXPA2_06_PIN + #define E2_ENABLE_PIN EXPA2_04_PIN + #define E2_DIAG_PIN EXPA1_06_PIN + #define E2_CS_PIN EXPA1_05_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXPA1_05_PIN + #define E2_SERIAL_RX_PIN EXPA1_05_PIN + #endif + // M2 on Driver Expansion Module + #define E3_STEP_PIN EXPA2_08_PIN + #define E3_DIR_PIN EXPA2_07_PIN + #define E3_ENABLE_PIN EXPA1_03_PIN + #define E3_DIAG_PIN EXPA1_08_PIN + #define E3_CS_PIN EXPA1_07_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXPA1_07_PIN + #define E3_SERIAL_RX_PIN EXPA1_07_PIN + #endif + // M3 on Driver Expansion Module + #define E4_STEP_PIN EXPA2_10_PIN + #define E4_DIR_PIN EXPA2_09_PIN + #define E4_ENABLE_PIN EXPA1_04_PIN + #define E4_DIAG_PIN EXPA1_10_PIN + #define E4_CS_PIN EXPA1_09_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXPA1_09_PIN + #define E4_SERIAL_RX_PIN EXPA1_09_PIN + #endif +#endif // HAS_BTT_EXP_MOT diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index f948c32f92..b0d1ec1f03 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -229,7 +229,7 @@ * _____ _____ * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) + * (LCD_D4) 0.15 | · · 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 0719752399..dcf0741a76 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -249,9 +249,9 @@ /** * _____ _____ - * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) - * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI) + * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK) + * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2) + * (LCD_D4) 0.15 | · · 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · 0.9 (SD_MOSI) * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST * GND | · · | 5V GND | · · | NC * ----- ----- diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index a0174f2602..c11cd9e9da 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -155,7 +155,7 @@ * _____ * 5V | · · | GND * (LCD_EN) P0_18 | · · | P0_16 (LCD_RS) - * (LCD_D4) P0_15 | · · | P3_25 (BTN_EN2) + * (LCD_D4) P0_15 | · · P3_25 (BTN_EN2) * (RESET) P2_11 | · · | P3_26 (BTN_EN1) * (BTN_ENC) P1_30 | · · | P1_31 (BEEPER) * ----- diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 80eb3f1534..66714240e7 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -201,7 +201,7 @@ * ----- ----- * 5V/D41 | · · | GND 5V | · · | GND * RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6) - * (MOSI) D51 | · · | D33 (BTN_EN2) (LCD_D5) D25 | · · | D23 (LCD_D4) + * (MOSI) D51 | · · D33 (BTN_EN2) (LCD_D5) D25 | · · D23 (LCD_D4) * (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN) * (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER) * ----- ----- 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 c151b44bb7..c748dbbed3 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -264,7 +264,7 @@ #define BEEPER_PIN PB6 #define CLCD_MOD_RESET PA9 - #define CLCD_SPI_CS PA8 + #define CLCD_SPI_CS PB8 #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 46ed9372ab..acc5ba17f2 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1103,19 +1103,67 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table. n = (seq - 1) * (FILENAME_LENGTH); - LOOP_L_N(i, FILENAME_LENGTH) - longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; + LOOP_L_N(i, FILENAME_LENGTH) { + uint16_t utf16_ch = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11]; + #if ENABLED(UTF_FILENAME_SUPPORT) + // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks + // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. + uint16_t idx = (n + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + longFilename[idx] = utf16_ch & 0xFF; + longFilename[idx+1] = (utf16_ch >> 8) & 0xFF; + #else + // Replace all multibyte characters to '_' + longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); + #endif + } // If this VFAT entry is the last one, add a NUL terminator at the end of the string - if (VFAT->sequenceNumber & 0x40) longFilename[n + FILENAME_LENGTH] = '\0'; + if (VFAT->sequenceNumber & 0x40) longFilename[(n + FILENAME_LENGTH) * LONG_FILENAME_CHARSIZE] = '\0'; } } } + // Return if normal file or subdirectory - if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; + if (DIR_IS_FILE_OR_SUBDIR(dir)) { + #if ENABLED(UTF_FILENAME_SUPPORT) + // Convert filename from utf-16 to utf-8 as Marlin expects + #if LONG_FILENAME_CHARSIZE > 2 + // Add warning for developers for currently not supported 3-byte cases (Conversion series of 2-byte + // codepoints to 3-byte in-place will break the rest of filename) + #error "Currently filename re-encoding is done in-place. It may break the remaining chars to use 3-byte codepoints." + #endif + uint16_t currentPos = 0; + LOOP_L_N(i, (LONG_FILENAME_LENGTH / 2)) { + uint16_t idx = i * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + + uint16_t utf16_ch = longFilename[idx] | (longFilename[idx + 1] << 8); + if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_' + longFilename[currentPos++] = '_'; + else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte utf-8 char + longFilename[currentPos++] = utf16_ch & 0x007F; + else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte utf-8 char + longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x1F); + longFilename[currentPos++] = 0x80 | (utf16_ch & 0x3F); + } + else { + #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte utf-8 char + longFilename[currentPos++] = 0xE0 | ((utf16_ch >> 12) & 0x0F); + longFilename[currentPos++] = 0xC0 | ((utf16_ch >> 6) & 0x3F); + longFilename[currentPos++] = 0xC0 | (utf16_ch & 0x3F); + #else // Encode as '_' + longFilename[currentPos++] = '_'; + #endif + } + + if (0 == utf16_ch) break; // End of filename + } + return currentPos; + #else + return n; + #endif + } } } - // Read next directory entry into the cache // Assumes file is correctly positioned dir_t* SdBaseFile::readDirCache() { diff --git a/Marlin/src/sd/SdFatConfig.h b/Marlin/src/sd/SdFatConfig.h index 8f0596c5dd..13ac3a7487 100644 --- a/Marlin/src/sd/SdFatConfig.h +++ b/Marlin/src/sd/SdFatConfig.h @@ -103,5 +103,10 @@ #define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry +// UTF-8 may use up to 3 bytes to represent single UTF-16 code point. +// We discard 3-byte characters allowing only 2-bytes +// or 1-byte if UTF_FILENAME_SUPPORT disabled. +#define LONG_FILENAME_CHARSIZE TERN(UTF_FILENAME_SUPPORT, 2, 1) + // Total bytes needed to store a single long filename -#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1) +#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * LONG_FILENAME_CHARSIZE * MAX_VFAT_ENTRIES + 1) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 5a914050c4..1be5f4f2f6 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -118,9 +118,11 @@ Sd2Card CardReader::sd2card; SdVolume CardReader::volume; SdFile CardReader::file; -uint8_t CardReader::file_subcall_ctr; -uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; -char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; +#if HAS_MEDIA_SUBCALLS + uint8_t CardReader::file_subcall_ctr; + uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; + char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; +#endif uint32_t CardReader::filesize, CardReader::sdpos; @@ -135,7 +137,8 @@ CardReader::CardReader() { #endif flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; filesize = sdpos = 0; - file_subcall_ctr = 0; + + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); workDirDepth = 0; ZERO(workDirParents); @@ -422,7 +425,8 @@ void CardReader::manage_media() { if (stat) { // Media Inserted safe_delay(500); // Some boards need a delay to get settled - mount(); // Try to mount the media + if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) + mount(); // Try to mount the media #if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II) reset_stepper_drivers(); // Workaround for Cheetah bug #endif @@ -540,34 +544,38 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* switch (subcall_type) { case 0: // Starting a new print. "Now fresh file: ..." announceOpen(2, path); - file_subcall_ctr = 0; + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); break; - case 1: // Starting a sub-procedure + #if HAS_MEDIA_SUBCALLS - // With no file is open it's a simple macro. "Now doing file: ..." - if (!isFileOpen()) { announceOpen(1, path); break; } + case 1: // Starting a sub-procedure - // Too deep? The firmware has to bail. - if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:" STRINGIFY(SD_PROCEDURE_DEPTH)); - kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW)); - return; - } + // With no file is open it's a simple macro. "Now doing file: ..." + if (!isFileOpen()) { announceOpen(1, path); break; } - // Store current filename (based on workDirParents) and position - getAbsFilename(proc_filenames[file_subcall_ctr]); - filespos[file_subcall_ctr] = sdpos; + // Too deep? The firmware has to bail. + if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { + SERIAL_ERROR_MSG("Exceeded max SUBROUTINE depth:", int(SD_PROCEDURE_DEPTH)); + kill(GET_TEXT(MSG_KILL_SUBCALL_OVERFLOW)); + return; + } - // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); - file_subcall_ctr++; - break; + // Store current filename (based on workDirParents) and position + getAbsFilename(proc_filenames[file_subcall_ctr]); + filespos[file_subcall_ctr] = sdpos; - case 2: // Resuming previous file after sub-procedure - SERIAL_ECHO_MSG("END SUBROUTINE"); - break; + // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); + file_subcall_ctr++; + break; + + case 2: // Resuming previous file after sub-procedure + SERIAL_ECHO_MSG("END SUBROUTINE"); + break; + + #endif } endFilePrint(); @@ -603,7 +611,7 @@ void CardReader::openFileWrite(char * const path) { if (!isMounted()) return; announceOpen(2, path); - file_subcall_ctr = 0; + TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0); endFilePrint(); @@ -1158,17 +1166,19 @@ uint16_t CardReader::get_num_Files() { void CardReader::fileHasFinished() { planner.synchronize(); file.close(); - if (file_subcall_ctr > 0) { // Resume calling file after closing procedure - file_subcall_ctr--; - openFileRead(proc_filenames[file_subcall_ctr], 2); // 2 = Returning from sub-procedure - setIndex(filespos[file_subcall_ctr]); - startFileprint(); - } - else { - endFilePrint(TERN_(SD_RESORT, true)); - marlin_state = MF_SD_COMPLETE; - } + #if HAS_MEDIA_SUBCALLS + if (file_subcall_ctr > 0) { // Resume calling file after closing procedure + file_subcall_ctr--; + openFileRead(proc_filenames[file_subcall_ctr], 2); // 2 = Returning from sub-procedure + setIndex(filespos[file_subcall_ctr]); + startFileprint(); + return; + } + #endif + + endFilePrint(TERN_(SD_RESORT, true)); + marlin_state = MF_SD_COMPLETE; } #if ENABLED(AUTO_REPORT_SD_STATUS) diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 33645b6531..c6fe37400c 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -249,12 +249,11 @@ private: // // Procedure calls to other files // - #ifndef SD_PROCEDURE_DEPTH - #define SD_PROCEDURE_DEPTH 1 + #if HAS_MEDIA_SUBCALLS + static uint8_t file_subcall_ctr; + static uint32_t filespos[SD_PROCEDURE_DEPTH]; + static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; #endif - static uint8_t file_subcall_ctr; - static uint32_t filespos[SD_PROCEDURE_DEPTH]; - static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; // // SD Auto Reporting diff --git a/README.md b/README.md index f3c2afa874..f70b7c409a 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0. - This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle. - Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. -- Please submit your questions and concerns to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues). +- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). Support resources are also listed there. ### [RepRap.org Wiki Page](https://reprap.org/wiki/Marlin) diff --git a/buildroot/share/PlatformIO/variants/archim/variant.h b/buildroot/share/PlatformIO/variants/archim/variant.h index 179a137353..11f8f63bfb 100644 --- a/buildroot/share/PlatformIO/variants/archim/variant.h +++ b/buildroot/share/PlatformIO/variants/archim/variant.h @@ -55,10 +55,10 @@ extern "C"{ *----------------------------------------------------------------------------*/ // Number of pins defined in PinDescription array -#define PINS_COUNT (79U) -#define NUM_DIGITAL_PINS (66U) -#define NUM_ANALOG_INPUTS (12U) -#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) +#define PINS_COUNT 79 +#define NUM_DIGITAL_PINS 66 +#define NUM_ANALOG_INPUTS 12 +#define analogInputToDigitalPin(p) ((p < 12) ? (p) + 54 : -1) #define digitalPinToPort(P) ( g_APinDescription[P].pPort ) #define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin ) diff --git a/buildroot/share/fonts/genpages.c b/buildroot/share/fonts/genpages.c index 2a87b19d47..c855ceac50 100644 --- a/buildroot/share/fonts/genpages.c +++ b/buildroot/share/fonts/genpages.c @@ -71,63 +71,49 @@ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) { assert(NULL != pstart); + #define NEXT_6_BITS() do{ val <<= 6; p++; val |= (*p & 0x3F); }while(0) + if (0 == (0x80 & *p)) { val = (size_t)*p; p++; } else if (0xC0 == (0xE0 & *p)) { val = *p & 0x1F; - val <<= 6; - p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xE0 == (0xF0 & *p)) { val = *p & 0x0F; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xF0 == (0xF8 & *p)) { val = *p & 0x07; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xF8 == (0xFC & *p)) { val = *p & 0x03; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } else if (0xFC == (0xFE & *p)) { val = *p & 0x01; - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); - val <<= 6; p++; - val |= (*p & 0x3F); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); + NEXT_6_BITS(); p++; assert((wchar_t)val == get_val_utf82uni(pstart)); } diff --git a/buildroot/tests/BIGTREE_GTR_V1_0-tests b/buildroot/tests/BIGTREE_GTR_V1_0-tests index e8d47562aa..1db0bcffd2 100644 --- a/buildroot/tests/BIGTREE_GTR_V1_0-tests +++ b/buildroot/tests/BIGTREE_GTR_V1_0-tests @@ -24,7 +24,20 @@ opt_set E2_AUTO_FAN_PIN PC12 opt_set X_DRIVER_TYPE TMC2208 opt_set Y_DRIVER_TYPE TMC2130 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan and Mixed TMC Drivers" +opt_enable FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE +opt_set FIL_RUNOUT_PIN 3 +opt_set FIL_RUNOUT2_PIN 4 +opt_set FIL_RUNOUT3_PIN 5 +opt_set FIL_RUNOUT4_PIN 6 +opt_set FIL_RUNOUT5_PIN 7 +opt_set FIL_RUNOUT6_PIN 8 +opt_set FIL_RUNOUT7_PIN 9 +opt_set FIL_RUNOUT8_PIN 10 +opt_set FIL_RUNOUT4_STATE HIGH +opt_enable FIL_RUNOUT4_PULL +opt_set FIL_RUNOUT8_STATE HIGH +opt_enable FIL_RUNOUT8_PULL +exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan, Mixed TMC Drivers, and Runout Sensors with distinct states" restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 diff --git a/buildroot/tests/LPC1769-tests b/buildroot/tests/LPC1769-tests index 4314b0d5ff..df66f0ab75 100755 --- a/buildroot/tests/LPC1769-tests +++ b/buildroot/tests/LPC1769-tests @@ -23,6 +23,7 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER +opt_disable SD_PROCEDURE_DEPTH opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Smoothieboard with many features" diff --git a/buildroot/tests/mega2560-tests b/buildroot/tests/mega2560-tests index a6902b9d14..9ae43dcdb5 100755 --- a/buildroot/tests/mega2560-tests +++ b/buildroot/tests/mega2560-tests @@ -75,6 +75,21 @@ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." +# +# 5 runout sensors with distinct states +# +restore_configs +opt_set EXTRUDERS 5 +opt_set NUM_SERVOS 1 +opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ + AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ + NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ + PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ + FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL +opt_set MIXING_STEPPERS 5 +opt_set FIL_RUNOUT3_STATE HIGH +exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" + # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features # diff --git a/platformio.ini b/platformio.ini index af7ce47a50..360a02f420 100644 --- a/platformio.ini +++ b/platformio.ini @@ -180,6 +180,7 @@ default_src_filter = + - - + - - - + - - - - @@ -221,7 +222,7 @@ HAS_L64XX = Arduino-L6470@0.8.0 src_filter=+ + + NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 src_filter=+ -MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 +MAX6675_._IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 USES_LIQUIDCRYSTAL = LiquidCrystal@1.5.0 USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 @@ -370,6 +371,7 @@ Z_PROBE_SLED = src_filter=+ G38_PROBE_TARGET = src_filter=+ MAGNETIC_PARKING_EXTRUDER = src_filter=+ SDSUPPORT = src_filter=+ +HAS_MEDIA_SUBCALLS = src_filter=+ HAS_EXTRUDERS = src_filter=+ + AUTO_REPORT_TEMPERATURES = src_filter=+ INCH_MODE_SUPPORT = src_filter=+