From 7717beb79362522b8239d5af62b32ff3d0e2d748 Mon Sep 17 00:00:00 2001 From: kadir ilkimen Date: Wed, 11 Jan 2023 06:29:38 +0200 Subject: [PATCH 01/41] =?UTF-8?q?=E2=9C=A8=20Polar=20Kinematics=20(#25214)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 65 +++++++++-- Marlin/src/MarlinCore.cpp | 2 + Marlin/src/core/language.h | 1 + .../src/feature/bedlevel/ubl/ubl_motion.cpp | 32 +++--- Marlin/src/gcode/calibrate/G33.cpp | 4 +- Marlin/src/gcode/calibrate/M48.cpp | 4 +- Marlin/src/gcode/calibrate/M665.cpp | 19 ++++ Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M114.cpp | 2 +- Marlin/src/gcode/host/M360.cpp | 1 + Marlin/src/gcode/motion/G0_G1.cpp | 2 +- Marlin/src/gcode/motion/G2_G3.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_post.h | 14 +-- Marlin/src/inc/SanityCheck.h | 23 +++- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 4 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 2 +- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 2 +- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/motion.cpp | 38 +++++-- Marlin/src/module/motion.h | 2 + Marlin/src/module/planner.cpp | 61 ++++++++++- Marlin/src/module/planner.h | 10 +- Marlin/src/module/polar.cpp | 102 ++++++++++++++++++ Marlin/src/module/polar.h | 36 +++++++ Marlin/src/module/probe.h | 6 +- Marlin/src/module/stepper.cpp | 2 +- .../sublime/MarlinFirmware.sublime-project | 2 +- 32 files changed, 376 insertions(+), 76 deletions(-) create mode 100644 Marlin/src/module/polar.cpp create mode 100644 Marlin/src/module/polar.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ce6a70a3aaa4..ec3ee87b9cd9 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -915,7 +915,7 @@ #endif // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). - #define DELTA_PRINTABLE_RADIUS 140.0 // (mm) + #define PRINTABLE_RADIUS 140.0 // (mm) // Maximum reachable area #define DELTA_MAX_RADIUS 140.0 // (mm) @@ -969,7 +969,7 @@ #if ENABLED(MORGAN_SCARA) //#define DEBUG_SCARA_KINEMATICS - #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly // Radius around the center where the arm cannot reach #define MIDDLE_DEAD_ZONE_R 0 // (mm) @@ -1004,7 +1004,7 @@ #define TPARA_OFFSET_Y 0 // (mm) #define TPARA_OFFSET_Z 0 // (mm) - #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly // Radius around the center where the arm cannot reach #define MIDDLE_DEAD_ZONE_R 0 // (mm) @@ -1014,6 +1014,59 @@ #define PSI_HOMING_OFFSET 0 #endif +// @section polar + +/** + * POLAR Kinematics + * developed by Kadir ilkimen for PolarBear CNC and babyBear + * https://github.com/kadirilkimen/Polar-Bear-Cnc-Machine + * https://github.com/kadirilkimen/babyBear-3D-printer + * + * A polar machine can have different configurations. + * This kinematics is only compatible with the following configuration: + * X : Independent linear + * Y or B : Polar + * Z : Independent linear + * + * For example, PolarBear has CoreXZ plus Polar Y or B. + * + * Motion problem for Polar axis near center / origin: + * + * 3D printing: + * Movements very close to the center of the polar axis take more time than others. + * This brief delay results in more material deposition due to the pressure in the nozzle. + * + * Current Kinematics and feedrate scaling deals with this by making the movement as fast + * as possible. It works for slow movements but doesn't work well with fast ones. A more + * complicated extrusion compensation must be implemented. + * + * Ideally, it should estimate that a long rotation near the center is ahead and will cause + * unwanted deposition. Therefore it can compensate the extrusion beforehand. + * + * Laser cutting: + * Same thing would be a problem for laser engraving too. As it spends time rotating at the + * center point, more likely it will burn more material than it should. Therefore similar + * compensation would be implemented for laser-cutting operations. + * + * Milling: + * This shouldn't be a problem for cutting/milling operations. + */ +//#define POLAR +#if ENABLED(POLAR) + #define DEFAULT_SEGMENTS_PER_SECOND 180 // If movement is choppy try lowering this value + #define PRINTABLE_RADIUS 82.0f // (mm) Maximum travel of X axis + + // Movements fall inside POLAR_FAST_RADIUS are assigned the highest possible feedrate + // to compensate unwanted deposition related to the near-origin motion problem. + #define POLAR_FAST_RADIUS 3.0f // (mm) + + // Radius which is unreachable by the tool. + // Needed if the tool is not perfectly aligned to the center of the polar axis. + #define POLAR_CENTER_OFFSET 0.0f // (mm) + + #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly +#endif + // @section machine // Articulated robot (arm). Joints are directly mapped to axes with no kinematics. @@ -1420,13 +1473,13 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_FEEDRATE - #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_FEEDRATE)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 676d230d35ea..ed892ac8132a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -168,6 +168,8 @@ #include "module/polargraph.h" #elif IS_SCARA #include "module/scara.h" +#elif ENABLED(POLAR) + #include "module/polar.h" #endif #if HAS_LEVELING diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 545f9df6410b..2d0b23a52998 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -279,6 +279,7 @@ #define STR_S_SEG_PER_SEC "S" #define STR_DELTA_SETTINGS "Delta (L R H S XYZ ABC)" #define STR_SCARA_SETTINGS "SCARA" +#define STR_POLAR_SETTINGS "Polar" #define STR_POLARGRAPH_SETTINGS "Polargraph" #define STR_SCARA_P_T_Z "P T Z" #define STR_ENDSTOP_ADJUSTMENT "Endstop adjustment" diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 96c30a0efd89..1a2b6eb23abd 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -334,16 +334,14 @@ #else // UBL_SEGMENTED #if IS_SCARA - #define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm - #elif ENABLED(DELTA) - #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND) - #elif ENABLED(POLARGRAPH) - #define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND) + #define SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm + #elif IS_KINEMATIC + #define SEGMENT_MIN_LENGTH 0.10 // (mm) Still subject to DEFAULT_SEGMENTS_PER_SECOND #else // CARTESIAN #ifdef LEVELED_SEGMENT_LENGTH - #define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH + #define SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH #else - #define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation) + #define SEGMENT_MIN_LENGTH 1.00 // (mm) Similar to G2/G3 arc segmentation #endif #endif @@ -361,23 +359,23 @@ const xyze_pos_t total = destination - current_position; const float cart_xy_mm_2 = HYPOT2(total.x, total.y), - cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance + cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance #if IS_KINEMATIC - const float seconds = cart_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate - uint16_t segments = LROUND(segments_per_second * seconds), // Preferred number of segments for distance @ feedrate - seglimit = LROUND(cart_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length - NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments) + const float seconds = cart_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate + uint16_t segments = LROUND(segments_per_second * seconds), // Preferred number of segments for distance @ feedrate + seglimit = LROUND(cart_xy_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length + NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments) #else - uint16_t segments = LROUND(cart_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length + uint16_t segments = LROUND(cart_xy_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length #endif - NOLESS(segments, 1U); // Must have at least one segment - const float inv_segments = 1.0f / segments; // Reciprocal to save calculation + NOLESS(segments, 1U); // Must have at least one segment + const float inv_segments = 1.0f / segments; // Reciprocal to save calculation // Add hints to help optimize the move - PlannerHints hints(SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments); // Length of each segment - #if ENABLED(SCARA_FEEDRATE_SCALING) + PlannerHints hints(SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments); // Length of each segment + #if ENABLED(FEEDRATE_SCALING) hints.inv_duration = scaled_fr_mm_s / hints.millimeters; #endif diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 656c23cb78ff..836d5c867b6b 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -407,12 +407,12 @@ void GcodeSuite::G33() { towers_set = !parser.seen_test('T'); // The calibration radius is set to a calculated value - float dcr = probe_at_offset ? DELTA_PRINTABLE_RADIUS : DELTA_PRINTABLE_RADIUS - PROBING_MARGIN; + float dcr = probe_at_offset ? PRINTABLE_RADIUS : PRINTABLE_RADIUS - PROBING_MARGIN; #if HAS_PROBE_XY_OFFSET const float total_offset = HYPOT(probe.offset_xy.x, probe.offset_xy.y); dcr -= probe_at_offset ? _MAX(total_offset, PROBING_MARGIN) : total_offset; #endif - NOMORE(dcr, DELTA_PRINTABLE_RADIUS); + NOMORE(dcr, PRINTABLE_RADIUS); if (parser.seenval('R')) dcr -= _MAX(parser.value_float(), 0.0f); TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index bfb3b640078b..ff14175c71d7 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -162,8 +162,8 @@ void GcodeSuite::M48() { float angle = random(0, 360); const float radius = random( #if ENABLED(DELTA) - int(0.1250000000 * (DELTA_PRINTABLE_RADIUS)), - int(0.3333333333 * (DELTA_PRINTABLE_RADIUS)) + int(0.1250000000 * (PRINTABLE_RADIUS)), + int(0.3333333333 * (PRINTABLE_RADIUS)) #else int(5), int(0.125 * _MIN(X_BED_SIZE, Y_BED_SIZE)) #endif diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index a8e02831e2a8..22ad80425ac7 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -181,6 +181,25 @@ ); } +#elif ENABLED(POLAR) + + #include "../../module/polar.h" + + /** + * M665: Set POLAR settings + * Parameters: + * S[segments] - Segments-per-second + */ + void GcodeSuite::M665() { + if (!parser.seen_any()) return M665_report(); + if (parser.seenval('S')) segments_per_second = parser.value_float(); + } + + void GcodeSuite::M665_report(const bool forReplay/*=true*/) { + report_heading_etc(forReplay, F(STR_POLAR_SETTINGS)); + SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second); + } + #endif #endif // IS_KINEMATIC diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index b50d8363a4cf..9d5621f0c3dd 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -335,7 +335,7 @@ #include "../feature/encoder_i2c.h" #endif -#if IS_SCARA || defined(G0_FEEDRATE) +#if EITHER(IS_SCARA, POLAR) || defined(G0_FEEDRATE) #define HAS_FAST_MOVES 1 #endif diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 60359eeecfae..e6e83ba6e598 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -71,7 +71,7 @@ #if IS_KINEMATIC // Kinematics applied to the leveled position - SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: ")); + SERIAL_ECHOPGM(TERN(POLAR, "Polar", TERN(IS_SCARA, "Scara", "Delta")) "K: " ); inverse_kinematics(leveled); // writes delta[] report_linear_axis_pos(delta); #endif diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index b3a95a35aaec..d8e166dad8e0 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -161,6 +161,7 @@ void GcodeSuite::M360() { SERIAL_ECHOLNPGM( TERN_(DELTA, "Delta") TERN_(IS_SCARA, "SCARA") + TERN_(POLAR, "Polar") TERN_(IS_CORE, "Core") TERN_(MARKFORGED_XY, "MarkForgedXY") TERN_(MARKFORGED_YX, "MarkForgedYX") diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index cee2f050807e..b10f1ac920d6 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -106,7 +106,7 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) { #endif // FWRETRACT - #if IS_SCARA + #if EITHER(IS_SCARA, POLAR) fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination(); #else prepare_line_to_destination(); diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 1a0a9c8cccf2..2634117cd9c0 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -218,7 +218,7 @@ void plan_arc( // Add hints to help optimize the move PlannerHints hints; - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if ENABLED(FEEDRATE_SCALING) hints.inv_duration = (scaled_fr_mm_s / flat_mm) * segments; #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 0a66284df6d2..5463e9169c05 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1406,7 +1406,7 @@ #if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA) #define IS_SCARA 1 #define IS_KINEMATIC 1 -#elif EITHER(DELTA, POLARGRAPH) +#elif ANY(DELTA, POLARGRAPH, POLAR) #define IS_KINEMATIC 1 #else #define IS_CARTESIAN 1 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index b9bcb4d0d286..8fe9a408f22d 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -267,6 +267,7 @@ */ #if IS_KINEMATIC #undef LCD_BED_TRAMMING + #undef SLOWDOWN #endif /** @@ -274,12 +275,11 @@ * Printable radius assumes joints can fully extend */ #if IS_SCARA - #undef SLOWDOWN #if ENABLED(AXEL_TPARA) - #define SCARA_PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2) + #define PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2) #else #define QUICK_HOME - #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) + #define PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) #endif #endif @@ -378,7 +378,6 @@ */ #if ENABLED(DELTA) #undef Z_SAFE_HOMING - #undef SLOWDOWN #endif #ifndef MESH_INSET @@ -3083,7 +3082,10 @@ /** * Only constrain Z on DELTA / SCARA machines */ -#if IS_KINEMATIC +#if ENABLED(POLAR) + #undef MIN_SOFTWARE_ENDSTOP_Y + #undef MAX_SOFTWARE_ENDSTOP_Y +#elif IS_KINEMATIC #undef MIN_SOFTWARE_ENDSTOP_X #undef MIN_SOFTWARE_ENDSTOP_Y #undef MAX_SOFTWARE_ENDSTOP_X @@ -3154,7 +3156,7 @@ #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #if IS_KINEMATIC // Probing points may be verified at compile time within the radius - // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") + // 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) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2ef6fd33567d..6cad2e3c72c3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -658,6 +658,12 @@ #error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND." #elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI) #error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE." +#elif defined(DELTA_PRINTABLE_RADIUS) + #error "DELTA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS." +#elif defined(SCARA_PRINTABLE_RADIUS) + #error "SCARA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS." +#elif defined(SCARA_FEEDRATE_SCALING) + #error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING." #endif // L64xx stepper drivers have been removed @@ -1371,6 +1377,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +/** + * POLAR warnings + */ +#if BOTH(POLAR, S_CURVE_ACCELERATION) + #warning "POLAR Kinematics may not work well with S_CURVE_ACCELERATION." +#endif + /** * Special tool-changing options */ @@ -1666,8 +1679,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Allow only one kinematic type to be defined */ -#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV) - #error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, or FOAMCUTTER_XYUV." +#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, POLAR) + #error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, or POLAR." #endif /** @@ -1695,7 +1708,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Junction deviation is incompatible with kinematic systems. */ #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC - #error "CLASSIC_JERK is required for DELTA and SCARA." + #error "CLASSIC_JERK is required for DELTA, SCARA, and POLAR." #endif /** @@ -1913,7 +1926,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0."); #endif - #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))) + #define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)) static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large."); static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large."); static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large."); @@ -2004,6 +2017,8 @@ 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 ENABLED(POLAR) + #error "AUTO_BED_LEVELING_UBL does not yet support POLAR printers." #elif DISABLED(EEPROM_SETTINGS) #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index afb18f24dbc9..f950d7451c45 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -281,7 +281,7 @@ void DWINUI::Draw_FillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) { // color2 : End color uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) { uint8_t B, G, R; - const float n = (float)(val - minv) / (maxv - minv); + const float n = float(val - minv) / (maxv - minv); R = (1 - n) * GetRColor(color1) + n * GetRColor(color2); G = (1 - n) * GetGColor(color1) + n * GetGColor(color2); B = (1 - n) * GetBColor(color1) + n * GetBColor(color2); @@ -296,7 +296,7 @@ uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { uint8_t B, G, R; const uint8_t maxB = 28, maxR = 28, maxG = 38; const int16_t limv = _MAX(abs(minv), abs(maxv)); - float n = minv >= 0 ? (float)(val - minv) / (maxv - minv) : (float)val / limv; + float n = minv >= 0 ? float(val - minv) / (maxv - minv) : (float)val / limv; LIMIT(n, -1, 1); if (n < 0) { R = 0; diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 4422e8115d8a..da04c9bc8b5f 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -333,7 +333,7 @@ namespace ExtUI { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z) { - max = SQRT(sq(float(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis + max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis min = -max; } #endif diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index ae935e53c446..94663744ea23 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -92,7 +92,7 @@ void _man_probe_pt(const xy_pos_t &xy) { } void _goto_tower_a(const_float_t a) { - float dcr = DELTA_PRINTABLE_RADIUS - PROBING_MARGIN; + float dcr = PRINTABLE_RADIUS - PROBING_MARGIN; TERN_(HAS_PROBE_XY_OFFSET, dcr -= HYPOT(probe.offset_xy.x, probe.offset_xy.y)); TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) }; diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index b25dd73f26e7..ffd60f77e8e4 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -68,7 +68,7 @@ void lcd_move_axis(const AxisEnum axis) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 585aef05694e..6511757d7dfa 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -734,7 +734,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS && axis != E_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index a7c49241b473..85ed59b2cce9 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -714,7 +714,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS && axis != E_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index c5e03566a9b1..e8d51d89a10f 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -715,7 +715,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS && axis != E_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index ce2a6f4adad0..58dc13972cb2 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -132,7 +132,7 @@ float delta_safe_distance_from_top() { xyz_pos_t cartesian{0}; inverse_kinematics(cartesian); const float centered_extent = delta.a; - cartesian.y = DELTA_PRINTABLE_RADIUS; + cartesian.y = PRINTABLE_RADIUS; inverse_kinematics(cartesian); return ABS(centered_extent - delta.a); } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index dadbfab29724..17c607da0830 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -38,6 +38,10 @@ #include "../lcd/marlinui.h" #endif +#if ENABLED(POLAR) + #include "polar.h" +#endif + #if HAS_BED_PROBE #include "probe.h" #endif @@ -145,11 +149,14 @@ xyz_pos_t cartes; #if HAS_SOFTWARE_ENDSTOPS float delta_max_radius, delta_max_radius_2; #elif IS_SCARA - constexpr float delta_max_radius = SCARA_PRINTABLE_RADIUS, - delta_max_radius_2 = sq(SCARA_PRINTABLE_RADIUS); + constexpr float delta_max_radius = PRINTABLE_RADIUS, + delta_max_radius_2 = sq(PRINTABLE_RADIUS); + #elif ENABLED(POLAR) + constexpr float delta_max_radius = PRINTABLE_RADIUS, + delta_max_radius_2 = sq(PRINTABLE_RADIUS); #else // DELTA - constexpr float delta_max_radius = DELTA_PRINTABLE_RADIUS, - delta_max_radius_2 = sq(DELTA_PRINTABLE_RADIUS); + constexpr float delta_max_radius = PRINTABLE_RADIUS, + delta_max_radius_2 = sq(PRINTABLE_RADIUS); #endif #endif @@ -183,6 +190,7 @@ xyz_pos_t cartes; inline void report_more_positions() { stepper.report_positions(); TERN_(IS_SCARA, scara_report_positions()); + TERN_(POLAR, polar_report_positions()); } // Report the logical position for a given machine position @@ -277,8 +285,7 @@ void report_current_position_projected() { #endif ); - stepper.report_positions(); - TERN_(IS_SCARA, scara_report_positions()); + report_more_positions(); report_current_grblstate_moving(); } @@ -308,7 +315,7 @@ void report_current_position_projected() { #if ENABLED(DELTA) - can_reach = HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop); + can_reach = HYPOT2(rx, ry) <= sq(PRINTABLE_RADIUS - inset + fslop); #elif ENABLED(AXEL_TPARA) @@ -343,6 +350,8 @@ void report_current_position_projected() { && b < polargraph_max_belt_len + 1 ); + #elif ENABLED(POLAR) + can_reach = HYPOT(rx, ry) <= PRINTABLE_RADIUS; #endif return can_reach; @@ -426,6 +435,9 @@ void get_cartesian_from_steppers() { OPTARG(AXEL_TPARA, planner.get_axis_position_degrees(C_AXIS)) ); cartes.z = planner.get_axis_position_mm(Z_AXIS); + #elif ENABLED(POLAR) + forward_kinematics(planner.get_axis_position_mm(X_AXIS), planner.get_axis_position_degrees(B_AXIS)); + cartes.z = planner.get_axis_position_mm(Z_AXIS); #else NUM_AXIS_CODE( cartes.x = planner.get_axis_position_mm(X_AXIS), @@ -914,6 +926,8 @@ void restore_feedrate_and_scaling() { #if BOTH(HAS_HOTEND_OFFSET, DELTA) // The effector center position will be the target minus the hotend offset. const xy_pos_t offs = hotend_offset[active_extruder]; + #elif ENABLED(POLAR) + // For now, we don't limit POLAR #else // SCARA needs to consider the angle of the arm through the entire move, so for now use no tool offset. constexpr xy_pos_t offs{0}; @@ -922,6 +936,8 @@ void restore_feedrate_and_scaling() { #if ENABLED(POLARGRAPH) LIMIT(target.x, draw_area_min.x, draw_area_max.x); LIMIT(target.y, draw_area_min.y, draw_area_max.y); + #elif ENABLED(POLAR) + // Motion limits are as same as cartesian limits. #else if (TERN1(IS_SCARA, axis_was_homed(X_AXIS) && axis_was_homed(Y_AXIS))) { const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y); @@ -1055,6 +1071,8 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { * and compare the difference. */ #define SCARA_MIN_SEGMENT_LENGTH 0.5f + #elif ENABLED(POLAR) + #define POLAR_MIN_SEGMENT_LENGTH 0.5f #endif /** @@ -1107,6 +1125,8 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { // For SCARA enforce a minimum segment size #if IS_SCARA NOMORE(segments, cartesian_mm * RECIPROCAL(SCARA_MIN_SEGMENT_LENGTH)); + #elif ENABLED(POLAR) + NOMORE(segments, cartesian_mm * RECIPROCAL(POLAR_MIN_SEGMENT_LENGTH)); #endif // At least one segment is required @@ -1118,7 +1138,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { // Add hints to help optimize the move PlannerHints hints(cartesian_mm * inv_segments); - TERN_(SCARA_FEEDRATE_SCALING, hints.inv_duration = scaled_fr_mm_s / hints.millimeters); + TERN_(FEEDRATE_SCALING, hints.inv_duration = scaled_fr_mm_s / hints.millimeters); /* SERIAL_ECHOPGM("mm=", cartesian_mm); @@ -1185,7 +1205,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { // Add hints to help optimize the move PlannerHints hints(cartesian_mm * inv_segments); - TERN_(SCARA_FEEDRATE_SCALING, hints.inv_duration = scaled_fr_mm_s / hints.millimeters); + TERN_(FEEDRATE_SCALING, hints.inv_duration = scaled_fr_mm_s / hints.millimeters); //SERIAL_ECHOPGM("mm=", cartesian_mm); //SERIAL_ECHOLNPGM(" segments=", segments); diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index ce9094765765..8950cf6f228d 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -32,6 +32,8 @@ #if IS_SCARA #include "scara.h" +#elif ENABLED(POLAR) + #include "polar.h" #endif // Error margin to work around float imprecision diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 867b6a98a876..aceaf8a253a5 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -3161,24 +3161,75 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s ? xyz_pos_t(cart_dist_mm).magnitude() : TERN0(HAS_Z_AXIS, ABS(cart_dist_mm.z)); - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if DISABLED(FEEDRATE_SCALING) + + const feedRate_t feedrate = fr_mm_s; + + #elif IS_SCARA + // For SCARA scale the feedrate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. const float duration_recip = hints.inv_duration ?: fr_mm_s / ph.millimeters; const xyz_pos_t diff = delta - position_float; const feedRate_t feedrate = diff.magnitude() * duration_recip; - #else - const feedRate_t feedrate = fr_mm_s; - #endif + + #elif ENABLED(POLAR) + + /** + * Motion problem for Polar axis near center / origin: + * + * 3D printing: + * Movements very close to the center of the polar axis take more time than others. + * This brief delay results in more material deposition due to the pressure in the nozzle. + * + * Current Kinematics and feedrate scaling deals with this by making the movement as fast + * as possible. It works for slow movements but doesn't work well with fast ones. A more + * complicated extrusion compensation must be implemented. + * + * Ideally, it should estimate that a long rotation near the center is ahead and will cause + * unwanted deposition. Therefore it can compensate the extrusion beforehand. + * + * Laser cutting: + * Same thing would be a problem for laser engraving too. As it spends time rotating at the + * center point, more likely it will burn more material than it should. Therefore similar + * compensation would be implemented for laser-cutting operations. + * + * Milling: + * This shouldn't be a problem for cutting/milling operations. + */ + feedRate_t calculated_feedrate = fr_mm_s; + const xyz_pos_t diff = delta - position_float; + if (!NEAR_ZERO(diff.b)) { + if (delta.a <= POLAR_FAST_RADIUS ) + calculated_feedrate = settings.max_feedrate_mm_s[Y_AXIS]; + else { + // Normalized vector of movement + const float diffBLength = ABS((2.0f * PI * diff.a) * (diff.b / 360.0f)), + diffTheta = DEGREES(ATAN2(diff.a, diffBLength)), + normalizedTheta = 1.0f - (ABS(diffTheta > 90.0f ? 180.0f - diffTheta : diffTheta) / 90.0f); + + // Normalized position along the radius + const float radiusRatio = PRINTABLE_RADIUS/delta.a; + calculated_feedrate += (fr_mm_s * radiusRatio * normalizedTheta); + } + } + const feedRate_t feedrate = calculated_feedrate; + + #endif // POLAR && FEEDRATE_SCALING + TERN_(HAS_EXTRUDERS, delta.e = machine.e); if (buffer_segment(delta OPTARG(HAS_DIST_MM_ARG, cart_dist_mm), feedrate, extruder, ph)) { position_cart = cart; return true; } return false; - #else + + #else // !IS_KINEMATIC + return buffer_segment(machine, fr_mm_s, extruder, hints); + #endif + } // buffer_line() #if ENABLED(DIRECT_STEPPING) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 04cde2381da2..7cc8bc08e4eb 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -50,6 +50,8 @@ #include "delta.h" #elif ENABLED(POLARGRAPH) #include "polargraph.h" +#elif ENABLED(POLAR) + #include "polar.h" #endif #if ABL_PLANAR @@ -291,7 +293,7 @@ typedef struct PlannerBlock { } block_t; -#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY) +#if ANY(LIN_ADVANCE, FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY) #define HAS_POSITION_FLOAT 1 #endif @@ -361,7 +363,7 @@ typedef struct { struct PlannerHints { float millimeters = 0.0; // Move Length, if known, else 0. - #if ENABLED(SCARA_FEEDRATE_SCALING) + #if ENABLED(FEEDRATE_SCALING) float inv_duration = 0.0; // Reciprocal of the move duration, if known #endif #if ENABLED(HINTS_CURVE_RADIUS) @@ -913,8 +915,8 @@ class Planner { return out; } - // SCARA AB axes are in degrees, not mm - #if IS_SCARA + // SCARA AB and Polar YB axes are in degrees, not mm + #if EITHER(IS_SCARA, POLAR) FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); } #endif diff --git a/Marlin/src/module/polar.cpp b/Marlin/src/module/polar.cpp new file mode 100644 index 000000000000..4fbd33cccf53 --- /dev/null +++ b/Marlin/src/module/polar.cpp @@ -0,0 +1,102 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * POLAR Kinematics + * developed by Kadir ilkimen for PolarBear CNC and babyBear + * https://github.com/kadirilkimen/Polar-Bear-Cnc-Machine + * https://github.com/kadirilkimen/babyBear-3D-printer + * + * A polar machine can have different configurations. + * This kinematics is only compatible with the following configuration: + * X : Independent linear + * Y or B : Polar + * Z : Independent linear + * + * For example, PolarBear has CoreXZ plus Polar Y or B. + */ + +#include "../inc/MarlinConfigPre.h" + +#if ENABLED(POLAR) + +#include "polar.h" +#include "motion.h" +#include "planner.h" + +#include "../inc/MarlinConfig.h" + +float segments_per_second = DEFAULT_SEGMENTS_PER_SECOND, + polar_center_offset = POLAR_CENTER_OFFSET; + +float absoluteAngle(float a) { + if (a < 0.0) while (a < 0.0) a += 360.0; + else if (a > 360.0) while (a > 360.0) a -= 360.0; + return a; +} + +void forward_kinematics(const_float_t r, const_float_t theta) { + const float absTheta = absoluteAngle(theta); + float radius = r; + if (polar_center_offset > 0.0) radius = SQRT( ABS( sq(r) - sq(-polar_center_offset) ) ); + cartes.x = cos(RADIANS(absTheta))*radius; + cartes.y = sin(RADIANS(absTheta))*radius; +} + +void inverse_kinematics(const xyz_pos_t &raw) { + const float x = raw.x, y = raw.y, + rawRadius = HYPOT(x,y), + posTheta = DEGREES(ATAN2(y, x)); + + static float current_polar_theta = 0; + + float r = rawRadius, + theta = absoluteAngle(posTheta), + currentAbsTheta = absoluteAngle(current_polar_theta); + + if (polar_center_offset > 0.0) { + const float offsetRadius = SQRT(ABS(sq(r) - sq(polar_center_offset))); + float offsetTheta = absoluteAngle(DEGREES(ATAN2(polar_center_offset, offsetRadius))); + theta = absoluteAngle(offsetTheta + theta); + } + + const float deltaTheta = theta - currentAbsTheta; + if (ABS(deltaTheta) <= 180) + theta = current_polar_theta + deltaTheta; + else { + if (currentAbsTheta > 180) theta = current_polar_theta + 360 + deltaTheta; + else theta = current_polar_theta - (360 - deltaTheta); + } + + current_polar_theta = theta; + + delta.set(r, theta, raw.z); +} + +void polar_report_positions() { + SERIAL_ECHOLNPGM("X: ", planner.get_axis_position_mm(X_AXIS), + " POLAR Theta:", planner.get_axis_position_degrees(B_AXIS), + " Z: ", planner.get_axis_position_mm(Z_AXIS) + ); +} + +#endif diff --git a/Marlin/src/module/polar.h b/Marlin/src/module/polar.h new file mode 100644 index 000000000000..79fbd4194d53 --- /dev/null +++ b/Marlin/src/module/polar.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * polar.h - POLAR-specific functions + */ + +#include "../core/types.h" + +extern float segments_per_second; + +float absoluteAngle(float a); +void forward_kinematics(const_float_t r, const_float_t theta); + +void inverse_kinematics(const xyz_pos_t &raw); +void polar_report_positions(); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 96d22fdd389c..92909834945f 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -195,12 +195,8 @@ class Probe { #if HAS_BED_PROBE || HAS_LEVELING #if IS_KINEMATIC - static constexpr float printable_radius = ( - TERN_(DELTA, DELTA_PRINTABLE_RADIUS) - TERN_(IS_SCARA, SCARA_PRINTABLE_RADIUS) - ); static constexpr float probe_radius(const xy_pos_t &probe_offset_xy=offset_xy) { - return printable_radius - _MAX(PROBING_MARGIN, HYPOT(probe_offset_xy.x, probe_offset_xy.y)); + return float(PRINTABLE_RADIUS) - _MAX(PROBING_MARGIN, HYPOT(probe_offset_xy.x, probe_offset_xy.y)); } #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 70a1e25ceca3..9c3d459634e3 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3212,7 +3212,7 @@ int32_t Stepper::triggered_position(const AxisEnum axis) { #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX, IS_SCARA, DELTA) #define SAYS_A 1 #endif -#if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX, IS_SCARA, DELTA) +#if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX, IS_SCARA, DELTA, POLAR) #define SAYS_B 1 #endif #if ANY(CORE_IS_XZ, CORE_IS_YZ, DELTA) diff --git a/buildroot/share/sublime/MarlinFirmware.sublime-project b/buildroot/share/sublime/MarlinFirmware.sublime-project index e0cf953fa813..11808dd45df0 100644 --- a/buildroot/share/sublime/MarlinFirmware.sublime-project +++ b/buildroot/share/sublime/MarlinFirmware.sublime-project @@ -11,7 +11,7 @@ ".vscode" ], "binary_file_patterns": - [ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff" ], + [ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff", "*.otf" ], "file_exclude_patterns": [ "Marlin/platformio.ini", From 01e58de31a804731d21c491952afd2347fda3753 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 10 Jan 2023 22:38:08 -0600 Subject: [PATCH 02/41] =?UTF-8?q?=F0=9F=A9=B9=20ProUI=20-=20Remove=20Manua?= =?UTF-8?q?lZOffset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 1 + Marlin/src/inc/Conditionals_adv.h | 3 +++ Marlin/src/inc/SanityCheck.h | 20 +++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 19 ++++--------------- Marlin/src/lcd/e3v2/proui/dwin.h | 12 ++++++++---- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 10 ++++++---- Marlin/src/module/probe.h | 8 +++----- 7 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5463e9169c05..88d7c91c6ef3 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1298,6 +1298,7 @@ // Clear probe pin settings when no probe is selected #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef USE_PROBE_FOR_Z_HOMING + #undef Z_MIN_PROBE_REPEATABILITY_TEST #endif #if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index bf1088afc898..ea52c9b99861 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -79,6 +79,9 @@ #define SERVO_DELAY { 50 } #endif +#if !HAS_BED_PROBE + #undef BABYSTEP_ZPROBE_OFFSET +#endif #if !HAS_STOWABLE_PROBE #undef PROBE_DEPLOY_STOW_MENU #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6cad2e3c72c3..5eb057e6646d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1938,15 +1938,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Make sure Z raise values are set */ #ifndef Z_CLEARANCE_DEPLOY_PROBE - #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration." - #elif !defined(Z_CLEARANCE_BETWEEN_PROBES) - #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration." - #elif Z_CLEARANCE_DEPLOY_PROBE < 0 - #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." - #elif Z_CLEARANCE_BETWEEN_PROBES < 0 - #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." + #error "Z_CLEARANCE_DEPLOY_PROBE is required for bed probes." + #else + static_assert(Z_CLEARANCE_DEPLOY_PROBE >= 0, "Probes require Z_CLEARANCE_DEPLOY_PROBE >= 0."); + #endif + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #error "Z_CLEARANCE_BETWEEN_PROBES is required for bed probes." + #else + static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0."); + #endif + #ifdef Z_AFTER_PROBING + static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0."); #endif #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0 diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index deefbf25734b..098db27b1b87 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -109,14 +109,8 @@ #include "../../../feature/bltouch.h" #endif -#if EITHER(BABYSTEPPING, HAS_BED_PROBE) - #define HAS_ZOFFSET_ITEM 1 - #if ENABLED(BABYSTEPPING) - #include "../../../feature/babystep.h" - #if !HAS_BED_PROBE - #define JUST_BABYSTEP 1 - #endif - #endif +#if ENABLED(BABYSTEPPING) + #include "../../../feature/babystep.h" #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -197,8 +191,8 @@ #define DWIN_UPDATE_INTERVAL 1024 #define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20) -#if HAS_MESH - #define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset) +#if HAS_MESH && HAS_BED_PROBE + #define BABY_Z_VAR probe.offset.z #else float z_offset = 0; #define BABY_Z_VAR z_offset @@ -1473,10 +1467,6 @@ void DWIN_HomingStart() { void DWIN_HomingDone() { HMI_flag.home_flag = false; - #if DISABLED(HAS_BED_PROBE) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - planner.synchronize(); - babystep.add_mm(Z_AXIS, HMI_data.ManualZOffset); - #endif HMI_ReturnScreen(); } @@ -1696,7 +1686,6 @@ void DWIN_SetDataDefaults() { #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) HMI_data.z_after_homing = DEF_Z_AFTER_HOMING; #endif - IF_DISABLED(HAS_BED_PROBE, HMI_data.ManualZOffset = 0); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) TERN_(LED_COLOR_PRESETS, leds.set_default()); ApplyLEDColor(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 50be4a8ba5a2..27e1b4ebfacb 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -35,6 +35,13 @@ #include "../common/encoder.h" #include "../../../libs/BL24CXX.h" +#if EITHER(BABYSTEPPING, HAS_BED_PROBE) + #define HAS_ZOFFSET_ITEM 1 + #if !HAS_BED_PROBE + #define JUST_BABYSTEP 1 + #endif +#endif + namespace GET_LANG(LCD_LANGUAGE) { #define _MSG_PREHEAT(N) \ LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \ @@ -118,15 +125,12 @@ typedef struct { #if ENABLED(BAUD_RATE_GCODE) bool Baud115K = false; #endif + bool FullManualTramming = false; bool MediaAutoMount = ENABLED(HAS_SD_EXTENDER); #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) uint8_t z_after_homing = DEF_Z_AFTER_HOMING; #endif - #if ENABLED(MESH_BED_LEVELING) - float ManualZOffset = 0; - #endif - // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) LEDColor Led_Color = Def_Leds_Color; #endif diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 294666e35621..9505a82dd77c 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -68,10 +68,12 @@ // void _lcd_level_bed_done() { if (!ui.wait_for_move) { - #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING) - // Display "Done" screen and wait for moves to complete - line_to_z(Z_AFTER_PROBING); - ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); + #if DISABLED(MESH_BED_LEVELING) && defined(Z_AFTER_PROBING) + if (Z_AFTER_PROBING) { + // Display "Done" screen and wait for moves to complete + line_to_z(Z_AFTER_PROBING); + ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); + } #endif ui.goto_previous_screen_no_defer(); ui.completion_feedback(); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 92909834945f..9b2855132249 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -161,11 +161,9 @@ class Probe { #endif static void move_z_after_homing() { - #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - do_z_clearance(HMI_data.z_after_homing, true); - #elif defined(Z_AFTER_HOMING) - do_z_clearance(Z_AFTER_HOMING, true); - #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE) + #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) || defined(Z_AFTER_HOMING) + do_z_clearance(Z_POST_CLEARANCE, true); + #elif HAS_BED_PROBE move_z_after_probing(); #endif } From 250fd60920142467c4c44370abf6446744b557ef Mon Sep 17 00:00:00 2001 From: Alex Z Date: Wed, 11 Jan 2023 15:22:28 +1000 Subject: [PATCH 03/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Chitu=20V6=20Z=5FSTO?= =?UTF-8?q?P=5FPIN=20(#25227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index b76ef52c420a..89e07d6a21e8 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -27,6 +27,8 @@ #define Z2_STEP_PIN PF5 #define Z2_DIR_PIN PF1 +#define Z_STOP_PIN PA14 + #ifndef FIL_RUNOUT2_PIN #define FIL_RUNOUT2_PIN PF13 #endif From 64167dfe79df4ef5f69b2632e3c0cc162fb22914 Mon Sep 17 00:00:00 2001 From: Powerlated Date: Wed, 11 Jan 2023 00:40:15 -0500 Subject: [PATCH 04/41] =?UTF-8?q?=E2=9C=A8=20PREHEAT=5FTIME=5FBED=5FMS=20(?= =?UTF-8?q?#25146)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 +- Marlin/src/inc/SanityCheck.h | 10 ++++-- Marlin/src/module/temperature.cpp | 56 ++++++++++++++++++------------- Marlin/src/module/temperature.h | 52 +++++++++++++++++++--------- 4 files changed, 78 insertions(+), 43 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c41cb04803dc..bf4b439d8531 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -493,7 +493,8 @@ * the minimum temperature your thermistor can read. The lower the better/safer. * This shouldn't need to be more than 30 seconds (30000) */ -//#define MILLISECONDS_PREHEAT_TIME 0 +//#define PREHEAT_TIME_HOTEND_MS 0 +//#define PREHEAT_TIME_BED_MS 0 // @section extruder diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 5eb057e6646d..485eb9011d2c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -664,6 +664,8 @@ #error "SCARA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS." #elif defined(SCARA_FEEDRATE_SCALING) #error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING." +#elif defined(MILLISECONDS_PREHEAT_TIME) + #error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS." #endif // L64xx stepper drivers have been removed @@ -2400,12 +2402,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5 #error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5." - #elif MILLISECONDS_PREHEAT_TIME < 15000 - #error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 15000, but 30000 or higher is recommended." + #elif PREHEAT_TIME_HOTEND_MS < 15000 + #error "Thermistor 66 requires PREHEAT_TIME_HOTEND_MS ≥ 15000, but 30000 or higher is recommended." #endif #undef _BAD_MINTEMP #endif +#if TEMP_SENSOR_BED == 66 && PREHEAT_TIME_BED_MS < 15000 + #error "Thermistor 66 requires PREHEAT_TIME_BED_MS ≥ 15000, but 30000 or higher is recommended." +#endif + /** * Required MAX31865 settings */ diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d01b4bc14237..c53fa5df14ef 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -561,8 +561,11 @@ volatile bool Temperature::raw_temps_ready = false; uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; #endif -#if MILLISECONDS_PREHEAT_TIME > 0 - millis_t Temperature::preheat_end_time[HOTENDS] = { 0 }; +#if PREHEAT_TIME_HOTEND_MS > 0 + millis_t Temperature::preheat_end_ms_hotend[HOTENDS] { 0 }; +#endif +#if HAS_HEATED_BED && PREHEAT_TIME_BED_MS > 0 + millis_t Temperature::preheat_end_ms_bed = 0; #endif #if HAS_FAN_LOGIC @@ -1535,7 +1538,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { tr_state_machine[e].run(temp_hotend[e].celsius, temp_hotend[e].target, (heater_id_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); #endif - temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; + temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_hotend_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; #if WATCH_HOTENDS // Make sure temperature is increasing @@ -1609,25 +1612,30 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { #endif if (!bed_timed_out) { - #if ENABLED(PIDTEMPBED) - temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; - #else - // Check if temperature is within the correct band - if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) { - #if ENABLED(BED_LIMIT_SWITCHING) - if (temp_bed.is_above_target((BED_HYSTERESIS) - 1)) - temp_bed.soft_pwm_amount = 0; - else if (temp_bed.is_below_target((BED_HYSTERESIS) - 1)) - temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; - #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - temp_bed.soft_pwm_amount = temp_bed.is_below_target() ? MAX_BED_POWER >> 1 : 0; - #endif - } - else { - temp_bed.soft_pwm_amount = 0; - WRITE_HEATER_BED(LOW); - } - #endif + if (is_bed_preheating()) { + temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; + } + else { + #if ENABLED(PIDTEMPBED) + temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; + #else + // Check if temperature is within the correct band + if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) { + #if ENABLED(BED_LIMIT_SWITCHING) + if (temp_bed.is_above_target((BED_HYSTERESIS) - 1)) + temp_bed.soft_pwm_amount = 0; + else if (temp_bed.is_below_target((BED_HYSTERESIS) - 1)) + temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; + #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING + temp_bed.soft_pwm_amount = temp_bed.is_below_target() ? MAX_BED_POWER >> 1 : 0; + #endif + } + else { + temp_bed.soft_pwm_amount = 0; + WRITE_HEATER_BED(LOW); + } + #endif + } } } while (false); @@ -2394,7 +2402,7 @@ void Temperature::updateTemperaturesFromRawValues() { //*/ const bool heater_on = temp_hotend[e].target > 0; - if (heater_on && !is_preheating(e) && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) { + if (heater_on && !is_hotend_preheating(e) && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) { if (TERN1(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, ++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)) mintemp_error((heater_id_t)e); } @@ -2408,7 +2416,7 @@ void Temperature::updateTemperaturesFromRawValues() { #define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B))) #if ENABLED(THERMAL_PROTECTION_BED) if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) maxtemp_error(H_BED); - if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) mintemp_error(H_BED); + if (temp_bed.target > 0 && !is_bed_preheating() && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) mintemp_error(H_BED); #endif #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 091f218eb837..d099c3d73b36 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -748,10 +748,6 @@ class Temperature { static uint8_t consecutive_low_temperature_error[HOTENDS]; #endif - #if MILLISECONDS_PREHEAT_TIME > 0 - static millis_t preheat_end_time[HOTENDS]; - #endif - #if HAS_FAN_LOGIC static millis_t fan_update_ms; @@ -907,20 +903,38 @@ class Temperature { static void task(); /** - * Preheating hotends + * Preheating hotends & bed */ - #if MILLISECONDS_PREHEAT_TIME > 0 - static bool is_preheating(const uint8_t E_NAME) { - return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); + #if PREHEAT_TIME_HOTEND_MS > 0 + static millis_t preheat_end_ms_hotend[HOTENDS]; + static bool is_hotend_preheating(const uint8_t E_NAME) { + return preheat_end_ms_hotend[HOTEND_INDEX] && PENDING(millis(), preheat_end_ms_hotend[HOTEND_INDEX]); } - static void start_preheat_time(const uint8_t E_NAME) { - preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; + static void start_hotend_preheat_time(const uint8_t E_NAME) { + preheat_end_ms_hotend[HOTEND_INDEX] = millis() + PREHEAT_TIME_HOTEND_MS; } - static void reset_preheat_time(const uint8_t E_NAME) { - preheat_end_time[HOTEND_INDEX] = 0; + static void reset_hotend_preheat_time(const uint8_t E_NAME) { + preheat_end_ms_hotend[HOTEND_INDEX] = 0; } #else - #define is_preheating(n) (false) + static bool is_hotend_preheating(const uint8_t) { return false; } + #endif + + #if HAS_HEATED_BED + #if PREHEAT_TIME_BED_MS > 0 + static millis_t preheat_end_ms_bed; + static bool is_bed_preheating() { + return preheat_end_ms_bed && PENDING(millis(), preheat_end_ms_bed); + } + static void start_bed_preheat_time() { + preheat_end_ms_bed = millis() + PREHEAT_TIME_BED_MS; + } + static void reset_bed_preheat_time() { + preheat_end_ms_bed = 0; + } + #else + static bool is_bed_preheating() { return false; } + #endif #endif //high level conversion routines, for use outside of temperature.cpp @@ -949,11 +963,11 @@ class Temperature { static void setTargetHotend(const celsius_t celsius, const uint8_t E_NAME) { const uint8_t ee = HOTEND_INDEX; - #if MILLISECONDS_PREHEAT_TIME > 0 + #if PREHEAT_TIME_HOTEND_MS > 0 if (celsius == 0) - reset_preheat_time(ee); + reset_hotend_preheat_time(ee); else if (temp_hotend[ee].target == 0) - start_preheat_time(ee); + start_hotend_preheat_time(ee); #endif TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); temp_hotend[ee].target = _MIN(celsius, hotend_max_target(ee)); @@ -1016,6 +1030,12 @@ class Temperature { static void start_watching_bed() { TERN_(WATCH_BED, watch_bed.restart(degBed(), degTargetBed())); } static void setTargetBed(const celsius_t celsius) { + #if PREHEAT_TIME_BED_MS > 0 + if (celsius == 0) + reset_bed_preheat_time(); + else if (temp_bed.target == 0) + start_bed_preheat_time(); + #endif TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); temp_bed.target = _MIN(celsius, BED_MAX_TARGET); start_watching_bed(); From fe62c8006ab4884c73aa4cc2d58a1d8a13265d11 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 11 Jan 2023 06:24:37 +0000 Subject: [PATCH 05/41] [cron] Bump distribution date (2023-01-11) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 8da8df7c8399..91037353e878 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-10" +//#define STRING_DISTRIBUTION_DATE "2023-01-11" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index df695014d2de..d3c0f4f717e4 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 "2023-01-10" + #define STRING_DISTRIBUTION_DATE "2023-01-11" #endif /** From 5af5c2a35c2bfa6c3128fd69f4c57a5eccc82147 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Jan 2023 01:19:45 -0600 Subject: [PATCH 06/41] =?UTF-8?q?=F0=9F=94=A8=20Improve=20config.ini=20par?= =?UTF-8?q?ser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/configuration.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index aed9fc2f3d02..d752ebc2c828 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -180,10 +180,11 @@ def apply_config_ini(cp): # For a key ending in .ini load and parse another .ini file if ckey.endswith('.ini'): sect = 'base' - if '@' in ckey: sect, ckey = ckey.split('@') - other_ini = configparser.ConfigParser() - other_ini.read(config_path(ckey)) - apply_sections(other_ini, sect) + if '@' in ckey: sect, ckey = map(str.strip, ckey.split('@')) + cp2 = configparser.ConfigParser() + cp2.read(config_path(ckey)) + apply_sections(cp2, sect) + ckey = 'base'; # (Allow 'example/' as a shortcut for 'examples/') elif ckey.startswith('example/'): @@ -191,11 +192,11 @@ def apply_config_ini(cp): # For 'examples/' fetch an example set from GitHub. # For https?:// do a direct fetch of the URL. - elif ckey.startswith('examples/') or ckey.startswith('http'): + if ckey.startswith('examples/') or ckey.startswith('http:'): fetch_example(ckey) ckey = 'base' - elif ckey == 'all': + if ckey == 'all': apply_sections(cp) else: From 0838f70b25316fa8a06d019e5ed5d446b5c207e2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Jan 2023 01:19:54 -0600 Subject: [PATCH 07/41] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Sim=20with=20USE=5FW?= =?UTF-8?q?ATCHDOG=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/NATIVE_SIM/HAL.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 66203611447f..52e5eb4f3997 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -208,8 +208,8 @@ class MarlinHAL { MarlinHAL() {} // Watchdog - static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); - static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_init(); + static void watchdog_refresh(); static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() From 3d0b11a373746f8a08dc6d84d38e7c747990f143 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 12 Jan 2023 01:39:45 +0000 Subject: [PATCH 08/41] [cron] Bump distribution date (2023-01-12) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 91037353e878..1b9d7c43c657 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-11" +//#define STRING_DISTRIBUTION_DATE "2023-01-12" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d3c0f4f717e4..817fcdc80bde 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 "2023-01-11" + #define STRING_DISTRIBUTION_DATE "2023-01-12" #endif /** From 80dc7b290b38f042eb994b8c306b18c602f410aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Jan 2023 20:31:46 -0600 Subject: [PATCH 09/41] =?UTF-8?q?=F0=9F=94=A7=20Input=20Shaping=20sanity?= =?UTF-8?q?=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 60 +++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 485eb9011d2c..0275c539b508 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4369,34 +4369,52 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." #endif -// Check requirements for Input Shaping -#if HAS_SHAPING && defined(__AVR__) - #ifdef SHAPING_MIN_FREQ - static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0."); - #else - TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set.")); - TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set.")); +/** + * Input Shaping requirements + */ +#if HAS_SHAPING + #if ENABLED(DELTA) + #error "Input Shaping is not compatible with DELTA kinematics." + #elif ENABLED(SCARA) + #error "Input Shaping is not compatible with SCARA kinematics." + #elif ENABLED(TPARA) + #error "Input Shaping is not compatible with TPARA kinematics." + #elif ENABLED(POLAR) + #error "Input Shaping is not compatible with POLAR kinematics." + #elif ENABLED(POLARGRAPH) + #error "Input Shaping is not compatible with POLARGRAPH kinematics." + #elif ENABLED(DIRECT_STEPPING) + #error "Input Shaping is not compatible with DIRECT_STEPPING." + #elif ENABLED(INPUT_SHAPING_X) && ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) + #error "INPUT_SHAPING_X is not supported with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_*." + #elif ENABLED(INPUT_SHAPING_Y) && ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) + #error "INPUT_SHAPING_Y is not supported with COREXY, COREYX, COREYZ, COREZY, or MARKFORGED_*." #endif - #if ENABLED(INPUT_SHAPING_X) - #if F_CPU > 16000000 - static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz."); + + #ifdef __AVR__ + #ifdef SHAPING_MIN_FREQ + static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0."); #else - static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz."); + TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set.")); + TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set.")); #endif - #endif - #if ENABLED(INPUT_SHAPING_Y) - #if F_CPU > 16000000 - static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz."); - #else - static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz."); + #if ENABLED(INPUT_SHAPING_X) + #if F_CPU > 16000000 + static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz."); + #else + static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz."); + #endif + #endif + #if ENABLED(INPUT_SHAPING_Y) + #if F_CPU > 16000000 + static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz."); + #else + static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz."); + #endif #endif #endif #endif -#if BOTH(HAS_SHAPING, DIRECT_STEPPING) - #error "INPUT_SHAPING_[XY] cannot currently be used with DIRECT_STEPPING." -#endif - // Misc. Cleanup #undef _TEST_PWM #undef _NUM_AXES_STR From 7503ac3c67b1521f8d2c822f51b46c97a884a21e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 13 Jan 2023 00:22:51 +0000 Subject: [PATCH 10/41] [cron] Bump distribution date (2023-01-13) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 1b9d7c43c657..8e8d09fdf619 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-12" +//#define STRING_DISTRIBUTION_DATE "2023-01-13" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 817fcdc80bde..b97be81521ca 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 "2023-01-12" + #define STRING_DISTRIBUTION_DATE "2023-01-13" #endif /** From 5fd5cb02f6b26f32fd9b49fb37e53a93531da98c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 Jan 2023 07:44:57 -0600 Subject: [PATCH 11/41] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20ProUI=20followup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 16 ++++++++-------- Marlin/src/lcd/e3v2/proui/menus.cpp | 2 +- Marlin/src/lcd/e3v2/proui/menus.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 098db27b1b87..ffb216f05fc3 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -874,7 +874,7 @@ void update_variable() { bool DWIN_lcd_sd_status = false; void SetMediaAutoMount() { - Toogle_Chkb_Line(HMI_data.MediaAutoMount); + Toggle_Chkb_Line(HMI_data.MediaAutoMount); } inline uint16_t nr_sd_menu_items() { @@ -2036,7 +2036,7 @@ void SetLanguage() { } bool EnableLiveMove = false; -void SetLiveMove() { Toogle_Chkb_Line(EnableLiveMove); } +void SetLiveMove() { Toggle_Chkb_Line(EnableLiveMove); } void LiveMove() { planner.synchronize(); if (!EnableLiveMove) return; @@ -2082,7 +2082,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(POWER_LOSS_RECOVERY) void SetPwrLossr() { - Toogle_Chkb_Line(recovery.enabled); + Toggle_Chkb_Line(recovery.enabled); recovery.changed(); } #endif @@ -2108,7 +2108,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(CASE_LIGHT_MENU) void SetCaseLight() { - Toogle_Chkb_Line(caselight.on); + Toggle_Chkb_Line(caselight.on); caselight.update_enabled(); } #if ENABLED(CASELIGHT_USES_BRIGHTNESS) @@ -2144,7 +2144,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(SOUND_MENU_ITEM) void SetEnableSound() { - Toogle_Chkb_Line(ui.sound_on); + Toggle_Chkb_Line(ui.sound_on); } #endif @@ -2168,7 +2168,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(BLTOUCH_HS_MODE) void SetHSMode() { - Toogle_Chkb_Line(bltouch.high_speed_mode); + Toggle_Chkb_Line(bltouch.high_speed_mode); } #endif @@ -2177,7 +2177,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if HAS_FILAMENT_SENSOR void SetRunoutEnable() { runout.reset(); - Toogle_Chkb_Line(runout.enabled); + Toggle_Chkb_Line(runout.enabled); } #if HAS_FILAMENT_RUNOUT_DISTANCE void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); } @@ -2439,7 +2439,7 @@ void TramC () { Tram(4); } } void SetManualTramming() { - Toogle_Chkb_Line(HMI_data.FullManualTramming); + Toggle_Chkb_Line(HMI_data.FullManualTramming); } #endif // HAS_BED_PROBE && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 3267eec60d33..540f9e1f417b 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -115,7 +115,7 @@ void Show_Chkb_Line(const bool checked) { DWIN_UpdateLCD(); } -void Toogle_Chkb_Line(bool &checked) { +void Toggle_Chkb_Line(bool &checked) { checked = !checked; Show_Chkb_Line(checked); } diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 9bc9d702bd30..33712f8959ef 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -145,7 +145,7 @@ void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false, bool selected=false); void Draw_Chkb_Line(const uint8_t line, const bool checked); void Show_Chkb_Line(const bool checked); -void Toogle_Chkb_Line(bool &checked); +void Toggle_Chkb_Line(bool &checked); void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value=0); void onDrawMenuItem(MenuItemClass* menuitem, int8_t line); void onDrawSubMenu(MenuItemClass* menuitem, int8_t line); From 80a25550128b05a7761e4a3bd365b853891b48d4 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 14 Jan 2023 18:05:38 +0000 Subject: [PATCH 12/41] [cron] Bump distribution date (2023-01-14) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 8e8d09fdf619..c3f5c624bc9a 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-13" +//#define STRING_DISTRIBUTION_DATE "2023-01-14" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b97be81521ca..ea2509a83d25 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 "2023-01-13" + #define STRING_DISTRIBUTION_DATE "2023-01-14" #endif /** From 5acf73868876da8baf823e7b95f49265935c249b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 01:11:49 -0600 Subject: [PATCH 13/41] =?UTF-8?q?=F0=9F=94=A7=20Added=20MOTHERBOARD=20erro?= =?UTF-8?q?r=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0275c539b508..fbae1f5d8849 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -88,7 +88,7 @@ * Warnings for old configurations */ #ifndef MOTHERBOARD - #error "MOTHERBOARD is required." + #error "MOTHERBOARD is required. You must '#define MOTHERBOARD BOARD_MYNAME' (not just '#define BOARD_MYNAME')." #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) #error "X_BED_SIZE and Y_BED_SIZE are now required!" #elif WATCH_TEMP_PERIOD > 500 From da87c203c1e70bf719b90f7bfdce6027861bef90 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 01:19:45 -0600 Subject: [PATCH 14/41] =?UTF-8?q?=F0=9F=94=96=20=20Config=20version=200201?= =?UTF-8?q?0300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 2 +- Marlin/src/inc/Version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ec3ee87b9cd9..32df08f853ec 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,7 +35,7 @@ * * Advanced settings can be found in Configuration_adv.h */ -#define CONFIGURATION_H_VERSION 02010200 +#define CONFIGURATION_H_VERSION 02010300 //=========================================================================== //============================= Getting Started ============================= diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bf4b439d8531..4735e34ededb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -30,7 +30,7 @@ * * Basic settings can be found in Configuration.h */ -#define CONFIGURATION_ADV_H_VERSION 02010200 +#define CONFIGURATION_ADV_H_VERSION 02010300 // @section develop diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ea2509a83d25..d33ad5087746 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -52,7 +52,7 @@ * to alert users to major changes. */ -#define MARLIN_HEX_VERSION 02010200 +#define MARLIN_HEX_VERSION 02010300 #ifndef REQUIRED_CONFIGURATION_H_VERSION #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION #endif From d753781dc0c4853e8aac1cd997a5f105fbb8fa3a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 15 Jan 2023 12:06:24 +0000 Subject: [PATCH 15/41] [cron] Bump distribution date (2023-01-15) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c3f5c624bc9a..b3dce84c4776 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-14" +//#define STRING_DISTRIBUTION_DATE "2023-01-15" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d33ad5087746..52dd76d83412 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 "2023-01-14" + #define STRING_DISTRIBUTION_DATE "2023-01-15" #endif /** From 212167b140f7a1b6f24ff69cf367860b78812c05 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 15 Jan 2023 05:25:36 -0800 Subject: [PATCH 16/41] =?UTF-8?q?=F0=9F=93=9D=20No=20longer=20experimental?= =?UTF-8?q?=20(#25238)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 5 ++--- Marlin/Configuration_adv.h | 5 ++--- Marlin/src/inc/SanityCheck.h | 16 +++++----------- Marlin/src/inc/Warnings.cpp | 7 +++++++ buildroot/tests/SAMD21_minitronics20 | 2 +- buildroot/tests/SAMD51_grandcentral_m4 | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 32df08f853ec..f639b68787a8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2019,7 +2019,7 @@ //#define EXTRAPOLATE_BEYOND_GRID // - // Experimental Subdivision of the grid by Catmull-Rom method. + // Subdivision of the grid by Catmull-Rom method. // Synthesizes intermediate points to produce a more detailed mesh. // //#define ABL_BILINEAR_SUBDIVISION @@ -2304,7 +2304,7 @@ #endif /** - * Clean Nozzle Feature -- EXPERIMENTAL + * Clean Nozzle Feature * * Adds the G12 command to perform a nozzle cleaning process. * @@ -2338,7 +2338,6 @@ * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. * * Caveats: The ending Z should be the same as starting Z. - * Attention: EXPERIMENTAL. G-code arguments may change. */ //#define NOZZLE_CLEAN_FEATURE diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4735e34ededb..ee5310914280 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -375,7 +375,7 @@ #endif #if ENABLED(PIDTEMP) - // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // Add an additional term to the heater power, proportional to the extrusion speed. // A well-chosen Kc value should add just enough power to melt the increased material volume. //#define PID_EXTRUSION_SCALING #if ENABLED(PID_EXTRUSION_SCALING) @@ -384,7 +384,7 @@ #endif /** - * Add an experimental additional term to the heater power, proportional to the fan speed. + * Add an additional term to the heater power, proportional to the fan speed. * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. * You can either just add a constant compensation with the DEFAULT_Kf value * or follow the instruction below to get speed-dependent compensation. @@ -2121,7 +2121,6 @@ #endif //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. - //#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA. //#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index fbae1f5d8849..b17bf2b7196f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -666,6 +666,8 @@ #error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING." #elif defined(MILLISECONDS_PREHEAT_TIME) #error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS." +#elif defined(EXPERIMENTAL_SCURVE) + #error "EXPERIMENTAL_SCURVE is no longer needed and should be removed." #endif // L64xx stepper drivers have been removed @@ -1370,22 +1372,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #else static_assert(WITHIN(ADVANCE_K, 0, 10), "ADVANCE_K must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."); #endif - #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE) - #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue." - #elif ENABLED(DIRECT_STEPPING) - #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible." + + #if ENABLED(DIRECT_STEPPING) + #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. (Extrusion is controlled externally by the Step Daemon.)" #elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK) static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive)."); #endif #endif -/** - * POLAR warnings - */ -#if BOTH(POLAR, S_CURVE_ACCELERATION) - #warning "POLAR Kinematics may not work well with S_CURVE_ACCELERATION." -#endif - /** * Special tool-changing options */ diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 24f4d7fbe9f3..561c8f43a34e 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -783,3 +783,10 @@ #if ENABLED(BD_SENSOR) && DISABLED(BABYSTEPPING) #warning "BABYSTEPPING is recommended with BD_SENSOR." #endif + +/** + * POLAR warnings + */ +#if BOTH(POLAR, S_CURVE_ACCELERATION) + #warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION." +#endif diff --git a/buildroot/tests/SAMD21_minitronics20 b/buildroot/tests/SAMD21_minitronics20 index 018d6a70fe00..420495bb7659 100755 --- a/buildroot/tests/SAMD21_minitronics20 +++ b/buildroot/tests/SAMD21_minitronics20 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING EXPERIMENTAL_SCURVE + SQUARE_WAVE_STEPPING exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3" # clean up diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index 3a5ac8e70cc9..ef67e061fe4b 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING TMC_DEBUG EXPERIMENTAL_SCURVE + SQUARE_WAVE_STEPPING TMC_DEBUG exec_test $1 $2 "Grand Central M4 with assorted features" "$3" # clean up From d94defc545ad477c82a8bc77e949aa91cdd3e0f2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 06:48:17 -0600 Subject: [PATCH 17/41] =?UTF-8?q?=F0=9F=8E=A8=20Language=20/=20menu=20clea?= =?UTF-8?q?nup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 132 ++++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.h | 23 ++-- Marlin/src/lcd/e3v2/proui/dwinui.h | 6 +- Marlin/src/lcd/language/language_an.h | 1 - Marlin/src/lcd/language/language_cz.h | 1 - Marlin/src/lcd/language/language_da.h | 1 - Marlin/src/lcd/language/language_de.h | 1 - Marlin/src/lcd/language/language_en.h | 7 +- Marlin/src/lcd/language/language_es.h | 1 - Marlin/src/lcd/language/language_eu.h | 1 - Marlin/src/lcd/language/language_fr.h | 1 - Marlin/src/lcd/language/language_gl.h | 1 - Marlin/src/lcd/language/language_hr.h | 1 - Marlin/src/lcd/language/language_hu.h | 1 - Marlin/src/lcd/language/language_it.h | 1 - Marlin/src/lcd/language/language_jp_kana.h | 1 - Marlin/src/lcd/language/language_nl.h | 1 - Marlin/src/lcd/language/language_pl.h | 1 - Marlin/src/lcd/language/language_pt_br.h | 1 - Marlin/src/lcd/language/language_ro.h | 1 - Marlin/src/lcd/language/language_ru.h | 1 - Marlin/src/lcd/language/language_sk.h | 1 - Marlin/src/lcd/language/language_sv.h | 1 - Marlin/src/lcd/language/language_tr.h | 1 - Marlin/src/lcd/language/language_uk.h | 1 - Marlin/src/lcd/language/language_vi.h | 1 - Marlin/src/lcd/language/language_zh_CN.h | 1 - Marlin/src/lcd/language/language_zh_TW.h | 1 - Marlin/src/lcd/menu/menu_motion.cpp | 18 +-- Marlin/src/module/probe.h | 2 +- 30 files changed, 102 insertions(+), 110 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index ffb216f05fc3..621b3d0dd393 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -550,10 +550,10 @@ void DWIN_DrawStatusMessage() { // If the string fits the status line do not scroll it if (slen <= LCD_WIDTH) { - if (hash_changed) { - DWIN_DrawStatusLine(ui.status_message); - hash_changed = false; - } + if (hash_changed) { + DWIN_DrawStatusLine(ui.status_message); + hash_changed = false; + } } else { // String is larger than the available line space @@ -676,14 +676,18 @@ void Draw_PrintDone() { Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); + #if HAS_GCODE_PREVIEW - if (Preview_Valid()) { + const bool isvalid = Preview_Valid(); + if (isvalid) { DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); DWINUI::Draw_Button(BTN_Continue, 86, 300); } - else + #else + constexpr bool isvalid = false; #endif - { + + if (!isvalid) { Draw_Print_ProgressBar(); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); @@ -731,11 +735,7 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, // Check for a position change static xyz_pos_t oldpos = { -1, -1, -1 }; - #if ENABLED(SHOW_REAL_POS) - const float p = stepper.position(axis) / planner.settings.axis_steps_per_mm[axis]; - #else - const float p = current_position[axis]; - #endif + const float p = TERN(SHOW_REAL_POS, stepper.position(axis) / planner.settings.axis_steps_per_mm[axis], current_position[axis]); const bool changed = oldpos[axis] != p; if (changed) oldpos[axis] = p; @@ -811,15 +811,9 @@ void update_variable() { if (IsMenu(TuneMenu) || IsMenu(TemperatureMenu)) { // Tune page temperature update - #if HAS_HOTEND - if (_new_hotend_target) HotendTargetItem->redraw(); - #endif - #if HAS_HEATED_BED - if (_new_bed_target) BedTargetItem->redraw(); - #endif - #if HAS_FAN - if (_new_fanspeed) FanSpeedItem->redraw(); - #endif + TERN_(HAS_HOTEND, if (_new_hotend_target) HotendTargetItem->redraw()); + TERN_(HAS_HEATED_BED, if (_new_bed_target) BedTargetItem->redraw()); + TERN_(HAS_FAN, if (_new_fanspeed) FanSpeedItem->redraw()); } // Bottom temperature update @@ -956,8 +950,7 @@ void onClickSDItem() { void FileMenuIdle(bool reset=false) { static bool hasUpDir = false; static uint8_t last_itemselected = 0; - static int8_t shift_amt = 0; - static int8_t shift_len = 0; + static int8_t shift_amt = 0, shift_len = 0; if (reset) { last_itemselected = 0; hasUpDir = !card.flag.workDirIsRoot; // is a SubDir @@ -1715,7 +1708,6 @@ void DWIN_CopySettingsFrom(const char * const buff) { ); leds.update(); #endif - } // Initialize or re-initialize the LCD @@ -1839,6 +1831,7 @@ void DWIN_RedrawScreen() { #endif // ADVANCED_PAUSE_FEATURE #if HAS_MESH + void DWIN_MeshViewer() { if (!leveling_is_valid()) DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); @@ -1847,8 +1840,8 @@ void DWIN_RedrawScreen() { MeshViewer.Draw(); } } -#endif // HAS_MESH +#endif // HAS_MESH #if HAS_LOCKSCREEN @@ -1874,7 +1867,7 @@ void DWIN_RedrawScreen() { if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } -#endif // HAS_LOCKSCREEN +#endif // HAS_LOCKSCREEN #if HAS_GCODE_PREVIEW @@ -1886,20 +1879,21 @@ void DWIN_RedrawScreen() { Goto_Main_Menu(); return card.openAndPrintFile(card.filename); } - else HMI_ReturnScreen(); + else + HMI_ReturnScreen(); } - void Goto_ConfirmToPrint() { - Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); - } +#endif -#else - void Goto_ConfirmToPrint() { +void Goto_ConfirmToPrint() { + #if HAS_GCODE_PREVIEW + Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); + #else // Print SD file HMI_flag.heat_flag = true; card.openAndPrintFile(card.filename); - } -#endif + #endif +} #if HAS_ESDIAG void Draw_EndStopDiag() { @@ -1915,6 +1909,7 @@ void DWIN_RedrawScreen() { // Tool functions #if ENABLED(EEPROM_SETTINGS) + void WriteEeprom() { DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM)); DWIN_UpdateLCD(); @@ -1934,8 +1929,9 @@ void DWIN_RedrawScreen() { } #if HAS_MESH - void SaveMesh() { TERN(AUTO_BED_LEVELING_UBL, UBLSaveMesh(), WriteEeprom()); } + void SaveMesh() { TERN(AUTO_BED_LEVELING_UBL, UBLMeshSave(), WriteEeprom()); } #endif + #endif // Reset Printer @@ -2404,9 +2400,9 @@ void TramC () { Tram(4); } MeshViewer.DrawMesh(zval, 2, 2); ui.reset_status(); - if (ABS(MeshViewer.max - MeshViewer.min) < 0.05) { - DWINUI::Draw_CenteredString(140,F("Corners leveled")); - DWINUI::Draw_CenteredString(160,F("Tolerance achieved!")); + if (ABS(MeshViewer.max - MeshViewer.min) < 0.05f) { + DWINUI::Draw_CenteredString(140, F("Corners leveled")); + DWINUI::Draw_CenteredString(160, F("Tolerance achieved!")); } else { uint8_t p = 0; @@ -2698,7 +2694,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } - #if EITHER(PIDTEMP, PIDTEMPBED) void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } @@ -2891,6 +2886,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { } #if HAS_HOTEND + void onDrawMaxJerkE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); @@ -2900,6 +2896,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { } onDrawPFloatMenu(menuitem, line); } + #endif #endif // HAS_CLASSIC_JERK @@ -2929,6 +2926,7 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { } #if HAS_HOTEND + void onDrawStepsE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 153, 148, 194, 161); @@ -2936,6 +2934,7 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { } onDrawPFloatMenu(menuitem, line); } + #endif #if HAS_ONESTEP_LEVELING @@ -3106,6 +3105,7 @@ void Draw_Move_Menu() { } #if HAS_HOME_OFFSET + void Draw_HomeOffset_Menu() { checkkey = Menu; if (SET_MENU(HomeOffMenu, MSG_SET_HOME_OFFSETS, 4)) { @@ -3116,9 +3116,11 @@ void Draw_Move_Menu() { } UpdateMenu(HomeOffMenu); } + #endif #if HAS_BED_PROBE + void Draw_ProbeSet_Menu() { checkkey = Menu; if (SET_MENU(ProbeSetMenu, MSG_ZPROBE_SETTINGS, 9)) { @@ -3138,6 +3140,7 @@ void Draw_Move_Menu() { } UpdateMenu(ProbeSetMenu); } + #endif void Draw_FilSet_Menu() { @@ -3205,6 +3208,7 @@ void Draw_GetColor_Menu() { } #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) + void Draw_CaseLight_Menu() { checkkey = Menu; if (SET_MENU(CaseLightMenu, MSG_CASE_LIGHT, 3)) { @@ -3214,9 +3218,11 @@ void Draw_GetColor_Menu() { } UpdateMenu(CaseLightMenu); } + #endif #if ENABLED(LED_CONTROL_MENU) + void Draw_LedControl_Menu() { checkkey = Menu; if (SET_MENU(LedControlMenu, MSG_LED_CONTROL, 10)) { @@ -3246,7 +3252,8 @@ void Draw_GetColor_Menu() { } UpdateMenu(LedControlMenu); } -#endif + +#endif // LED_CONTROL_MENU void Draw_Tune_Menu() { checkkey = Menu; @@ -3309,6 +3316,7 @@ void Draw_Motion_Menu() { } #if ENABLED(ADVANCED_PAUSE_FEATURE) + void Draw_FilamentMan_Menu() { checkkey = Menu; if (SET_MENU(FilamentMenu, MSG_FILAMENT_MAN, 5)) { @@ -3324,9 +3332,11 @@ void Draw_Motion_Menu() { } UpdateMenu(FilamentMenu); } + #endif #if ENABLED(MESH_BED_LEVELING) + void Draw_ManualMesh_Menu() { checkkey = Menu; if (SET_MENU(ManualMesh, MSG_UBL_MANUAL_MESH, 6)) { @@ -3339,7 +3349,8 @@ void Draw_Motion_Menu() { } UpdateMenu(ManualMesh); } -#endif + +#endif // MESH_BED_LEVELING #if HAS_PREHEAT @@ -3422,6 +3433,7 @@ void Draw_MaxAccel_Menu() { } #if HAS_CLASSIC_JERK + void Draw_MaxJerk_Menu() { checkkey = Menu; if (SET_MENU_R(MaxJerkMenu, selrect({1, 16, 28, 13}), MSG_JERK, 5)) { @@ -3435,7 +3447,8 @@ void Draw_MaxAccel_Menu() { } UpdateMenu(MaxJerkMenu); } -#endif + +#endif // HAS_CLASSIC_JERK void Draw_Steps_Menu() { checkkey = Menu; @@ -3452,6 +3465,7 @@ void Draw_Steps_Menu() { } #if ENABLED(PIDTEMP) + void Draw_HotendPID_Menu() { checkkey = Menu; if (SET_MENU_F(HotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { @@ -3468,9 +3482,11 @@ void Draw_Steps_Menu() { } UpdateMenu(HotendPIDMenu); } + #endif #if ENABLED(PIDTEMPBED) + void Draw_BedPID_Menu() { checkkey = Menu; if (SET_MENU_F(BedPIDMenu, STR_BED_PID " Settings", 8)) { @@ -3487,9 +3503,11 @@ void Draw_Steps_Menu() { } UpdateMenu(BedPIDMenu); } -#endif + +#endif // PIDTEMPBED #if HAS_BED_PROBE + void Draw_ZOffsetWiz_Menu() { checkkey = Menu; if (SET_MENU(ZOffsetWizMenu, MSG_PROBE_WIZARD, 4)) { @@ -3501,9 +3519,11 @@ void Draw_Steps_Menu() { UpdateMenu(ZOffsetWizMenu); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); } + #endif #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + void Draw_Homing_Menu() { checkkey = Menu; if (SET_MENU(HomingMenu, MSG_HOMING, 6)) { @@ -3518,9 +3538,11 @@ void Draw_Steps_Menu() { } UpdateMenu(HomingMenu); } + #endif #if ENABLED(FWRETRACT) + void Draw_FWRetract_Menu() { checkkey = Menu; if (SET_MENU(FWRetractMenu, MSG_FWRETRACT, 6)) { @@ -3533,6 +3555,7 @@ void Draw_Steps_Menu() { } UpdateMenu(FWRetractMenu); } + #endif //============================================================================= @@ -3565,22 +3588,23 @@ void Draw_Steps_Menu() { void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, bedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); } void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } #endif -#endif + +#endif // HAS_MESH #if ENABLED(AUTO_BED_LEVELING_UBL) void ApplyUBLSlot() { bedlevel.storage_slot = MenuData.Value; } void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, bedlevel.storage_slot, ApplyUBLSlot); } void onDrawUBLSlot(MenuItemClass* menuitem, int8_t line) { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + NOLESS(bedlevel.storage_slot, 0); onDrawIntMenu(menuitem, line, bedlevel.storage_slot); } void ApplyUBLTiltGrid() { bedLevelTools.tilt_grid = MenuData.Value; } void SetUBLTiltGrid() { SetIntOnClick(1, 3, bedLevelTools.tilt_grid, ApplyUBLTiltGrid); } - void UBLTiltMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshTilt() { + NOLESS(bedlevel.storage_slot, 0); char buf[15]; if (bedLevelTools.tilt_grid > 1) { sprintf_P(buf, PSTR("G28O\nG29 J%i"), bedLevelTools.tilt_grid); @@ -3596,15 +3620,15 @@ void Draw_Steps_Menu() { LCD_MESSAGE(MSG_UBL_MESH_FILLED); } - void UBLSaveMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshSave() { + NOLESS(bedlevel.storage_slot, 0); settings.store_mesh(bedlevel.storage_slot); ui.status_printf(0, GET_TEXT_F(MSG_MESH_SAVED), bedlevel.storage_slot); DONE_BUZZ(true); } - void UBLLoadMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshLoad() { + NOLESS(bedlevel.storage_slot, 0); settings.load_mesh(bedlevel.storage_slot); } @@ -3626,10 +3650,10 @@ void Draw_Steps_Menu() { #endif #if ENABLED(AUTO_BED_LEVELING_UBL) EDIT_ITEM(ICON_UBLSlot, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); - MENU_ITEM(ICON_UBLSaveMesh, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); - MENU_ITEM(ICON_UBLLoadMesh, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); + MENU_ITEM(ICON_UBLMeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLMeshSave); + MENU_ITEM(ICON_UBLMeshLoad, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLMeshLoad); EDIT_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &bedLevelTools.tilt_grid); - MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); + MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLMeshTilt); MENU_ITEM(ICON_UBLSmartFill, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); #endif #if ENABLED(MESH_EDIT_MENU) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 27e1b4ebfacb..cac64b8ce57d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -141,7 +141,9 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components - TERN_(HAS_PID_HEATING, pidresult_t pidresult = PID_DONE); + #if HAS_PID_HEATING + tempcontrol_t pidresult = PID_DONE; + #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select } HMI_value_t; @@ -213,10 +215,10 @@ void ParkHead(); void ApplyLEDColor(); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - void UBLTiltMesh(); + void UBLMeshTilt(); bool UBLValidMesh(); - void UBLSaveMesh(); - void UBLLoadMesh(); + void UBLMeshSave(); + void UBLMeshLoad(); #endif #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) void HostShutDown(); @@ -356,10 +358,13 @@ void Draw_Steps_Menu(); #endif // PID -void DWIN_PidTuning(pidresult_t result); -#if ENABLED(PIDTEMP) - void Draw_HotendPID_Menu(); +#if HAS_PID_HEATING + void DWIN_PidTuning(tempcontrol_t result); + #if ENABLED(PIDTEMP) + void Draw_HotendPID_Menu(); + #endif + #if ENABLED(PIDTEMPBED) + void Draw_BedPID_Menu(); + #endif #endif -#if ENABLED(PIDTEMPBED) - void Draw_BedPID_Menu(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 3dd37f30dfe6..55345a789985 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -138,14 +138,12 @@ #define ICON_UBLActive ICON_HotendTemp #define ICON_UBLActive ICON_HotendTemp #define ICON_UBLSlot ICON_ResumeEEPROM -#define ICON_UBLSaveMesh ICON_WriteEEPROM -#define ICON_UBLLoadMesh ICON_ReadEEPROM +#define ICON_UBLMeshSave ICON_WriteEEPROM +#define ICON_UBLMeshLoad ICON_ReadEEPROM #define ICON_UBLTiltGrid ICON_PrintSize #define ICON_UBLSmartFill ICON_StockConfiguration #define ICON_ZAfterHome ICON_SetEndTemp - - #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 8e65f3801285..1d4801278ce2 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -103,7 +103,6 @@ namespace Language_an { LSTR MSG_FLOW_N = _UxGT("Fluxo ~"); LSTR MSG_CONTROL = _UxGT("Control"); LSTR MSG_AUTOTEMP = _UxGT("Temperatura Auto."); - LSTR MSG_SELECT = _UxGT("Trigar"); LSTR MSG_SELECT_E = _UxGT("Trigar *"); LSTR MSG_ACC = _UxGT("Aceleracion"); LSTR MSG_VTRAV_MIN = _UxGT("Vel. viache min"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 50d490a6c2eb..db50def2da87 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -264,7 +264,6 @@ namespace Language_cz { LSTR MSG_LCD_OFF = _UxGT("Vyp"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID automatika"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID automatika *"); - LSTR MSG_SELECT = _UxGT("Vybrat"); LSTR MSG_SELECT_E = _UxGT("Vybrat *"); LSTR MSG_ACC = _UxGT("Zrychl"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 4078c413d110..7d3867c3584c 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -98,7 +98,6 @@ namespace Language_da { LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); LSTR MSG_LCD_ON = _UxGT("Til"); LSTR MSG_LCD_OFF = _UxGT("Fra"); - LSTR MSG_SELECT = _UxGT("Vælg"); LSTR MSG_SELECT_E = _UxGT("Vælg *"); LSTR MSG_A_RETRACT = _UxGT("A-retract"); LSTR MSG_A_TRAVEL = _UxGT("A-rejse"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index c2af37fc7777..a60da34d5f13 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -357,7 +357,6 @@ namespace Language_de { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); - LSTR MSG_SELECT = _UxGT("Auswählen"); LSTR MSG_SELECT_E = _UxGT("Auswählen *"); LSTR MSG_ACC = _UxGT("Beschleunigung"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 3ce7a5aa2b3a..9e67042d3797 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -378,7 +378,6 @@ namespace Language_en { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); - LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -553,11 +552,11 @@ namespace Language_en { LSTR MSG_TOOL_MIGRATION_END = _UxGT("Last Extruder"); LSTR MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrate to *"); LSTR MSG_FILAMENTCHANGE = _UxGT("Change Filament"); - LSTR MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *"); + LSTR MSG_FILAMENTCHANGE_E = _UxGT("Change * Filament"); LSTR MSG_FILAMENTLOAD = _UxGT("Load Filament"); - LSTR MSG_FILAMENTLOAD_E = _UxGT("Load *"); + LSTR MSG_FILAMENTLOAD_E = _UxGT("Load * Filament"); LSTR MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); - LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Unload *"); + LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Unload * Filament"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); #if ENABLED(MULTI_VOLUME) LSTR MSG_ATTACH_MEDIA = _UxGT("Attach SD Card"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 5422a8117ba1..92e469576536 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -265,7 +265,6 @@ namespace Language_es { LSTR MSG_LCD_OFF = _UxGT("Apg"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Auto-ajuste"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Auto-ajuste *"); - LSTR MSG_SELECT = _UxGT("Seleccionar"); LSTR MSG_SELECT_E = _UxGT("Seleccionar *"); LSTR MSG_ACC = _UxGT("Aceleración"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 77c8dbe2d870..e5e1d898ab70 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -161,7 +161,6 @@ namespace Language_eu { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); LSTR MSG_AUTOTEMP = _UxGT("Auto tenperatura"); - LSTR MSG_SELECT = _UxGT("Aukeratu"); LSTR MSG_SELECT_E = _UxGT("Aukeratu *"); LSTR MSG_ACC = _UxGT("Azelerazioa"); LSTR MSG_JERK = _UxGT("Astindua"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index ed4c7ca9af50..02576f802c1b 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -272,7 +272,6 @@ namespace Language_fr { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); - LSTR MSG_SELECT = _UxGT("Sélectionner"); LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); LSTR MSG_ACC = _UxGT("Accélération"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 005c6cc5d025..97b8b0831789 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -266,7 +266,6 @@ namespace Language_gl { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida! Extrusor danado."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida! Temperatura moi alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida! Tempo excedido."); - LSTR MSG_SELECT = _UxGT("Escolla"); LSTR MSG_SELECT_E = _UxGT("Escolla *"); LSTR MSG_ACC = _UxGT("Acel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 7ca0f5405af1..36eaf78acb1a 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -95,7 +95,6 @@ namespace Language_hr { LSTR MSG_BED = _UxGT("Bed"); LSTR MSG_FAN_SPEED = _UxGT("Brzina ventilatora"); LSTR MSG_FAN_SPEED_N = _UxGT("Brzina ventilatora ~"); - LSTR MSG_SELECT = _UxGT("Odaberi"); LSTR MSG_SELECT_E = _UxGT("Odaberi *"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); LSTR MSG_MOTION = _UxGT("Gibanje"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 09fb71876f3f..0d70148c624c 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -309,7 +309,6 @@ namespace Language_hu { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba! Rossz adagoló."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba! Magas hömérséklet."); LSTR MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); - LSTR MSG_SELECT = _UxGT("Kiválaszt"); LSTR MSG_SELECT_E = _UxGT("Kiválaszt *"); LSTR MSG_ACC = _UxGT("Gyorsítás"); LSTR MSG_JERK = _UxGT("Rántás"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index def1b9834317..b0adb7791fe2 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -370,7 +370,6 @@ namespace Language_it { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H Amb. vent. *"); - LSTR MSG_SELECT = _UxGT("Seleziona"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 2f75b887590e..989d5844f603 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -114,7 +114,6 @@ namespace Language_jp_kana { LSTR MSG_AUTOTEMP = _UxGT("ジドウオンドセイギョ"); // "Autotemp" LSTR MSG_LCD_ON = _UxGT("オン"); // "On" LSTR MSG_LCD_OFF = _UxGT("オフ"); // "Off" - LSTR MSG_SELECT = _UxGT("センタク"); // "Select" LSTR MSG_SELECT_E = _UxGT("センタク *"); LSTR MSG_ACC = _UxGT("カソクド mm/s") SUPERSCRIPT_TWO; // "Accel" LSTR MSG_JERK = _UxGT("ヤクドウ mm/s"); // "Jerk" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 8aa74d7e9fdc..0636899c9523 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -108,7 +108,6 @@ namespace Language_nl { LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); LSTR MSG_LCD_ON = _UxGT("Aan"); LSTR MSG_LCD_OFF = _UxGT("Uit"); - LSTR MSG_SELECT = _UxGT("Selecteer"); LSTR MSG_SELECT_E = _UxGT("Selecteer *"); LSTR MSG_ACC = _UxGT("Versn"); LSTR MSG_TEMPERATURE = _UxGT("Temperatuur"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 635866baf106..7eb17e93f73b 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -269,7 +269,6 @@ namespace Language_pl { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autostrojenie"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autostrojenie *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Strojenie PID zakończone"); - LSTR MSG_SELECT = _UxGT("Wybierz"); LSTR MSG_SELECT_E = _UxGT("Wybierz *"); LSTR MSG_ACC = _UxGT("Przyspieszenie"); LSTR MSG_JERK = _UxGT("Zryw"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 1d07b2b94f22..d34cd0c0c187 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -236,7 +236,6 @@ namespace Language_pt_br { LSTR MSG_AUTOTEMP = _UxGT("Temp. Automática"); LSTR MSG_LCD_ON = _UxGT("Ligado"); LSTR MSG_LCD_OFF = _UxGT("Desligado"); - LSTR MSG_SELECT = _UxGT("Selecionar"); LSTR MSG_SELECT_E = _UxGT("Selecionar *"); LSTR MSG_ACC = _UxGT("Acel."); LSTR MSG_JERK = _UxGT("Arrancada"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 2cf6fff263cc..57af06202359 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -264,7 +264,6 @@ namespace Language_ro { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); - LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index ec9ddfa7f63c..0af84d120a6b 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -386,7 +386,6 @@ namespace Language_ru { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора! Температура повышена."); LSTR MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); - LSTR MSG_SELECT = _UxGT("Выбор"); LSTR MSG_SELECT_E = _UxGT("Выбор *"); LSTR MSG_ACC = _UxGT("Ускорение"); LSTR MSG_JERK = _UxGT("Рывок"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index bb332f4b1ff2..812e2a03c530 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -368,7 +368,6 @@ namespace Language_sk { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Rozliš. senz. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H okolia *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H vent. okolia *"); - LSTR MSG_SELECT = _UxGT("Vybrať"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); LSTR MSG_ACC = _UxGT("Zrýchlenie"); LSTR MSG_JERK = _UxGT("Skok"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 1342ccaad764..7b3c2d56a66a 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -294,7 +294,6 @@ namespace Language_sv { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad! Dålig extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad! Temperatur för hög."); LSTR MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); - LSTR MSG_SELECT = _UxGT("Välj"); LSTR MSG_SELECT_E = _UxGT("Välj *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Ryck"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index cb2766306c8e..84d33f764de0 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -256,7 +256,6 @@ namespace Language_tr { LSTR MSG_LCD_OFF = _UxGT("Kapalı"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Kalibrasyon"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Kalibrasyon *"); - LSTR MSG_SELECT = _UxGT("Seç"); LSTR MSG_SELECT_E = _UxGT("Seç *"); LSTR MSG_ACC = _UxGT("İvme"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 6b4ebc79cd1e..59dd14812b7f 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -391,7 +391,6 @@ namespace Language_uk { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору! Температура завищена."); LSTR MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); - LSTR MSG_SELECT = _UxGT("Вибрати"); LSTR MSG_SELECT_E = _UxGT("Вибрати *"); LSTR MSG_ACC = _UxGT("Прискорорення"); LSTR MSG_JERK = _UxGT("Ривок"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 27c6ee11812f..ed50cca6633b 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -224,7 +224,6 @@ namespace Language_vi { LSTR MSG_AUTOTEMP = _UxGT("Nhiệt độ tự động"); // Autotemp LSTR MSG_LCD_ON = _UxGT("Bật"); // on LSTR MSG_LCD_OFF = _UxGT("Tắt"); // off - LSTR MSG_SELECT = _UxGT("Lựa"); // Select LSTR MSG_SELECT_E = _UxGT("Lựa *"); LSTR MSG_ACC = _UxGT("Tăng Tốc"); LSTR MSG_JERK = _UxGT("Giật"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 4c5a94edcdc8..26515b60940d 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -264,7 +264,6 @@ namespace Language_zh_CN { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败! 坏的挤出机"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败! 温度太高"); LSTR MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); - LSTR MSG_SELECT = _UxGT("选择"); // "Select" LSTR MSG_SELECT_E = _UxGT("选择 *"); LSTR MSG_ACC = _UxGT("加速度"); // "Accel" acceleration LSTR MSG_JERK = _UxGT("抖动速率"); // "Jerk" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 2aa3554fe80f..6bc00e712aca 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -249,7 +249,6 @@ namespace Language_zh_TW { LSTR MSG_LCD_ON = _UxGT("開 "); // "On" LSTR MSG_LCD_OFF = _UxGT("關 "); // "Off" - LSTR MSG_SELECT = _UxGT("選擇"); // "Select" LSTR MSG_SELECT_E = _UxGT("選擇 *"); LSTR MSG_ACC = _UxGT("加速度"); // "Accel" acceleration LSTR MSG_JERK = _UxGT("抖動速率"); // "Jerk" diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index ffd60f77e8e4..1bd580aa2b34 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -246,25 +246,15 @@ void menu_move() { #endif } #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); - } + if (active_extruder < 2) + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #else - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #endif #elif ENABLED(DUAL_X_CARRIAGE) - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #endif diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 9b2855132249..961ba411440e 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -50,7 +50,7 @@ #endif #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #define Z_POST_CLEARANCE HMI_data.z_after_homing; + #define Z_POST_CLEARANCE HMI_data.z_after_homing #elif defined(Z_AFTER_HOMING) #define Z_POST_CLEARANCE Z_AFTER_HOMING #elif defined(Z_HOMING_HEIGHT) From 6fe387b6f0722033e6cca96fd5e8215ea7b162eb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 06:48:17 -0600 Subject: [PATCH 18/41] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Adjus?= =?UTF-8?q?t=20PID=20/=20MPC=20/=20ProUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes to simplify #25232 WIP --- Marlin/Configuration_adv.h | 6 +- Marlin/src/gcode/geometry/M206_M428.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 19 +---- Marlin/src/gcode/temp/M306.cpp | 28 +++---- Marlin/src/inc/Conditionals_post.h | 3 + Marlin/src/lcd/e3v2/proui/dwin.cpp | 37 ++++++--- Marlin/src/lcd/e3v2/proui/dwin.h | 27 +++---- Marlin/src/lcd/e3v2/proui/plot.cpp | 2 +- Marlin/src/lcd/e3v2/proui/plot.h | 2 +- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 4 +- .../lcd/extui/dgus/DGUSScreenHandlerBase.h | 1 + Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 12 +-- .../extui/dgus_reloaded/DGUSScreenHandler.cpp | 4 +- .../extui/dgus_reloaded/DGUSScreenHandler.h | 8 +- Marlin/src/lcd/extui/example/example.cpp | 10 +-- .../ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 4 +- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 4 +- Marlin/src/lcd/extui/ui_api.h | 2 +- Marlin/src/lcd/language/language_de.h | 4 +- Marlin/src/lcd/language/language_en.h | 15 ++-- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 4 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 4 +- Marlin/src/lcd/language/language_sv.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 22 +++--- Marlin/src/module/settings.cpp | 20 +++-- Marlin/src/module/temperature.cpp | 76 ++++++++++--------- Marlin/src/module/temperature.h | 10 ++- 34 files changed, 181 insertions(+), 165 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ee5310914280..71f46bfe8a79 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1429,12 +1429,10 @@ #endif // HAS_MARLINUI_MENU -#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) +#if HAS_DISPLAY //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu #define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state -#endif -#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) // The timeout to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 // (ms) @@ -1483,7 +1481,7 @@ #endif #endif -#endif // HAS_DISPLAY || DWIN_LCD_PROUI +#endif // HAS_DISPLAY // Add 'M73' to set print job progress, overrides Marlin's built-in estimate //#define SET_PROGRESS_MANUALLY diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 494b2115b826..b12e68060537 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -91,7 +91,7 @@ void GcodeSuite::M428() { diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGE_F("Err: Too far!"); + LCD_ALERTMESSAGE(MSG_ERR_M428_TOO_FAR); ERR_BUZZ(); return; } diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 820b1556d611..e0ad26027e60 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -67,8 +67,8 @@ void GcodeSuite::M303() { default: SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM)); + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_BAD_HEATER_ID)); return; } @@ -78,20 +78,9 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) - if (seenC) HMI_data.PidCycles = c; - if (seenS) { - switch (hid) { - OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break) - OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break) - default: break; - } - } - #endif + TERN_(DWIN_PID_TUNE, DWIN_StartM303(seenC, c, seenS, hid, temp)); - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif + IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY)); LCD_MESSAGE(MSG_PID_AUTOTUNE); thermalManager.PID_autotune(temp, hid, c, u); diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index c6b700eac3b6..582eb13f81f7 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -52,15 +52,15 @@ void GcodeSuite::M306() { if (parser.seen("ACFPRH")) { const heater_id_t hid = (heater_id_t)parser.intval('E', 0); - MPC_t &constants = thermalManager.temp_hotend[hid].constants; - if (parser.seenval('P')) constants.heater_power = parser.value_float(); - if (parser.seenval('C')) constants.block_heat_capacity = parser.value_float(); - if (parser.seenval('R')) constants.sensor_responsiveness = parser.value_float(); - if (parser.seenval('A')) constants.ambient_xfer_coeff_fan0 = parser.value_float(); + MPC_t &mpc = thermalManager.temp_hotend[hid].mpc; + if (parser.seenval('P')) mpc.heater_power = parser.value_float(); + if (parser.seenval('C')) mpc.block_heat_capacity = parser.value_float(); + if (parser.seenval('R')) mpc.sensor_responsiveness = parser.value_float(); + if (parser.seenval('A')) mpc.ambient_xfer_coeff_fan0 = parser.value_float(); #if ENABLED(MPC_INCLUDE_FAN) - if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0; + if (parser.seenval('F')) mpc.applyFanAdjustment(parser.value_float()); #endif - if (parser.seenval('H')) constants.filament_heat_capacity_permm = parser.value_float(); + if (parser.seenval('H')) mpc.filament_heat_capacity_permm = parser.value_float(); return; } @@ -71,16 +71,16 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) { report_heading(forReplay, F("Model predictive control")); HOTEND_LOOP() { report_echo_start(forReplay); - MPC_t& constants = thermalManager.temp_hotend[e].constants; + MPC_t &mpc = thermalManager.temp_hotend[e].mpc; SERIAL_ECHOPGM(" M306 E", e); - SERIAL_ECHOPAIR_F(" P", constants.heater_power, 2); - SERIAL_ECHOPAIR_F(" C", constants.block_heat_capacity, 2); - SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); - SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); + SERIAL_ECHOPAIR_F(" P", mpc.heater_power, 2); + SERIAL_ECHOPAIR_F(" C", mpc.block_heat_capacity, 2); + SERIAL_ECHOPAIR_F(" R", mpc.sensor_responsiveness, 4); + SERIAL_ECHOPAIR_F(" A", mpc.ambient_xfer_coeff_fan0, 4); #if ENABLED(MPC_INCLUDE_FAN) - SERIAL_ECHOPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + SERIAL_ECHOPAIR_F(" F", mpc.fanCoefficient(), 4); #endif - SERIAL_ECHOPAIR_F(" H", constants.filament_heat_capacity_permm, 4); + SERIAL_ECHOPAIR_F(" H", mpc.filament_heat_capacity_permm, 4); SERIAL_EOL(); } } diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 8fe9a408f22d..515d5f7984ac 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2504,6 +2504,9 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 + #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) + #define DWIN_PID_TUNE 1 + #endif #endif // Thermal protection diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 621b3d0dd393..4be081944138 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1500,9 +1500,10 @@ void DWIN_LevelingDone() { // PID process -#if HAS_PIDPLOT +#if BOTH(HAS_PIDPLOT, DWIN_PID_TUNE) + void DWIN_Draw_PIDPopup() { - frame_rect_t gfrm = {40, 180, DWIN_WIDTH - 80, 120}; + frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); @@ -1525,9 +1526,21 @@ void DWIN_LevelingDone() { default: break; } } + #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE + + void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp) { + if (seenC) HMI_data.PidCycles = c; + if (seenS) { + switch (hid) { + OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break) + OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break) + default: break; + } + } + } void DWIN_PidTuning(pidresult_t result) { HMI_value.pidresult = result; @@ -1541,9 +1554,9 @@ void DWIN_LevelingDone() { DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); #endif break; - case PID_BAD_EXTRUDER_NUM: + case PID_BAD_HEATER_ID: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM)); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_HEATER_ID)); break; #endif #if ENABLED(PIDTEMPBED) @@ -1568,11 +1581,13 @@ void DWIN_LevelingDone() { checkkey = last_checkkey; DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); break; - default: checkkey = last_checkkey; break; + default: + checkkey = last_checkkey; + break; } } -#endif // PIDTEMP || PIDTEMPBED +#endif // DWIN_PID_TUNE // Started a Print Job void DWIN_Print_Started() { @@ -1667,7 +1682,7 @@ void DWIN_SetDataDefaults() { DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT); TERN_(PIDTEMPBED, HMI_data.BedPidT = DEF_BEDPIDT); - TERN_(HAS_PID_HEATING, HMI_data.PidCycles = DEF_PIDCYCLES); + TERN_(DWIN_PID_TUNE, HMI_data.PidCycles = DEF_PIDCYCLES); #if ENABLED(PREVENT_COLD_EXTRUSION) HMI_data.ExtMinT = EXTRUDE_MINTEMP; ApplyExtMinT(); @@ -2057,7 +2072,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS } #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void SetPID(celsius_t t, heater_id_t h) { char cmd[53] = ""; char str_1[5] = "", str_2[5] = ""; @@ -2523,7 +2538,7 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetBedPidT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void SetPidCycles() { SetPIntOnClick(3, 50); } void SetKp() { SetPFloatOnClick(0, 1000, 2); } void ApplyPIDi() { @@ -2694,7 +2709,7 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index cac64b8ce57d..bc050abd2e1e 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -76,7 +76,7 @@ enum processID : uint8_t { enum pidresult_t : uint8_t { PIDTEMP_START = 0, PIDTEMPBED_START, - PID_BAD_EXTRUDER_NUM, + PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE, @@ -107,14 +107,14 @@ typedef struct { uint16_t Coordinate_Color; // Temperatures - #if ENABLED(PIDTEMP) - int16_t HotendPidT = DEF_HOTENDPIDT; - #endif - #if ENABLED(PIDTEMPBED) - int16_t BedPidT = DEF_BEDPIDT; - #endif - #if (HAS_HOTEND || HAS_HEATED_BED) && HAS_PID_HEATING + #if DWIN_PID_TUNE int16_t PidCycles = DEF_PIDCYCLES; + #if ENABLED(PIDTEMP) + int16_t HotendPidT = DEF_HOTENDPIDT; + #endif + #if ENABLED(PIDTEMPBED) + int16_t BedPidT = DEF_BEDPIDT; + #endif #endif #if ENABLED(PREVENT_COLD_EXTRUSION) int16_t ExtMinT = EXTRUDE_MINTEMP; @@ -141,8 +141,8 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components - #if HAS_PID_HEATING - tempcontrol_t pidresult = PID_DONE; + #if DWIN_PID_TUNE + pidresult_t pidresult = PID_DONE; #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select @@ -358,8 +358,10 @@ void Draw_Steps_Menu(); #endif // PID -#if HAS_PID_HEATING - void DWIN_PidTuning(tempcontrol_t result); +#if DWIN_PID_TUNE + #include "../../../module/temperature.h" + void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); + void DWIN_PidTuning(pidresult_t result); #if ENABLED(PIDTEMP) void Draw_HotendPID_Menu(); #endif @@ -367,4 +369,3 @@ void Draw_Steps_Menu(); void Draw_BedPID_Menu(); #endif #endif -#endif diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 75917320a45f..53178e3ea705 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -74,7 +74,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); } -void PlotClass::Update(const float value) { +void PlotClass::Update(const_float_t value) { if (!scale) return; uint16_t y = round((y2) - value * scale); if (grphpoints < grphframe.w) { diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index ea15255fe53a..2663776dc4fc 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -48,7 +48,7 @@ class PlotClass { public: void Draw(frame_rect_t frame, float max, float ref = 0); - void Update(float value); + void Update(const_float_t value); }; extern PlotClass Plot; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 37543a237c0b..82dbeee4112b 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -295,11 +295,11 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) // Don't let the user in the dark why there is no reaction. if (!ExtUI::isMediaInserted()) { - setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA)); + setstatusmessage(GET_TEXT_F(MSG_NO_MEDIA)); return; } if (card.flag.abort_sd_printing) { - setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING)); + setstatusmessage(GET_TEXT_F(MSG_MEDIA_ABORTING)); return; } } diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h index 07a108e84663..340938c9790d 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -51,6 +51,7 @@ class DGUSScreenHandler { static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); + static void setstatusmessage(FSTR_P const fmsg) { setstatusmessagePGM(FTOP(fmsg)); } // Callback for VP "Display wants to change screen on idle printer" static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); // Callback for VP "Screen has been changed" diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index b041687a14fa..382c5eb1befa 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -137,19 +137,19 @@ namespace ExtUI { // Called for temperature PID tuning result switch (rst) { case PID_STARTED: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); break; case PID_TUNING_TIMEOUT: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_DONE: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)); break; } ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 4d758ae5ef74..3d0896a67cf6 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -325,8 +325,8 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) { case ExtUI::PID_STARTED: SetStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case ExtUI::PID_BAD_EXTRUDER_NUM: - SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case ExtUI::PID_BAD_HEATER_ID: + SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case ExtUI::PID_TEMP_TOO_HIGH: SetStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index cc59bda6d7fa..6a00a4f72aff 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -72,10 +72,10 @@ class DGUSScreenHandler { static void SetMessageLine(const char* msg, uint8_t line); static void SetMessageLinePGM(PGM_P msg, uint8_t line); - static void SetStatusMessage(const char* msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS); - static void SetStatusMessage(FSTR_P const msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS); + static void SetStatusMessage(const char* msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); + static void SetStatusMessage(FSTR_P const msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); - static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue = false); + static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue=false); static DGUS_Screen GetCurrentScreen(); static void TriggerScreenChange(DGUS_Screen screen); @@ -115,7 +115,7 @@ class DGUSScreenHandler { static const DGUS_Addr* FindScreenAddrList(DGUS_Screen screen); static bool CallScreenSetup(DGUS_Screen screen); - static void MoveToScreen(DGUS_Screen screen, bool abort_wait = false); + static void MoveToScreen(DGUS_Screen screen, bool abort_wait=false); static bool SendScreenVPData(DGUS_Screen screen, bool complete_update); static bool settings_ready; diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index 6ef20cf5f0f3..27269a9bee7b 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -121,11 +121,11 @@ namespace ExtUI { void onPidTuning(const result_t rst) { // Called for temperature PID tuning result switch (rst) { - case PID_STARTED: break; - case PID_BAD_EXTRUDER_NUM: break; - case PID_TEMP_TOO_HIGH: break; - case PID_TUNING_TIMEOUT: break; - case PID_DONE: break; + case PID_STARTED: break; + case PID_BAD_HEATER_ID: break; + case PID_TEMP_TOO_HIGH: break; + case PID_TUNING_TIMEOUT: break; + case PID_DONE: break; } } #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index 2ce9ed027e86..84de2c587128 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -136,8 +136,8 @@ namespace ExtUI { case PID_STARTED: StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index 945ff472e1a1..8ed319e35c8a 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -111,8 +111,8 @@ namespace ExtUI { case PID_STARTED: set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - set_lcd_error(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + set_lcd_error(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: set_lcd_error(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index c2ce52ba4c1e..b48dc94f8fef 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -61,7 +61,7 @@ namespace ExtUI { enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER }; enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; - enum result_t : uint8_t { PID_STARTED, PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; + enum result_t : uint8_t { PID_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; constexpr uint8_t extruderCount = EXTRUDERS; constexpr uint8_t hotendCount = HOTENDS; diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index a60da34d5f13..56f91e0ed23b 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -343,10 +343,10 @@ namespace Language_de { LSTR MSG_PID_CYCLE = _UxGT("PID Zyklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID Tuning fertig"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune fehlge.!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("ungültiger Extruder."); + LSTR MSG_BAD_HEATER_ID = _UxGT("ungültiger Extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperatur zu hoch."); LSTR MSG_TIMEOUT = _UxGT("Timeout."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge.! Ungültiger Extruder"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune fehlge.! Ungültiger Extruder"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge.! Temperatur zu hoch."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("teste Wärmeverlust"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9e67042d3797..8352ef888622 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -107,6 +107,7 @@ namespace Language_en { LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Too far!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); LSTR MSG_LAST_VALUE_SP = _UxGT("Last value "); @@ -364,20 +365,22 @@ namespace Language_en { LSTR MSG_PID_CYCLE = _UxGT("PID Cycles"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune failed!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Bad extruder."); + LSTR MSG_BAD_HEATER_ID = _UxGT("Bad extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); LSTR MSG_TIMEOUT = _UxGT("Timeout."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Heating to >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Cooling to ambient"); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC"); LSTR MSG_MPC_POWER_E = _UxGT("Power *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *"); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Heat Cap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor Resp. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient Co. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan coeff. *"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 02576f802c1b..35e8502b940c 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -269,7 +269,7 @@ namespace Language_fr { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Tuning PID terminé"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Echec Autotune! E incorrect"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 97b8b0831789..abad80bbecb8 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -263,7 +263,7 @@ namespace Language_gl { LSTR MSG_PID_AUTOTUNE = _UxGT("Auto-Sint. PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Auto-Sint. PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Fin Auto-Sint PID"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida! Extrusor danado."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Auto-Sint. fallida! Extrusor danado."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida! Temperatura moi alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida! Tempo excedido."); LSTR MSG_SELECT_E = _UxGT("Escolla *"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 0d70148c624c..598da662cc74 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -306,7 +306,7 @@ namespace Language_hu { LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID hangolás *"); LSTR MSG_PID_CYCLE = _UxGT("PID ciklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID hangolás kész"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba! Rossz adagoló."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Hangolási hiba! Rossz adagoló."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba! Magas hömérséklet."); LSTR MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); LSTR MSG_SELECT_E = _UxGT("Kiválaszt *"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index b0adb7791fe2..12a9c572b5e9 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -356,10 +356,10 @@ namespace Language_it { LSTR MSG_PID_CYCLE = _UxGT("Ciclo PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Calibr.PID fallito!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Estrusore invalido."); + LSTR MSG_BAD_HEATER_ID = _UxGT("Estrusore invalido."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temp.troppo alta."); LSTR MSG_TIMEOUT = _UxGT("Tempo scaduto."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita! Estrusore errato."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 57af06202359..48751f8cd2a4 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -261,7 +261,7 @@ namespace Language_ro { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_SELECT_E = _UxGT("Select *"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 0af84d120a6b..1f3c77752e73 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -382,7 +382,7 @@ namespace Language_ru { LSTR MSG_PID_AUTOTUNE = _UxGT("Автоподбор PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автоподбор PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Подбор PID выполнен"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Сбой автоподбора! Плохой экструдер."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Сбой автоподбора! Плохой экструдер."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора! Температура повышена."); LSTR MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 812e2a03c530..323ae684d5ea 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -354,10 +354,10 @@ namespace Language_sk { LSTR MSG_PID_CYCLE = _UxGT("Cykly PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Kal. PID dokončená"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kal. PID zlyhala!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Zlý extrudér"); + LSTR MSG_BAD_HEATER_ID = _UxGT("Zlý extrudér"); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Príliš vysoká tepl."); LSTR MSG_TIMEOUT = _UxGT("Čas vypršal."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Test. tepl. straty"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 7b3c2d56a66a..a18691fe0e5e 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -291,7 +291,7 @@ namespace Language_sv { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autojustera"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autojustera *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad! Dålig extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autojustera misslyckad! Dålig extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad! Temperatur för hög."); LSTR MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); LSTR MSG_SELECT_E = _UxGT("Välj *"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 59dd14812b7f..697445288dbb 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -387,7 +387,7 @@ namespace Language_uk { LSTR MSG_PID_AUTOTUNE = _UxGT("Автопідбір PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автопідбір PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Підбір PID виконано"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору! Поганий екструдер."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Збій автопідбору! Поганий екструдер."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору! Температура завищена."); LSTR MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 26515b60940d..79c59be44b07 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -261,7 +261,7 @@ namespace Language_zh_CN { LSTR MSG_PID_AUTOTUNE = _UxGT("自动PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("自动PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID调整完成"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败! 坏的挤出机"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("自动调失败! 坏的挤出机"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败! 温度太高"); LSTR MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); LSTR MSG_SELECT_E = _UxGT("选择 *"); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 8e1963afe593..6f404f20e11e 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -41,7 +41,7 @@ #include "../../module/probe.h" #endif -#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) +#if HAS_PID_HEATING #include "../../module/temperature.h" #endif @@ -277,10 +277,10 @@ void menu_backlash(); // #if SHOW_MENU_ADVANCED_TEMPERATURE - #if ENABLED(MPC_EDIT_MENU) - #define MPC_EDIT_DEFS(N) \ - MPC_t &c = thermalManager.temp_hotend[N].constants; \ - TERN_(MPC_INCLUDE_FAN, editable.decimal = c.ambient_xfer_coeff_fan0 + c.fan255_adjustment) + #if BOTH(MPC_EDIT_MENU, MPC_INCLUDE_FAN) + #define MPC_EDIT_DEFS(N) editable.decimal = thermalManager.temp_hotend[N].fanCoefficient() + #else + #define MPC_EDIT_DEFS(...) #endif void menu_advanced_temperature() { @@ -370,17 +370,17 @@ void menu_backlash(); #if ENABLED(MPC_EDIT_MENU) #define _MPC_EDIT_ITEMS(N) \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &c.heater_power, 1, 200); \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &c.block_heat_capacity, 0, 40); \ - EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &c.sensor_responsiveness, 0, 1); \ - EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &c.ambient_xfer_coeff_fan0, 0, 1) + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &mpc.heater_power, 1, 200); \ + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &mpc.block_heat_capacity, 0, 40); \ + EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &mpc.sensor_responsiveness, 0, 1); \ + EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &mpc.ambient_xfer_coeff_fan0, 0, 1) #if ENABLED(MPC_INCLUDE_FAN) #define MPC_EDIT_ITEMS(N) \ + MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ _MPC_EDIT_ITEMS(N); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ - MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ - c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \ + thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \ }) #else #define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index afdbf3d10342..8b615f2faf14 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1632,8 +1632,7 @@ void MarlinSettings::postprocess() { // Model predictive control // #if ENABLED(MPCTEMP) - HOTEND_LOOP() - EEPROM_WRITE(thermalManager.temp_hotend[e].constants); + HOTEND_LOOP() EEPROM_WRITE(thermalManager.temp_hotend[e].mpc); #endif // @@ -2627,8 +2626,7 @@ void MarlinSettings::postprocess() { // #if ENABLED(MPCTEMP) { - HOTEND_LOOP() - EEPROM_READ(thermalManager.temp_hotend[e].constants); + HOTEND_LOOP() EEPROM_READ(thermalManager.temp_hotend[e].mpc); } #endif @@ -3416,15 +3414,15 @@ void MarlinSettings::reset() { static_assert(COUNT(_filament_heat_capacity_permm) == HOTENDS, "FILAMENT_HEAT_CAPACITY_PERMM must have HOTENDS items."); HOTEND_LOOP() { - MPC_t &constants = thermalManager.temp_hotend[e].constants; - constants.heater_power = _mpc_heater_power[e]; - constants.block_heat_capacity = _mpc_block_heat_capacity[e]; - constants.sensor_responsiveness = _mpc_sensor_responsiveness[e]; - constants.ambient_xfer_coeff_fan0 = _mpc_ambient_xfer_coeff[e]; + MPC_t &mpc = thermalManager.temp_hotend[e].mpc; + mpc.heater_power = _mpc_heater_power[e]; + mpc.block_heat_capacity = _mpc_block_heat_capacity[e]; + mpc.sensor_responsiveness = _mpc_sensor_responsiveness[e]; + mpc.ambient_xfer_coeff_fan0 = _mpc_ambient_xfer_coeff[e]; #if ENABLED(MPC_INCLUDE_FAN) - constants.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; + mpc.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; #endif - constants.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; + mpc.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; } #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index c53fa5df14ef..a4f528a4c819 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -660,13 +660,13 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -760,7 +760,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -797,7 +797,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TUNING_TIMEOUT)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TUNING_TIMEOUT)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOPGM(STR_PID_AUTOTUNE); @@ -852,7 +852,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); goto EXIT_M303; } @@ -870,7 +870,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); EXIT_M303: TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); @@ -882,7 +882,7 @@ volatile bool Temperature::raw_temps_ready = false; #if ENABLED(MPCTEMP) void Temperature::MPC_autotune() { - auto housekeeping = [] (millis_t& ms, celsius_float_t& current_temp, millis_t& next_report_ms) { + auto housekeeping = [] (millis_t &ms, celsius_float_t ¤t_temp, millis_t &next_report_ms) { ms = millis(); if (updateTemperaturesIfReady()) { // temp sample ready @@ -929,7 +929,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_START, active_extruder); MPCHeaterInfo &hotend = temp_hotend[active_extruder]; - MPC_t &constants = hotend.constants; + MPC_t &mpc = hotend.mpc; // Move to center of bed, just above bed height and cool with max fan gcode.home_all_axes(true); @@ -939,11 +939,11 @@ volatile bool Temperature::raw_temps_ready = false; set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); #endif - const xyz_pos_t tuningpos = MPC_TUNING_POS; - do_blocking_move_to(tuningpos); + do_blocking_move_to(xyz_pos_t(MPC_TUNING_POS)); SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); LCD_MESSAGE(MSG_COOLING); + millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; celsius_float_t current_temp = degHotend(active_extruder), ambient_temp = current_temp; @@ -961,6 +961,7 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 10000UL; } } + wait_for_heatup = false; #if HAS_FAN set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); @@ -970,7 +971,7 @@ volatile bool Temperature::raw_temps_ready = false; hotend.modeled_ambient_temp = ambient_temp; SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200); - LCD_MESSAGE(MSG_HEATING); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_HEATING_PAST_200), LCD_MESSAGE(MSG_HEATING)); hotend.target = 200.0f; // So M105 looks nice hotend.soft_pwm_amount = MPC_MAX >> 1; const millis_t heat_start_time = next_test_ms = ms; @@ -1012,17 +1013,17 @@ volatile bool Temperature::raw_temps_ready = false; float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.ambient_xfer_coeff_fan0 = constants.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); - constants.fan255_adjustment = 0.0f; - constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; - constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); + mpc.ambient_xfer_coeff_fan0 = mpc.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); + mpc.fan255_adjustment = 0.0f; + mpc.block_heat_capacity = mpc.ambient_xfer_coeff_fan0 / block_responsiveness; + mpc.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); hotend.modeled_block_temp = asymp_temp + (ambient_temp - asymp_temp) * exp(-block_responsiveness * (ms - heat_start_time) / 1000.0f); hotend.modeled_sensor_temp = current_temp; // Allow the system to stabilize under MPC, then get a better measure of ambient loss with and without fan SERIAL_ECHOLNPGM(STR_MPC_MEASURING_AMBIENT, hotend.modeled_block_temp); - LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_MEASURING_AMBIENT), LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT)); hotend.target = hotend.modeled_block_temp; next_test_ms = ms + MPC_dT * 1000; constexpr millis_t settle_time = 20000UL, test_duration = 20000UL; @@ -1042,7 +1043,7 @@ volatile bool Temperature::raw_temps_ready = false; hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms) && TERN1(HAS_FAN, !fan0_done)) - total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + total_energy_fan0 += mpc.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * mpc.block_heat_capacity; #if HAS_FAN else if (ELAPSED(ms, test_end_ms) && !fan0_done) { set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); @@ -1052,7 +1053,7 @@ volatile bool Temperature::raw_temps_ready = false; fan0_done = true; } else if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms)) - total_energy_fan255 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + total_energy_fan255 += mpc.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * mpc.block_heat_capacity; #endif else if (ELAPSED(ms, test_end_ms)) break; @@ -1067,24 +1068,24 @@ volatile bool Temperature::raw_temps_ready = false; } const float power_fan0 = total_energy_fan0 * 1000 / test_duration; - constants.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); + mpc.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); #if HAS_FAN const float power_fan255 = total_energy_fan255 * 1000 / test_duration, ambient_xfer_coeff_fan255 = power_fan255 / (hotend.target - ambient_temp); - constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0; + mpc.applyFanAdjustment(ambient_xfer_coeff_fan255); #endif // Calculate a new and better asymptotic temperature and re-evaluate the other constants - asymp_temp = ambient_temp + constants.heater_power * (MPC_MAX) / 255 / constants.ambient_xfer_coeff_fan0; + asymp_temp = ambient_temp + mpc.heater_power * (MPC_MAX) / 255 / mpc.ambient_xfer_coeff_fan0; block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; - constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); + mpc.block_heat_capacity = mpc.ambient_xfer_coeff_fan0 / block_responsiveness; + mpc.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); - /* <-- add a slash to enable + #if 0 SERIAL_ECHOLNPGM("t1_time ", t1_time); SERIAL_ECHOLNPGM("sample_count ", sample_count); SERIAL_ECHOLNPGM("sample_distance ", sample_distance); @@ -1093,10 +1094,11 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM("t1 ", t1, " t2 ", t2, " t3 ", t3); SERIAL_ECHOLNPGM("asymp_temp ", asymp_temp); SERIAL_ECHOLNPAIR_F("block_responsiveness ", block_responsiveness, 4); - //*/ - SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", constants.block_heat_capacity); - SERIAL_ECHOLNPAIR_F("MPC_SENSOR_RESPONSIVENESS ", constants.sensor_responsiveness, 4); - SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF ", constants.ambient_xfer_coeff_fan0, 4); + #endif + + SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", mpc.block_heat_capacity); + SERIAL_ECHOLNPAIR_F("MPC_SENSOR_RESPONSIVENESS ", mpc.sensor_responsiveness, 4); + SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF ", mpc.ambient_xfer_coeff_fan0, 4); TERN_(HAS_FAN, SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF_FAN255 ", ambient_xfer_coeff_fan255, 4)); } @@ -1413,7 +1415,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { #elif ENABLED(MPCTEMP) MPCHeaterInfo &hotend = temp_hotend[ee]; - MPC_t &constants = hotend.constants; + MPC_t &mpc = hotend.mpc; // At startup, initialize modeled temperatures if (isnan(hotend.modeled_block_temp)) { @@ -1427,11 +1429,11 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { const bool this_hotend = (ee == active_extruder); #endif - float ambient_xfer_coeff = constants.ambient_xfer_coeff_fan0; + float ambient_xfer_coeff = mpc.ambient_xfer_coeff_fan0; #if ENABLED(MPC_INCLUDE_FAN) const uint8_t fan_index = EITHER(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; const float fan_fraction = TERN_(MPC_FAN_0_ACTIVE_HOTEND, !this_hotend ? 0.0f : ) fan_speed[fan_index] * RECIPROCAL(255); - ambient_xfer_coeff += fan_fraction * constants.fan255_adjustment; + ambient_xfer_coeff += fan_fraction * mpc.fan255_adjustment; #endif if (this_hotend) { @@ -1442,17 +1444,17 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) mpc_e_position = e_position; else if (e_speed > 0.0f) { // Ignore retract/recover moves - ambient_xfer_coeff += e_speed * constants.filament_heat_capacity_permm; + ambient_xfer_coeff += e_speed * mpc.filament_heat_capacity_permm; mpc_e_position = e_position; } } // Update the modeled temperatures - float blocktempdelta = hotend.soft_pwm_amount * constants.heater_power * (MPC_dT / 127) / constants.block_heat_capacity; - blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / constants.block_heat_capacity; + float blocktempdelta = hotend.soft_pwm_amount * mpc.heater_power * (MPC_dT / 127) / mpc.block_heat_capacity; + blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / mpc.block_heat_capacity; hotend.modeled_block_temp += blocktempdelta; - const float sensortempdelta = (hotend.modeled_block_temp - hotend.modeled_sensor_temp) * (constants.sensor_responsiveness * MPC_dT); + const float sensortempdelta = (hotend.modeled_block_temp - hotend.modeled_sensor_temp) * (mpc.sensor_responsiveness * MPC_dT); hotend.modeled_sensor_temp += sensortempdelta; // Any delta between hotend.modeled_sensor_temp and hotend.celsius is either model @@ -1468,11 +1470,11 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { float power = 0.0; if (hotend.target != 0 && !is_idling) { // Plan power level to get to target temperature in 2 seconds - power = (hotend.target - hotend.modeled_block_temp) * constants.block_heat_capacity / 2.0f; + power = (hotend.target - hotend.modeled_block_temp) * mpc.block_heat_capacity / 2.0f; power -= (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff; } - float pid_output = power * 254.0f / constants.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 + float pid_output = power * 254.0f / mpc.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 pid_output = constrain(pid_output, 0, MPC_MAX); /* <-- add a slash to enable diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index d099c3d73b36..0b5f8caf3fac 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -382,10 +382,14 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; float block_heat_capacity; // M306 C float sensor_responsiveness; // M306 R float ambient_xfer_coeff_fan0; // M306 A + float filament_heat_capacity_permm; // M306 H #if ENABLED(MPC_INCLUDE_FAN) float fan255_adjustment; // M306 F + void applyFanAdjustment(const_float_t cf) { fan255_adjustment = cf - ambient_xfer_coeff_fan0; } + #else + void applyFanAdjustment(const_float_t) {} #endif - float filament_heat_capacity_permm; // M306 H + float fanCoefficient() { return SUM_TERN(MPC_INCLUDE_FAN, ambient_xfer_coeff_fan0, fan255_adjustment); } } MPC_t; #define MPC_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (TEMP_TIMER_FREQUENCY)) @@ -433,10 +437,12 @@ struct PIDHeaterInfo : public HeaterInfo { #if ENABLED(MPCTEMP) struct MPCHeaterInfo : public HeaterInfo { - MPC_t constants; + MPC_t mpc; float modeled_ambient_temp, modeled_block_temp, modeled_sensor_temp; + float fanCoefficient() { return mpc.fanCoefficient(); } + void applyFanAdjustment(const_float_t cf) { mpc.applyFanAdjustment(cf); } }; #endif From 938d7b5e14fadf7c0f63bfaf4726f7ce5045e27b Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 16 Jan 2023 00:22:07 +0000 Subject: [PATCH 19/41] [cron] Bump distribution date (2023-01-16) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index b3dce84c4776..9fea3cacaca7 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-15" +//#define STRING_DISTRIBUTION_DATE "2023-01-16" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 52dd76d83412..b93139f87dd4 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 "2023-01-15" + #define STRING_DISTRIBUTION_DATE "2023-01-16" #endif /** From c4482083ac901b1691662ed01ec89f8a2cba6874 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 16 Jan 2023 22:11:49 -0600 Subject: [PATCH 20/41] =?UTF-8?q?=F0=9F=8E=A8=20Heading=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32F1/onboard_sd.h | 28 ++++++++++++++++--- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 1 - 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.h b/Marlin/src/HAL/STM32F1/onboard_sd.h index f228d068c9db..f8846e95bcaa 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.h +++ b/Marlin/src/HAL/STM32F1/onboard_sd.h @@ -1,11 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + /*----------------------------------------------------------------------- -/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] / * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] -/ * Low level disk interface module include file (C)ChaN, 2015 +/ * Low level disk interface module include file (c) ChaN, 2015 /-----------------------------------------------------------------------*/ -#pragma once - #define _DISKIO_WRITE 1 /* 1: Enable disk_write function */ #define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl function */ #define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control function */ diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 603da09d14ef..d26811199bc8 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ - #pragma once // From 58f64eaeba35107cff15ed225577c553b23a6627 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 17 Jan 2023 06:05:52 +0000 Subject: [PATCH 21/41] [cron] Bump distribution date (2023-01-17) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 9fea3cacaca7..a4c4a580c832 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-16" +//#define STRING_DISTRIBUTION_DATE "2023-01-17" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b93139f87dd4..cd87b9255c46 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 "2023-01-16" + #define STRING_DISTRIBUTION_DATE "2023-01-17" #endif /** From 99d1b04a1f1d66aef78994fd98189a9ba9acbcb1 Mon Sep 17 00:00:00 2001 From: alexgrach Date: Wed, 18 Jan 2023 02:37:19 +0300 Subject: [PATCH 22/41] =?UTF-8?q?=E2=9C=A8=20TFT=20320x240=20portrait=20(#?= =?UTF-8?q?25207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_LCD.h | 84 +++- Marlin/src/lcd/tft/tft.h | 16 - Marlin/src/lcd/tft/tft_font.h | 1 - Marlin/src/lcd/tft/ui_1024x600.cpp | 20 +- Marlin/src/lcd/tft/ui_1024x600.h | 6 +- Marlin/src/lcd/tft/ui_320x240.cpp | 456 +++++++++++++----- Marlin/src/lcd/tft/ui_320x240.h | 2 + Marlin/src/lcd/tft/ui_480x320.cpp | 8 +- Marlin/src/lcd/tft_io/tft_io.h | 17 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 27 +- buildroot/tests/mks_robin_nano_v1v2_maple | 9 +- 11 files changed, 430 insertions(+), 216 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 88d7c91c6ef3..af9dd2255799 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -324,7 +324,7 @@ #define IS_ULTIPANEL 1 #endif -// TFT Compatibility +// TFT Legacy Compatibility #if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) #define IS_LEGACY_TFT 1 #define TFT_GENERIC @@ -1525,30 +1525,6 @@ #endif #endif -#if ENABLED(TFT_RES_320x240) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 - #define GRAPHICAL_TFT_UPSCALE 2 -#elif ENABLED(TFT_RES_480x272) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 272 - #define GRAPHICAL_TFT_UPSCALE 2 -#elif ENABLED(TFT_RES_480x320) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 - #define GRAPHICAL_TFT_UPSCALE 3 -#elif ENABLED(TFT_RES_1024x600) - #define TFT_WIDTH 1024 - #define TFT_HEIGHT 600 - #if ENABLED(TOUCH_SCREEN) - #define GRAPHICAL_TFT_UPSCALE 6 - #define TFT_PIXEL_OFFSET_X 120 - #else - #define GRAPHICAL_TFT_UPSCALE 8 - #define TFT_PIXEL_OFFSET_X 0 - #endif -#endif - // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h #if ENABLED(TFT_INTERFACE_FSMC) #define HAS_FSMC_TFT 1 @@ -1573,8 +1549,62 @@ #endif #endif +// Set TFT_COLOR_UI_PORTRAIT flag, if needed +#if defined(TFT_ROTATION) && (HAS_SPI_TFT || HAS_FSMC_TFT || HAS_LTDC_TFT) + #define _CMP_TFT_ROTATE_90 90 + #define _CMP_TFT_ROTATE_270 270 + #define _CMP_TFT_ROTATE_90_MIRROR_X 90 + #define _CMP_TFT_ROTATE_90_MIRROR_Y 90 + #define _CMP_TFT_ROTATE_270_MIRROR_X 270 + #define _CMP_TFT_ROTATE_270_MIRROR_Y 270 + #define _ISROT(N) || (_CAT(_CMP_, TFT_ROTATION) == N) + #define ISROT(V...) (0 MAP(_ISROT, V)) + + #if ISROT(90, 270) + #define TFT_COLOR_UI_PORTRAIT 1 + #endif + + #undef _CMP_TFT_ROTATE_90 + #undef _CMP_TFT_ROTATE_270 + #undef _CMP_TFT_ROTATE_90_MIRROR_X + #undef _CMP_TFT_ROTATE_90_MIRROR_Y + #undef _CMP_TFT_ROTATE_270_MIRROR_X + #undef _CMP_TFT_ROTATE_270_MIRROR_Y + #undef _ISROT + #undef ISROT +#endif + +#if ENABLED(TFT_RES_320x240) + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + #define TFT_WIDTH 240 + #define TFT_HEIGHT 320 + #else + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #endif + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x272) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 272 + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x320) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define GRAPHICAL_TFT_UPSCALE 3 +#elif ENABLED(TFT_RES_1024x600) + #define TFT_WIDTH 1024 + #define TFT_HEIGHT 600 + #if ENABLED(TOUCH_SCREEN) + #define GRAPHICAL_TFT_UPSCALE 6 + #define TFT_PIXEL_OFFSET_X 120 + #else + #define GRAPHICAL_TFT_UPSCALE 8 + #define TFT_PIXEL_OFFSET_X 0 + #endif +#endif + #if ENABLED(TFT_COLOR_UI) - #if TFT_HEIGHT == 240 + #if (TFT_WIDTH == 320 && TFT_HEIGHT == 240) || (TFT_WIDTH == 240 && TFT_HEIGHT == 320) #if ENABLED(TFT_INTERFACE_SPI) #define TFT_320x240_SPI #elif ENABLED(TFT_INTERFACE_FSMC) @@ -1612,6 +1642,8 @@ #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen +#elif HAS_UI_240x320 + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 6) // Fewer lines with touch buttons onscreen #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen #endif diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 6df4c22d5191..7dc3996148ab 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -37,22 +37,6 @@ #define ENDIAN_COLOR(C) (C) #endif -#if HAS_UI_320x240 - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 -#elif HAS_UI_480x320 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 -#elif HAS_UI_480x272 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 272 -#elif HAS_UI_1024x600 - #define TFT_WIDTH 1024 - #define TFT_HEIGHT 600 -#else - #error "Unsupported display resolution!" -#endif - #ifndef TFT_BUFFER_SIZE #ifdef STM32F103xB #define TFT_BUFFER_SIZE 1024 diff --git a/Marlin/src/lcd/tft/tft_font.h b/Marlin/src/lcd/tft/tft_font.h index 5ed5f8380cc5..6c8838ed7c48 100644 --- a/Marlin/src/lcd/tft/tft_font.h +++ b/Marlin/src/lcd/tft/tft_font.h @@ -37,5 +37,4 @@ extern const uint8_t SYMBOLS_FONT_NAME[]; extern const uint8_t EXTRA_FONT_NAME[]; #endif - #endif // HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 6511757d7dfa..f3eb83eb9f50 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -700,12 +700,12 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(F("")); // clear the error drawAxisValue(axis); } - else { + else drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); - } + #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; @@ -717,9 +717,9 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } - else { - drawMessage(""); // clear the error - } + else + drawMessage(F("")); // clear the error + drawAxisValue(axis); #endif return; @@ -765,10 +765,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -810,8 +808,8 @@ static void disable_steppers() { } static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { - uint16_t width = Images[imgBtn52Rounded].width; - uint16_t height = Images[imgBtn52Rounded].height; + uint16_t width = Images[imgBtn52Rounded].width, + height = Images[imgBtn52Rounded].height; if (!enabled) bgColor = COLOR_CONTROL_DISABLED; diff --git a/Marlin/src/lcd/tft/ui_1024x600.h b/Marlin/src/lcd/tft/ui_1024x600.h index 855b0db865f9..c6b5d9f85ec1 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.h +++ b/Marlin/src/lcd/tft/ui_1024x600.h @@ -35,15 +35,15 @@ #define MENU_ITEM_ICON_Y 5 #define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_HEIGHT 43 +#define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) + #if (TFT_FONT == NOTOSANS) || (TFT_FONT == HELVETICA) #define FONT_SIZE 19 #elif TFT_FONT == UNIFONT #define FONT_SIZE 20 #endif -#define MENU_ITEM_HEIGHT 43 #define FONT_LINE_HEIGHT 34 -#define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) - #include "tft_font.h" diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 85ed59b2cce9..07fa95732726 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -49,9 +49,11 @@ void MarlinUI::tft_idle() { #if ENABLED(TOUCH_SCREEN) if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return; if (draw_menu_navigation) { - add_control(48, 206, PAGE_UP, imgPageUp, encoderTopLine > 0); - add_control(240, 206, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); - add_control(144, 206, BACK, imgBack); + constexpr uint16_t cx = TERN(TFT_COLOR_UI_PORTRAIT, 16, 48), + cy = TERN(TFT_COLOR_UI_PORTRAIT, 286, 206); + add_control(cx, cy, PAGE_UP, imgPageUp, encoderTopLine > 0); + add_control(cx + 192, cy, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); + add_control(cx + 96, cy, BACK, imgBack); draw_menu_navigation = false; } #endif @@ -97,19 +99,19 @@ void MarlinUI::draw_kill_screen() { tft.queue.reset(); tft.fill(0, 0, TFT_WIDTH, TFT_HEIGHT, COLOR_KILL_SCREEN_BG); - tft.canvas(0, 60, TFT_WIDTH, 24); + tft.canvas(0, 60, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(status_message); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_KILL_SCREEN_TEXT, tft_string); - tft.canvas(0, 120, TFT_WIDTH, 24); + tft.canvas(0, 120, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(GET_TEXT(MSG_HALTED)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_KILL_SCREEN_TEXT, tft_string); - tft.canvas(0, 160, TFT_WIDTH, 24); + tft.canvas(0, 160, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(GET_TEXT(MSG_PLEASE_RESET)); tft_string.trim(); @@ -185,13 +187,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); - tft.add_text(tft_string.center(64) + 2, 69 + tft_string.vcenter(24), Color, tft_string); + tft.add_text(tft_string.center(64) + 2, 69 + tft_string.vcenter(FONT_LINE_HEIGHT), Color, tft_string); if (targetTemperature >= 0) { tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); - tft.add_text(tft_string.center(64) + 2, 5 + tft_string.vcenter(24), Color, tft_string); + tft.add_text(tft_string.center(64) + 2, 5 + tft_string.vcenter(FONT_LINE_HEIGHT), Color, tft_string); } } @@ -214,7 +216,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); - tft.add_text(tft_string.center(64) + 6, 69 + tft_string.vcenter(24), COLOR_FAN, tft_string); + tft.add_text(tft_string.center(64) + 6, 69 + tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_FAN, tft_string); } void MarlinUI::draw_status_screen() { @@ -226,7 +228,7 @@ void MarlinUI::draw_status_screen() { uint16_t i, x, y = TFT_STATUS_TOP_Y; for (i = 0 ; i < ITEMS_COUNT; i++) { - x = (320 / ITEMS_COUNT - 64) / 2 + (320 * i / ITEMS_COUNT); + x = (TFT_WIDTH / ITEMS_COUNT - 64) / 2 + (TFT_WIDTH * i / ITEMS_COUNT); switch (i) { #ifdef ITEM_E0 case ITEM_E0: draw_heater_status(x, y, H_E0); break; @@ -253,33 +255,60 @@ void MarlinUI::draw_status_screen() { } // coordinates - tft.canvas(4, 103, 312, 24); + tft.canvas(4, 103, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + ); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, 312, 24, COLOR_AXIS_HOMED); + tft.add_rectangle(0, 0, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + , COLOR_AXIS_HOMED + ); if (TERN0(LCD_SHOW_E_TOTAL, printingIsActive())) { #if ENABLED(LCD_SHOW_E_TOTAL) - tft.add_text( 10, tft_string.vcenter(24), COLOR_AXIS_HOMED , "E"); + tft.add_text( 10, tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "E"); const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm tft_string.set(ftostr4sign(e_move_accumulator / escale)); tft_string.add(escale == 10 ? 'c' : 'm'); tft_string.add('m'); - tft.add_text(127 - tft_string.width(), tft_string.vcenter(24), COLOR_AXIS_HOMED, tft_string); + tft.add_text(127 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED, tft_string); #endif } else { - tft.add_text( 10, tft_string.vcenter(24), COLOR_AXIS_HOMED , "X"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 32, 10), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "X"); const bool nhx = axis_should_home(X_AXIS); tft_string.set(blink && nhx ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); - tft.add_text( 68 - tft_string.width(), tft_string.vcenter(24), nhx ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 32 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 68 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhx ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string + ); - tft.add_text(127, tft_string.vcenter(24), COLOR_AXIS_HOMED , "Y"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 110, 127), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "Y"); const bool nhy = axis_should_home(Y_AXIS); tft_string.set(blink && nhy ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); - tft.add_text(185 - tft_string.width(), tft_string.vcenter(24), nhy ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 110 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 185 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhy ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string + ); } - tft.add_text(219, tft_string.vcenter(24), COLOR_AXIS_HOMED , "Z"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 192, 219), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "Z"); const bool nhz = axis_should_home(Z_AXIS); uint16_t offset = 25; if (blink && nhz) @@ -293,61 +322,138 @@ void MarlinUI::draw_status_screen() { tft_string.set(ftostr52sp(z)); offset -= tft_string.width(); } - tft.add_text(301 - tft_string.width() - offset, tft_string.vcenter(24), nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 0, 103, 312, 24)); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 192 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 301 - tft_string.width() - offset, tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 0, 103, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + )); // feed rate - tft.canvas(70, 136, 84, 32); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 30, 172, 80 + #else + 70, 136, 84 + #endif + , 32 + ); tft.set_background(COLOR_BACKGROUND); uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFeedRate, color); tft_string.set(i16tostr3rj(feedrate_percentage)); tft_string.add('%'); tft.add_text(32, tft_string.vcenter(30), color , tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, 70, 136, 84, 32)); + TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 30, 172, 80 + #else + 70, 136, 84 + #endif + , 32 + )); // flow rate - tft.canvas(170, 136, 84, 32); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 140, 172, 80 + #else + 170, 136, 84 + #endif + , 32 + ); tft.set_background(COLOR_BACKGROUND); color = planner.flow_percentage[0] == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFlowRate, color); tft_string.set(i16tostr3rj(planner.flow_percentage[active_extruder])); tft_string.add('%'); tft.add_text(32, tft_string.vcenter(30), color , tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, 170, 136, 84, 32, active_extruder)); + TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 140, 172, 80 + #else + 170, 136, 84 + #endif + , 32, active_extruder + )); // print duration char buffer[14]; duration_t elapsed = print_job_timer.duration(); elapsed.toDigital(buffer); - tft.canvas(96, 173, 128, 24); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 56, 256, 128 + #else + 96, 173, 128 + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); tft_string.set(buffer); - tft.add_text(tft_string.center(128), tft_string.vcenter(24), COLOR_PRINT_TIME, tft_string); + tft.add_text(tft_string.center(128), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_PRINT_TIME, tft_string); // progress bar const uint8_t progress = ui.get_progress_percent(); - tft.canvas(4, 198, 312, 9); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 4, 278, 232 + #else + 4, 198, 312 + #endif + , 9 + ); tft.set_background(COLOR_PROGRESS_BG); - tft.add_rectangle(0, 0, 312, 9, COLOR_PROGRESS_FRAME); + tft.add_rectangle(0, 0, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, 9 + #else + 312, 9 + #endif + , COLOR_PROGRESS_FRAME + ); if (progress) - tft.add_bar(1, 1, (310 * progress) / 100, 7, COLOR_PROGRESS_BAR); + tft.add_bar(1, 1, ((TFT_WIDTH - 10) * progress) / 100, 7, COLOR_PROGRESS_BAR); // status message - tft.canvas(0, 212, 320, 24); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 0, 296, 240 + #else + 0, 212, 320 + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); tft_string.set(status_message); tft_string.trim(); - tft.add_text(tft_string.center(TFT_WIDTH), tft_string.vcenter(24), COLOR_STATUS_MESSAGE, tft_string); + tft.add_text(tft_string.center(TFT_WIDTH), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_STATUS_MESSAGE, tft_string); #if ENABLED(TOUCH_SCREEN) - add_control(256, 130, menu_main, imgSettings); + { + add_control( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 176, 210 + #else + 256, 130 + #endif + , menu_main, imgSettings + ); #if ENABLED(SDSUPPORT) const bool cm = card.isMounted(), pa = printingIsActive(); - add_control(0, 130, menu_media, imgSD, cm && !pa, COLOR_CONTROL_ENABLED, cm && pa ? COLOR_BUSY : COLOR_CONTROL_DISABLED); + add_control(0, TERN(TFT_COLOR_UI_PORTRAIT, 210, 130), menu_media, imgSD, cm && !pa, COLOR_CONTROL_ENABLED, cm && pa ? COLOR_BUSY : COLOR_CONTROL_DISABLED); #endif - #endif + } // (sublime) + #endif // TOUCH_SCREEN } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace @@ -412,9 +518,9 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va void TFT::draw_edit_screen_buttons() { #if ENABLED(TOUCH_SCREEN) - add_control(32, TFT_HEIGHT - 64, DECREASE, imgDecrease); - add_control(224, TFT_HEIGHT - 64, INCREASE, imgIncrease); - add_control(128, TFT_HEIGHT - 64, CLICK, imgConfirm); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 16, 32), TFT_HEIGHT - 64, DECREASE, imgDecrease); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 172, 224), TFT_HEIGHT - 64, INCREASE, imgIncrease); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 96, 128), TFT_HEIGHT - 64, CLICK, imgConfirm); #endif } @@ -443,8 +549,8 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } #if ENABLED(TOUCH_SCREEN) - if (no) add_control( 48, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); - if (yes) add_control(208, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); + if (no) add_control(TERN(TFT_COLOR_UI_PORTRAIT, 32, 48), TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); + if (yes) add_control(TERN(TFT_COLOR_UI_PORTRAIT, 172, 208), TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); #endif } @@ -625,9 +731,16 @@ static void drawCurESelection() { } static void drawMessage(PGM_P const msg) { - tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20); + tft.canvas(X_MARGIN, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + TFT_HEIGHT - 2 * BTN_HEIGHT, TFT_WIDTH - X_MARGIN + #else + TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); - tft.add_text(0, 0, COLOR_YELLOW, msg); + tft.add_text(0, 0, COLOR_STATUS_MESSAGE, msg); } static void drawMessage(FSTR_P const fmsg) { drawMessage(FTOP(fmsg)); } @@ -646,7 +759,7 @@ static void drawAxisValue(const AxisEnum axis) { case E_AXIS: pos = motionAxisState.eValuePos; color = E_BTN_COLOR; break; default: return; } - tft.canvas(pos.x, pos.y, BTN_WIDTH + X_MARGIN, 20); + tft.canvas(pos.x, pos.y, BTN_WIDTH + X_MARGIN, FONT_LINE_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(ftostr52sp(value)); tft.add_text(0, 0, color, tft_string); @@ -745,10 +858,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -773,16 +884,17 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } quick_feedback(); drawCurStepValue(); } -#endif -#if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) - static void z_select() { - motionAxisState.z_selection *= -1; - quick_feedback(); - drawCurZSelection(); - drawAxisValue(Z_AXIS); - } -#endif + #if HAS_BED_PROBE + static void z_select() { + motionAxisState.z_selection *= -1; + quick_feedback(); + drawCurZSelection(); + drawAxisValue(Z_AXIS); + } + #endif + +#endif // TOUCH_SCREEN static void disable_steppers() { quick_feedback(); @@ -805,12 +917,12 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft_string.trim(); tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); } - else { + else tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); - } TERN_(HAS_TFT_XPT2046, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); } + void MarlinUI::move_axis_screen() { // Reset defer_status_screen(true); @@ -827,93 +939,187 @@ void MarlinUI::move_axis_screen() { if (busy && ENABLED(BABYSTEP_ZPROBE_OFFSET)) motionAxisState.z_selection = Z_SELECTION_Z_PROBE; - // ROW 1 -> E- Y- CurY Z+ - int x = X_MARGIN, y = Y_MARGIN, spacing = 0; + #if ENABLED(TFT_COLOR_UI_PORTRAIT) - drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); + // ROW 1 -> E+ Y+ Z+ + int x = X_MARGIN, y = Y_MARGIN, spacing = 0; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; - x += BTN_WIDTH + spacing; - uint16_t yplus_x = x; - drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); + drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); - // Cur Y - x += BTN_WIDTH; - motionAxisState.yValuePos.x = x + 2; - motionAxisState.yValuePos.y = y; - drawAxisValue(Y_AXIS); + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + x += BTN_WIDTH + spacing; + uint16_t yplus_x = x; + drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); - x += spacing; - drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + x += BTN_WIDTH + spacing; + uint16_t zplus_x = x; + drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step - // ROW 2 -> "Ex" X- HOME X+ "Z" - y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; - x = X_MARGIN; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; + // ROW 2 -> "Ex" CurY "Z" + x = X_MARGIN; + y += BTN_HEIGHT + 2; - motionAxisState.eNamePos.x = x; - motionAxisState.eNamePos.y = y; - drawCurESelection(); - TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); + motionAxisState.eNamePos.x = x; + motionAxisState.eNamePos.y = y; + drawCurESelection(); + TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); - x += BTN_WIDTH + spacing; - drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); + motionAxisState.yValuePos.x = yplus_x; + motionAxisState.yValuePos.y = y; + drawAxisValue(Y_AXIS); - x += BTN_WIDTH + spacing; //imgHome is 64x64 - TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); + motionAxisState.zTypePos.x = zplus_x; + motionAxisState.zTypePos.y = y; + drawCurZSelection(); - x += BTN_WIDTH + spacing; - uint16_t xplus_x = x; - drawBtn(x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); + // ROW 3 -> X- HOME X+ + y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2; + x = X_MARGIN; - x += BTN_WIDTH + spacing; - motionAxisState.zTypePos.x = x; - motionAxisState.zTypePos.y = y; - drawCurZSelection(); - #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) - if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); - #endif + drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); - // ROW 3 -> E- CurX Y- Z- - y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; - x = X_MARGIN; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); - drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); + drawBtn(zplus_x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); - // Cur E - motionAxisState.eValuePos.x = x; - motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; - drawAxisValue(E_AXIS); + #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) + if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); + #endif - // Cur X - motionAxisState.xValuePos.x = BTN_WIDTH + (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; //X- pos - motionAxisState.xValuePos.y = y - 10; - drawAxisValue(X_AXIS); + // ROW 4 -> Cur X + y += BTN_HEIGHT + 2; - x += BTN_WIDTH + spacing; - drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + motionAxisState.xValuePos.x = x; + motionAxisState.xValuePos.y = y; + drawAxisValue(X_AXIS); - x += BTN_WIDTH + spacing; - drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + // ROW 5 -> E- CurX Y- Z- + y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2; + x = X_MARGIN; - // Cur Z - motionAxisState.zValuePos.x = x; - motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; - drawAxisValue(Z_AXIS); + drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); - // ROW 4 -> step_size disable steppers back - y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // - x = xplus_x - CUR_STEP_VALUE_WIDTH - 10; - motionAxisState.stepValuePos.x = yplus_x + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; - motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; - if (!busy) { - drawCurStepValue(); - TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); - } + // Cur E + motionAxisState.eValuePos.x = x; + motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(E_AXIS); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // Cur Z + motionAxisState.zValuePos.x = x; + motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(Z_AXIS); + + // ROW 6 -> step_size disable steppers back + y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // + x = zplus_x - CUR_STEP_VALUE_WIDTH - 10; + motionAxisState.stepValuePos.x = X_MARGIN + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; + motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; + + if (!busy) { + drawCurStepValue(); + TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); + } + + // aligned with x+ + drawBtn(yplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + + #else // !TFT_COLOR_UI_PORTRAIT + + // ROW 1 -> E+ Y+ CurY Z+ + int x = X_MARGIN, y = Y_MARGIN, spacing = 0; + + drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); + + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + x += BTN_WIDTH + spacing; + uint16_t yplus_x = x; + drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); + + // Cur Y + x += BTN_WIDTH; + motionAxisState.yValuePos.x = x + 2; + motionAxisState.yValuePos.y = y; + drawAxisValue(Y_AXIS); + + x += spacing; + drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // ROW 2 -> "Ex" X- HOME X+ "Z" + y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; + x = X_MARGIN; + spacing = (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; + + motionAxisState.eNamePos.x = x; + motionAxisState.eNamePos.y = y; + drawCurESelection(); + TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; //imgHome is 64x64 + TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); + + x += BTN_WIDTH + spacing; + uint16_t xplus_x = x; + drawBtn(x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + motionAxisState.zTypePos.x = x; + motionAxisState.zTypePos.y = y; + drawCurZSelection(); + #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) + if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); + #endif + + // ROW 3 -> E- CurX Y- Z- + y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; + x = X_MARGIN; + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + + drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); + + // Cur E + motionAxisState.eValuePos.x = x; + motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(E_AXIS); + + // Cur X + motionAxisState.xValuePos.x = BTN_WIDTH + (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; //X- pos + motionAxisState.xValuePos.y = y - 10; + drawAxisValue(X_AXIS); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // Cur Z + motionAxisState.zValuePos.x = x; + motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(Z_AXIS); + + // ROW 4 -> step_size disable steppers back + y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // + x = xplus_x - CUR_STEP_VALUE_WIDTH - 10; + motionAxisState.stepValuePos.x = yplus_x + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; + motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; + if (!busy) { + drawCurStepValue(); + TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); + } + + // aligned with x+ + drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); - // aligned with x+ - drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + #endif // !TFT_COLOR_UI_PORTRAIT TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } diff --git a/Marlin/src/lcd/tft/ui_320x240.h b/Marlin/src/lcd/tft/ui_320x240.h index 72aafbf245c0..555ca3616a09 100644 --- a/Marlin/src/lcd/tft/ui_320x240.h +++ b/Marlin/src/lcd/tft/ui_320x240.h @@ -44,4 +44,6 @@ #define FONT_SIZE 10 #endif +#define FONT_LINE_HEIGHT 24 + #include "tft_font.h" diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index e8d51d89a10f..02e9ca196aba 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -746,10 +746,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -791,8 +789,8 @@ static void disable_steppers() { } static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { - uint16_t width = Images[imgBtn52Rounded].width; - uint16_t height = Images[imgBtn52Rounded].height; + uint16_t width = Images[imgBtn52Rounded].width, + height = Images[imgBtn52Rounded].height; if (!enabled) bgColor = COLOR_CONTROL_DISABLED; diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index c1c4a8e3b192..8f68d789009d 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -49,19 +49,14 @@ #define TFT_MIRROR_X (TFT_INVERT_Y) #define TFT_MIRROR_Y (TFT_INVERT_X) -#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_INVERT_Y) -#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_INVERT_X) +#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) +#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) -#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_INVERT_Y) -#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_INVERT_X) +#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) +#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) -#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_INVERT_Y) -#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_INVERT_X) - -// TFT_ROTATION is user configurable -#ifndef TFT_ROTATION - #define TFT_ROTATION TFT_NO_ROTATION -#endif +#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) +#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) // TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION #define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 59441dc80609..cd4989d73d49 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -149,26 +149,27 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ -#if EITHER(HAS_FSMC_GRAPHICAL_TFT, TFT_320x240) - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 +#if HAS_FSMC_TFT - #define TFT_CS_PIN FSMC_CS_PIN - #define TFT_RS_PIN FSMC_RS_PIN + #define TFT_CS_PIN PD7 // NE4 + #define TFT_RS_PIN PD11 // A0 + #define LCD_RESET_PIN PC6 // FSMC_RST + #define LCD_BACKLIGHT_PIN PD13 + + #define FSMC_CS_PIN TFT_CS_PIN // NE4 + #define FSMC_RS_PIN TFT_RS_PIN // A0 #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - #define LCD_RESET_PIN PC6 // FSMC_RST - #define LCD_BACKLIGHT_PIN PD13 -#endif + #if NEED_TOUCH_PINS + #define TOUCH_CS_PIN PC2 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #endif -#if BOTH(NEED_TOUCH_PINS, HAS_FSMC_GRAPHICAL_TFT) || ENABLED(TFT_320x240) - #define TOUCH_CS_PIN PC2 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI #endif #if ENABLED(TFT_320x240) // TFT32/28 diff --git a/buildroot/tests/mks_robin_nano_v1v2_maple b/buildroot/tests/mks_robin_nano_v1v2_maple index ebd5466ce61c..e241c14b9fe6 100755 --- a/buildroot/tests/mks_robin_nano_v1v2_maple +++ b/buildroot/tests/mks_robin_nano_v1v2_maple @@ -40,11 +40,10 @@ exec_test $1 $2 "MKS Robin v2 nano LVGL SPI w/ WiFi" "$3" # (Robin v2 nano has no FSMC interface) # use_example_configs Mks/Robin -opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 -opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 -opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 -opt_enable BINARY_FILE_TRANSFER -exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI + BINARY_FILE_TRANSFER" "$3" +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 TFT_ROTATION TFT_ROTATE_90 +opt_disable TFT_INTERFACE_FSMC +opt_enable TFT_INTERFACE_SPI BINARY_FILE_TRANSFER +exec_test $1 $2 "MKS Robin v2 nano New Color UI 240x320 SPI + BINARY_FILE_TRANSFER" "$3" # # MKS Robin v2 nano LVGL SPI + TMC From b3f65b674f23db5c32e4d7e96ad2dff97c77c717 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Tue, 17 Jan 2023 18:41:36 -0500 Subject: [PATCH 23/41] =?UTF-8?q?=F0=9F=9A=B8=20ProUI=20MPC=20menu=20(#252?= =?UTF-8?q?32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_post.h | 8 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 200 +++++++++++++------- Marlin/src/lcd/e3v2/proui/dwin.h | 39 +++- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 4 +- Marlin/src/lcd/e3v2/proui/dwinui.h | 10 +- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 17 +- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 24 ++- Marlin/src/lcd/e3v2/proui/menus.cpp | 14 -- Marlin/src/lcd/e3v2/proui/menus.h | 16 +- Marlin/src/lcd/e3v2/proui/plot.cpp | 27 +-- Marlin/src/lcd/e3v2/proui/plot.h | 23 +-- Marlin/src/lcd/language/language_en.h | 5 + Marlin/src/module/temperature.cpp | 10 +- buildroot/tests/STM32F103RE_creality | 6 +- 14 files changed, 228 insertions(+), 175 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 515d5f7984ac..3faef307a8ae 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2504,9 +2504,15 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 - #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) +#endif + +#if ENABLED(DWIN_LCD_PROUI) + #if EITHER(PIDTEMP, PIDTEMPBED) #define DWIN_PID_TUNE 1 #endif + #if EITHER(DWIN_PID_TUNE, MPCTEMP) && DISABLED(DISABLE_TUNING_GRAPH) + #define SHOW_TUNING_GRAPH 1 + #endif #endif // Thermal protection diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 4be081944138..e8430d591c98 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -31,37 +31,6 @@ #if ENABLED(DWIN_LCD_PROUI) -#if DISABLED(LIMITED_MAX_FR_EDITING) - #warning "LIMITED_MAX_FR_EDITING is recommended with ProUI." -#endif -#if DISABLED(LIMITED_MAX_ACCEL_EDITING) - #warning "LIMITED_MAX_ACCEL_EDITING is recommended with ProUI." -#endif -#if ENABLED(CLASSIC_JERK) && DISABLED(LIMITED_JERK_EDITING) - #warning "LIMITED_JERK_EDITING is recommended with ProUI." -#endif -#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) - #warning "INDIVIDUAL_AXIS_HOMING_SUBMENU is recommended with ProUI." -#endif -#if DISABLED(SET_PROGRESS_MANUALLY) - #warning "SET_PROGRESS_MANUALLY is recommended with ProUI." -#endif -#if DISABLED(STATUS_MESSAGE_SCROLLING) - #warning "STATUS_MESSAGE_SCROLLING is recommended with ProUI." -#endif -#if DISABLED(BAUD_RATE_GCODE) - #warning "BAUD_RATE_GCODE is recommended with ProUI." -#endif -#if DISABLED(SOUND_MENU_ITEM) - #warning "SOUND_MENU_ITEM is recommended with ProUI." -#endif -#if DISABLED(PRINTCOUNTER) - #warning "PRINTCOUNTER is recommended with ProUI." -#endif -#if HAS_MESH && DISABLED(MESH_EDIT_MENU) - #warning "MESH_EDIT_MENU is recommended with ProUI." -#endif - #include "../../fontutils.h" #include "../../marlinui.h" @@ -142,7 +111,7 @@ #include "endstop_diag.h" #endif -#if HAS_PIDPLOT +#if SHOW_TUNING_GRAPH #include "plot.h" #endif @@ -297,6 +266,9 @@ MenuClass *MaxAccelMenu = nullptr; MenuClass *MaxJerkMenu = nullptr; #endif MenuClass *StepsMenu = nullptr; +#if ENABLED(MPCTEMP) + MenuClass *HotendMPCMenu = nullptr; +#endif #if ENABLED(PIDTEMP) MenuClass *HotendPIDMenu = nullptr; #endif @@ -1275,8 +1247,8 @@ void EachMomentUpdate() { #if HAS_ESDIAG if (checkkey == ESDiagProcess) ESDiag.Update(); #endif - #if HAS_PIDPLOT - if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); + #if SHOW_TUNING_GRAPH + if (checkkey == PidProcess) plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); #endif } @@ -1498,36 +1470,64 @@ void DWIN_LevelingDone() { } #endif -// PID process +// PID/MPC process -#if BOTH(HAS_PIDPLOT, DWIN_PID_TUNE) +#if SHOW_TUNING_GRAPH + + #include "plot.h" - void DWIN_Draw_PIDPopup() { - frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; + celsius_t _maxtemp, _target; + void DWIN_Draw_PID_MPC_Popup() { + constexpr frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); - DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - switch (HMI_value.pidresult) { - #if ENABLED(PIDTEMP) + + #if ENABLED(MPCTEMP) + + switch (HMI_value.pidresult) { + case MPCTEMP_START: + _maxtemp = thermalManager.hotend_maxtemp[0]; + _target = 200; + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_MPC_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius")); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); + break; + case PIDTEMPBED_START: + _maxtemp = BED_MAXTEMP; + _target = HMI_data.BedPidT; + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); + break; + default: return; + } + + #else // PID + + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + + switch (HMI_value.pidresult) { case PIDTEMP_START: + _maxtemp = thermalManager.hotend_maxtemp[0]; + _target = HMI_data.HotendPidT; DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); - Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); break; - #endif - #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: + _maxtemp = BED_MAXTEMP; + _target = HMI_data.BedPidT; DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); - Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); break; - #endif - default: break; - } + default: return; + } + + #endif // PID + + plot.Draw(gfrm, _maxtemp, _target); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, _target); } -#endif +#endif // SHOW_TUNING_GRAPH #if DWIN_PID_TUNE @@ -1542,40 +1542,40 @@ void DWIN_LevelingDone() { } } - void DWIN_PidTuning(pidresult_t result) { + void DWIN_PidTuning(tempcontrol_t result) { HMI_value.pidresult = result; switch (result) { #if ENABLED(PIDTEMP) case PIDTEMP_START: HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); #else DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); #endif break; - case PID_BAD_HEATER_ID: + case PID_TEMP_TOO_HIGH: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_HEATER_ID)); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); #else DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); #endif break; #endif - case PID_TUNING_TIMEOUT: + case PID_BAD_HEATER_ID: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; - case PID_TEMP_TOO_HIGH: + case PID_TUNING_TIMEOUT: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_DONE: checkkey = last_checkkey; @@ -1589,6 +1589,43 @@ void DWIN_LevelingDone() { #endif // DWIN_PID_TUNE +#if ENABLED(MPCTEMP) + + void DWIN_MPCTuning(tempcontrol_t result) { + HMI_value.pidresult = result; + switch (result) { + case MPCTEMP_START: + HMI_SaveProcessID(MPCProcess); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_MPC_AUTOTUNE), F("for Nozzle is running.")); + #endif + break; + case MPC_TEMP_ERROR: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), F(STR_MPC_TEMPERATURE_ERROR)); + ui.reset_alert_level(); + break; + case MPC_INTERRUPTED: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), F(STR_MPC_AUTOTUNE STR_MPC_AUTOTUNE_INTERRUPTED)); + ui.reset_alert_level(); + break; + case MPC_DONE: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_MPC_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); + ui.reset_alert_level(); + break; + default: + checkkey = last_checkkey; + ui.reset_alert_level(); + break; + } + } + +#endif // MPCTEMP + // Started a Print Job void DWIN_Print_Started() { DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); @@ -3054,7 +3091,7 @@ void Draw_Control_Menu() { void Draw_AdvancedSettings_Menu() { checkkey = Menu; - if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 18)) { + if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 19)) { BACK_ITEM(Goto_Main_Menu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); @@ -3069,6 +3106,9 @@ void Draw_AdvancedSettings_Menu() { #if ENABLED(PIDTEMP) MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, Draw_HotendPID_Menu); #endif + #if ENABLED(MPCTEMP) + MENU_ITEM_F(ICON_MPCNozzle, STR_MPC_AUTOTUNE " Settings", onDrawSubMenu, Draw_HotendMPC_Menu); + #endif #if ENABLED(PIDTEMPBED) MENU_ITEM_F(ICON_PIDBed, STR_BED_PID " Settings", onDrawSubMenu, Draw_BedPID_Menu); #endif @@ -3500,6 +3540,38 @@ void Draw_Steps_Menu() { #endif +#if ENABLED(MPCTEMP) + + void HotendMPC() { thermalManager.MPC_autotune(); } + void SetHeaterPower() { SetPFloatOnClick(1, 200, 1); } + void SetBlkHeatCapacity() { SetPFloatOnClick(0, 40, 2); } + void SetSensorRespons() { SetPFloatOnClick(0, 1, 4); } + void SetAmbientXfer() { SetPFloatOnClick(0, 1, 4); } + #if ENABLED(MPC_INCLUDE_FAN) + void onDrawFanAdj(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 4, thermalManager.temp_hotend[0].fanCoefficient()); } + void ApplyFanAdj() { thermalManager.temp_hotend[0].applyFanAdjustment(MenuData.Value / POW(10, 4)); } + void SetFanAdj() { SetFloatOnClick(0, 1, 4, thermalManager.temp_hotend[0].fanCoefficient(), ApplyFanAdj); } + #endif + + void Draw_HotendMPC_Menu() { + checkkey = Menu; + if (SET_MENU_F(HotendMPCMenu, STR_MPC_AUTOTUNE " Settings", 7)) { + MPC_t &mpc = thermalManager.temp_hotend[0].mpc; + BACK_ITEM(Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_MPCNozzle, MSG_MPC_AUTOTUNE, onDrawMenuItem, HotendMPC); + EDIT_ITEM(ICON_MPCHeater, MSG_MPC_POWER, onDrawPFloatMenu, SetHeaterPower, &mpc.heater_power); + EDIT_ITEM(ICON_MPCHeatCap, MSG_MPC_BLOCK_HEAT_CAPACITY, onDrawPFloat2Menu, SetBlkHeatCapacity, &mpc.block_heat_capacity); + EDIT_ITEM(ICON_MPCValue, MSG_SENSOR_RESPONSIVENESS, onDrawPFloat4Menu, SetSensorRespons, &mpc.sensor_responsiveness); + EDIT_ITEM(ICON_MPCValue, MSG_MPC_AMBIENT_XFER_COEFF, onDrawPFloat4Menu, SetAmbientXfer, &mpc.ambient_xfer_coeff_fan0); + #if ENABLED(MPC_INCLUDE_FAN) + EDIT_ITEM(ICON_MPCFan, MSG_MPC_AMBIENT_XFER_COEFF_FAN, onDrawFanAdj, SetFanAdj, &mpc.fan255_adjustment); + #endif + } + UpdateMenu(HotendMPCMenu); + } + +#endif // MPCTEMP + #if ENABLED(PIDTEMPBED) void Draw_BedPID_Menu() { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index bc050abd2e1e..112df5cae144 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -70,17 +70,30 @@ enum processID : uint8_t { WaitResponse, Homing, PidProcess, + MPCProcess, NothingToDo }; -enum pidresult_t : uint8_t { - PIDTEMP_START = 0, - PIDTEMPBED_START, - PID_BAD_HEATER_ID, - PID_TEMP_TOO_HIGH, - PID_TUNING_TIMEOUT, - PID_DONE, -}; +#if EITHER(DWIN_PID_TUNE, MPCTEMP) + + enum tempcontrol_t : uint8_t { + #if DWIN_PID_TUNE + PID_DONE, + PIDTEMP_START, + PIDTEMPBED_START, + PID_BAD_HEATER_ID, + PID_TEMP_TOO_HIGH, + PID_TUNING_TIMEOUT, + #endif + #if ENABLED(MPCTEMP) + MPC_DONE, + MPCTEMP_START, + MPC_TEMP_ERROR, + MPC_INTERRUPTED + #endif + }; + +#endif #define DWIN_CHINESE 123 #define DWIN_ENGLISH 0 @@ -142,7 +155,7 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components #if DWIN_PID_TUNE - pidresult_t pidresult = PID_DONE; + tempcontrol_t pidresult = PID_DONE; #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select @@ -361,7 +374,7 @@ void Draw_Steps_Menu(); #if DWIN_PID_TUNE #include "../../../module/temperature.h" void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); - void DWIN_PidTuning(pidresult_t result); + void DWIN_PidTuning(tempcontrol_t result); #if ENABLED(PIDTEMP) void Draw_HotendPID_Menu(); #endif @@ -369,3 +382,9 @@ void Draw_Steps_Menu(); void Draw_BedPID_Menu(); #endif #endif + +// MPC +#if ENABLED(MPCTEMP) + void DWIN_MPCTuning(tempcontrol_t result); + void Draw_HotendMPC_Menu(); +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index de3f40e2814b..e87aedf31179 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -19,6 +19,8 @@ * along with this program. If not, see . * */ +#pragma once + /** * DWIN general defines and data structs for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) @@ -26,8 +28,6 @@ * Date: 2022/08/08 */ -#pragma once - //#define DEBUG_DWIN 1 //#define NEED_HEX_PRINT 1 diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 55345a789985..85d969043f02 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#pragma once /** * DWIN Enhanced implementation for PRO UI @@ -27,8 +28,6 @@ * Date: 2022/07/05 */ -#pragma once - #include "../../../inc/MarlinConfigPre.h" #include "../common/dwin_set.h" @@ -147,6 +146,13 @@ #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion +// MPC +#define ICON_MPCNozzle ICON_SetEndTemp +#define ICON_MPCValue ICON_Contact +#define ICON_MPCHeater ICON_Temperature +#define ICON_MPCHeatCap ICON_SetBedTemp +#define ICON_MPCFan ICON_FanSpeed + // Buttons #define BTN_Continue 85 #define BTN_Cancel 87 diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 6411b669bbc8..bc489dd1fa8f 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -21,25 +21,10 @@ */ /** - * DWIN g-code thumbnail preview + * DWIN G-code thumbnail preview * Author: Miguel A. Risco-Castillo * version: 3.1.2 * Date: 2022/09/03 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index c1949c5abc12..2452797d0c62 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -1,12 +1,13 @@ /** - * DWIN g-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.1.2 - * Date: 2022/09/03 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,14 +15,19 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For commercial applications additional licenses can be requested */ - #pragma once +/** + * DWIN G-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 3.1.2 + * Date: 2022/09/03 + */ + void Preview_DrawFromSD(); void Preview_Invalidate(); bool Preview_Valid(); diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 540f9e1f417b..dfcfaa7bbc19 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -25,20 +25,6 @@ * Author: Miguel A. Risco-Castillo * Version: 1.9.1 * Date: 2022/12/02 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 33712f8959ef..072bf7584d90 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -19,28 +19,14 @@ * along with this program. If not, see . * */ +#pragma once /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo * Version: 1.9.1 * Date: 2022/12/02 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * */ -#pragma once #include "dwinui.h" diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 53178e3ea705..fddaf3963ae1 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -25,26 +25,11 @@ * Author: Miguel A. Risco-Castillo * Version: 2.1.2 * Date: 2022/11/20 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ -#include "../../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfig.h" -#if BOTH(DWIN_LCD_PROUI, HAS_PIDPLOT) +#if BOTH(DWIN_LCD_PROUI, SHOW_TUNING_GRAPH) #include "plot.h" #include "../../../core/types.h" @@ -55,13 +40,13 @@ #define Plot_Bg_Color RGB( 1, 12, 8) -PlotClass Plot; +PlotClass plot; uint16_t grphpoints, r, x2, y2 = 0; frame_rect_t grphframe = {0}; float scale = 0; -void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) { +void PlotClass::Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref/*=0*/) { grphframe = frame; grphpoints = 0; scale = frame.h / max; @@ -76,7 +61,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) void PlotClass::Update(const_float_t value) { if (!scale) return; - uint16_t y = round((y2) - value * scale); + const uint16_t y = round((y2) - value * scale); if (grphpoints < grphframe.w) { DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y); } @@ -89,4 +74,4 @@ void PlotClass::Update(const_float_t value) { grphpoints++; } -#endif // DWIN_LCD_PROUI && HAS_PIDPLOT +#endif // DWIN_LCD_PROUI && SHOW_TUNING_GRAPH diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index 2663776dc4fc..14e7058b0171 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -19,36 +19,21 @@ * along with this program. If not, see . * */ +#pragma once /** * DWIN Single var plot * Author: Miguel A. Risco-Castillo * Version: 2.1.2 * Date: 2022/11/20 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ -#pragma once #include "dwinui.h" class PlotClass { public: - void Draw(frame_rect_t frame, float max, float ref = 0); - void Update(const_float_t value); + static void Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref=0); + static void Update(const_float_t value); }; -extern PlotClass Plot; +extern PlotClass plot; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 8352ef888622..425c948dbe39 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -376,10 +376,15 @@ namespace Language_en { LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Cooling to ambient"); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC"); + LSTR MSG_MPC_POWER = _UxGT("Heater Power"); LSTR MSG_MPC_POWER_E = _UxGT("Power *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Heat Capacity"); LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Heat Cap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Sensor Resp."); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor Resp. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Ambient Coeff."); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient Co. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Fan coeff."); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan coeff. *"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index a4f528a4c819..99d5603566b6 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -903,6 +903,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!wait_for_heatup) { SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_INTERRUPTED)); return false; } @@ -942,7 +943,12 @@ volatile bool Temperature::raw_temps_ready = false; do_blocking_move_to(xyz_pos_t(MPC_TUNING_POS)); SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); - LCD_MESSAGE(MSG_COOLING); + #if ENABLED(DWIN_LCD_PROUI) + DWIN_MPCTuning(MPCTEMP_START); + LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT); + #else + LCD_MESSAGE(MSG_COOLING); + #endif millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; celsius_float_t current_temp = degHotend(active_extruder), @@ -1063,6 +1069,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!WITHIN(current_temp, t3 - 15.0f, hotend.target + 15.0f)) { SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_TEMP_ERROR)); break; } } @@ -1084,6 +1091,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_DONE)); #if 0 SERIAL_ECHOLNPGM("t1_time ", t1_time); diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index a3c52372ef37..8c0a40d8ae22 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -25,7 +25,11 @@ opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY S BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 -exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" +exec_test $1 $2 "Ender-3 S1 with ProUI (PIDTEMP)" "$3" + +opt_disable PIDTEMP +opt_enable MPCTEMP +exec_test $1 $2 "Ender-3 S1 with ProUI (MPCTEMP)" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 From f81c468f1e4fab9df0741011d34852886a6ab8cc Mon Sep 17 00:00:00 2001 From: John Robertson Date: Tue, 17 Jan 2023 23:53:39 +0000 Subject: [PATCH 24/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20potential=20I2S=20bu?= =?UTF-8?q?ffer=20overwrite=20(#25113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/i2s.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index d9bad4ec2d12..63ceed4c9dcd 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -149,30 +149,28 @@ void stepperTask(void *parameter) { dma.rw_pos = 0; while (dma.rw_pos < DMA_SAMPLE_COUNT) { - // Fill with the port data post pulse_phase until the next step - if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR)) - i2s_push_sample(); - - // i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr() - // in a rare case where both are called, we need to double decrement the counters - const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR)); - + if (!nextMainISR) { + Stepper::pulse_phase_isr(); + nextMainISR = Stepper::block_phase_isr(); + } #if ENABLED(LIN_ADVANCE) - if (!nextAdvanceISR) { + else if (!nextAdvanceISR) { Stepper::advance_isr(); nextAdvanceISR = Stepper::la_interval; } - else if (nextAdvanceISR == Stepper::LA_ADV_NEVER) - nextAdvanceISR = Stepper::la_interval; #endif + else + i2s_push_sample(); - if (!nextMainISR) { - Stepper::pulse_phase_isr(); - nextMainISR = Stepper::block_phase_isr(); - } + nextMainISR--; - nextMainISR -= push_count; - TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count); + #if ENABLED(LIN_ADVANCE) + if (nextAdvanceISR == Stepper::LA_ADV_NEVER) + nextAdvanceISR = Stepper::la_interval; + + if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER) + nextAdvanceISR--; + #endif } } } From f2b8942adc6ff85fe99c0bd5ebae83acdf4e1b75 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 18 Jan 2023 00:22:56 +0000 Subject: [PATCH 25/41] [cron] Bump distribution date (2023-01-18) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index a4c4a580c832..3a5d0eafdbec 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-17" +//#define STRING_DISTRIBUTION_DATE "2023-01-18" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index cd87b9255c46..0646321c07a2 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 "2023-01-17" + #define STRING_DISTRIBUTION_DATE "2023-01-18" #endif /** From b7c23631c5840e2338cae531b171459e9e9c5301 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:08:37 +1300 Subject: [PATCH 26/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20misc.=20UI=20issues?= =?UTF-8?q?=20(#25252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/host/M115.cpp | 4 +++- Marlin/src/inc/Conditionals_adv.h | 4 ++++ Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp | 6 +++--- Marlin/src/lcd/marlinui.cpp | 11 +++++++---- Marlin/src/lcd/marlinui.h | 4 +++- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 10 ++++------ Marlin/src/lcd/tft/ui_320x240.cpp | 10 ++++------ Marlin/src/lcd/tft/ui_480x320.cpp | 10 ++++------ Marlin/src/lcd/tft_io/tft_io.h | 5 +++++ Marlin/src/module/motion.cpp | 8 ++------ Marlin/src/module/temperature.cpp | 3 +++ Marlin/src/module/temperature.h | 2 ++ Marlin/src/module/tool_change.cpp | 12 +++++------- 16 files changed, 52 insertions(+), 43 deletions(-) diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 6e8c406adc1a..d28d53eeddba 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -232,7 +232,7 @@ void GcodeSuite::M115() { const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(), wmin = cmin.asLogical(), wmax = cmax.asLogical(); - SERIAL_ECHOLNPGM( + SERIAL_ECHOPGM( "area:{" "full:{" "min:{" @@ -249,6 +249,8 @@ void GcodeSuite::M115() { ), "}" // max "}," // full + ); + SERIAL_ECHOLNPGM( "work:{" "min:{" LIST_N(DOUBLE(NUM_AXES), diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index ea52c9b99861..9833b300d368 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -656,6 +656,10 @@ #define HAS_MEDIA_SUBCALLS 1 #endif +#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) + #define HAS_EXTRA_PROGRESS 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/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b17bf2b7196f..1aadbb19e3e2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -944,7 +944,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled." #endif -#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) +#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4 #error "Displays with fewer than 4 rows of text can't show progress values." #endif diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index cba58f5c02f9..03e83c218104 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -444,7 +444,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } // Prepare strings for progress display -#if HAS_PRINT_PROGRESS +#if HAS_EXTRA_PROGRESS static MarlinUI::progress_t progress = 0; static char bufferc[13]; diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 9ed0d8a9d674..3d1594aca2c0 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -705,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawRemain() { const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time()); if (printJobOngoing() && remaint.value) { - draw_progress_string( PPOS, prepare_time_string(remaint, 'R')); + draw_progress_string(PPOS, prepare_time_string(remaint, 'R')); } } #endif @@ -714,7 +714,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawInter() { const duration_t interactt = ui.interaction_time; if (printingIsActive() && interactt.value) { - draw_progress_string( PPOS, prepare_time_string(interactt, 'C')); + draw_progress_string(PPOS, prepare_time_string(interactt, 'C')); } } #endif @@ -723,7 +723,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawElapsed() { if (printJobOngoing()) { const duration_t elapsedt = print_job_timer.duration(); - draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E')); + draw_progress_string(PPOS, prepare_time_string(elapsedt, 'E')); } } #endif diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index ff12703ca94c..91982b54801e 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1743,9 +1743,11 @@ void MarlinUI::init() { ); } - #if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT) - typedef void (*PrintProgress_t)(); - void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings + #if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS + + // Renew and redraw all enabled progress strings + void MarlinUI::rotate_progress() { + typedef void (*PrintProgress_t)(); const PrintProgress_t progFunc[] = { OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent) OPTITEM(SHOW_ELAPSED_TIME, drawElapsed) @@ -1760,7 +1762,8 @@ void MarlinUI::init() { (*progFunc[i])(); } } - #endif + + #endif // LCD_WITH_BLINK && HAS_EXTRA_PROGRESS #endif // HAS_PRINT_PROGRESS diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index ec19f8bd34ba..827a71a29dc3 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -334,7 +334,7 @@ class MarlinUI { FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); } #endif static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); } - #if LCD_WITH_BLINK + #if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS #if ENABLED(SHOW_PROGRESS_PERCENT) static void drawPercent(); #endif @@ -348,6 +348,8 @@ class MarlinUI { static void drawInter(); #endif static void rotate_progress(); + #else + static void rotate_progress() {} #endif #else static constexpr uint8_t get_progress_percent() { return 0; } diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 6f404f20e11e..0e24d0ed8087 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -377,7 +377,7 @@ void menu_backlash(); #if ENABLED(MPC_INCLUDE_FAN) #define MPC_EDIT_ITEMS(N) \ - MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ + MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].mpc; \ _MPC_EDIT_ITEMS(N); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \ diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index f3eb83eb9f50..363e8eaf9925 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -675,12 +675,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 07fa95732726..fa433645d7b2 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -768,12 +768,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 02e9ca196aba..5bf50a581843 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -656,12 +656,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 8f68d789009d..a3635aaa93d6 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -58,6 +58,11 @@ #define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) #define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) +// TFT_ROTATION is user configurable +#ifndef TFT_ROTATION + #define TFT_ROTATION TFT_NO_ROTATION +#endif + // TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION #define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 17c607da0830..39506e21d6a8 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1418,12 +1418,8 @@ void prepare_line_to_destination() { #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) { - bool ignore_e = false; - - #if ENABLED(PREVENT_COLD_EXTRUSION) - ignore_e = thermalManager.tooColdToExtrude(active_extruder); - if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); - #endif + bool ignore_e = thermalManager.tooColdToExtrude(active_extruder); + if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); #if ENABLED(PREVENT_LENGTHY_EXTRUDE) const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder]; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 99d5603566b6..5d4ccc0a5189 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -517,6 +517,9 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if ENABLED(PREVENT_COLD_EXTRUSION) bool Temperature::allow_cold_extrude = false; celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; +#else + constexpr bool Temperature::allow_cold_extrude; + constexpr celsius_t Temperature::extrude_min_temp; #endif #if HAS_ADC_BUTTONS diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 0b5f8caf3fac..9ac5db44edfa 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -643,6 +643,8 @@ class Temperature { static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } #else + static constexpr bool allow_cold_extrude = true; + static constexpr celsius_t extrude_min_temp = 0; static bool tooColdToExtrude(const uint8_t) { return false; } static bool targetTooColdToExtrude(const uint8_t) { return false; } #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 7322098c0bb7..74e99ac09344 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -929,7 +929,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. * Returns FALSE if able to move. */ bool too_cold(uint8_t toolID){ - if (TERN0(PREVENT_COLD_EXTRUSION, !DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID))) { + if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID)) { SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); return true; } @@ -1429,12 +1429,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { bool extruder_migration() { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.targetTooColdToExtrude(active_extruder)) { - DEBUG_ECHOLNPGM("Migration Source Too Cold"); - return false; - } - #endif + if (thermalManager.targetTooColdToExtrude(active_extruder)) { + DEBUG_ECHOLNPGM("Migration Source Too Cold"); + return false; + } // No auto-migration or specified target? if (!migration.target && active_extruder >= migration.last) { From 7e72981b8cbaa7a6276f6833527e97cb10e060e7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 Jan 2023 22:57:56 -0600 Subject: [PATCH 27/41] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20homing=5Fneeded=5Fer?= =?UTF-8?q?ror=20language?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 2 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_de.h | 2 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_es.h | 2 +- Marlin/src/lcd/language/language_eu.h | 2 +- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 2 +- Marlin/src/lcd/language/language_jp_kana.h | 2 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 2 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 2 +- Marlin/src/lcd/language/language_sv.h | 2 +- Marlin/src/lcd/language/language_tr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_vi.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/language/language_zh_TW.h | 2 +- Marlin/src/module/motion.cpp | 11 ++++++++--- 25 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index d3a1c2eac1bb..13b5d70837ad 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -151,7 +151,7 @@ namespace Language_ca { LSTR MSG_CHANGE_MEDIA = _UxGT("Canvia SD"); LSTR MSG_ZPROBE_OUT = _UxGT("Sonda Z fora"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reinicia BLTouch"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s primer"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s primer"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Decalatge Z"); LSTR MSG_BABYSTEP_X = _UxGT("Micropas X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropas Y"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index db50def2da87..bb930eb7846c 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -395,7 +395,7 @@ namespace Language_cz { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("vysunout TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Vysunout Z-sondu"); LSTR MSG_MANUAL_STOW = _UxGT("Zasunout Z-sondu"); - LSTR MSG_HOME_FIRST = _UxGT("Domů %s%s%s první"); + LSTR MSG_HOME_FIRST = _UxGT("Domů %s první"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 7d3867c3584c..56c53b84fd51 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -138,7 +138,7 @@ namespace Language_da { LSTR MSG_CHANGE_MEDIA = _UxGT("Skift SD kort"); LSTR MSG_ZPROBE_OUT = _UxGT("Probe udenfor plade"); LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selv-Test"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s først"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s først"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Opvarmning fejlet"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Fejl: reserve temp"); LSTR MSG_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 56f91e0ed23b..1cbddf860e25 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -539,7 +539,7 @@ namespace Language_de { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI ausfahren"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Sonde ausfahren"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Sonde einfahren"); - LSTR MSG_HOME_FIRST = _UxGT("Vorher %s%s%s homen"); + LSTR MSG_HOME_FIRST = _UxGT("Vorher %s homen"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Sondeneinstellungen"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Sondenversatz"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Sondenversatz X"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 425c948dbe39..a1520c0a7ed1 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -597,7 +597,7 @@ namespace Language_en { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Probe Settings"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Probe Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 92e469576536..d95275c317ac 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -398,7 +398,7 @@ namespace Language_es { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Subir TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Subir Sonda Z"); LSTR MSG_MANUAL_STOW = _UxGT("Bajar Sonda Z"); - LSTR MSG_HOME_FIRST = _UxGT("Origen %s%s%s Prim."); + LSTR MSG_HOME_FIRST = _UxGT("Origen %s Prim."); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Desf. Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Desf. Sonda X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Desf. Sonda Y"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index e5e1d898ab70..0c29cdd2aaba 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -235,7 +235,7 @@ namespace Language_eu { LSTR MSG_BLTOUCH_RESET = _UxGT("BLTouch berrabia."); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch jaitsi/luzatu"); LSTR MSG_BLTOUCH_STOW = _UxGT("BLTouch igo/jaso"); - LSTR MSG_HOME_FIRST = _UxGT("Etxera %s%s%s lehenengo"); + LSTR MSG_HOME_FIRST = _UxGT("Etxera %s lehenengo"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Konpentsatu"); LSTR MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 35e8502b940c..d9d43427c27a 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -424,7 +424,7 @@ namespace Language_fr { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Déployer TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Déployer Sonde Z"); LSTR MSG_MANUAL_STOW = _UxGT("Ranger Sonde Z"); - LSTR MSG_HOME_FIRST = _UxGT("Origine %s%s%s Premier"); + LSTR MSG_HOME_FIRST = _UxGT("Origine %s Premier"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Position sonde Z"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Décalage X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Décalage Y"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index abad80bbecb8..28917bad35bf 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -413,7 +413,7 @@ namespace Language_gl { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estender TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda Z"); LSTR MSG_MANUAL_STOW = _UxGT("Recoller Sonda Z"); - LSTR MSG_HOME_FIRST = _UxGT("Orixe %s%s%s Primeiro"); + LSTR MSG_HOME_FIRST = _UxGT("Orixe %s Primeiro"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Desfases Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Desfase Sonda X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Desfase Sonda Y"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 598da662cc74..61c7d9f9c4e4 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -467,7 +467,7 @@ namespace Language_hu { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI használ"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Szonda telepítés"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Szonda elhelyezés"); - LSTR MSG_HOME_FIRST = _UxGT("Elöször %s%s%s kell"); + LSTR MSG_HOME_FIRST = _UxGT("Elöször %s kell"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Szonda eltolások"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X szonda eltolás"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y szonda eltolás"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 12a9c572b5e9..a520972b0f7d 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -564,7 +564,7 @@ namespace Language_it { LSTR MSG_MANUAL_DEPLOY = _UxGT("Estendi Sonda-Z"); LSTR MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); LSTR MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s prima"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s prima"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Impostazioni sonda"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Offsets sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Offset X sonda"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 989d5844f603..335d4533daa6 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -175,7 +175,7 @@ namespace Language_jp_kana { LSTR MSG_ZPROBE_OUT = _UxGT("Zプローブ ベッドガイ"); // "Z probe out. bed" LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch ジコシンダン"); // "BLTouch Self-Test" LSTR MSG_BLTOUCH_RESET = _UxGT("BLTouch リセット"); // "Reset BLTouch" - LSTR MSG_HOME_FIRST = _UxGT("サキニ %s%s%s ヲフッキサセテクダサイ"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("サキニ %s ヲフッキサセテクダサイ"); // "Home ... first" LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Zオフセット"); // "Z Offset" LSTR MSG_BABYSTEP_X = _UxGT("Xジク ビドウ"); // "Babystep X" LSTR MSG_BABYSTEP_Y = _UxGT("Yジク ビドウ"); // "Babystep Y" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 0636899c9523..9ad16bcd8c14 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -152,7 +152,7 @@ namespace Language_nl { LSTR MSG_ZPROBE_OUT = _UxGT("Z probe uit. bed"); LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Zelf-Test"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s Eerst"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s Eerst"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Offset"); // accepted English term in Dutch LSTR MSG_BABYSTEP_X = _UxGT("Babystap X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystap Y"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 7eb17e93f73b..b39c084ec89a 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -372,7 +372,7 @@ namespace Language_pl { LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); LSTR MSG_BLTOUCH_MODE_CHANGE = _UxGT("UWAGA: Złe ustawienia mogą uszkodzić drukarkę. Kontynuować?"); - LSTR MSG_HOME_FIRST = _UxGT("Najpierw Home %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Najpierw Home %s"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Przesuń dyszę do stołu"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Łącznie"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index d34cd0c0c187..d52728d10726 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -340,7 +340,7 @@ namespace Language_pt_br { LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Estender BLTouch"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda-Z"); LSTR MSG_MANUAL_STOW = _UxGT("Recolher Sonda-Z"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s Primeiro"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s Primeiro"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Compensar Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Compensar Sonda em X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Compensar Sonda em Y"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 48751f8cd2a4..c5fdcc786f68 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -419,7 +419,7 @@ namespace Language_ro { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Probe Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Probe Y Offset"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 1f3c77752e73..b8a08afc2294 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -581,7 +581,7 @@ namespace Language_ru { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установить TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Установить зонд"); LSTR MSG_MANUAL_STOW = _UxGT("Загрузить зонд"); - LSTR MSG_HOME_FIRST = _UxGT("Сначала паркуй %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Сначала паркуй %s"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Смещения Z-зонда"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Смещение X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Смещение Y"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 323ae684d5ea..ef50f5988c92 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -550,7 +550,7 @@ namespace Language_sk { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Zasunúť TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Zasunúť sondu Z"); LSTR MSG_MANUAL_STOW = _UxGT("Vysunúť sondu Z"); - LSTR MSG_HOME_FIRST = _UxGT("Najskôr os %s%s%s domov"); + LSTR MSG_HOME_FIRST = _UxGT("Najskôr os %s domov"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Nastav. sondy"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Ofsety sondy Z"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X ofset"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index a18691fe0e5e..e550e877a1b3 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -452,7 +452,7 @@ namespace Language_sv { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Fällut TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Fällut Z-Sond"); LSTR MSG_MANUAL_STOW = _UxGT("Stuva undan Z-Sond"); - LSTR MSG_HOME_FIRST = _UxGT("Hem %s%s%s Först"); + LSTR MSG_HOME_FIRST = _UxGT("Hem %s Först"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Sond Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Sond X Offset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Sond Y Offset"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 84d33f764de0..5ff8ab7b4882 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -390,7 +390,7 @@ namespace Language_tr { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI Aç"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Probe Aç"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Probe Kapat"); - LSTR MSG_HOME_FIRST = _UxGT("Önce %s%s%s Sıfırla"); + LSTR MSG_HOME_FIRST = _UxGT("Önce %s Sıfırla"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Prob Ofsetleri"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X Prob Ofset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y Prob Ofset"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 697445288dbb..16f3c9527866 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -598,7 +598,7 @@ namespace Language_uk { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установити TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Установити Z-зонд"); LSTR MSG_MANUAL_STOW = _UxGT("Завантажити Z-зонд"); - LSTR MSG_HOME_FIRST = _UxGT("Спочатку дім %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Спочатку дім %s"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Зміщення зонду"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Зміщення по X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Зміщення по Y"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index ed50cca6633b..575191f50b28 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -326,7 +326,7 @@ namespace Language_vi { LSTR MSG_BLTOUCH_STOW = _UxGT("Cất BLTouch"); // Stow BLTouch LSTR MSG_MANUAL_DEPLOY = _UxGT("Đem Đầu Dò-Z"); // Deploy Z-Probe LSTR MSG_MANUAL_STOW = _UxGT("Cất Đầu Dò-Z"); // Stow Z-Probe - LSTR MSG_HOME_FIRST = _UxGT("Về nhà %s%s%s Trước"); + LSTR MSG_HOME_FIRST = _UxGT("Về nhà %s Trước"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Đầu Dò Bù Đắp Z"); // Probe Z Offset LSTR MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X LSTR MSG_BABYSTEP_Y = _UxGT("Nhít Y"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 79c59be44b07..6e2864ce6f78 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -419,7 +419,7 @@ namespace Language_zh_CN { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("部署TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("部署Z探针"); LSTR MSG_MANUAL_STOW = _UxGT("收好Z探针"); - LSTR MSG_HOME_FIRST = _UxGT("归位 %s%s%s 先"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("归位 %s 先"); // "Home ... first" LSTR MSG_ZPROBE_OFFSETS = _UxGT("探针偏移量"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("探针X偏移"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("探针Y偏移"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 6bc00e712aca..79d4ba75a7ba 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -369,7 +369,7 @@ namespace Language_zh_TW { LSTR MSG_BLTOUCH_STOW = _UxGT("裝載BLTouch"); // "Stow BLTouch" LSTR MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" - LSTR MSG_HOME_FIRST = _UxGT("歸位 %s%s%s 先"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("歸位 %s 先"); // "Home ... first" LSTR MSG_ZPROBE_OFFSETS = _UxGT("探針偏移"); //Probe Offsets LSTR MSG_ZPROBE_XOFFSET = _UxGT("探針X偏移量"); //Probe X Offset LSTR MSG_ZPROBE_YOFFSET = _UxGT("探針Y偏移量"); //Probe Y Offset diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 39506e21d6a8..8b1a8b6e502c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1488,12 +1488,17 @@ void prepare_line_to_destination() { bool homing_needed_error(main_axes_bits_t axis_bits/*=main_axes_mask*/) { if ((axis_bits = axes_should_home(axis_bits))) { - PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); + char all_axes[] = STR_AXES_MAIN, need[NUM_AXES]; + uint8_t n = 0; + LOOP_NUM_AXES(i) if (TEST(axis_bits, i)) need[n++] = all_axes[i]; + need[n] = '\0'; + char msg[30]; - #define _AXIS_CHAR(N) TEST(axis_bits, _AXIS(N)) ? STR_##N : "" - sprintf_P(msg, home_first, MAPLIST(_AXIS_CHAR, MAIN_AXIS_NAMES)); + sprintf_P(msg, GET_EN_TEXT(MSG_HOME_FIRST), need); SERIAL_ECHO_START(); SERIAL_ECHOLN(msg); + + sprintf_P(msg, GET_TEXT(MSG_HOME_FIRST), need); ui.set_status(msg); return true; } From e656f108c8161de94427dfb65ca74153cd231a31 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 22 Jan 2023 06:05:45 +0000 Subject: [PATCH 28/41] [cron] Bump distribution date (2023-01-22) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 3a5d0eafdbec..a6a8076ed581 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-18" +//#define STRING_DISTRIBUTION_DATE "2023-01-22" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0646321c07a2..103e61992d4d 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 "2023-01-18" + #define STRING_DISTRIBUTION_DATE "2023-01-22" #endif /** From fffc96661f53735691b6287c8bb90d0229dbfaae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Jan 2023 01:22:03 -0600 Subject: [PATCH 29/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20homing=5Fneeded=5Fer?= =?UTF-8?q?ror=20bits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/motion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 8b1a8b6e502c..d440093b169b 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1487,8 +1487,8 @@ void prepare_line_to_destination() { } bool homing_needed_error(main_axes_bits_t axis_bits/*=main_axes_mask*/) { - if ((axis_bits = axes_should_home(axis_bits))) { - char all_axes[] = STR_AXES_MAIN, need[NUM_AXES]; + if ((axis_bits &= axes_should_home(axis_bits))) { + char all_axes[] = STR_AXES_MAIN, need[NUM_AXES + 1]; uint8_t n = 0; LOOP_NUM_AXES(i) if (TEST(axis_bits, i)) need[n++] = all_axes[i]; need[n] = '\0'; From 32688979a166d334bb20d696f521bdffeaf92357 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Mon, 23 Jan 2023 01:37:35 -0600 Subject: [PATCH 30/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Ender-2=20Stock=20Di?= =?UTF-8?q?splay=20with=20Melzi=20(#25258)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- .../src/pins/sanguino/pins_MELZI_CREALITY.h | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index aac839808119..a574a9fe8d0d 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -358,11 +358,11 @@ #define BEEPER_PIN EXP1_01_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC EXP1_02_PIN // (58) open-drain #define LCD_PINS_RS EXP1_07_PIN #define BTN_EN1 EXP1_03_PIN #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index f508093c2257..437ba35eeadc 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -43,13 +43,19 @@ #endif // -// For the stock CR-10 enable CR10_STOCKDISPLAY in Configuration.h +// LCD / Controller // -#if ENABLED(CR10_STOCKDISPLAY) - #define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) - #define LCD_PINS_RS 28 // ST9720 CS - #define LCD_PINS_ENABLE 17 // ST9720 DAT - #define LCD_PINS_D4 30 // ST9720 CLK +#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS 28 // ST9720 CS + #define LCD_PINS_ENABLE 17 // ST9720 DAT + #define LCD_PINS_D4 30 // ST9720 CLK + #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + #define DOGLCD_CS 28 + #define DOGLCD_A0 30 + #endif + + #define LCD_SDSS 31 // Controller's SD card #define BTN_ENC 16 #define BTN_EN1 11 @@ -57,6 +63,7 @@ #define BEEPER_PIN 27 #define LCD_PINS_DEFINED + #endif #include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 From 4099763cfc06cc6b2d71a1fce76d73422183fac0 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 23 Jan 2023 12:07:26 +0000 Subject: [PATCH 31/41] [cron] Bump distribution date (2023-01-23) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index a6a8076ed581..f4c528b1663b 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-22" +//#define STRING_DISTRIBUTION_DATE "2023-01-23" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 103e61992d4d..79f59cc83084 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 "2023-01-22" + #define STRING_DISTRIBUTION_DATE "2023-01-23" #endif /** From e0ae072f5a7094af02704fd7ccc4f3894f076d7a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Jan 2023 02:21:02 -0600 Subject: [PATCH 32/41] =?UTF-8?q?=F0=9F=94=A7=20Overridable=20Stepper=20EN?= =?UTF-8?q?=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/stepper.cpp | 68 ++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9c3d459634e3..2a9487f09697 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2776,35 +2776,44 @@ void Stepper::init() { // Init Enable Pins - steppers default to disabled. #if HAS_X_ENABLE + #ifndef X_ENABLE_INIT_STATE + #define X_ENABLE_INIT_STATE !X_ENABLE_ON + #endif X_ENABLE_INIT(); - if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); + if (X_ENABLE_INIT_STATE) X_ENABLE_WRITE(X_ENABLE_INIT_STATE); #if BOTH(HAS_X2_STEPPER, HAS_X2_ENABLE) X2_ENABLE_INIT(); - if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); + if (X_ENABLE_INIT_STATE) X2_ENABLE_WRITE(X_ENABLE_INIT_STATE); #endif #endif #if HAS_Y_ENABLE + #ifndef Y_ENABLE_INIT_STATE + #define Y_ENABLE_INIT_STATE !Y_ENABLE_ON + #endif Y_ENABLE_INIT(); - if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); + if (Y_ENABLE_INIT_STATE) Y_ENABLE_WRITE(Y_ENABLE_INIT_STATE); #if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_ENABLE) Y2_ENABLE_INIT(); - if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); + if (Y_ENABLE_INIT_STATE) Y2_ENABLE_WRITE(Y_ENABLE_INIT_STATE); #endif #endif #if HAS_Z_ENABLE + #ifndef Z_ENABLE_INIT_STATE + #define Z_ENABLE_INIT_STATE !Z_ENABLE_ON + #endif Z_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #if NUM_Z_STEPPERS >= 2 && HAS_Z2_ENABLE Z2_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z2_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #if NUM_Z_STEPPERS >= 3 && HAS_Z3_ENABLE Z3_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z3_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z3_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #if NUM_Z_STEPPERS >= 4 && HAS_Z4_ENABLE Z4_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z4_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z4_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #endif #if HAS_I_ENABLE @@ -2832,36 +2841,63 @@ void Stepper::init() { if (!W_ENABLE_ON) W_ENABLE_WRITE(HIGH); #endif #if HAS_E0_ENABLE + #ifndef E_ENABLE_INIT_STATE + #define E_ENABLE_INIT_STATE !E_ENABLE_ON + #endif + #ifndef E0_ENABLE_INIT_STATE + #define E0_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E0_ENABLE_INIT(); - if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); + if (E0_ENABLE_INIT_STATE) E0_ENABLE_WRITE(E0_ENABLE_INIT_STATE); #endif #if HAS_E1_ENABLE + #ifndef E1_ENABLE_INIT_STATE + #define E1_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E1_ENABLE_INIT(); - if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); + if (E1_ENABLE_INIT_STATE) E1_ENABLE_WRITE(E1_ENABLE_INIT_STATE); #endif #if HAS_E2_ENABLE + #ifndef E2_ENABLE_INIT_STATE + #define E2_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E2_ENABLE_INIT(); - if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); + if (E2_ENABLE_INIT_STATE) E2_ENABLE_WRITE(E2_ENABLE_INIT_STATE); #endif #if HAS_E3_ENABLE + #ifndef E3_ENABLE_INIT_STATE + #define E3_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E3_ENABLE_INIT(); - if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); + if (E3_ENABLE_INIT_STATE) E3_ENABLE_WRITE(E3_ENABLE_INIT_STATE); #endif #if HAS_E4_ENABLE + #ifndef E4_ENABLE_INIT_STATE + #define E4_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E4_ENABLE_INIT(); - if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); + if (E4_ENABLE_INIT_STATE) E4_ENABLE_WRITE(E4_ENABLE_INIT_STATE); #endif #if HAS_E5_ENABLE + #ifndef E5_ENABLE_INIT_STATE + #define E5_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E5_ENABLE_INIT(); - if (!E_ENABLE_ON) E5_ENABLE_WRITE(HIGH); + if (E5_ENABLE_INIT_STATE) E5_ENABLE_WRITE(E5_ENABLE_INIT_STATE); #endif #if HAS_E6_ENABLE + #ifndef E6_ENABLE_INIT_STATE + #define E6_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E6_ENABLE_INIT(); - if (!E_ENABLE_ON) E6_ENABLE_WRITE(HIGH); + if (E6_ENABLE_INIT_STATE) E6_ENABLE_WRITE(E6_ENABLE_INIT_STATE); #endif #if HAS_E7_ENABLE + #ifndef E7_ENABLE_INIT_STATE + #define E7_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E7_ENABLE_INIT(); - if (!E_ENABLE_ON) E7_ENABLE_WRITE(HIGH); + if (E7_ENABLE_INIT_STATE) E7_ENABLE_WRITE(E7_ENABLE_INIT_STATE); #endif #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT() From 73932855609aa949fa13e3570659ce26c43b0ab8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Jan 2023 21:17:13 -0600 Subject: [PATCH 33/41] SDIO retry, hsd clock, etc. --- Marlin/src/HAL/STM32/sdio.cpp | 8 +++++++- Marlin/src/feature/stepper_driver_safety.cpp | 2 +- Marlin/src/gcode/config/M220.cpp | 15 +++++++-------- Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h | 10 +++++----- docs/Serial.md | 4 ++-- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 41fe90b82540..72518ef1cc87 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -286,6 +286,9 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { go_to_transfer_speed(); + hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_ENABLE; + hsd.Init.ClockDiv = 8; + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined retry_Cnt = retryCnt; for (;;) { @@ -433,7 +436,10 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { #else uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; + while (retries--) { + if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; + delay(10); + } return false; #endif diff --git a/Marlin/src/feature/stepper_driver_safety.cpp b/Marlin/src/feature/stepper_driver_safety.cpp index b8762da9b0c0..d3fc1614861e 100644 --- a/Marlin/src/feature/stepper_driver_safety.cpp +++ b/Marlin/src/feature/stepper_driver_safety.cpp @@ -43,7 +43,7 @@ void stepper_driver_backward_check() { SET_INPUT(AXIS##_ENABLE_PIN); \ OUT_WRITE(AXIS##_STEP_PIN, false); \ delay(20); \ - if (READ(AXIS##_ENABLE_PIN) == false) { \ + if (READ(AXIS##_ENABLE_PIN) == LOW) { \ SBI(axis_plug_backward, BIT); \ stepper_driver_backward_error(F(STRINGIFY(AXIS))); \ } \ diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index c9070df803b8..6797df25d562 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -36,16 +36,15 @@ * R : Flag to restore the last-saved factor */ void GcodeSuite::M220() { + if (!parser.seen_any()) { + SERIAL_ECHOLNPGM("FR:", feedrate_percentage, "%"); + return; + } static int16_t backup_feedrate_percentage = 100; - if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; - if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; - + const int16_t now_feedrate_perc = feedrate_percentage; + if (parser.seen_test('R')) feedrate_percentage = backup_feedrate_percentage; + if (parser.seen_test('B')) backup_feedrate_percentage = now_feedrate_perc; if (parser.seenval('S')) feedrate_percentage = parser.value_int(); - if (!parser.seen_any()) { - SERIAL_ECHOPGM("FR:", feedrate_percentage); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h index 7ce7b5e6ba85..268c0e1d1dcd 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h @@ -65,12 +65,12 @@ * multiple serial ports are available. * For example Serial3. */ -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_HOST_SERIAL MYSERIAL1 -#endif - #ifndef USB_HOST_SERIAL - #define USB_HOST_SERIAL Serial + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_HOST_SERIAL MYSERIAL1 + #else + #define USB_HOST_SERIAL Serial + #endif #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/docs/Serial.md b/docs/Serial.md index be3b23e87dd7..88846e1bb45a 100644 --- a/docs/Serial.md +++ b/docs/Serial.md @@ -64,9 +64,9 @@ The following macros are defined (in `serial.h`) to output data to the serial po | `SERIAL_ECHOLNPGM_P` | Same as `SERIAL_ECHOPGM_P` | Do `SERIAL_ECHOPGM_P`, adding a newline | `SERIAL_ECHOLNPGM_P(PSTR("Alice"), 78);` | `alice78\n` | | `SERIAL_ECHOLIST` | String literal, values | Print a string literal and a list of values | `SERIAL_ECHOLIST(F("Key "), 1, 2, 3);` | `Key 1, 2, 3` | | `SERIAL_ECHO_START` | None | Prefix an echo line | `SERIAL_ECHO_START();` | `echo:` | -| `SERIAL_ECHO_MSG` | Same as `SERIAL_ECHOLN_PAIR` | Print a full echo line | `SERIAL_ECHO_MSG("Count is ", count);` | `echo:Count is 3` | +| `SERIAL_ECHO_MSG` | Same as `SERIAL_ECHOLNPGM` | Print a full echo line | `SERIAL_ECHO_MSG("Count is ", count);` | `echo:Count is 3` | | `SERIAL_ERROR_START`| None | Prefix an error line | `SERIAL_ERROR_START();` | `Error:` | -| `SERIAL_ERROR_MSG` | Same as `SERIAL_ECHOLN_PAIR` | Print a full error line | `SERIAL_ERROR_MSG("Not found");` | `Error:Not found` | +| `SERIAL_ERROR_MSG` | Same as `SERIAL_ECHOLNPGM` | Print a full error line | `SERIAL_ERROR_MSG("Not found");` | `Error:Not found` | | `SERIAL_ECHO_SP` | Number of spaces | Print one or more spaces | `SERIAL_ECHO_SP(3)` | ` ` | | `SERIAL_EOL` | None | Print an end of line | `SERIAL_EOL();` | `\n` | | `SERIAL_OUT` | `SERIAL_OUT(myMethod)` | Call a custom serial method | `SERIAL_OUT(msgDone);` | ... | From 7a49fab16d9fd3df238cbd341f90b067e401b17c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 24 Jan 2023 12:07:25 +0000 Subject: [PATCH 34/41] [cron] Bump distribution date (2023-01-24) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index f4c528b1663b..0866724b5f29 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-23" +//#define STRING_DISTRIBUTION_DATE "2023-01-24" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 79f59cc83084..98b7bfcccdfa 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 "2023-01-23" + #define STRING_DISTRIBUTION_DATE "2023-01-24" #endif /** From cf02107e6a8f9a122f15b38ed6b699215ee7cf16 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Jan 2023 21:37:10 -0600 Subject: [PATCH 35/41] =?UTF-8?q?=F0=9F=94=A7=20Refine=20Input=20Shaping?= =?UTF-8?q?=20check=20(#25280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 15 +++++++++++---- Marlin/src/inc/Warnings.cpp | 7 +++++++ Marlin/src/module/stepper.cpp | 8 ++++---- Marlin/src/module/stepper.h | 27 ++++++++++++++------------- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1aadbb19e3e2..d571ddd7f4a2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4379,10 +4379,17 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "Input Shaping is not compatible with POLARGRAPH kinematics." #elif ENABLED(DIRECT_STEPPING) #error "Input Shaping is not compatible with DIRECT_STEPPING." - #elif ENABLED(INPUT_SHAPING_X) && ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) - #error "INPUT_SHAPING_X is not supported with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_*." - #elif ENABLED(INPUT_SHAPING_Y) && ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) - #error "INPUT_SHAPING_Y is not supported with COREXY, COREYX, COREYZ, COREZY, or MARKFORGED_*." + #elif BOTH(INPUT_SHAPING_X, CORE_IS_XZ) + #error "INPUT_SHAPING_X is not supported with COREXZ." + #elif BOTH(INPUT_SHAPING_Y, CORE_IS_YZ) + #error "INPUT_SHAPING_Y is not supported with COREYZ." + #elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) + #if !BOTH(INPUT_SHAPING_X, INPUT_SHAPING_Y) + #error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*." + #else + static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y, "SHAPING_FREQ_X and SHAPING_FREQ_Y must be the same for COREXY / COREYX / MARKFORGED_*."); + static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y, "SHAPING_ZETA_X and SHAPING_ZETA_Y must be the same for COREXY / COREYX / MARKFORGED_*."); + #endif #endif #ifdef __AVR__ diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 561c8f43a34e..1d1426936f95 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -790,3 +790,10 @@ #if BOTH(POLAR, S_CURVE_ACCELERATION) #warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION." #endif + +/** + * Input Shaping + */ +#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) + #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental." +#endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2a9487f09697..54b52cd16e0a 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3020,7 +3020,7 @@ void Stepper::init() { * Calculate a fixed point factor to apply to the signal and its echo * when shaping an axis. */ - void Stepper::set_shaping_damping_ratio(const AxisEnum axis, const float zeta) { + void Stepper::set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta) { // from the damping ratio, get a factor that can be applied to advance_dividend for fixed point maths // for ZV, we use amplitudes 1/(1+K) and K/(1+K) where K = exp(-zeta * M_PI / sqrt(1.0f - zeta * zeta)) // which can be converted to 1:7 fixed point with an excellent fit with a 3rd order polynomial @@ -3029,9 +3029,9 @@ void Stepper::init() { else if (zeta >= 1.0f) factor2 = 0.0f; else { factor2 = 64.44056192 + -99.02008832 * zeta; - const float zeta2 = zeta * zeta; + const_float_t zeta2 = zeta * zeta; factor2 += -7.58095488 * zeta2; - const float zeta3 = zeta2 * zeta; + const_float_t zeta3 = zeta2 * zeta; factor2 += 43.073216 * zeta3; factor2 = floor(factor2); } @@ -3049,7 +3049,7 @@ void Stepper::init() { return -1; } - void Stepper::set_shaping_frequency(const AxisEnum axis, const float freq) { + void Stepper::set_shaping_frequency(const AxisEnum axis, const_float_t freq) { // enabling or disabling shaping whilst moving can result in lost steps planner.synchronize(); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index e86498e841da..3bbfeac9cab8 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -154,38 +154,39 @@ // Add time for each stepper #if HAS_X_STEP - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_Y_STEP - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_Z_STEP - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_I_STEP - #define ISR_I_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_I_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_J_STEP - #define ISR_J_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_J_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_K_STEP - #define ISR_K_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_K_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_U_STEP - #define ISR_U_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_U_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_V_STEP - #define ISR_V_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_V_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_W_STEP - #define ISR_W_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_W_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_EXTRUDERS - #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES // E is always interpolated, even for mixing extruders + #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES // E is always interpolated, even for mixing extruders #endif // And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_MIXING_STEPPER_CYCLES LOGICAL_AXIS_GANG(+ ISR_E_STEPPER_CYCLES, + ISR_X_STEPPER_CYCLES, + ISR_Y_STEPPER_CYCLES, + ISR_Z_STEPPER_CYCLES, + ISR_I_STEPPER_CYCLES, + ISR_J_STEPPER_CYCLES, + ISR_K_STEPPER_CYCLES, + ISR_U_STEPPER_CYCLES, + ISR_V_STEPPER_CYCLES, + ISR_W_STEPPER_CYCLES)) +#define _PLUS_AXIS_CYCLES(A) + (ISR_##A##_STEPPER_CYCLES) +#define MIN_ISR_LOOP_CYCLES (ISR_MIXING_STEPPER_CYCLES LOGICAL_AXIS_MAP(_PLUS_AXIS_CYCLES)) // Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate #define _MIN_STEPPER_PULSE_CYCLES(N) _MAX(uint32_t((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) @@ -802,9 +803,9 @@ class Stepper { } #if HAS_SHAPING - static void set_shaping_damping_ratio(const AxisEnum axis, const float zeta); + static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta); static float get_shaping_damping_ratio(const AxisEnum axis); - static void set_shaping_frequency(const AxisEnum axis, const float freq); + static void set_shaping_frequency(const AxisEnum axis, const_float_t freq); static float get_shaping_frequency(const AxisEnum axis); #endif From 4f902ac950e02d1d4e4b13afdec46937364ec22d Mon Sep 17 00:00:00 2001 From: Alexander Gavrilenko Date: Thu, 26 Jan 2023 07:05:43 +0300 Subject: [PATCH 36/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Simulator=20TFT=20co?= =?UTF-8?q?mpile=20(#25279)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h | 11 ++-- Marlin/src/inc/Conditionals_LCD.h | 25 +------- Marlin/src/lcd/tft_io/tft_io.h | 59 +---------------- Marlin/src/lcd/tft_io/tft_orientation.h | 85 +++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 84 deletions(-) create mode 100644 Marlin/src/lcd/tft_io/tft_orientation.h diff --git a/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h b/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h index b3e622f19ac4..f412e09e1102 100644 --- a/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h +++ b/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h @@ -31,10 +31,11 @@ #endif #define DATASIZE_8BIT 8 -#define DATASIZE_16BIT 16 -#define TFT_IO_DRIVER TFT_SPI +#define DATASIZE_16BIT 16 +#define TFT_IO_DRIVER TFT_SPI +#define DMA_MAX_SIZE 0xFFFF -#define DMA_MINC_ENABLE 1 +#define DMA_MINC_ENABLE 1 #define DMA_MINC_DISABLE 0 class TFT_SPI { @@ -58,7 +59,9 @@ class TFT_SPI { static void WriteData(uint16_t Data); static void WriteReg(uint16_t Reg); + static void WriteSequence_DMA(uint16_t *Data, uint16_t Count) { WriteSequence(Data, Count); } + static void WriteMultiple_DMA(uint16_t Color, uint16_t Count) { WriteMultiple(Color, Count); } + static void WriteSequence(uint16_t *Data, uint16_t Count); - // static void WriteMultiple(uint16_t Color, uint16_t Count); static void WriteMultiple(uint16_t Color, uint32_t Count); }; diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index af9dd2255799..b411d3e7c607 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1549,29 +1549,8 @@ #endif #endif -// Set TFT_COLOR_UI_PORTRAIT flag, if needed -#if defined(TFT_ROTATION) && (HAS_SPI_TFT || HAS_FSMC_TFT || HAS_LTDC_TFT) - #define _CMP_TFT_ROTATE_90 90 - #define _CMP_TFT_ROTATE_270 270 - #define _CMP_TFT_ROTATE_90_MIRROR_X 90 - #define _CMP_TFT_ROTATE_90_MIRROR_Y 90 - #define _CMP_TFT_ROTATE_270_MIRROR_X 270 - #define _CMP_TFT_ROTATE_270_MIRROR_Y 270 - #define _ISROT(N) || (_CAT(_CMP_, TFT_ROTATION) == N) - #define ISROT(V...) (0 MAP(_ISROT, V)) - - #if ISROT(90, 270) - #define TFT_COLOR_UI_PORTRAIT 1 - #endif - - #undef _CMP_TFT_ROTATE_90 - #undef _CMP_TFT_ROTATE_270 - #undef _CMP_TFT_ROTATE_90_MIRROR_X - #undef _CMP_TFT_ROTATE_90_MIRROR_Y - #undef _CMP_TFT_ROTATE_270_MIRROR_X - #undef _CMP_TFT_ROTATE_270_MIRROR_Y - #undef _ISROT - #undef ISROT +#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT) + #include "../lcd/tft_io/tft_orientation.h" #endif #if ENABLED(TFT_RES_320x240) diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index a3635aaa93d6..9cfb2137df5e 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -34,65 +34,10 @@ #endif #ifndef DMA_MAX_SIZE - #error "MAX_DMA_SIZE is not configured for this platform." + #error "DMA_MAX_SIZE is not configured for this platform." #endif -#define TFT_EXCHANGE_XY _BV32(1) -#define TFT_INVERT_X _BV32(2) -#define TFT_INVERT_Y _BV32(3) - -#define TFT_NO_ROTATION (0x00) -#define TFT_ROTATE_90 (TFT_EXCHANGE_XY | TFT_INVERT_X) -#define TFT_ROTATE_180 (TFT_INVERT_X | TFT_INVERT_Y) -#define TFT_ROTATE_270 (TFT_EXCHANGE_XY | TFT_INVERT_Y) - -#define TFT_MIRROR_X (TFT_INVERT_Y) -#define TFT_MIRROR_Y (TFT_INVERT_X) - -#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) -#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) - -#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) -#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) - -#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) -#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) - -// TFT_ROTATION is user configurable -#ifndef TFT_ROTATION - #define TFT_ROTATION TFT_NO_ROTATION -#endif - -// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION -#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) - -#define TFT_COLOR_RGB _BV32(3) -#define TFT_COLOR_BGR _BV32(4) - -// Each TFT Driver is responsible for its default color mode. -// #ifndef TFT_COLOR -// #define TFT_COLOR TFT_COLOR_RGB -// #endif - -#define TOUCH_ORIENTATION_NONE 0 -#define TOUCH_LANDSCAPE 1 -#define TOUCH_PORTRAIT 2 - -#ifndef TOUCH_CALIBRATION_X - #define TOUCH_CALIBRATION_X 0 -#endif -#ifndef TOUCH_CALIBRATION_Y - #define TOUCH_CALIBRATION_Y 0 -#endif -#ifndef TOUCH_OFFSET_X - #define TOUCH_OFFSET_X 0 -#endif -#ifndef TOUCH_OFFSET_Y - #define TOUCH_OFFSET_Y 0 -#endif -#ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE -#endif +#include "tft_orientation.h" #ifndef TFT_DRIVER #define TFT_DRIVER AUTO diff --git a/Marlin/src/lcd/tft_io/tft_orientation.h b/Marlin/src/lcd/tft_io/tft_orientation.h new file mode 100644 index 000000000000..7822fc6b04f2 --- /dev/null +++ b/Marlin/src/lcd/tft_io/tft_orientation.h @@ -0,0 +1,85 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define TFT_EXCHANGE_XY _BV32(1) +#define TFT_INVERT_X _BV32(2) +#define TFT_INVERT_Y _BV32(3) + +#define TFT_NO_ROTATION (0x00) +#define TFT_ROTATE_90 (TFT_EXCHANGE_XY | TFT_INVERT_X) +#define TFT_ROTATE_180 (TFT_INVERT_X | TFT_INVERT_Y) +#define TFT_ROTATE_270 (TFT_EXCHANGE_XY | TFT_INVERT_Y) + +#define TFT_MIRROR_X (TFT_INVERT_Y) +#define TFT_MIRROR_Y (TFT_INVERT_X) + +#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) +#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) + +#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) +#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) + +#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) +#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) + +// TFT_ROTATION is user configurable +#ifndef TFT_ROTATION + #define TFT_ROTATION TFT_NO_ROTATION +#endif + +// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION +#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) + +// Set TFT_COLOR_UI_PORTRAIT flag, if needed +#if ((TFT_ORIENTATION) & TFT_EXCHANGE_XY) == 0 + #define TFT_COLOR_UI_PORTRAIT 1 +#endif + +#define TFT_COLOR_RGB _BV32(3) +#define TFT_COLOR_BGR _BV32(4) + +// Each TFT Driver is responsible for its default color mode. +// #ifndef TFT_COLOR +// #define TFT_COLOR TFT_COLOR_RGB +// #endif + +#define TOUCH_ORIENTATION_NONE 0 +#define TOUCH_LANDSCAPE 1 +#define TOUCH_PORTRAIT 2 + +#ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 0 +#endif +#ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 0 +#endif +#ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 0 +#endif +#ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 0 +#endif +#ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE +#endif + From a2c93c24a69ab5342bd92c92426628e45b790d8f Mon Sep 17 00:00:00 2001 From: avionix-g <63542699+avionix-g@users.noreply.github.com> Date: Wed, 25 Jan 2023 23:14:52 -0500 Subject: [PATCH 37/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20board=20Ultipa?= =?UTF-8?q?nel=20support=20(#25278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index b1031de8d5b7..1896cd5441b3 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -344,7 +344,7 @@ #else #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index d26811199bc8..42b252d320e7 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -361,7 +361,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 873ba3e90d66..14b3d6616830 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -363,7 +363,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN From 2637153575a6ee695a6edb0ac561ee7899fba2f2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 26 Jan 2023 06:05:55 +0000 Subject: [PATCH 38/41] [cron] Bump distribution date (2023-01-26) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 0866724b5f29..73363610f75e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-24" +//#define STRING_DISTRIBUTION_DATE "2023-01-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 98b7bfcccdfa..3bc302e61d26 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 "2023-01-24" + #define STRING_DISTRIBUTION_DATE "2023-01-26" #endif /** From 0e748da7d39f6d2193257478e6f997cb4a4fc1a5 Mon Sep 17 00:00:00 2001 From: xBiohazardx <36756950+xBiohazardx@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:05:04 +0100 Subject: [PATCH 39/41] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20probe=20invert?= =?UTF-8?q?=20flag=20(#25282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 8 ++++---- Marlin/src/pins/ramps/pins_K8400.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index d571ddd7f4a2..b4e0699403da 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1808,7 +1808,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file." #endif - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_PROBE_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." #endif @@ -1816,7 +1816,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." #endif #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true." #endif @@ -1848,7 +1848,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif !HAS_RESUME_CONTINUE #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER." #endif - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_PROBE_ENDSTOP_INVERTING #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." #endif @@ -1856,7 +1856,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." #endif #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_ENDSTOP_INVERTING #error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to true." #endif diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index 686c29b7fb8f..22ac1be8abc9 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -51,7 +51,7 @@ #define Y_STOP_PIN 14 #if EITHER(BLTOUCH, TOUCH_MI_PROBE) - #define HAS_INVERTED_PROBE + #define INVERTED_PROBE_STATE #endif #include "pins_3DRAG.h" // ... RAMPS From ab767a4586a5c0c9ca1c7afeb43d0ee226a1e38d Mon Sep 17 00:00:00 2001 From: alexgrach Date: Fri, 27 Jan 2023 03:20:09 +0300 Subject: [PATCH 40/41] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TFT=20Color=20UI=20L?= =?UTF-8?q?CD=5FHEIGHT=20(#25281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b411d3e7c607..c4926edd51c7 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1620,9 +1620,11 @@ #define HAS_UI_1024x600 1 #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen -#elif HAS_UI_240x320 - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 6) // Fewer lines with touch buttons onscreen + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen + #else + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen + #endif #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen #endif From 67bc855000345921281a2c8c210e4363542f6a81 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 27 Jan 2023 00:27:06 +0000 Subject: [PATCH 41/41] [cron] Bump distribution date (2023-01-27) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 73363610f75e..77f889518c3e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-26" +//#define STRING_DISTRIBUTION_DATE "2023-01-27" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3bc302e61d26..d6535886bdae 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 "2023-01-26" + #define STRING_DISTRIBUTION_DATE "2023-01-27" #endif /**