From 5523c12cfd01c859a01f26575a1dfff4c43eac8e Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:02:11 +0100 Subject: [PATCH 01/20] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MarlinUI=20UTF-8=20c?= =?UTF-8?q?hars=20(#26381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/lcdprint.cpp | 18 +++++------------- Marlin/src/lcd/utf8.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 2b524e983f7e..c84a695c786a 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -51,6 +51,7 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in int8_t n = maxlen; while (n > 0) { lchar_t wc; + uint8_t *psc = (uint8_t *)p; p = get_utf8_value_cb(p, read_byte_rom, wc); if (!wc) break; if (wc == '{' || wc == '~' || wc == '*') { @@ -88,20 +89,11 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in n -= utf8_strlen(o); o += strlen(o); } - else if (wc == '@') { - *o++ = AXIS_CHAR(ind); - *o = '\0'; - n--; - } - else if (wc > 255 && prop == 2) { - // Wide glyph support incomplete - *((uint16_t*)o) = wc; - o += 2; - *o = '\0'; - n--; - } else { - *o++ = wc; + if (wc == '@') + *o++ = AXIS_CHAR(ind); + else + while (psc != p) *o++ = read_byte_rom(psc++); *o = '\0'; n--; } diff --git a/Marlin/src/lcd/utf8.cpp b/Marlin/src/lcd/utf8.cpp index 6957fffc6457..d9dd53e95324 100644 --- a/Marlin/src/lcd/utf8.cpp +++ b/Marlin/src/lcd/utf8.cpp @@ -94,13 +94,15 @@ int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, return -1; } -/* Returns true if passed byte is first byte of UTF-8 char sequence */ +// Is the passed byte the first byte of a UTF-8 char sequence? static inline bool utf8_is_start_byte_of_char(const uint8_t b) { return 0x80 != (b & 0xC0); } -/* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences - and returns the pointer to the next character */ +/** + * Get the character at pstart, interpreting UTF8 multibyte sequences. + * Return the pointer to the next character. + */ const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, lchar_t &pval) { uint32_t val = 0; const uint8_t *p = pstart; From e0767f867517e49ce680b4be97fbaf3c5cb2d653 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:03:28 +0100 Subject: [PATCH 02/20] =?UTF-8?q?=F0=9F=8C=90=20Fix=20long=20Italian=20str?= =?UTF-8?q?ing=20(#26378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 620171ab63c6..61a572b3b331 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -883,7 +883,7 @@ namespace LanguageWide_it { LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella l'oggetto"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancella l'oggetto {"); LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il Job di stampa"); - LSTR MSG_MEDIA_MENU = _UxGT("Seleziona dal supporto"); + LSTR MSG_MEDIA_MENU = _UxGT("Selez.da supporto"); LSTR MSG_TURN_OFF = _UxGT("Spegni la stampante"); LSTR MSG_END_LOOPS = _UxGT("Termina i cicli di ripetizione"); LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); From 41a6f2bc8da53e3277c6b183bdc167399245c858 Mon Sep 17 00:00:00 2001 From: Chris <52449218+shadow578@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:10:37 +0100 Subject: [PATCH 03/20] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Impro?= =?UTF-8?q?ve=20POSTMORTEM=5FDEBUGGING=20(#26374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp | 7 ++++++- Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index 148927a19f52..bd87b6731cdf 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -55,7 +55,12 @@ static const char *UnwTabGetFunctionName(const UnwindCallbacks *cb, uint32_t add return nullptr; if ((flag_word & 0xFF000000) == 0xFF000000) { - return (const char *)(address - 4 - (flag_word & 0x00FFFFFF)); + const uint32_t fn_name_addr = address - 4 - (flag_word & 0x00FFFFFF); + + // Ensure the address is readable to avoid returning a bogus pointer + uint8_t dummy = 0; + if (cb->readB(fn_name_addr, &dummy)) + return (const char *)fn_name_addr; } return nullptr; } diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index e54661c77071..3c514f58a9c4 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -279,8 +279,6 @@ void CommonHandler_C(ContextStateFrame * frame, unsigned long lr, unsigned long if (!faulted_from_exception) { // Not sure about the non_usage_fault, we want to try anyway, don't we ? && !non_usage_fault_occurred) // Try to resume to our handler here CFSR |= CFSR; // The ARM programmer manual says you must write to 1 all fault bits to clear them so this instruction is correct - // The frame will not be valid when returning anymore, let's clean it - savedFrame.CFSR = 0; frame->pc = (uint32_t)resume_from_fault; // Patch where to return to frame->lr = 0xDEADBEEF; // If our handler returns (it shouldn't), let's make it trigger an exception immediately From 24cf29b6a8e9f5e3cd37c4160a20b0a75ff04ad5 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 1 Nov 2023 01:19:48 +0000 Subject: [PATCH 04/20] [cron] Bump distribution date (2023-11-01) --- 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 797c21ba7fd0..d99e5ebf5e43 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-10-29" +//#define STRING_DISTRIBUTION_DATE "2023-11-01" /** * 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 f24965c4e5d2..3de54adc4672 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-10-29" + #define STRING_DISTRIBUTION_DATE "2023-11-01" #endif /** From 76f938309efc62d6ed4983c350f2379ff77ea02e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Nov 2023 15:36:26 -0500 Subject: [PATCH 05/20] =?UTF-8?q?=F0=9F=94=A8=20Minor=20schema.py=20update?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/schema.py | 33 +++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/schema.py b/buildroot/share/PlatformIO/scripts/schema.py index afac7b5d2788..535a8f671e94 100755 --- a/buildroot/share/PlatformIO/scripts/schema.py +++ b/buildroot/share/PlatformIO/scripts/schema.py @@ -85,7 +85,8 @@ class Parse: NORMAL = 0 # No condition yet BLOCK_COMMENT = 1 # Looking for the end of the block comment EOL_COMMENT = 2 # EOL comment started, maybe add the next comment? - GET_SENSORS = 3 # Gathering temperature sensor options + SLASH_COMMENT = 3 # Block-like comment, starting with aligned // + GET_SENSORS = 4 # Gathering temperature sensor options ERROR = 9 # Syntax error # List of files to process, with shorthand @@ -107,6 +108,7 @@ class Parse: line_number = 0 # Counter for the line number of the file conditions = [] # Create a condition stack for the current file comment_buff = [] # A temporary buffer for comments + prev_comment = '' # Copy before reset for an EOL comment options_json = '' # A buffer for the most recent options JSON found eol_options = False # The options came from end of line, so only apply once join_line = False # A flag that the line should be joined with the previous one @@ -143,9 +145,13 @@ class Parse: if not defmatch and the_line.startswith('//'): comment_buff.append(the_line[2:].strip()) else: - last_added_ref['comment'] = ' '.join(comment_buff) - comment_buff = [] state = Parse.NORMAL + cline = ' '.join(comment_buff) + comment_buff = [] + if cline != '': + # A (block or slash) comment was already added + cfield = 'notes' if 'comment' in last_added_ref else 'comment' + last_added_ref[cfield] = cline def use_comment(c, opt, sec, bufref): if c.startswith(':'): # If the comment starts with : then it has magic JSON @@ -162,6 +168,15 @@ def use_comment(c, opt, sec, bufref): bufref.append(c) return opt, sec + # For slash comments, capture consecutive slash comments. + # The comment will be applied to the next #define. + if state == Parse.SLASH_COMMENT: + if not defmatch and the_line.startswith('//'): + use_comment(the_line[2:].strip(), options_json, section, comment_buff) + continue + else: + state = Parse.NORMAL + # In a block comment, capture lines up to the end of the comment. # Assume nothing follows the comment closure. if state in (Parse.BLOCK_COMMENT, Parse.GET_SENSORS): @@ -178,14 +193,14 @@ def use_comment(c, opt, sec, bufref): state = Parse.NORMAL # Strip the leading '*' from block comments - if cline.startswith('*'): cline = cline[1:].strip() + cline = re.sub(r'^\* ?', '', cline) # Collect temperature sensors if state == Parse.GET_SENSORS: sens = re.match(r'^(-?\d+)\s*:\s*(.+)$', cline) if sens: s2 = sens[2].replace("'","''") - options_json += f"{sens[1]}:'{s2}', " + options_json += f"{sens[1]}:'{sens[1]} - {s2}', " elif state == Parse.BLOCK_COMMENT: @@ -216,15 +231,19 @@ def use_comment(c, opt, sec, bufref): # Comment after a define may be continued on the following lines if defmatch != None and cpos > 10: state = Parse.EOL_COMMENT + prev_comment = '\n'.join(comment_buff) comment_buff = [] + else: + state = Parse.SLASH_COMMENT # Process the start of a new comment if cpos != -1: + comment_buff = [] cline, line = line[cpos+2:].strip(), line[:cpos].strip() if state == Parse.BLOCK_COMMENT: # Strip leading '*' from block comments - if cline.startswith('*'): cline = cline[1:].strip() + cline = re.sub(r'^\* ?', '', cline) else: # Expire end-of-line options after first use if cline.startswith(':'): eol_options = True @@ -320,7 +339,7 @@ def atomize(s): if value_type != '': define_info['type'] = value_type # Join up accumulated conditions with && - if conditions: define_info['requires'] = ' && '.join(sum(conditions, [])) + if conditions: define_info['requires'] = '(' + ') && ('.join(sum(conditions, [])) + ')' # If the comment_buff is not empty, add the comment to the info if comment_buff: From cac742009c1b44f3789e6bd8c400d9ee5763521b Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 4 Nov 2023 04:12:33 +0000 Subject: [PATCH 06/20] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Backlash=20Compensat?= =?UTF-8?q?ion=20layer=20shift=20(#26392)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/backlash.cpp | 54 ++++++++++++++++++++++----------- Marlin/src/feature/backlash.h | 2 +- Marlin/src/module/planner.cpp | 2 +- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index c6eb0d33f309..07fa7725a06c 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -63,25 +63,25 @@ Backlash backlash; * spread over multiple segments, smoothing out artifacts even more. */ -void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const AxisBits dm, block_t * const block) { +void Backlash::add_correction_steps(const xyze_long_t &dist, const AxisBits dm, block_t * const block) { AxisBits changed_dir = last_direction_bits ^ dm; // Ignore direction change unless steps are taken in that direction #if DISABLED(CORE_BACKLASH) || ANY(MARKFORGED_XY, MARKFORGED_YX) - if (!da) changed_dir.x = false; - if (!db) changed_dir.y = false; - if (!dc) changed_dir.z = false; + if (!dist.a) changed_dir.x = false; + if (!dist.b) changed_dir.y = false; + if (!dist.c) changed_dir.z = false; #elif CORE_IS_XY - if (!(da + db)) changed_dir.x = false; - if (!(da - db)) changed_dir.y = false; - if (!dc) changed_dir.z = false; + if (!(dist.a + dist.b)) changed_dir.x = false; + if (!(dist.a - dist.b)) changed_dir.y = false; + if (!dist.c) changed_dir.z = false; #elif CORE_IS_XZ - if (!(da + dc)) changed_dir.x = false; - if (!(da - dc)) changed_dir.z = false; - if (!db) changed_dir.y = false; + if (!(dist.a + dist.c)) changed_dir.x = false; + if (!(dist.a - dist.c)) changed_dir.z = false; + if (!dist.b) changed_dir.y = false; #elif CORE_IS_YZ - if (!(db + dc)) changed_dir.y = false; - if (!(db - dc)) changed_dir.z = false; - if (!da) changed_dir.x = false; + if (!(dist.b + dist.c)) changed_dir.y = false; + if (!(dist.b - dist.c)) changed_dir.z = false; + if (!dist.a) changed_dir.x = false; #endif last_direction_bits ^= changed_dir; @@ -97,7 +97,15 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const const float f_corr = float(correction) / all_on; + bool changed = false; + float millimeters_delta = 0.0f; + #if IS_KINEMATIC + float sqr_stepper_space_mm = 0.0f; + #endif + LOOP_NUM_AXES(axis) { + TERN_(IS_KINEMATIC, sqr_stepper_space_mm += sq(dist[axis] * planner.mm_per_step[axis])); + if (distance_mm[axis]) { const bool forward = dm[axis]; @@ -107,8 +115,6 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // Decide how much of the residual error to correct in this segment int32_t error_correction = residual_error[axis]; - if (forward == (error_correction < 0)) - error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps #ifdef BACKLASH_SMOOTHING_MM if (error_correction && smoothing_mm != 0) { @@ -118,9 +124,18 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } #endif + // Don't correct backlash in the opposite direction to movement on this axis and for accuracy in + // updating block->millimeters, don't add too many steps to the movement on this axis + if (forward) + LIMIT(error_correction, 0, dist[axis]); + else + LIMIT(error_correction, dist[axis], 0); + // This correction reduces the residual error and adds block steps if (error_correction) { + changed = true; block->steps[axis] += ABS(error_correction); + millimeters_delta += dist[axis] * error_correction * sq(planner.mm_per_step[axis]); #if ENABLED(CORE_BACKLASH) switch (axis) { case CORE_AXIS_1: @@ -142,6 +157,11 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } } } + + // If backlash correction steps were added modify block->millimeters with a linear approximation + // See https://github.com/MarlinFirmware/Marlin/pull/26392 + if (changed) + block->millimeters += TERN(IS_KINEMATIC, millimeters_delta * block->millimeters / sqr_stepper_space_mm, millimeters_delta / block->millimeters); } int32_t Backlash::get_applied_steps(const AxisEnum axis) { @@ -151,8 +171,8 @@ int32_t Backlash::get_applied_steps(const AxisEnum axis) { const int32_t residual_error_axis = residual_error[axis]; - // At startup it is assumed the last move was forwards. So the applied - // steps will always be a non-positive number. + // At startup it is assumed the last move was forward. + // So the applied steps will always be negative. if (forward) return -residual_error_axis; diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 14c0fe20e378..593e51b9d0fe 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -72,7 +72,7 @@ class Backlash { return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); } - static void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const AxisBits dm, block_t * const block); + static void add_correction_steps(const xyze_long_t &dist, const AxisBits dm, block_t * const block); static int32_t get_applied_steps(const AxisEnum axis); #if ENABLED(BACKLASH_GCODE) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 1414a3144578..8e9021b03069 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2175,7 +2175,7 @@ bool Planner::_populate_block( * A correction function is permitted to add steps to an axis, it * should *never* remove steps! */ - TERN_(BACKLASH_COMPENSATION, backlash.add_correction_steps(dist.a, dist.b, dist.c, dm, block)); + TERN_(BACKLASH_COMPENSATION, backlash.add_correction_steps(dist, dm, block)); } TERN_(HAS_EXTRUDERS, block->steps.e = esteps); From 0d42196d11670d52e7b84bbdf5d577c5ba59cb38 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 4 Nov 2023 06:05:47 +0000 Subject: [PATCH 07/20] [cron] Bump distribution date (2023-11-04) --- 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 d99e5ebf5e43..79eeb9231dcf 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-11-01" +//#define STRING_DISTRIBUTION_DATE "2023-11-04" /** * 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 3de54adc4672..ec6641f31f01 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-11-01" + #define STRING_DISTRIBUTION_DATE "2023-11-04" #endif /** From cb044d989c397fcbf6f106502df69a7e5c41d34b Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 5 Nov 2023 09:46:57 +0300 Subject: [PATCH 08/20] =?UTF-8?q?=E2=9C=A8=20Probe=20XY=20Offset=20value?= =?UTF-8?q?=20limits=20(#26267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 10 +++-- Marlin/src/gcode/probe/M851.cpp | 12 +++--- Marlin/src/inc/Changes.h | 2 + Marlin/src/inc/Conditionals_post.h | 20 ++++++++-- Marlin/src/inc/SanityCheck.h | 37 +++++++++++++++---- Marlin/src/lcd/e3v2/creality/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 6 +-- .../src/lcd/extui/mks_ui/draw_number_key.cpp | 6 +-- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 6 +-- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 6 +-- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/tft/ui_common.cpp | 10 ++--- 17 files changed, 85 insertions(+), 44 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 33810011cfbf..c5a73982364a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1641,9 +1641,13 @@ #define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping -// For M851 give a range for adjusting the Z probe offset -#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm) -#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm) +// For M851 provide ranges for adjusting the X, Y, and Z probe offsets +//#define PROBE_OFFSET_XMIN -50 // (mm) +//#define PROBE_OFFSET_XMAX 50 // (mm) +//#define PROBE_OFFSET_YMIN -50 // (mm) +//#define PROBE_OFFSET_YMAX 50 // (mm) +//#define PROBE_OFFSET_ZMIN -20 // (mm) +//#define PROBE_OFFSET_ZMAX 20 // (mm) // Enable the M48 repeatability test to test probe accuracy //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index e66392acb454..ec63ff190dc0 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -44,10 +44,10 @@ void GcodeSuite::M851() { if (parser.seenval('X')) { const float x = parser.value_float(); #if HAS_PROBE_XY_OFFSET - if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) offs.x = x; else { - SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")"); + SERIAL_ECHOLNPGM("?X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"); ok = false; } #else @@ -58,10 +58,10 @@ void GcodeSuite::M851() { if (parser.seenval('Y')) { const float y = parser.value_float(); #if HAS_PROBE_XY_OFFSET - if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) offs.y = y; else { - SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")"); + SERIAL_ECHOLNPGM("?Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"); ok = false; } #else @@ -71,10 +71,10 @@ void GcodeSuite::M851() { if (parser.seenval('Z')) { const float z = parser.value_float(); - if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) offs.z = z; else { - SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")"); + SERIAL_ECHOLNPGM("?Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"); ok = false; } } diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 40116bc5a498..3e80fe70cd62 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -665,6 +665,8 @@ #error "FOLDER_SORTING is now SDSORT_FOLDERS." #elif defined(BTT_MINI_12864_V1) #error "BTT_MINI_12864_V1 is now BTT_MINI_12864." +#elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX) + #error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)." #endif // L64xx stepper drivers have been removed diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ab3da7325942..d172f6d858d9 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2943,14 +2943,26 @@ * Bed Probe dependencies */ #if ANY(MESH_BED_LEVELING, HAS_BED_PROBE) - #ifndef Z_PROBE_OFFSET_RANGE_MIN - #define Z_PROBE_OFFSET_RANGE_MIN -20 + #ifndef PROBE_OFFSET_ZMIN + #define PROBE_OFFSET_ZMIN -20 #endif - #ifndef Z_PROBE_OFFSET_RANGE_MAX - #define Z_PROBE_OFFSET_RANGE_MAX 20 + #ifndef PROBE_OFFSET_ZMAX + #define PROBE_OFFSET_ZMAX 20 #endif #endif #if HAS_BED_PROBE + #ifndef PROBE_OFFSET_XMIN + #define PROBE_OFFSET_XMIN -50 + #endif + #ifndef PROBE_OFFSET_XMAX + #define PROBE_OFFSET_XMAX 50 + #endif + #ifndef PROBE_OFFSET_YMIN + #define PROBE_OFFSET_YMIN -50 + #endif + #ifndef PROBE_OFFSET_YMAX + #define PROBE_OFFSET_YMAX 50 + #endif #if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE) #define ENDSTOPPULLUP_ZMIN_PROBE #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3fe26eddc182..8796ea224fdc 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1418,20 +1418,15 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif /** - * Check for improper NOZZLE_TO_PROBE_OFFSET + * Check for improper PROBING_MARGIN */ - constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; - #if ENABLED(NOZZLE_AS_PROBE) - static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, - "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); - #elif !IS_KINEMATIC + #if NONE(NOZZLE_AS_PROBE, IS_KINEMATIC) static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0."); static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0."); #endif - #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."); @@ -1440,6 +1435,34 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large."); #undef _MARGIN + /** + * Check for improper PROBE_OFFSET_[XYZ](MIN|MAX) + */ + #define PROBE_OFFSET_ASSERT(varname, x, min, max) static_assert(WITHIN(x, min, max), varname " must be within " STRINGIFY(min) " and " STRINGIFY(max)) + #if HAS_PROBE_XY_OFFSET + PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMIN", PROBE_OFFSET_XMIN, -(X_BED_SIZE), X_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMAX", PROBE_OFFSET_XMAX, -(X_BED_SIZE), X_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMIN", PROBE_OFFSET_YMIN, -(Y_BED_SIZE), Y_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMAX", PROBE_OFFSET_YMAX, -(Y_BED_SIZE), Y_BED_SIZE); + #endif + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -20, 20); + + /** + * Check for improper NOZZLE_AS_PROBE or NOZZLE_TO_PROBE_OFFSET + */ + constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; + #if ENABLED(NOZZLE_AS_PROBE) + static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, + "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); + #endif + #if HAS_PROBE_XY_OFFSET + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.x", sanity_nozzle_to_probe_offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX); + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.y", sanity_nozzle_to_probe_offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX); + #endif + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.z", sanity_nozzle_to_probe_offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); + #undef PROBE_OFFSET_ASSERT + /** * Make sure Z raise values are set */ diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index b21cc3085032..f99a3d0a1ab0 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1384,7 +1384,7 @@ void hmiMoveDone(const AxisEnum axis) { dwinUpdateLCD(); return; } - LIMIT(hmiValues.offset_value, (Z_PROBE_OFFSET_RANGE_MIN) * 100, (Z_PROBE_OFFSET_RANGE_MAX) * 100); + LIMIT(hmiValues.offset_value, (PROBE_OFFSET_ZMIN) * 100, (PROBE_OFFSET_ZMAX) * 100); last_zoffset = dwin_zoffset; dwin_zoffset = hmiValues.offset_value / 100.0f; #if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 0f038a30b214..843009c27461 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2057,7 +2057,7 @@ void autoHome() { queue.inject_P(G28_STR); } #if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR); #endif - setPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, applyZOffset, liveZOffset); + setPFloatOnClick(PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX, 2, applyZOffset, liveZOffset); } void setMoveZto0() { diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index fdb068d32f38..68581aeafd9b 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -795,7 +795,7 @@ void RTS::handleData() { tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; else tmp_zprobe_offset = float(recdat.data[0]) / 100; - if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); @@ -1116,7 +1116,7 @@ void RTS::handleData() { #if HAS_BED_PROBE case 2: { // Z-axis to Up - if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((getZOffset_mm() + 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //setZOffset_mm(getZOffset_mm() + 0.1); sendData(getZOffset_mm() * 100, ProbeOffset_Z); @@ -1125,7 +1125,7 @@ void RTS::handleData() { break; } case 3: { // Z-axis to Down - if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((getZOffset_mm() - 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); //setZOffset_mm(getZOffset_mm() - 0.1); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp index 850a409a1857..9bb93e333394 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp @@ -358,20 +358,20 @@ static void set_value_confirm() { case x_offset: { #if HAS_PROBE_XY_OFFSET const float x = atof(key_value); - if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) probe.offset.x = x; #endif } break; case y_offset: { #if HAS_PROBE_XY_OFFSET const float y = atof(key_value); - if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) probe.offset.y = y; #endif } break; case z_offset: { const float z = atof(key_value); - if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) probe.offset.z = z; } break; #endif diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index bccc543b7f34..19f4903cc69b 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -895,7 +895,7 @@ namespace ExtUI { void setZOffset_mm(const_float_t value) { #if HAS_BED_PROBE - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(value, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) probe.offset.z = value; #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) babystep.add_mm(Z_AXIS, value - getZOffset_mm()); diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index a4eab8fc9d85..1c77d9a0923c 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -298,7 +298,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { , do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff , new_probe_offset ); - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { babystep.add_steps(Z_AXIS, babystep_increment); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index e4cd183b4646..3f95d08effbe 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -39,7 +39,7 @@ typedef void (*selectFunc_t)(); #define SS_INVERT 0x04 #define SS_DEFAULT SS_CENTER -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9 +#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && PROBE_OFFSET_ZMIN >= -9 && PROBE_OFFSET_ZMAX <= 9 #define BABYSTEP_TO_STR(N) ftostr43sign(N) #elif ENABLED(BABYSTEPPING) #define BABYSTEP_TO_STR(N) ftostr53sign(N) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 2bcd4e681b61..90a37ed5199c 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -628,10 +628,10 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); #if HAS_PROBE_XY_OFFSET - EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, -(X_BED_SIZE), X_BED_SIZE); - EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, -(Y_BED_SIZE), Y_BED_SIZE); + EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX); + EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX); #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #if ENABLED(PROBE_OFFSET_WIZARD) SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard); diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 981c51a6b056..f4d5a269af69 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -278,18 +278,18 @@ void menu_bed_leveling() { // Mesh Bed Leveling Z-Offset // #if ENABLED(MESH_BED_LEVELING) - #if WITHIN(Z_PROBE_OFFSET_RANGE_MIN, -9, 9) + #if WITHIN(PROBE_OFFSET_ZMIN, -9, 9) #define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000 #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif #if ENABLED(PROBE_OFFSET_WIZARD) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 0a8d4a975aba..52123d101b68 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -562,7 +562,7 @@ void menu_configuration() { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif // diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 011cdc4423aa..ea26b48907a2 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -163,7 +163,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5 ,uint32_t ,ftostr5rj , 0.01f DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) #if HAS_BED_PROBE - #if Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9 + #if WITHIN(PROBE_OFFSET_ZMIN, -9, 9) #define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000 #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 3426abab0e20..13c8d60d1c83 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -85,7 +85,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { , do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff , new_probe_offset ); - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { babystep.add_steps(Z_AXIS, babystep_increment); if (do_probe) probe.offset.z = new_offs; @@ -100,12 +100,12 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { #else // Only change probe.offset.z probe.offset.z += diff; - if (direction < 0 && current_position.z < Z_PROBE_OFFSET_RANGE_MIN) { - current_position.z = Z_PROBE_OFFSET_RANGE_MIN; + if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) { + current_position.z = PROBE_OFFSET_ZMIN; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } - else if (direction > 0 && current_position.z > Z_PROBE_OFFSET_RANGE_MAX) { - current_position.z = Z_PROBE_OFFSET_RANGE_MAX; + else if (direction > 0 && current_position.z > PROBE_OFFSET_ZMAX) { + current_position.z = PROBE_OFFSET_ZMAX; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else From 5ac4ebad78044feec0a88c386fb7c2d25f53c692 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 5 Nov 2023 12:06:43 +0000 Subject: [PATCH 09/20] [cron] Bump distribution date (2023-11-05) --- 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 79eeb9231dcf..330a5266a6ec 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-11-04" +//#define STRING_DISTRIBUTION_DATE "2023-11-05" /** * 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 ec6641f31f01..e045a4f12683 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-11-04" + #define STRING_DISTRIBUTION_DATE "2023-11-05" #endif /** From dba613fadde7671858cc11a80b500601d648b177 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 12:29:05 -0600 Subject: [PATCH 10/20] =?UTF-8?q?=F0=9F=94=A8=20Fix=20test=20of=20env['PRO?= =?UTF-8?q?GNAME']?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26386 --- buildroot/share/scripts/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index ee48af6fc6de..9fb927c42685 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -157,7 +157,7 @@ def _RollbackUpload(FirmwareFile): marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') # Get firmware upload params - upload_firmware_source_name = env['PROGNAME'] + '.bin' if env['PROGNAME'] else str(source[0]) + upload_firmware_source_name = env['PROGNAME'] + '.bin' if 'PROGNAME' in env else str(source[0]) # Source firmware filename upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 # baud rate of serial connection From 06215944423aa8d304108521bd3b73aa046bfc82 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 14:55:06 -0600 Subject: [PATCH 11/20] =?UTF-8?q?=E2=9C=85=20Update=20stale=20/=20close=20?= =?UTF-8?q?durations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/close-stale.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml index 88fea1996ddc..ef1b33b4eb17 100644 --- a/.github/workflows/close-stale.yml +++ b/.github/workflows/close-stale.yml @@ -20,9 +20,21 @@ jobs: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.' - days-before-stale: 60 - days-before-close: 10 + stale-issue-message: | + Greetings from the Marlin AutoBot! + This issue has had no activity for the last 90 days. + Do you still see this issue with the latest `bugfix-2.1.x` code? + Please add a reply within 14 days or this issue will be automatically closed. + To keep a confirmed issue open we can also add a "Bug: Confirmed" tag. + + Disclaimer: This is an open community project with lots of activity and limited + resources. The main project contributors will do a bug sweep ahead of the next + release, but any skilled member of the community may jump in at any time to fix + this issue. That can take a while depending on our busy lives so please be patient, + and take advantage of other resources such as the MarlinFirmware Discord to help + solve the issue. + days-before-stale: 90 + days-before-close: 14 stale-issue-label: 'stale-closing-soon' exempt-all-assignees: true exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: More Data,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' From e4e85e39b39dbe7b5cb80f8daf8abcdb532a9727 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 15:01:12 -0600 Subject: [PATCH 12/20] =?UTF-8?q?=E2=9C=85=20Get=20LCD/Controller=20in=20b?= =?UTF-8?q?ug=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b40d881a7524..52bac0cd04bd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -109,8 +109,13 @@ body: - type: input attributes: - label: Add-ons - description: Please list any hardware add-ons that could be involved. + label: LCD/Controller + description: Some Marlin behaviors are determined by the controller. Describe your LCD/Controller model and version. + + - type: input + attributes: + label: Other add-ons + description: Please list any other hardware add-ons that could be involved. - type: dropdown attributes: From 0bdbf52bc61f054b418b623bb18256edb4a2dd13 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 6 Nov 2023 00:21:03 +0000 Subject: [PATCH 13/20] [cron] Bump distribution date (2023-11-06) --- 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 330a5266a6ec..e99190944902 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-11-05" +//#define STRING_DISTRIBUTION_DATE "2023-11-06" /** * 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 e045a4f12683..2eff1f5918a7 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-11-05" + #define STRING_DISTRIBUTION_DATE "2023-11-06" #endif /** From 3341683db23c1aef9aaa538439df7a079f200166 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 21:30:04 -0600 Subject: [PATCH 14/20] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Use?= =?UTF-8?q?=20FLT=5FMAX=20for=20HUGE=5FVALF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 15e36ac678f7..df3faaa50f45 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -788,7 +788,7 @@ void unified_bed_leveling::shift_mesh_height() { #endif #ifndef HUGE_VALF - #define HUGE_VALF (10e100F) + #define HUGE_VALF FLT_MAX #endif best = do_furthest // Points with valid data or HUGE_VALF are skipped From 9a6c2635eec0ea78ef3be58e5f1afffa0abdd7d7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 7 Nov 2023 00:20:29 +0000 Subject: [PATCH 15/20] [cron] Bump distribution date (2023-11-07) --- 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 e99190944902..0555c2eeba04 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-11-06" +//#define STRING_DISTRIBUTION_DATE "2023-11-07" /** * 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 2eff1f5918a7..0512d068c6dc 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-11-06" + #define STRING_DISTRIBUTION_DATE "2023-11-07" #endif /** From bf5612c0ed3818d5a61e053a5cfb53f9914ef45f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Nov 2023 16:05:11 -0600 Subject: [PATCH 16/20] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Use?= =?UTF-8?q?=20=5F=5FFLT=5FMAX=5F=5F=20for=20HUGE=5FVALF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index df3faaa50f45..7496c9e9b5e1 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -788,7 +788,7 @@ void unified_bed_leveling::shift_mesh_height() { #endif #ifndef HUGE_VALF - #define HUGE_VALF FLT_MAX + #define HUGE_VALF __FLT_MAX__ #endif best = do_furthest // Points with valid data or HUGE_VALF are skipped From b2758208c7e63567baa0165a3d552b706c85cf85 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:34:48 -0500 Subject: [PATCH 17/20] =?UTF-8?q?=E2=9C=A8=20G27=20P3=20/=20P4=20(#26401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/feature/pause/G27.cpp | 9 +++++- Marlin/src/libs/nozzle.cpp | 41 ++++++++++++++++---------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G27.cpp b/Marlin/src/gcode/feature/pause/G27.cpp index f61453e6fb75..229b22a96c0a 100644 --- a/Marlin/src/gcode/feature/pause/G27.cpp +++ b/Marlin/src/gcode/feature/pause/G27.cpp @@ -29,7 +29,14 @@ #include "../../../module/motion.h" /** - * G27: Park the nozzle + * G27: Park the nozzle according with the given style + * + * P