Skip to content

Commit 29da21d

Browse files
committed
Merge branch 'bugfix-2.1.x' into mike-config
* bugfix-2.1.x: (25 commits) [cron] Bump distribution date (2023-08-26) ✨ Mellow Fly E3 V2 (STM32F407VG) (MarlinFirmware#26081) 🚸 Fixes for ProUI, JyersUI, backlight, etc. (MarlinFirmware#26086) 🧑‍💻 Encapsulate ProUI G-code preview [cron] Bump distribution date (2023-08-25) 🧑‍💻 Adjust LCD string draw (MarlinFirmware#26154) [cron] Bump distribution date (2023-08-24) 📝 Thermistor info updates (MarlinFirmware#26202) [cron] Bump distribution date (2023-08-23) ✨ G-code 'T' report current tool (MarlinFirmware#26151) 🔧 Allow arbitrary BLOCK_BUFFER_SIZE 🔧 Fix Linear Leveling grid size sanity check (MarlinFirmware#26199) 🚸 Avoid LCD messages starting with "Error:" (MarlinFirmware#26164) 🩹 Fix FT Motion menu Back item (MarlinFirmware#26175) [cron] Bump distribution date (2023-08-22) ✅ Fix unused test 🐛 Fixes for G2/G3 arcs (MarlinFirmware#26170) [cron] Bump distribution date (2023-08-21) 🎨 FTDI cleanup [cron] Bump distribution date (2023-08-20) ...
2 parents aaea20e + 11f98ad commit 29da21d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1367
-849
lines changed

Marlin/Configuration.h

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
471471
* 14 : 100kΩ (R25), 4092K (beta25), 4.7kΩ pull-up, bed thermistor as used in Ender-5 S1
472472
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
473+
* 17 : 100kΩ Dagoma NTC white thermistor
473474
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
474475
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
475476
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
@@ -481,6 +482,7 @@
481482
* 68 : PT100 Smplifier board from Dyze Design
482483
* 70 : 100kΩ bq Hephestos 2
483484
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
485+
* 666 : 200kΩ Einstart S custom thermistor with 10k pullup.
484486
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
485487
*
486488
* ================================================================

Marlin/Configuration_adv.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1746,9 +1746,10 @@
17461746

17471747
// SD Card Sorting options
17481748
#if ENABLED(SDCARD_SORT_ALPHA)
1749+
#define SDSORT_REVERSE false // Default to sorting file names in reverse order.
17491750
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
1750-
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
1751-
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
1751+
#define SDSORT_FOLDERS -1 // -1=above 0=none 1=below
1752+
#define SDSORT_GCODE false // Enable G-code M34 to set sorting behaviors: M34 S<-1|0|1> F<-1|0|1>
17521753
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
17531754
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
17541755
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
@@ -2528,7 +2529,6 @@
25282529
// @section motion
25292530

25302531
// The number of linear moves that can be in the planner at once.
2531-
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
25322532
#if ALL(HAS_MEDIA, DIRECT_STEPPING)
25332533
#define BLOCK_BUFFER_SIZE 8
25342534
#elif HAS_MEDIA

Marlin/Marlin.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Marlin Firmware
44
5-
(c) 2011-2020 MarlinFirmware
5+
(c) 2011-2023 MarlinFirmware
66
Portions of Marlin are (c) by their respective authors.
77
All code complies with GPLv2 and/or GPLv3
88

Marlin/Version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2023-08-14"
44+
//#define STRING_DISTRIBUTION_DATE "2023-08-26"
4545

4646
/**
4747
* Defines a generic printer name to be output to the LCD after booting Marlin.

Marlin/src/core/boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@
459459
#define BOARD_CREALITY_F401RE 5245 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
460460
#define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6.
461461
#define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG)
462+
#define BOARD_MELLOW_FLY_E3_V2 5248 // Mellow Fly E3 V2 (STM32F407VG)
462463

463464
//
464465
// ARM Cortex-M7

Marlin/src/core/language.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
#define STR_ERR_ARC_ARGS "G2/G3 bad parameters"
155155
#define STR_ERR_PROTECTED_PIN "Protected Pin"
156156
#define STR_ERR_M420_FAILED "Failed to enable Bed Leveling"
157-
#define STR_ERR_M428_TOO_FAR "Too far from reference point"
157+
#define STR_ERR_M428_TOO_FAR "Too far from MIN/MAX"
158158
#define STR_ERR_M303_DISABLED "PIDTEMP disabled"
159159
#define STR_M119_REPORT "Reporting endstop status"
160160
#define STR_ON "ON"
@@ -254,7 +254,7 @@
254254
#define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
255255
#define STR_T_HEATING_FAILED "Heating failed"
256256
#define STR_T_THERMAL_RUNAWAY "Thermal Runaway"
257-
#define STR_T_MALFUNCTION "Thermal Malfunction"
257+
#define STR_T_THERMAL_MALFUNCTION "Thermal Malfunction"
258258
#define STR_T_MAXTEMP "MAXTEMP triggered"
259259
#define STR_T_MINTEMP "MINTEMP triggered"
260260
#define STR_ERR_PROBING_FAILED "Probing Failed"

Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ void unified_bed_leveling::shift_mesh_height() {
772772
const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1;
773773
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
774774
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
775+
TERN_(LCD_BACKLIGHT_TIMEOUT_MINS, ui.refresh_backlight_timeout());
775776

776777
#if HAS_MARLINUI_MENU
777778
if (ui.button_pressed()) {

Marlin/src/feature/caselight.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class CaseLight {
3131
public:
3232
static bool on;
33-
#if ENABLED(CASELIGHT_USES_BRIGHTNESS)
33+
#if CASELIGHT_USES_BRIGHTNESS
3434
static uint8_t brightness;
3535
#endif
3636

Marlin/src/feature/max7219.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ void Max7219::idle_tasks() {
706706

707707
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
708708
static int16_t last_depth = 0;
709-
const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF;
709+
const int16_t current_depth = BLOCK_MOD(head - tail + (BLOCK_BUFFER_SIZE)) & 0xF;
710710
if (current_depth != last_depth) {
711711
quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth, &row_change_mask);
712712
last_depth = current_depth;

Marlin/src/gcode/control/T.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@
4141
* S1 Don't move the tool in XY after change
4242
*
4343
* For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S)
44-
* T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
45-
* T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
44+
* T[n] G-code to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
45+
* T? G-code to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
4646
* Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
4747
* Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated.
4848
*/
4949
void GcodeSuite::T(const int8_t tool_index) {
5050

51+
#if HAS_MULTI_EXTRUDER
52+
// For 'T' with no parameter report the current tool.
53+
if (parser.string_arg && *parser.string_arg == '*') {
54+
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
55+
return;
56+
}
57+
#endif
58+
5159
DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING));
5260
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("...(", tool_index, ")");
5361

