Skip to content

Commit e7569d9

Browse files
committed
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x
2 parents 80aaf66 + b169d62 commit e7569d9

File tree

13 files changed

+144
-161
lines changed

13 files changed

+144
-161
lines changed

.github/workflows/check-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
3030
Please redo this PR starting with the `bugfix-2.1.x` branch and be careful to target `bugfix-2.1.x` when resubmitting the PR. Patches may also target `bugfix-2.0.x` if they are specifically for 2.0.9.x.
3131
32-
It may help to set your fork's default branch to `bugfix-2.0.x`.
32+
It may help to set your fork's default branch to `bugfix-2.1.x`.
3333
3434
See [this page](https://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions.

Marlin/Configuration.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,6 @@
909909
#define DELTA_CALIBRATION_DEFAULT_POINTS 4
910910
#endif
911911

912-
// NOTE: All values for DELTA_* values MUST be floating point, so always have a decimal point in them
913-
914912
#if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU)
915913
// Step size for paper-test probing
916914
#define PROBE_MANUALLY_STEP 0.05 // (mm)
@@ -1918,17 +1916,21 @@
19181916
#endif
19191917

19201918
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
1921-
// Gradually reduce leveling correction until a set height is reached,
1922-
// at which point movement will be level to the machine's XY plane.
1923-
// The height can be set with M420 Z<height>
1919+
/**
1920+
* Gradually reduce leveling correction until a set height is reached,
1921+
* at which point movement will be level to the machine's XY plane.
1922+
* The height can be set with M420 Z<height>
1923+
*/
19241924
#define ENABLE_LEVELING_FADE_HEIGHT
19251925
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
19261926
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.
19271927
#endif
19281928

1929-
// For Cartesian machines, instead of dividing moves on mesh boundaries,
1930-
// split up moves into short segments like a Delta. This follows the
1931-
// contours of the bed more closely than edge-to-edge straight moves.
1929+
/**
1930+
* For Cartesian machines, instead of dividing moves on mesh boundaries,
1931+
* split up moves into short segments like a Delta. This follows the
1932+
* contours of the bed more closely than edge-to-edge straight moves.
1933+
*/
19321934
#define SEGMENT_LEVELED_MOVES
19331935
#define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)
19341936

@@ -3303,6 +3305,7 @@
33033305
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
33043306
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
33053307
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
3308+
#define NEOPIXEL_M150_DEFAULT -1 // Default strip for M150 without 'S'. Use -1 to set all by default.
33063309
#else
33073310
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
33083311
#endif

Marlin/Configuration_adv.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,24 +1476,26 @@
14761476

14771477
#endif // HAS_DISPLAY || DWIN_LCD_PROUI
14781478

1479-
// Add the G-code 'M73' to set / report the current job progress
1479+
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
14801480
//#define SET_PROGRESS_MANUALLY
14811481
#if ENABLED(SET_PROGRESS_MANUALLY)
1482-
//#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done, otherwise use Marlin's estimate
1483-
//#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time, otherwise use Marlin's estimate
1482+
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done
1483+
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time
14841484
//#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
1485-
#if ENABLED(SET_INTERACTION_TIME)
1486-
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
1485+
//#define M73_REPORT // Report M73 values to host
1486+
#if BOTH(M73_REPORT, SDSUPPORT)
1487+
#define M73_REPORT_SD_ONLY // Report only when printing from SD
14871488
#endif
1488-
//#define M73_REPORT // Report progress to host with 'M73'
14891489
#endif
14901490

1491-
// LCD Print Progress options, multiple can be rotated depending on screen layout
1491+
// LCD Print Progress options. Multiple times may be displayed in turn.
14921492
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
14931493
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
14941494
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
14951495
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
1496-
1496+
#if ENABLED(SET_INTERACTION_TIME)
1497+
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
1498+
#endif
14971499
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show/report progress with decimal digits, not all UIs support this
14981500

14991501
#if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
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 "2022-12-05"
44+
//#define STRING_DISTRIBUTION_DATE "2022-12-07"
4545

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

Marlin/src/gcode/feature/leds/M150.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ void GcodeSuite::M150() {
6161
#if ENABLED(NEOPIXEL_LED)
6262
const pixel_index_t index = parser.intval('I', -1);
6363
#if ENABLED(NEOPIXEL2_SEPARATE)
64-
int8_t brightness = neo.brightness(), unit = parser.intval('S', -1);
64+
#ifndef NEOPIXEL_M150_DEFAULT
65+
#define NEOPIXEL_M150_DEFAULT -1
66+
#elif NEOPIXEL_M150_DEFAULT > 1
67+
#error "NEOPIXEL_M150_DEFAULT must be -1, 0, or 1."
68+
#endif
69+
int8_t brightness = neo.brightness(), unit = parser.intval('S', NEOPIXEL_M150_DEFAULT);
6570
switch (unit) {
6671
case -1: neo2.neoindex = index; // fall-thru
6772
case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break;

Marlin/src/gcode/lcd/M73.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
#include "../../lcd/e3v2/proui/dwin.h"
3434
#endif
3535

36-
#if ENABLED(M73_REPORT)
37-
#define M73_REPORT_PRUSA
38-
#endif
39-
4036
/**
4137
* M73: Set percentage complete (for display on LCD)
4238
*
@@ -46,10 +42,9 @@
4642
* M73 C12 ; Set next interaction countdown to 12 minutes
4743
* M73 ; Report current values
4844
*
49-
* Use a shorter-than-Průša report format:
50-
* M73 Percent done: ---%; Time left: -----m; Change: -----m;
45+
* M73 Progress: ---%; Time left: -----m; Change: -----m;
5146
*
52-
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100 / 23.4 / 3.45 format
47+
* When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100% / 23.4% / 3.45% format
5348
*
5449
*/
5550
void GcodeSuite::M73() {
@@ -79,19 +74,20 @@ void GcodeSuite::M73() {
7974
#endif
8075

8176
#if ENABLED(M73_REPORT)
82-
{
83-
SERIAL_ECHO_MSG(
84-
TERN(M73_REPORT_PRUSA, "M73 Percent done: ", "Progress: ")
85-
, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent())
77+
if (TERN1(M73_REPORT_SD_ONLY, IS_SD_PRINTING())) {
78+
SERIAL_ECHO_START();
79+
SERIAL_ECHOPGM(" M73");
80+
#if ENABLED(SET_PROGRESS_PERCENT)
81+
SERIAL_ECHOPGM(" Progress: ", TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()), "%;");
82+
#endif
8683
#if ENABLED(SET_REMAINING_TIME)
87-
, TERN(M73_REPORT_PRUSA, "; Print time remaining in mins: ", "%; Time left: "), ui.remaining_time / 60
84+
SERIAL_ECHOPGM(" Time left: ", ui.remaining_time / 60, "m;");
8885
#endif
8986
#if ENABLED(SET_INTERACTION_TIME)
90-
, TERN(M73_REPORT_PRUSA, "; Change in mins: ", "m; Change: "), ui.interaction_time / 60
87+
SERIAL_ECHOPGM(" Change: ", ui.interaction_time / 60, "m;");
9188
#endif
92-
, TERN(M73_REPORT_PRUSA, ";", "m")
93-
);
94-
}
89+
SERIAL_EOL();
90+
}
9591
#endif
9692
}
9793

Marlin/src/inc/Version.h

Lines changed: 1 addition & 1 deletion
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 "2022-12-05"
45+
#define STRING_DISTRIBUTION_DATE "2022-12-07"
4646
#endif
4747

4848
/**

Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void MarlinUI::draw_status_message(const bool blink) {
760760
#if HAS_PRINT_PROGRESS
761761
#define TPOFFSET (LCD_WIDTH - 1)
762762
static uint8_t timepos = TPOFFSET - 6;
763-
static char buffer[14];
763+
static char buffer[8];
764764
static lcd_uint_t pc, pr;
765765

766766
#if ENABLED(SHOW_PROGRESS_PERCENT)
@@ -776,9 +776,10 @@ void MarlinUI::draw_status_message(const bool blink) {
776776
#endif
777777
#if ENABLED(SHOW_REMAINING_TIME)
778778
void MarlinUI::drawRemain() {
779-
const duration_t remaint = ui.get_remaining_time();
780779
if (printJobOngoing()) {
780+
const duration_t remaint = ui.get_remaining_time();
781781
timepos = TPOFFSET - remaint.toDigital(buffer);
782+
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
782783
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
783784
lcd_put_u8str(buffer);
784785
}
@@ -789,18 +790,19 @@ void MarlinUI::draw_status_message(const bool blink) {
789790
const duration_t interactt = ui.interaction_time;
790791
if (printingIsActive() && interactt.value) {
791792
timepos = TPOFFSET - interactt.toDigital(buffer);
793+
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
792794
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
793795
lcd_put_u8str(buffer);
794796
}
795797
}
796798
#endif
797799
#if ENABLED(SHOW_ELAPSED_TIME)
798800
void MarlinUI::drawElapsed() {
799-
const duration_t elapsedt = print_job_timer.duration();
800801
if (printJobOngoing()) {
802+
const duration_t elapsedt = print_job_timer.duration();
801803
timepos = TPOFFSET - elapsedt.toDigital(buffer);
804+
TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);)
802805
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
803-
//lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]);
804806
lcd_put_u8str(buffer);
805807
}
806808
}
@@ -919,7 +921,7 @@ void MarlinUI::draw_status_screen() {
919921
#if LCD_WIDTH < 20
920922

921923
#if HAS_PRINT_PROGRESS
922-
pc = 0, pr = 2;
924+
pc = 0; pr = 2;
923925
rotate_progress();
924926
#endif
925927

@@ -1006,14 +1008,14 @@ void MarlinUI::draw_status_screen() {
10061008
#if LCD_WIDTH >= 20
10071009

10081010
#if HAS_PRINT_PROGRESS
1009-
pc = timepos - 7, pr = 2;
1011+
pc = 6; pr = 2;
10101012
rotate_progress();
10111013
#else
10121014
char c;
10131015
uint16_t per;
10141016
#if HAS_FAN0
10151017
if (true
1016-
#if EXTRUDERS && ENABLED(ADAPTIVE_FAN_SLOWING)
1018+
#if BOTH(HAS_EXTRUDERS, ADAPTIVE_FAN_SLOWING)
10171019
&& (blink || thermalManager.fan_speed_scaler[0] < 128)
10181020
#endif
10191021
) {
@@ -1087,15 +1089,15 @@ void MarlinUI::draw_status_screen() {
10871089
_draw_bed_status(blink);
10881090
#elif HAS_PRINT_PROGRESS
10891091
#define DREW_PRINT_PROGRESS 1
1090-
pc = 0, pr = 2;
1092+
pc = 0; pr = 2;
10911093
rotate_progress();
10921094
#endif
10931095

10941096
//
10951097
// All progress strings
10961098
//
10971099
#if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS
1098-
pc = LCD_WIDTH - 9, pr = 2;
1100+
pc = LCD_WIDTH - 9; pr = 2;
10991101
rotate_progress();
11001102
#endif
11011103
#endif // LCD_INFO_SCREEN_STYLE 1

Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -617,23 +617,58 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
617617

618618
#endif // HAS_CUTTER
619619

620-
#if HAS_PRINT_PROGRESS
621-
622-
FORCE_INLINE void _draw_print_progress() {
623-
if (!PanelDetected) return;
624-
const uint8_t progress = ui._get_progress();
625-
#if ENABLED(SDSUPPORT)
626-
lcd_put_u8str(F("SD"));
627-
#elif ENABLED(SET_PROGRESS_PERCENT)
628-
lcd_put_u8str(F("P:"));
629-
#endif
630-
if (progress)
631-
lcd.print(ui8tostr3rj(progress));
632-
else
633-
lcd_put_u8str(F("---"));
634-
lcd.write('%');
635-
}
636620

621+
#if HAS_PRINT_PROGRESS // UNTESTED!!!
622+
#define TPOFFSET (LCD_WIDTH - 1)
623+
static uint8_t timepos = TPOFFSET - 6;
624+
625+
#if ENABLED(SHOW_PROGRESS_PERCENT)
626+
void MarlinUI::drawPercent() {
627+
const uint8_t progress = ui.get_progress_percent();
628+
if (progress) {
629+
lcd_moveto(0, 2);
630+
lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
631+
lcd.print(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
632+
lcd.write('%');
633+
}
634+
}
635+
#endif
636+
#if ENABLED(SHOW_REMAINING_TIME)
637+
void MarlinUI::drawRemain() {
638+
if (printJobOngoing()) {
639+
const duration_t remaint = ui.get_remaining_time();
640+
char buffer[10];
641+
timepos = TPOFFSET - remaint.toDigital(buffer);
642+
lcd_moveto(timepos, 1);
643+
lcd.write('R');
644+
lcd.print(buffer);
645+
}
646+
}
647+
#endif
648+
#if ENABLED(SHOW_INTERACTION_TIME)
649+
void MarlinUI::drawInter() {
650+
const duration_t interactt = ui.interaction_time;
651+
if (printingIsActive() && interactt.value) {
652+
char buffer[10];
653+
timepos = TPOFFSET - interactt.toDigital(buffer);
654+
lcd_moveto(timepos, 1);
655+
lcd.write('C');
656+
lcd.print(buffer);
657+
}
658+
}
659+
#endif
660+
#if ENABLED(SHOW_ELAPSED_TIME)
661+
void MarlinUI::drawElapsed() {
662+
if (printJobOngoing()) {
663+
const duration_t elapsedt = print_job_timer.duration();
664+
char buffer[10];
665+
timepos = TPOFFSET - elapsedt.toDigital(buffer);
666+
lcd_moveto(timepos, 1);
667+
lcd.write('E');
668+
lcd.print(buffer);
669+
}
670+
}
671+
#endif
637672
#endif // HAS_PRINT_PROGRESS
638673

639674
#if ENABLED(LCD_PROGRESS_BAR)
@@ -817,23 +852,12 @@ void MarlinUI::draw_status_screen() {
817852
#endif
818853

819854
//
820-
// Line 2 - feedrate, , time
855+
// Line 2 - feedrate, progress %, progress time
821856
//
822857

823858
lcd_moveto(0, 1);
824859
lcd_put_u8str(F("FR")); lcd.print(i16tostr3rj(feedrate_percentage)); lcd.write('%');
825-
826-
#if BOTH(SDSUPPORT, HAS_PRINT_PROGRESS)
827-
lcd_moveto(LCD_WIDTH / 2 - 3, 1);
828-
_draw_print_progress();
829-
#endif
830-
831-
char buffer[10];
832-
duration_t elapsed = print_job_timer.duration();
833-
uint8_t len = elapsed.toDigital(buffer);
834-
835-
lcd_moveto((LCD_WIDTH - 1) - len, 1);
836-
lcd.write(LCD_STR_CLOCK[0]); lcd.print(buffer);
860+
ui.rotate_progress(); // UNTESTED!!!
837861

838862
//
839863
// Line 3 - progressbar

0 commit comments

Comments
 (0)