Skip to content

Commit 83f0eb7

Browse files
committed
Merge branch 'bugfix-2.1.x' into mike-anet-evo
* bugfix-2.1.x: [cron] Bump distribution date (2024-01-25) 📝 Fix dead LCD link (MarlinFirmware#26669) 🚸 PLR recover chamber temp (MarlinFirmware#26696) 🔧 Wrap POWER_LOSS_RETRACT_LEN (MarlinFirmware#26695) 🔧 Allow RAMPS FAN1_PIN override (MarlinFirmware#26725) 🔧 Update SKR_MINI_SCREEN_ADAPTER error (MarlinFirmware#26726) 🔧 STM32 UID followup (MarlinFirmware#26727) [cron] Bump distribution date (2024-01-24) 🎨 Cosmetic cleanup 23-01 🔧 Fix ROTATIONAL_AXIS_GANG 🩹 Fix _U and other conflicts 🔧 Allow for no STOP pin 🔧 Sanity check Z_CLEARANCE_FOR_HOMING (MarlinFirmware#26721) 🚸 DOGM active extruder indicator (MarlinFirmware#26152)
2 parents 5f2b0cf + a215bc2 commit 83f0eb7

25 files changed

+164
-126
lines changed

Marlin/Configuration.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3039,7 +3039,7 @@
30393039

30403040
//
30413041
// Factory display for Creality CR-10 / CR-7 / Ender-3
3042-
// https://www.aliexpress.com/item/32833148327.html
3042+
// https://marlinfw.org/docs/hardware/controllers.html#cr10_stockdisplay
30433043
//
30443044
// Connect to EXP1 on RAMPS and compatible boards.
30453045
//

Marlin/Configuration_adv.h

+14-8
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@
459459
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0
460460

461461
#else
462-
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed)
462+
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed)
463463
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
464464
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
465465
#endif
@@ -1540,6 +1540,7 @@
15401540
* Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH
15411541
* will be shown in the move submenus.
15421542
*/
1543+
15431544
#define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 // (mm)
15441545
//#define MANUAL_MOVE_DISTANCE_MM 100, 50, 10, 1.0, 0.1 // (mm)
15451546
//#define MANUAL_MOVE_DISTANCE_MM 500, 100, 50, 10, 1.0, 0.1 // (mm)
@@ -1744,21 +1745,26 @@
17441745
*/
17451746
#define POWER_LOSS_RECOVERY
17461747
#if ENABLED(POWER_LOSS_RECOVERY)
1747-
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
1748+
#define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
17481749
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)
1749-
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
1750-
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
1751-
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
1752-
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
1750+
1751+
//#define POWER_LOSS_PIN 44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default.
1752+
//#define POWER_LOSS_STATE HIGH // State of pin indicating power-loss
17531753
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
17541754
//#define POWER_LOSS_PULLDOWN
1755-
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
1756-
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
1755+
1756+
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power-loss with UPS)
1757+
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
17571758

17581759
// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
17591760
// especially with "vase mode" printing. Set too high and vases cannot be continued.
17601761
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
17611762

1763+
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power-loss
1764+
#if ENABLED(BACKUP_POWER_SUPPLY)
1765+
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail
1766+
#endif
1767+
17621768
// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
17631769
//#define POWER_LOSS_RECOVER_ZHOME
17641770
#if ENABLED(POWER_LOSS_RECOVER_ZHOME)

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 "2024-01-23"
44+
//#define STRING_DISTRIBUTION_DATE "2024-01-25"
4545

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