Marlin/src/gcode/motion/G2_G3.cpp

+64-66
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,17 @@ void plan_arc(
8282
rt_X = cart[axis_p] - center_P,
8383
rt_Y = cart[axis_q] - center_Q;
8484

85-
ARC_LIJKUVW_CODE(
86-
const float start_L = current_position[axis_l],
87-
const float start_I = current_position.i,
88-
const float start_J = current_position.j,
89-
const float start_K = current_position.k,
90-
const float start_U = current_position.u,
91-
const float start_V = current_position.v,
92-
const float start_W = current_position.w
85+
// Starting position of the move for all non-arc axes
86+
// i.e., only one of X, Y, or Z, plus the rest.
87+
ARC_LIJKUVWE_CODE(
88+
float start_L = current_position[axis_l],
89+
float start_I = current_position.i,
90+
float start_J = current_position.j,
91+
float start_K = current_position.k,
92+
float start_U = current_position.u,
93+
float start_V = current_position.v,
94+
float start_W = current_position.w,
95+
float start_E = current_position.e
9396
);
9497

9598
// Angle of rotation between position and target from the circle center.
@@ -125,6 +128,7 @@ void plan_arc(
125128
min_segments = CEIL((MIN_CIRCLE_SEGMENTS) * portion_of_circle); // Minimum segments for the arc
126129
}
127130

131+
// Total travel on all the non-arc axes
128132
ARC_LIJKUVWE_CODE(
129133
float travel_L = cart[axis_l] - start_L,
130134
float travel_I = cart.i - start_I,
@@ -133,7 +137,7 @@ void plan_arc(
133137
float travel_U = cart.u - start_U,
134138
float travel_V = cart.v - start_V,
135139
float travel_W = cart.w - start_W,
136-
float travel_E = cart.e - current_position.e
140+
float travel_E = cart.e - start_E
137141
);
138142

139143
// If "P" specified circles, call plan_arc recursively then continue with the rest of the arc
@@ -166,15 +170,29 @@ void plan_arc(
166170
);
167171
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
168172
}
173+
174+
// Get starting coordinates for the remainder from the current position
175+
ARC_LIJKUVWE_CODE(
176+
start_L = current_position[axis_l],
177+
start_I = current_position.i,
178+
start_J = current_position.j,
179+
start_K = current_position.k,
180+
start_U = current_position.u,
181+
start_V = current_position.v,
182+
start_W = current_position.w,
183+
start_E = current_position.e
184+
);
185+
186+
// Update travel distance for the remainder
169187
ARC_LIJKUVWE_CODE(
170-
travel_L = cart[axis_l] - current_position[axis_l], // Linear X, Y, or Z
171-
travel_I = cart.i - current_position.i, // The rest are also non-arc
172-
travel_J = cart.j - current_position.j,
173-
travel_K = cart.k - current_position.k,
174-
travel_U = cart.u - current_position.u,
175-
travel_V = cart.v - current_position.v,
176-
travel_W = cart.w - current_position.w,
177-
travel_E = cart.e - current_position.e
188+
travel_L = cart[axis_l] - start_L, // Linear X, Y, or Z
189+
travel_I = cart.i - start_I, // The rest are also non-arc
190+
travel_J = cart.j - start_J,
191+
travel_K = cart.k - start_K,
192+
travel_U = cart.u - start_U,
193+
travel_V = cart.v - start_V,
194+
travel_W = cart.w - start_W,
195+
travel_E = cart.e - start_E
178196
);
179197
}
180198

@@ -256,38 +274,35 @@ void plan_arc(
256274

257275
xyze_pos_t raw;
258276

259-
// do not calculate rotation parameters for trivial single-segment arcs
277+
// Don't calculate rotation parameters for trivial single-segment arcs
260278
if (segments > 1) {
261279
// Vector rotation matrix values
262280
const float theta_per_segment = angular_travel / segments,
263281
sq_theta_per_segment = sq(theta_per_segment),
264282
sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6,
265283
cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation
266284

267-
#if DISABLED(AUTO_BED_LEVELING_UBL)
268-
ARC_LIJKUVW_CODE(
269-
const float per_segment_L = travel_L / segments,
270-
const float per_segment_I = travel_I / segments,
271-
const float per_segment_J = travel_J / segments,
272-
const float per_segment_K = travel_K / segments,
273-
const float per_segment_U = travel_U / segments,
274-
const float per_segment_V = travel_V / segments,
275-
const float per_segment_W = travel_W / segments
276-
);
277-
#endif
278-
279-
CODE_ITEM_E(const float extruder_per_segment = travel_E / segments);
285+
ARC_LIJKUVWE_CODE(
286+
const float per_segment_L = travel_L / segments,
287+
const float per_segment_I = travel_I / segments,
288+
const float per_segment_J = travel_J / segments,
289+
const float per_segment_K = travel_K / segments,
290+
const float per_segment_U = travel_U / segments,
291+
const float per_segment_V = travel_V / segments,
292+
const float per_segment_W = travel_W / segments,
293+
const float per_segment_E = travel_E / segments
294+
);
280295

281296
// Initialize all linear axes and E
282297
ARC_LIJKUVWE_CODE(
283-
raw[axis_l] = current_position[axis_l],
284-
raw.i = current_position.i,
285-
raw.j = current_position.j,
286-
raw.k = current_position.k,
287-
raw.u = current_position.u,
288-
raw.v = current_position.v,
289-
raw.w = current_position.w,
290-
raw.e = current_position.e
298+
raw[axis_l] = start_L,
299+
raw.i = start_I,
300+
raw.j = start_J,
301+
raw.k = start_K,
302+
raw.u = start_U,
303+
raw.v = start_V,
304+
raw.w = start_W,
305+
raw.e = start_E
291306
);
292307

293308
millis_t next_idle_ms = millis() + 200UL;
@@ -305,7 +320,6 @@ void plan_arc(
305320
const float limiting_accel = _MIN(planner.settings.max_acceleration_mm_per_s2[axis_p], planner.settings.max_acceleration_mm_per_s2[axis_q]),
306321
limiting_speed = _MIN(planner.settings.max_feedrate_mm_s[axis_p], planner.settings.max_feedrate_mm_s[axis_q]),
307322
limiting_speed_sqr = _MIN(sq(limiting_speed), limiting_accel * radius, sq(scaled_fr_mm_s));
308-
float arc_mm_remaining = flat_mm;
309323

310324
for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times
311325

@@ -343,16 +357,14 @@ void plan_arc(
343357
raw[axis_p] = center_P + rvec.a;
344358
raw[axis_q] = center_Q + rvec.b;
345359
ARC_LIJKUVWE_CODE(
346-
#if ENABLED(AUTO_BED_LEVELING_UBL)
347-
raw[axis_l] = start_L,
348-
raw.i = start_I, raw.j = start_J, raw.k = start_K,
349-
raw.u = start_U, raw.v = start_V, raw.w = start_V
350-
#else
351-
raw[axis_l] += per_segment_L,
352-
raw.i += per_segment_I, raw.j += per_segment_J, raw.k += per_segment_K,
353-
raw.u += per_segment_U, raw.v += per_segment_V, raw.w += per_segment_W
354-
#endif
355-
, raw.e += extruder_per_segment
360+
raw[axis_l] = start_L + per_segment_L * i,
361+
raw.i = start_I + per_segment_I * i,
362+
raw.j = start_J + per_segment_J * i,
363+
raw.k = start_K + per_segment_K * i,
364+
raw.u = start_U + per_segment_U * i,
365+
raw.v = start_V + per_segment_V * i,
366+
raw.w = start_W + per_segment_W * i,
367+
raw.e = start_E + per_segment_E * i
356368
);
357369

358370
apply_motion_limits(raw);
@@ -362,7 +374,7 @@ void plan_arc(
362374
#endif
363375

364376
// calculate safe speed for stopping by the end of the arc
365-
arc_mm_remaining -= segment_mm;
377+
const float arc_mm_remaining = flat_mm - segment_mm * i;
366378
hints.safe_exit_speed_sqr = _MIN(limiting_speed_sqr, 2 * limiting_accel * arc_mm_remaining);
367379

368380
if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints))
@@ -374,13 +386,6 @@ void plan_arc(
374386

375387
// Ensure last segment arrives at target location.
376388
raw = cart;
377-
#if ENABLED(AUTO_BED_LEVELING_UBL)
378-
ARC_LIJKUVW_CODE(
379-
raw[axis_l] = start_L,
380-
raw.i = start_I, raw.j = start_J, raw.k = start_K,
381-
raw.u = start_U, raw.v = start_V, raw.w = start_W
382-
);
383-
#endif
384389

385390
apply_motion_limits(raw);
386391

@@ -392,14 +397,7 @@ void plan_arc(
392397
hints.safe_exit_speed_sqr = 0.0f;
393398
planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints);
394399

395-
#if ENABLED(AUTO_BED_LEVELING_UBL)
396-
ARC_LIJKUVW_CODE(
397-
raw[axis_l] = start_L,
398-
raw.i = start_I, raw.j = start_J, raw.k = start_K,
399-
raw.u = start_U, raw.v = start_V, raw.w = start_W
400-
);
401-
#endif
402-
current_position = raw;
400+
current_position = cart;
403401

404402
} // plan_arc
405403

Marlin/src/gcode/parser.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ void GCodeParser::parse(char *p) {
189189
#endif
190190

191191
// Bail if there's no command code number
192-
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) return;
192+
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) {
193+
if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) {
194+
p[0] = '*'; p[1] = '\0'; string_arg = p; // Convert 'T' alone into 'T*'
195+
command_letter = letter;
196+
}
197+
return;
198+
}
193199

194200
// Save the command letter at this point
195201
// A '?' signifies an unknown command

Marlin/src/gcode/sd/M34.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,19 @@
2929

3030
/**
3131
* M34: Set SD Card Sorting Options
32+
*
33+
* S - Default sorting (i.e., SDSORT_REVERSE)
34+
* S-1 - Reverse alpha sorting
35+
* S0 - FID Order (not always newest)
36+
* S1 - Forward alpha sorting
37+
* S2 - Alias for S-1 [deprecated]
38+
*
39+
* F-1 - Folders above files
40+
* F0 - Sort According to 'S'
41+
* F1 - Folders after files
3242
*/
3343
void GcodeSuite::M34() {
34-
if (parser.seen('S')) card.setSortOn(parser.value_bool());
44+
if (parser.seen('S')) card.setSortOn(SortFlag(parser.ushortval('S', TERN(SDSORT_REVERSE, AS_REV, AS_FWD))));
3545
if (parser.seenval('F')) {
3646
const int v = parser.value_long();
3747
card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);

Marlin/src/inc/Changes.h

+2
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@
661661
#error "Z4_USE_ENDSTOP is obsolete. Instead set Z4_STOP_PIN directly. (e.g., 'Z4_USE_ENDSTOP _ZMAX_' becomes 'Z4_STOP_PIN Z_MAX_PIN')"
662662
#elif defined(INTEGRATED_BABYSTEPPING)
663663
#error "INTEGRATED_BABYSTEPPING is no longer needed and should be removed."
664+
#elif defined(FOLDER_SORTING)
665+
#error "FOLDER_SORTING is now SDSORT_FOLDERS."
664666
#endif
665667

666668
// L64xx stepper drivers have been removed

Marlin/src/inc/Conditionals_post.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3337,8 +3337,8 @@
33373337
#define SDSORT_CACHE_NAMES true
33383338
#define SDSORT_CACHE_LPC1768_WARNING 1
33393339
#endif
3340-
#ifndef FOLDER_SORTING
3341-
#define FOLDER_SORTING -1
3340+
#ifndef SDSORT_FOLDERS
3341+
#define SDSORT_FOLDERS -1
33423342
#endif
33433343
#ifndef SDSORT_GCODE
33443344
#define SDSORT_GCODE false

0 commit comments

Comments
 (0)