From 89b0143b09aeb617d17cc029d3bbb363dd1c857b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 11 Aug 2024 16:26:04 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Config-related=20preparations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 155 +++++++++----- Marlin/src/inc/Conditionals_adv.h | 20 ++ Marlin/src/inc/Conditionals_post.h | 192 +++++++++++++++--- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 3 + Marlin/src/lcd/marlinui.cpp | 2 +- Marlin/src/module/motion.cpp | 4 +- Marlin/src/module/motion.h | 2 +- Marlin/src/module/planner.h | 8 +- Marlin/src/module/probe.h | 6 +- Marlin/src/module/settings.cpp | 11 +- Marlin/src/module/temperature.cpp | 46 +++++ buildroot/tests/DUE | 1 + buildroot/tests/rambo | 4 +- buildroot/tests/teensy35 | 2 +- 14 files changed, 371 insertions(+), 85 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 573cfb0d3c75..fa4e0a4c3c12 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -70,6 +70,8 @@ #undef FILAMENT_RUNOUT_SENSOR #undef FILAMENT_RUNOUT_DISTANCE_MM #undef DISABLE_OTHER_EXTRUDERS + #undef THERMAL_PROTECTION_HYSTERESIS + #undef THERMAL_PROTECTION_PERIOD #endif #define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) @@ -201,6 +203,10 @@ #undef HOTEND_OFFSET_Z #endif +// +// Remove irrelevant Configuration.h settings +// + // Clean up E-stepper-based settings... #if E_STEPPERS <= 7 #undef INVERT_E7_DIR @@ -235,6 +241,72 @@ #endif #endif +// Clean up unused temperature sensors and sub-options + +#if !TEMP_SENSOR_0 + #undef TEMP_SENSOR_0 +#endif +#if !TEMP_SENSOR_1 + #undef TEMP_SENSOR_1 +#endif +#if !TEMP_SENSOR_2 + #undef TEMP_SENSOR_2 +#endif +#if !TEMP_SENSOR_3 + #undef TEMP_SENSOR_3 +#endif +#if !TEMP_SENSOR_4 + #undef TEMP_SENSOR_4 +#endif +#if !TEMP_SENSOR_5 + #undef TEMP_SENSOR_5 +#endif +#if !TEMP_SENSOR_6 + #undef TEMP_SENSOR_6 +#endif +#if !TEMP_SENSOR_7 + #undef TEMP_SENSOR_7 +#endif + +#if TEMP_SENSOR_BED + #define HAS_HEATED_BED 1 +#else + #undef TEMP_SENSOR_BED + #undef THERMAL_PROTECTION_BED_HYSTERESIS + #undef THERMAL_PROTECTION_BED_PERIOD + #undef MAX_BED_POWER +#endif +#if !TEMP_SENSOR_CHAMBER + #undef TEMP_SENSOR_CHAMBER + #undef THERMAL_PROTECTION_CHAMBER_HYSTERESIS + #undef THERMAL_PROTECTION_CHAMBER_PERIOD + #undef CHAMBER_AUTO_FAN_PIN + #undef CHAMBER_AUTO_FAN_SPEED + #undef CHAMBER_AUTO_FAN_TEMPERATURE + #undef MAX_CHAMBER_POWER +#endif +#if !TEMP_SENSOR_COOLER + #undef TEMP_SENSOR_COOLER + #undef COOLER_AUTO_FAN_PIN + #undef COOLER_AUTO_FAN_SPEED + #undef COOLER_AUTO_FAN_TEMPERATURE +#endif +#if !TEMP_SENSOR_PROBE + #undef TEMP_SENSOR_PROBE +#endif +#if !TEMP_SENSOR_REDUNDANT + #undef TEMP_SENSOR_REDUNDANT +#endif +#if !TEMP_SENSOR_BOARD + #undef TEMP_SENSOR_BOARD +#endif +#if !TEMP_SENSOR_SOC + #undef TEMP_SENSOR_SOC +#endif +#if !SOFT_PWM_SCALE + #undef SOFT_PWM_SCALE +#endif + /** * Number of Linear Axes (e.g., XYZIJKUVW) * All the logical axes except for the tool (E) axis @@ -296,12 +368,20 @@ #endif #endif +#if HAS_Z_AXIS + #ifdef Z4_DRIVER_TYPE + #define NUM_Z_STEPPERS 4 + #elif defined(Z3_DRIVER_TYPE) + #define NUM_Z_STEPPERS 3 + #elif defined(Z2_DRIVER_TYPE) + #define NUM_Z_STEPPERS 2 + #else + #define NUM_Z_STEPPERS 1 + #endif +#endif + #if !HAS_X_AXIS #undef AVOID_OBSTACLES - #undef ENDSTOPPULLUP_XMIN - #undef ENDSTOPPULLUP_XMAX - #undef X_MIN_ENDSTOP_HIT_STATE - #undef X_MAX_ENDSTOP_HIT_STATE #undef X2_DRIVER_TYPE #undef X_ENABLE_ON #undef DISABLE_X @@ -312,14 +392,12 @@ #undef MANUAL_X_HOME_POS #undef MIN_SOFTWARE_ENDSTOPS #undef MAX_SOFTWARE_ENDSTOPS + #undef MIN_SOFTWARE_ENDSTOP_X + #undef MAX_SOFTWARE_ENDSTOP_X #endif #if !HAS_Y_AXIS #undef AVOID_OBSTACLES - #undef ENDSTOPPULLUP_YMIN - #undef ENDSTOPPULLUP_YMAX - #undef Y_MIN_ENDSTOP_HIT_STATE - #undef Y_MAX_ENDSTOP_HIT_STATE #undef Y2_DRIVER_TYPE #undef Y_ENABLE_ON #undef DISABLE_Y @@ -332,21 +410,7 @@ #undef MAX_SOFTWARE_ENDSTOP_Y #endif -#if HAS_Z_AXIS - #ifdef Z4_DRIVER_TYPE - #define NUM_Z_STEPPERS 4 - #elif defined(Z3_DRIVER_TYPE) - #define NUM_Z_STEPPERS 3 - #elif defined(Z2_DRIVER_TYPE) - #define NUM_Z_STEPPERS 2 - #else - #define NUM_Z_STEPPERS 1 - #endif -#else - #undef ENDSTOPPULLUP_ZMIN - #undef ENDSTOPPULLUP_ZMAX - #undef Z_MIN_ENDSTOP_HIT_STATE - #undef Z_MAX_ENDSTOP_HIT_STATE +#if !HAS_Z_AXIS #undef Z2_DRIVER_TYPE #undef Z3_DRIVER_TYPE #undef Z4_DRIVER_TYPE @@ -363,10 +427,6 @@ #endif #if !HAS_I_AXIS - #undef ENDSTOPPULLUP_IMIN - #undef ENDSTOPPULLUP_IMAX - #undef I_MIN_ENDSTOP_HIT_STATE - #undef I_MAX_ENDSTOP_HIT_STATE #undef I_ENABLE_ON #undef DISABLE_I #undef INVERT_I_DIR @@ -379,10 +439,6 @@ #endif #if !HAS_J_AXIS - #undef ENDSTOPPULLUP_JMIN - #undef ENDSTOPPULLUP_JMAX - #undef J_MIN_ENDSTOP_HIT_STATE - #undef J_MAX_ENDSTOP_HIT_STATE #undef J_ENABLE_ON #undef DISABLE_J #undef INVERT_J_DIR @@ -395,10 +451,6 @@ #endif #if !HAS_K_AXIS - #undef ENDSTOPPULLUP_KMIN - #undef ENDSTOPPULLUP_KMAX - #undef K_MIN_ENDSTOP_HIT_STATE - #undef K_MAX_ENDSTOP_HIT_STATE #undef K_ENABLE_ON #undef DISABLE_K #undef INVERT_K_DIR @@ -411,10 +463,6 @@ #endif #if !HAS_U_AXIS - #undef ENDSTOPPULLUP_UMIN - #undef ENDSTOPPULLUP_UMAX - #undef U_MIN_ENDSTOP_HIT_STATE - #undef U_MAX_ENDSTOP_HIT_STATE #undef U_ENABLE_ON #undef DISABLE_U #undef INVERT_U_DIR @@ -427,10 +475,6 @@ #endif #if !HAS_V_AXIS - #undef ENDSTOPPULLUP_VMIN - #undef ENDSTOPPULLUP_VMAX - #undef V_MIN_ENDSTOP_HIT_STATE - #undef V_MAX_ENDSTOP_HIT_STATE #undef V_ENABLE_ON #undef DISABLE_V #undef INVERT_V_DIR @@ -443,10 +487,6 @@ #endif #if !HAS_W_AXIS - #undef ENDSTOPPULLUP_WMIN - #undef ENDSTOPPULLUP_WMAX - #undef W_MIN_ENDSTOP_HIT_STATE - #undef W_MAX_ENDSTOP_HIT_STATE #undef W_ENABLE_ON #undef DISABLE_W #undef INVERT_W_DIR @@ -1151,6 +1191,19 @@ #endif #endif +/** + * Unused LCD options + */ +#if NONE(HAS_MARLINUI_HD44780, IS_DWIN_MARLINUI, IS_TFTGLCD_PANEL) && !MB(SIMULATED) + #undef DISPLAY_CHARSET_HD44780 +#endif +#if !HAS_MARLINUI_HD44780 + #undef LCD_INFO_SCREEN_STYLE +#endif +#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI) + #undef LCD_LANGUAGE +#endif + /** * Disable unused SINGLENOZZLE sub-options */ @@ -1585,6 +1638,14 @@ #define PROBE_SELECTED 1 #endif +#if !HAS_MESH + #undef MESH_INSET +#endif + +#if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) + #undef DEFAULT_LEVELING_FADE_HEIGHT +#endif + #ifdef GRID_MAX_POINTS_X #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) #define GRID_LOOP(A,B) for (uint8_t A = 0; A < GRID_MAX_POINTS_X; ++A) for (uint8_t B = 0; B < GRID_MAX_POINTS_Y; ++B) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index ef0b18e4b730..3f3dcf897130 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -83,6 +83,9 @@ // Convenience override for a BLTouch alone #if ENABLED(BLTOUCH) + #ifndef BLTOUCH_DELAY + #define BLTOUCH_DELAY 500 + #endif #ifdef BLTOUCH_HS_MODE #define HAS_BLTOUCH_HS_MODE 1 #endif @@ -622,6 +625,10 @@ #define HAS_MAX31865 1 #endif +#if !HAS_MAX_TC + #undef THERMOCOUPLE_MAX_ERRORS +#endif + #if TEMP_SENSOR_3 == -4 #define TEMP_SENSOR_3_IS_AD8495 1 #elif TEMP_SENSOR_3 == -3 @@ -819,6 +826,15 @@ #endif #endif +#if !ANY_THERMISTOR_IS(-1) + #undef TEMP_SENSOR_AD595_GAIN + #undef TEMP_SENSOR_AD595_OFFSET +#endif +#if !ANY_THERMISTOR_IS(-4) + #undef TEMP_SENSOR_AD8495_GAIN + #undef TEMP_SENSOR_AD8495_OFFSET +#endif + #if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND || HAS_PRUSA_MMU2 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) #define HAS_TOOLCHANGE 1 #endif @@ -869,6 +885,10 @@ #define HAS_PRINT_PROGRESS 1 #endif +#if !ALL(HAS_MARLINUI_MENU, HAS_MEDIA) + #undef SD_MENU_CONFIRM_START +#endif + #if DISABLED(SET_PROGRESS_MANUALLY) #undef SET_REMAINING_TIME #undef SET_INTERACTION_TIME diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 56d774f2fccd..9047d4831095 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -387,8 +387,10 @@ #undef Z_SAFE_HOMING #endif -#ifndef MESH_INSET - #define MESH_INSET 0 +#ifdef MESH_INSET + #define _MESH_INSET (MESH_INSET) +#else + #define _MESH_INSET 0 #endif /** @@ -397,7 +399,7 @@ #if ENABLED(Z_SAFE_HOMING) #if ENABLED(AUTO_BED_LEVELING_UBL) // Home close to center so grid points have z heights very close to 0 - #define _SAFE_POINT(A) (((GRID_MAX_POINTS_##A) / 2) * (A##_BED_SIZE - 2 * (MESH_INSET)) / (GRID_MAX_POINTS_##A - 1) + MESH_INSET) + #define _SAFE_POINT(A) (((GRID_MAX_POINTS_##A) / 2) * (A##_BED_SIZE - 2 * _MESH_INSET) / (GRID_MAX_POINTS_##A - 1) + _MESH_INSET) #else #define _SAFE_POINT(A) A##_CENTER #endif @@ -428,13 +430,6 @@ #define MAX_AUTORETRACT 99 #endif -/** - * Provide a DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT in case NO_VOLUMETRICS is enabled - */ -#ifndef DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT - #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 -#endif - /** * LCD Contrast for Graphical Displays */ @@ -2350,6 +2345,138 @@ #endif #endif +#if !USE_X_MIN + #undef ENDSTOPPULLUP_XMIN + #undef ENDSTOPPULLDOWN_XMIN +#endif +#if !USE_X_MAX + #undef ENDSTOPPULLUP_XMAX + #undef ENDSTOPPULLDOWN_XMAX +#endif +#if !USE_Y_MIN + #undef ENDSTOPPULLUP_YMIN + #undef ENDSTOPPULLDOWN_YMIN +#endif +#if !USE_Y_MAX + #undef ENDSTOPPULLUP_YMAX + #undef ENDSTOPPULLDOWN_YMAX +#endif +#if !USE_Z_MIN + #undef ENDSTOPPULLUP_ZMIN + #undef ENDSTOPPULLDOWN_ZMIN +#endif +#if !USE_Z_MAX + #undef ENDSTOPPULLUP_ZMAX + #undef ENDSTOPPULLDOWN_ZMAX +#endif +#if !USE_I_MIN + #undef ENDSTOPPULLUP_IMIN + #undef ENDSTOPPULLDOWN_IMIN +#endif +#if !USE_I_MAX + #undef ENDSTOPPULLUP_IMAX + #undef ENDSTOPPULLDOWN_IMAX +#endif +#if !USE_J_MIN + #undef ENDSTOPPULLUP_JMIN + #undef ENDSTOPPULLDOWN_JMIN +#endif +#if !USE_J_MAX + #undef ENDSTOPPULLUP_JMAX + #undef ENDSTOPPULLDOWN_JMAX +#endif +#if !USE_K_MIN + #undef ENDSTOPPULLUP_KMIN + #undef ENDSTOPPULLDOWN_KMIN +#endif +#if !USE_K_MAX + #undef ENDSTOPPULLUP_KMAX + #undef ENDSTOPPULLDOWN_KMAX +#endif +#if !USE_U_MIN + #undef ENDSTOPPULLUP_UMIN + #undef ENDSTOPPULLDOWN_UMIN +#endif +#if !USE_U_MAX + #undef ENDSTOPPULLUP_UMAX + #undef ENDSTOPPULLDOWN_UMAX +#endif +#if !USE_V_MIN + #undef ENDSTOPPULLUP_VMIN + #undef ENDSTOPPULLDOWN_VMIN +#endif +#if !USE_V_MAX + #undef ENDSTOPPULLUP_VMAX + #undef ENDSTOPPULLDOWN_VMAX +#endif +#if !USE_W_MIN + #undef ENDSTOPPULLUP_WMIN + #undef ENDSTOPPULLDOWN_WMIN +#endif +#if !USE_W_MAX + #undef ENDSTOPPULLUP_WMAX + #undef ENDSTOPPULLDOWN_WMAX +#endif + +#define PCAT(P) P##_PIN +#define NEED_HIT_STATE(P) (USE_##P || (PIN_EXISTS(P##_PIN) && ((defined(X2_STOP_PIN) && X2_STOP_PIN == PCAT(P)) || (defined(Y2_STOP_PIN) && Y2_STOP_PIN == PCAT(P)) || (defined(Z2_STOP_PIN) && Z2_STOP_PIN == PCAT(P)) || (defined(Z3_STOP_PIN) && Z3_STOP_PIN == PCAT(P)) || (defined(Z4_STOP_PIN) && Z4_STOP_PIN == PCAT(P))))) +#if !NEED_HIT_STATE(X_MIN) + #undef X_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(X_MAX) + #undef X_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(Y_MIN) + #undef Y_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(Y_MAX) + #undef Y_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(Z_MIN) + #undef Z_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(Z_MAX) + #undef Z_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(I_MIN) + #undef I_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(I_MAX) + #undef I_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(J_MIN) + #undef J_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(J_MAX) + #undef J_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(K_MIN) + #undef K_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(K_MAX) + #undef K_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(U_MIN) + #undef U_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(U_MAX) + #undef U_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(V_MIN) + #undef V_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(V_MAX) + #undef V_MAX_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(W_MIN) + #undef W_MIN_ENDSTOP_HIT_STATE +#endif +#if !NEED_HIT_STATE(W_MAX) + #undef W_MAX_ENDSTOP_HIT_STATE +#endif +#undef NEED_HIT_STATE +#undef PCAT + // // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) // @@ -2573,8 +2700,10 @@ #if HAS_TEMP_COOLER && PIN_EXISTS(COOLER_AUTO_FAN) #define HAS_AUTO_COOLER_FAN 1 #endif - -#if ANY(HAS_AUTO_FAN_0, HAS_AUTO_FAN_1, HAS_AUTO_FAN_2, HAS_AUTO_FAN_3, HAS_AUTO_FAN_4, HAS_AUTO_FAN_5, HAS_AUTO_FAN_6, HAS_AUTO_FAN_7, HAS_AUTO_CHAMBER_FAN, HAS_AUTO_COOLER_FAN) +#if ANY(HAS_AUTO_FAN_0, HAS_AUTO_FAN_1, HAS_AUTO_FAN_2, HAS_AUTO_FAN_3, HAS_AUTO_FAN_4, HAS_AUTO_FAN_5, HAS_AUTO_FAN_6, HAS_AUTO_FAN_7) + #define HAS_E_AUTO_FAN 1 +#endif +#if ANY(HAS_E_AUTO_FAN, HAS_AUTO_CHAMBER_FAN, HAS_AUTO_COOLER_FAN) #define HAS_AUTO_FAN 1 #define _FANOVERLAP(I,T) (T##_AUTO_FAN_PIN == E##I##_AUTO_FAN_PIN) #if HAS_AUTO_CHAMBER_FAN @@ -2632,6 +2761,19 @@ #define HAS_AUTO_REPORTING 1 #endif +#if !HAS_AUTO_CHAMBER_FAN + #undef CHAMBER_AUTO_FAN_SPEED + #undef CHAMBER_AUTO_FAN_TEMPERATURE +#endif +#if !HAS_AUTO_COOLER_FAN + #undef COOLER_AUTO_FAN_SPEED + #undef COOLER_AUTO_FAN_TEMPERATURE +#endif +#if !HAS_E_AUTO_FAN + #undef EXTRUDER_AUTO_FAN_SPEED + #undef EXTRUDER_AUTO_FAN_TEMPERATURE +#endif + #if !HAS_AUTO_CHAMBER_FAN || AUTO_CHAMBER_IS_E #undef AUTO_POWER_CHAMBER_FAN #endif @@ -2750,6 +2892,10 @@ #if PIN_EXISTS(FANMUX0) #define HAS_FANMUX 1 // Part Cooling fan multipliexer +#else + #undef FANMUX0_PIN + #undef FANMUX1_PIN + #undef FANMUX2_PIN #endif /** @@ -2855,6 +3001,8 @@ #endif #if ANY(HAS_X_MS_PINS, HAS_X2_MS_PINS, HAS_Y_MS_PINS, HAS_Y2_MS_PINS, HAS_SOME_Z_MS_PINS, HAS_I_MS_PINS, HAS_J_MS_PINS, HAS_K_MS_PINS, HAS_U_MS_PINS, HAS_V_MS_PINS, HAS_W_MS_PINS, HAS_SOME_E_MS_PINS) #define HAS_MICROSTEPS 1 +#else + #undef MICROSTEP_MODES #endif /** @@ -3149,10 +3297,6 @@ #endif #endif -#ifndef DEFAULT_LEVELING_FADE_HEIGHT - #define DEFAULT_LEVELING_FADE_HEIGHT 0.0 -#endif - #if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) #define LEVELED_SEGMENT_LENGTH 5 #endif @@ -3165,16 +3309,16 @@ // Probing points may be verified at compile time within the radius // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(PRINTABLE_RADIUS),"bad probe point!") // so that may be added to SanityCheck.h in the future. - #define _MESH_MIN_X (X_MIN_BED + (MESH_INSET)) - #define _MESH_MIN_Y (Y_MIN_BED + (MESH_INSET)) - #define _MESH_MAX_X (X_MAX_BED - (MESH_INSET)) - #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) + #define _MESH_MIN_X (X_MIN_BED + _MESH_INSET) + #define _MESH_MIN_Y (Y_MIN_BED + _MESH_INSET) + #define _MESH_MAX_X (X_MAX_BED - _MESH_INSET) + #define _MESH_MAX_Y (Y_MAX_BED - _MESH_INSET) #else // Boundaries for Cartesian probing based on set limits - #define _MESH_MIN_X (_MAX(X_MIN_BED + (MESH_INSET), X_MIN_POS)) // UBL is careful not to probe off the bed. It doesn't - #define _MESH_MIN_Y (_MAX(Y_MIN_BED + (MESH_INSET), Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions. - #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS)) - #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS)) + #define _MESH_MIN_X (_MAX(X_MIN_BED + _MESH_INSET, X_MIN_POS)) // UBL is careful not to probe off the bed. It doesn't + #define _MESH_MIN_Y (_MAX(Y_MIN_BED + _MESH_INSET, Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions. + #define _MESH_MAX_X (_MIN(X_MAX_BED - _MESH_INSET, X_MAX_POS)) + #define _MESH_MAX_Y (_MIN(Y_MAX_BED - _MESH_INSET, Y_MAX_POS)) #endif // These may be overridden in Configuration.h if a smaller area is desired diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 557d4f857991..00249ff08fa8 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -1622,6 +1622,9 @@ void RTS::handleData() { float meshVal = float(recdat.data[0] - (recdat.data[0] >= 32768 ? 65536 : 0)) / 1000; + #ifndef Z_PROBE_LOW_POINT + #define Z_PROBE_LOW_POINT -2 + #endif LIMIT(meshVal, Z_PROBE_LOW_POINT, Z_CLEARANCE_BETWEEN_PROBES); xy_uint8_t point = { xPnt, yPnt }; setMeshPoint(point, meshVal); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index fc21704022c5..157ef9204534 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -816,7 +816,7 @@ void MarlinUI::init() { // Add a manual move to the queue? if (axis == NO_AXIS_ENUM || PENDING(millis(), start_time) || planner.is_full()) return; - const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : PLANNER_XY_FEEDRATE_MM_S; /** * For a rotational axis apply the "inch" to "mm" conversion factor. This mimics behaviour of the G-code G1 diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index a4e69c5be7ca..7016544c2020 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -571,7 +571,7 @@ void do_blocking_move_to(NUM_AXIS_ARGS_(const_float_t) const_feedRate_t fr_mm_s/ if (DEBUGGING(LEVELING)) DEBUG_XYZ("> ", NUM_AXIS_ARGS()); #endif - const feedRate_t xy_feedrate = fr_mm_s ?: feedRate_t(XY_PROBE_FEEDRATE_MM_S); + const feedRate_t xy_feedrate = fr_mm_s ?: feedRate_t(PLANNER_XY_FEEDRATE_MM_S); #if HAS_Z_AXIS const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS); @@ -1492,7 +1492,7 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool if (planner.buffer_line(raised, fr_zfast)) { // 2. Move to the current native XY and raised Z. Presumably this is a null move. xyze_pos_t curpos = current_position; curpos.z = raised_parked_position.z; - if (planner.buffer_line(curpos, PLANNER_XY_FEEDRATE())) { + if (planner.buffer_line(curpos, PLANNER_XY_FEEDRATE_MM_S)) { // 3. Lower Z back down line_to_current_position(fr_zfast); } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 3a641a6f32b9..8aa66354ac78 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -68,7 +68,7 @@ extern xyz_pos_t cartes; #elif defined(XY_PROBE_FEEDRATE) #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_FEEDRATE) #else - #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() + #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE_MM_S #endif #if HAS_BED_PROBE diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 1053a27688d3..88a181839efa 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -1114,7 +1114,13 @@ class Planner { #endif // HAS_JUNCTION_DEVIATION }; -#define PLANNER_XY_FEEDRATE() _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) +#if HAS_Y_AXIS + #define PLANNER_XY_FEEDRATE_MM_S _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) +#elif HAS_X_AXIS + #define PLANNER_XY_FEEDRATE_MM_S planner.settings.max_feedrate_mm_s[X_AXIS] +#else + #define PLANNER_XY_FEEDRATE_MM_S 60.0f +#endif #define ANY_AXIS_MOVES(BLOCK) \ (false NUM_AXIS_GANG( \ diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 028a7589cc12..81b5ec6e02b6 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -349,8 +349,10 @@ class Probe { #endif private: - static bool probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s); - static float run_z_probe(const bool sanity_check=true, const_float_t z_min_point=Z_PROBE_LOW_POINT, const_float_t z_clearance=Z_TWEEN_SAFE_CLEARANCE); + #if HAS_BED_PROBE + static bool probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s); + static float run_z_probe(const bool sanity_check=true, const_float_t z_min_point=Z_PROBE_LOW_POINT, const_float_t z_clearance=Z_TWEEN_SAFE_CLEARANCE); + #endif }; extern Probe probe; diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index a553d56745ad..92f08969df6e 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -931,7 +931,10 @@ void MarlinSettings::postprocess() { // Global Leveling // { - const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, (DEFAULT_LEVELING_FADE_HEIGHT)); + #ifndef DEFAULT_LEVELING_FADE_HEIGHT + #define DEFAULT_LEVELING_FADE_HEIGHT 0 + #endif + const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, DEFAULT_LEVELING_FADE_HEIGHT); EEPROM_WRITE(zfh); } @@ -1320,7 +1323,7 @@ void MarlinSettings::postprocess() { #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) EEPROM_WRITE(planner.volumetric_extruder_limit); #else - dummyf = DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT; + dummyf = 0.0; for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); #endif @@ -1330,7 +1333,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(volumetric_enabled); dummyf = DEFAULT_NOMINAL_FILAMENT_DIA; for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); - dummyf = DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT; + dummyf = 0.0; for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummyf); #endif @@ -3311,7 +3314,7 @@ void MarlinSettings::reset() { // // Global Leveling // - TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); + TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = DEFAULT_LEVELING_FADE_HEIGHT); TERN_(HAS_LEVELING, reset_bed_level()); // diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index f617d8391a88..0070fa2eeafc 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -70,6 +70,52 @@ #include "../feature/spindle_laser.h" #endif +#ifndef TEMP_SENSOR_0 + #define TEMP_SENSOR_0 0 +#endif +#ifndef TEMP_SENSOR_1 + #define TEMP_SENSOR_1 0 +#endif +#ifndef TEMP_SENSOR_2 + #define TEMP_SENSOR_2 0 +#endif +#ifndef TEMP_SENSOR_3 + #define TEMP_SENSOR_3 0 +#endif +#ifndef TEMP_SENSOR_4 + #define TEMP_SENSOR_4 0 +#endif +#ifndef TEMP_SENSOR_5 + #define TEMP_SENSOR_5 0 +#endif +#ifndef TEMP_SENSOR_6 + #define TEMP_SENSOR_6 0 +#endif +#ifndef TEMP_SENSOR_7 + #define TEMP_SENSOR_7 0 +#endif +#ifndef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 0 +#endif +#ifndef TEMP_SENSOR_BOARD + #define TEMP_SENSOR_BOARD 0 +#endif +#ifndef TEMP_SENSOR_CHAMBER + #define TEMP_SENSOR_CHAMBER 0 +#endif +#ifndef TEMP_SENSOR_COOLER + #define TEMP_SENSOR_COOLER 0 +#endif +#ifndef TEMP_SENSOR_PROBE + #define TEMP_SENSOR_PROBE 0 +#endif +#ifndef TEMP_SENSOR_REDUNDANT + #define TEMP_SENSOR_REDUNDANT 0 +#endif +#ifndef TEMP_SENSOR_SOC + #define TEMP_SENSOR_SOC 0 +#endif + // MAX TC related macros #define TEMP_SENSOR_IS_MAX(n, M) (ENABLED(TEMP_SENSOR_##n##_IS_MAX##M) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX##M) && REDUNDANT_TEMP_MATCH(SOURCE, E##n))) diff --git a/buildroot/tests/DUE b/buildroot/tests/DUE index 590d76606c97..3c4876b44ec8 100755 --- a/buildroot/tests/DUE +++ b/buildroot/tests/DUE @@ -13,6 +13,7 @@ opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB \ GRID_MAX_POINTS_X 16 \ E0_AUTO_FAN_PIN 8 FANMUX0_PIN 53 EXTRUDER_AUTO_FAN_SPEED 100 \ TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 6 HEATER_CHAMBER_PIN 45 \ + BACKLASH_MEASUREMENT_FEEDRATE 600 \ TRAMMING_POINT_XY '{{20,20},{20,20},{20,20},{20,20},{20,20}}' TRAMMING_POINT_NAME_5 '"Point 5"' opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index a7deb02c9f55..74a1db25164f 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -14,8 +14,8 @@ opt_set MOTHERBOARD BOARD_RAMBO \ EXTRUDERS 2 TEMP_SENSOR_0 -2 TEMP_SENSOR_1 1 TEMP_SENSOR_BED 2 \ TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \ TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 3 HEATER_CHAMBER_PIN 45 \ - GRID_MAX_POINTS_X 16 AUTO_POWER_E_TEMP 80 \ - FANMUX0_PIN 53 FIL_MOTION1_PIN 45 + GRID_MAX_POINTS_X 16 BACKLASH_MEASUREMENT_FEEDRATE 600 \ + AUTO_POWER_E_TEMP 80 FANMUX0_PIN 53 FIL_MOTION1_PIN 45 opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PTC_PROBE PTC_BED \ diff --git a/buildroot/tests/teensy35 b/buildroot/tests/teensy35 index bba6859432cf..c7830aeaacf7 100755 --- a/buildroot/tests/teensy35 +++ b/buildroot/tests/teensy35 @@ -98,7 +98,7 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXY" "$3" # Enable COREXZ # restore_configs -opt_set MOTHERBOARD BOARD_TEENSY35_36 +opt_set MOTHERBOARD BOARD_TEENSY35_36 BACKLASH_MEASUREMENT_FEEDRATE 600 opt_enable COREXZ BACKLASH_COMPENSATION BACKLASH_GCODE CORE_BACKLASH exec_test $1 $2 "Teensy 3.5/3.6 COREXZ | BACKLASH" "$3"