Marlin/src/core/types.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ class AxisBits {
937937
typedef bits_t(NUM_AXIS_ENUMS) el;
938938
union {
939939
el bits;
940-
// x, y, z ... e0, e1, e2 ... hx, hy, hz
940+
// Axes x, y, z ... e0, e1, e2 ... hx, hy, hz
941941
struct {
942942
#if NUM_AXES
943943
bool NUM_AXIS_LIST(x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1);
@@ -949,7 +949,7 @@ class AxisBits {
949949
bool hx:1, hy:1, hz:1;
950950
#endif
951951
};
952-
// X, Y, Z ... E0, E1, E2 ... HX, HY, HZ
952+
// Axes X, Y, Z ... E0, E1, E2 ... HX, HY, HZ
953953
struct {
954954
#if NUM_AXES
955955
bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1);
@@ -963,7 +963,7 @@ class AxisBits {
963963
};
964964
// a, b, c, e ... ha, hb, hc
965965
struct {
966-
bool LOGICAL_AXIS_LIST(e:1, a:1, b:1, c:1, _i:1, _j:1, _k:1, _u:1, _v:1, _w:1);
966+
bool LOGICAL_AXIS_LIST(e:1, a:1, b:1, c:1, ii:1, jj:1, kk:1, uu:1, vv:1, ww:1);
967967
#if EXTRUDERS > 1
968968
#define _EN_ITEM(N) bool _e##N:1;
969969
REPEAT_S(1,EXTRUDERS,_EN_ITEM)
@@ -975,7 +975,7 @@ class AxisBits {
975975
};
976976
// A, B, C, E ... HA, HB, HC
977977
struct {
978-
bool LOGICAL_AXIS_LIST(E:1, A:1, B:1, C:1, _I:1, _J:1, _K:1, _U:1, _V:1, _W:1);
978+
bool LOGICAL_AXIS_LIST(E:1, A:1, B:1, C:1, II:1, JJ:1, KK:1, UU:1, VV:1, WW:1);
979979
#if EXTRUDERS > 1
980980
#define _EN_ITEM(N) bool _E##N:1;
981981
REPEAT_S(1,EXTRUDERS,_EN_ITEM)

Marlin/src/feature/powerloss.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
7575

7676
PrintJobRecovery recovery;
7777

78-
#ifndef POWER_LOSS_PURGE_LEN
79-
#define POWER_LOSS_PURGE_LEN 0
80-
#endif
81-
8278
#if DISABLED(BACKUP_POWER_SUPPLY)
8379
#undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power
8480
#endif
8581
#ifndef POWER_LOSS_RETRACT_LEN
8682
#define POWER_LOSS_RETRACT_LEN 0
8783
#endif
84+
#ifndef POWER_LOSS_PURGE_LEN
85+
#define POWER_LOSS_PURGE_LEN 0
86+
#endif
8887

8988
// Allow power-loss recovery to be aborted
9089
#define PLR_CAN_ABORT
@@ -229,6 +228,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
229228

230229
TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.degTargetBed());
231230

231+
TERN_(HAS_HEATED_CHAMBER, info.target_temperature_chamber = thermalManager.degTargetChamber());
232+
232233
TERN_(HAS_FAN, COPY(info.fan_speed, thermalManager.fan_speed));
233234

234235
#if HAS_LEVELING
@@ -384,6 +385,12 @@ void PrintJobRecovery::resume() {
384385
PROCESS_SUBCOMMANDS_NOW(F("M420S0"));
385386
#endif
386387

388+
#if HAS_HEATED_CHAMBER
389+
// Restore the chamber temperature
390+
const celsius_t ct = info.target_temperature_chamber;
391+
if (ct) PROCESS_SUBCOMMANDS_NOW(TS(F("M191S"), ct));
392+
#endif
393+
387394
#if HAS_HEATED_BED
388395
// Restore the bed temperature
389396
const celsius_t bt = info.target_temperature_bed;
@@ -634,6 +641,10 @@ void PrintJobRecovery::resume() {
634641
DEBUG_ECHOLNPGM("target_temperature_bed: ", info.target_temperature_bed);
635642
#endif
636643

644+
#if HAS_HEATED_CHAMBER
645+
DEBUG_ECHOLNPGM("target_temperature_chamber: ", info.target_temperature_chamber);
646+
#endif
647+
637648
#if HAS_FAN
638649
DEBUG_ECHOPGM("fan_speed: ");
639650
FANS_LOOP(i) {

Marlin/src/feature/powerloss.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@
4242
#define POWER_LOSS_STATE HIGH
4343
#endif
4444

45+
#if DISABLED(BACKUP_POWER_SUPPLY)
46+
#undef POWER_LOSS_ZRAISE // No Z raise at outage without backup power
47+
#endif
4548
#ifndef POWER_LOSS_ZRAISE
46-
#define POWER_LOSS_ZRAISE 2
49+
#define POWER_LOSS_ZRAISE 2 // Default Z-raise on outage or resume
4750
#endif
4851

4952
//#define DEBUG_POWER_LOSS_RECOVERY
@@ -84,6 +87,9 @@ typedef struct {
8487
#if HAS_HEATED_BED
8588
celsius_t target_temperature_bed;
8689
#endif
90+
#if HAS_HEATED_CHAMBER
91+
celsius_t target_temperature_chamber;
92+
#endif
8793
#if HAS_FAN
8894
uint8_t fan_speed[FAN_COUNT];
8995
#endif

Marlin/src/gcode/host/M115.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "../../feature/caselight.h"
3636
#endif
3737

38-
#if !defined(MACHINE_UUID) && HAS_STM32_UID
38+
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
3939
#include "../../libs/hex_print.h"
4040
#endif
4141

@@ -72,15 +72,15 @@ void GcodeSuite::M115() {
7272
#if NUM_AXES != XYZ
7373
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
7474
#endif
75-
#if defined(MACHINE_UUID) || HAS_STM32_UID
75+
#if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID)
7676
" UUID:"
7777
#endif
7878
#ifdef MACHINE_UUID
7979
MACHINE_UUID
8080
#endif
8181
);
8282

83-
#if !defined(MACHINE_UUID) && HAS_STM32_UID
83+
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
8484
/**
8585
* STM32-based devices have a 96-bit CPU device serial number.
8686
* Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
@@ -93,7 +93,7 @@ void GcodeSuite::M115() {
9393
#else
9494
uint16_t * const UID = (uint16_t*)UID_BASE;
9595
SERIAL_ECHO(
96-
F("CEDE2A2F-"), hex_word(UID[0]), '-', hex_word(UID[1]), '-', hex_word(UID[2]), '-',
96+
F("CEDE2A2F-"), hex_word(UID[0]), C('-'), hex_word(UID[1]), C('-'), hex_word(UID[2]), C('-'),
9797
hex_word(UID[3]), hex_word(UID[4]), hex_word(UID[5])
9898
);
9999
#endif

Marlin/src/gcode/parser.h

+18-14
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ class GCodeParser {
288288
// Bool is true with no value or non-zero
289289
static bool value_bool() { return !has_value() || !!value_byte(); }
290290

291+
static constexpr bool axis_is_rotational(const AxisEnum axis) {
292+
return (false
293+
|| TERN0(AXIS4_ROTATES, axis == I_AXIS)
294+
|| TERN0(AXIS5_ROTATES, axis == J_AXIS)
295+
|| TERN0(AXIS6_ROTATES, axis == K_AXIS)
296+
|| TERN0(AXIS7_ROTATES, axis == U_AXIS)
297+
|| TERN0(AXIS8_ROTATES, axis == V_AXIS)
298+
|| TERN0(AXIS9_ROTATES, axis == W_AXIS)
299+
);
300+
}
301+
291302
// Units modes: Inches, Fahrenheit, Kelvin
292303

293304
#if ENABLED(INCH_MODE_SUPPORT)
@@ -307,14 +318,7 @@ class GCodeParser {
307318
}
308319

309320
static float axis_unit_factor(const AxisEnum axis) {
310-
if (false
311-
|| TERN0(AXIS4_ROTATES, axis == I_AXIS)
312-
|| TERN0(AXIS5_ROTATES, axis == J_AXIS)
313-
|| TERN0(AXIS6_ROTATES, axis == K_AXIS)
314-
|| TERN0(AXIS7_ROTATES, axis == U_AXIS)
315-
|| TERN0(AXIS8_ROTATES, axis == V_AXIS)
316-
|| TERN0(AXIS9_ROTATES, axis == W_AXIS)
317-
) return 1.0f;
321+
if (axis_is_rotational(axis)) return 1.0f;
318322
#if HAS_EXTRUDERS
319323
if (axis >= E_AXIS && volumetric_enabled) return volumetric_unit_factor;
320324
#endif
@@ -327,12 +331,12 @@ class GCodeParser {
327331

328332
#else
329333

330-
static float mm_to_linear_unit(const_float_t mm) { return mm; }
331-
static float mm_to_volumetric_unit(const_float_t mm) { return mm; }
334+
static constexpr float mm_to_linear_unit(const_float_t mm) { return mm; }
335+
static constexpr float mm_to_volumetric_unit(const_float_t mm) { return mm; }
332336

333-
static float linear_value_to_mm(const_float_t v) { return v; }
334-
static float axis_value_to_mm(const AxisEnum, const float v) { return v; }
335-
static float per_axis_value(const AxisEnum, const float v) { return v; }
337+
static constexpr float linear_value_to_mm(const_float_t v) { return v; }
338+
static constexpr float axis_value_to_mm(const AxisEnum, const float v) { return v; }
339+
static constexpr float per_axis_value(const AxisEnum, const float v) { return v; }
336340

337341
#endif
338342

@@ -402,7 +406,7 @@ class GCodeParser {
402406

403407
#else // !TEMPERATURE_UNITS_SUPPORT
404408

405-
static float to_temp_units(int16_t c) { return (float)c; }
409+
static constexpr float to_temp_units(int16_t c) { return (float)c; }
406410

407411
static celsius_t value_celsius() { return value_int(); }
408412
static celsius_t value_celsius_diff() { return value_int(); }

Marlin/src/inc/Conditionals_LCD.h

+4
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,10 @@
507507
#define ROTATIONAL_AXES 0
508508
#endif
509509

510+
#if ROTATIONAL_AXES
511+
#define HAS_ROTATIONAL_AXES 1
512+
#endif
513+
510514
/**
511515
* Number of Secondary Linear Axes (e.g., UVW)
512516
* All secondary axes for which AXIS*_ROTATES is not defined.

Marlin/src/inc/Conditionals_adv.h

+5
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,11 @@
13511351
#undef MANUAL_MOVE_DISTANCE_IN
13521352
#endif
13531353

1354+
// Clean up if no rotational axes exist
1355+
#if !HAS_ROTATIONAL_AXES
1356+
#undef MANUAL_MOVE_DISTANCE_DEG
1357+
#endif
1358+
13541359
// Power-Loss Recovery
13551360
#if ENABLED(POWER_LOSS_RECOVERY) && defined(PLR_BED_THRESHOLD)
13561361
#define HAS_PLR_BED_THRESHOLD 1

Marlin/src/inc/Conditionals_post.h

-6
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@
9696
#define AXIS9_NAME 'W'
9797
#endif
9898

99-
#if ANY(AXIS4_ROTATES, AXIS5_ROTATES, AXIS6_ROTATES, AXIS7_ROTATES, AXIS8_ROTATES, AXIS9_ROTATES)
100-
#define HAS_ROTATIONAL_AXES 1
101-
#else
102-
#undef MANUAL_MOVE_DISTANCE_DEG
103-
#endif
104-
10599
#if HAS_X_AXIS
106100
#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
107101
#endif

Marlin/src/inc/SanityCheck.h

+7
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,13 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
17251725
static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
17261726
#endif
17271727

1728+
/**
1729+
* Make sure Z_CLEARANCE_FOR_HOMING is below Z_MAX_POS
1730+
*/
1731+
#if HAS_Z_AXIS
1732+
static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS.");
1733+
#endif
1734+
17281735
// Check Safe Bed Leveling settings
17291736
#if HAS_SAFE_BED_LEVELING
17301737
#if defined(SAFE_BED_LEVELING_START_Y) && !defined(SAFE_BED_LEVELING_START_X)

Marlin/src/inc/Version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* version was tagged.
4343
*/
4444
#ifndef STRING_DISTRIBUTION_DATE
45-
#define STRING_DISTRIBUTION_DATE "2024-01-23"
45+
#define STRING_DISTRIBUTION_DATE "2024-01-25"
4646
#endif
4747

4848
/**

Marlin/src/lcd/dogm/status/hotend.h

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@
9090

9191
#elif STATUS_HOTEND_BITMAPS > 1
9292

93+
const unsigned char status_active_extruder_indicator_bmp[] PROGMEM = {
94+
B00110000,
95+
B00011000,
96+
B00001100,
97+
B00011000,
98+
B00110000
99+
};
100+
93101
#ifdef STATUS_HOTEND_ANIM
94102

95103
const unsigned char status_hotend1_a_bmp[] PROGMEM = {

Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
323323

324324
} // PAGE_CONTAINS
325325

326+
#if HAS_MULTI_EXTRUDER && DISABLED(SLIM_LCD_MENUS)
327+
if (active_extruder == heater_id)
328+
u8g.drawBitmapP(_MAX(0, STATUS_HOTEND_X(heater_id) - 6), STATUS_HEATERS_Y + 3, 1, 5, status_active_extruder_indicator_bmp);
329+
#endif
330+
326331
#endif // !STATUS_COMBINE_HEATERS
327332

328333
if (PAGE_UNDER(7)) {

0 commit comments

Comments
 (0)