From 837dc4727de20856ed9e633d42fce906d8702a15 Mon Sep 17 00:00:00 2001 From: cbaugher Date: Sun, 9 Aug 2020 15:46:47 -0500 Subject: [PATCH 1/7] Tool-change Z move followup (#18963) --- Marlin/src/module/tool_change.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 5d2dc7d3be3f..d1017cea8078 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1133,7 +1133,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (toolchange_settings.enable_park) do_blocking_move_to_xy_z(destination, destination.z, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); #else do_blocking_move_to_xy(destination, planner.settings.max_feedrate_mm_s[X_AXIS]); - do_blocking_move_to_z(destination, planner.settings.max_feedrate_mm_s[Z_AXIS]); + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); #endif #endif From f7b261a363d50f1ca071cd46d859ac3eabc3b4b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Aug 2020 15:55:11 -0500 Subject: [PATCH 2/7] Shorthand values for M575 B --- Marlin/src/gcode/config/M575.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/config/M575.cpp b/Marlin/src/gcode/config/M575.cpp index 4144c366d114..3aa5844653c2 100644 --- a/Marlin/src/gcode/config/M575.cpp +++ b/Marlin/src/gcode/config/M575.cpp @@ -33,7 +33,21 @@ * B - Baud rate (bits per second) */ void GcodeSuite::M575() { - const int32_t baud = parser.ulongval('B'); + int32_t baud = parser.ulongval('B'); + switch (baud) { + case 24: + case 96: + case 192: + case 384: + case 576: + case 1152: baud *= 100; break; + case 250: + case 500: baud *= 1000; break; + case 19: baud = 19200; break; + case 38: baud = 38400; break; + case 57: baud = 57600; break; + case 115: baud = 115200; break; + } switch (baud) { case 2400: case 9600: case 19200: case 38400: case 57600: case 115200: case 250000: case 500000: case 1000000: { From 81f5973afc6da027bb2eb51f3f76a864585c01f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Aug 2020 15:57:59 -0500 Subject: [PATCH 3/7] Followup for SPI Flash --- Marlin/src/gcode/gcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 840df54f6a76..edbeca9c9279 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -896,7 +896,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe #endif - #if BOTH(HAS_SPI_FLASH, SDSUPPORT) + #if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE) case 993: M993(); break; // M993: Backup SPI Flash to SD case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash #endif From b15c207d0899e838d41bd1dd684917769b93b89d Mon Sep 17 00:00:00 2001 From: ftk Date: Mon, 10 Aug 2020 01:19:35 +0300 Subject: [PATCH 4/7] Remaining Time for LIGHTWEIGHT_UI (#18875) --- .../lcd/dogm/status_screen_lite_ST7920.cpp | 22 +++++++++++++++---- .../src/lcd/dogm/status_screen_lite_ST7920.h | 10 ++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index fba485d7060e..211acc86c6d4 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -591,16 +591,17 @@ void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) { write_byte('%'); } -void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) { +void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed, char suffix) { #if HOTENDS == 1 set_ddram_address(DDRAM_LINE_3); #else set_ddram_address(DDRAM_LINE_3 + 5); #endif char str[7]; - str[elapsed.toDigital(str)] = ' '; + int str_length = elapsed.toDigital(str); + str[str_length++] = suffix; begin_data(); - write_str(str, 6); + write_str(str, str_length); } void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) { @@ -714,6 +715,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { if (forceUpdate || indicators_changed()) { const bool blink = ui.get_blink(); const duration_t elapsed = print_job_timer.duration(); + duration_t remaining = TERN0(USE_M73_REMAINING_TIME, ui.get_remaining_time()); const uint16_t feedrate_perc = feedrate_percentage; const int16_t extruder_1_temp = thermalManager.degHotend(0), extruder_1_target = thermalManager.degTargetHotend(0); @@ -738,7 +740,19 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { #endif draw_fan_speed(thermalManager.fanPercent(spd)); - draw_print_time(elapsed); + + // Draw elapsed/remaining time + const bool show_remaining = ENABLED(SHOW_REMAINING_TIME) && (DISABLED(ROTATE_PROGRESS_DISPLAY) || blink); + if (show_remaining && !remaining.second()) { + const auto progress = ui.get_progress_percent(); + if (progress) + remaining = elapsed.second() * (100 - progress) / progress; + } + if (show_remaining && remaining.second()) + draw_print_time(remaining, 'R'); + else + draw_print_time(elapsed); + draw_feedrate_percentage(feedrate_perc); // Update the fan and bed animations diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index bc18c43f107f..9f0815d099ce 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -80,14 +80,14 @@ class ST7920_Lite_Status_Screen { static void draw_fan_icon(const bool whichIcon); static void draw_heat_icon(const bool whichIcon, const bool heating); static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange); - static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); - static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false); + static void draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate=false); + static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate=false); + static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate=false); static void draw_fan_speed(const uint8_t value); - static void draw_print_time(const duration_t &elapsed); + static void draw_print_time(const duration_t &elapsed, char suffix=' '); static void draw_feedrate_percentage(const uint16_t percentage); static void draw_status_message(); - static void draw_position(const xyze_pos_t &pos, bool position_known = true); + static void draw_position(const xyze_pos_t &pos, bool position_known=true); static bool indicators_changed(); static bool position_changed(); From f642656bff4e71256ea491c344b3ddb695dd962d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 10 Aug 2020 00:10:53 +0000 Subject: [PATCH 5/7] [cron] Bump distribution date (2020-08-10) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 33cd24dd0219..681bbfeca5ee 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 "2020-08-09" + #define STRING_DISTRIBUTION_DATE "2020-08-10" #endif /** From ce3df42e229ea563ef319f42cf5283f5a2ba3fa3 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Mon, 10 Aug 2020 03:48:57 +0200 Subject: [PATCH 6/7] Fix DISABLE_[XYZE] code (#18970) Co-authored-by: Scott Lahteine --- Marlin/src/module/planner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index c2a9e6ac7716..931daa3322b8 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1281,7 +1281,7 @@ void Planner::recalculate() { void Planner::check_axes_activity() { #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) - xyze_bool_t axis_active = { true, true, true, true }; + xyze_bool_t axis_active = { false }; #endif #if HAS_FAN @@ -1316,10 +1316,10 @@ void Planner::check_axes_activity() { #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { block_t *block = &block_buffer[b]; - if (ENABLED(DISABLE_X) && block->steps[X_AXIS]) axis_active[X_AXIS] = true; - if (ENABLED(DISABLE_Y) && block->steps[Y_AXIS]) axis_active[Y_AXIS] = true; - if (ENABLED(DISABLE_Z) && block->steps[Z_AXIS]) axis_active[Z_AXIS] = true; - if (ENABLED(DISABLE_E) && block->steps[E_AXIS]) axis_active[E_AXIS] = true; + if (ENABLED(DISABLE_X) && block->steps.x) axis_active.x = true; + if (ENABLED(DISABLE_Y) && block->steps.y) axis_active.y = true; + if (ENABLED(DISABLE_Z) && block->steps.z) axis_active.z = true; + if (ENABLED(DISABLE_E) && block->steps.e) axis_active.e = true; } #endif } From 911cdd4d2f90104c74a6f5ee3a5656388eeccfa7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 10 Aug 2020 01:44:11 -0500 Subject: [PATCH 7/7] Fix scripts using gawk and wget --- buildroot/bin/use_example_configs | 17 ++++++++++------- buildroot/share/fonts/uxggenpages.sh | 5 ++++- buildroot/share/git/ghtp | 9 ++++++--- buildroot/share/git/mfclean | 5 ++++- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index 96be67e53d17..a7fe39a85988 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -1,18 +1,21 @@ #!/usr/bin/env bash IFS=: read -r PART1 PART2 <<< "$@" -[ -n "${PART2}" ] && { REPO="$PART1" ; RDIR="$PART2" ; } \ - || { REPO=bugfix-2.0.x ; RDIR="$PART1" ; } +[ -n "${PART2}" ] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \ + || { REPO=bugfix-2.0.x ; RDIR="${PART1// /%20}" ; } EXAMPLES="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/examples" +which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot' +which wget >/dev/null && TOOL='wget -q -O wgot' + restore_configs cd Marlin -wget -q "$EXAMPLES/$RDIR/Configuration.h" -O wgot && mv wgot Configuration.h -wget -q "$EXAMPLES/$RDIR/Configuration_adv.h" -O wgot && mv wgot Configuration_adv.h -wget -q "$EXAMPLES/$RDIR/_Bootscreen.h" -O wgot && mv wgot _Bootscreen.h -wget -q "$EXAMPLES/$RDIR/_Statusscreen.h" -O wgot && mv wgot _Statusscreen.h -rm -f wgot +$TOOL "$EXAMPLES/$RDIR/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h +$TOOL "$EXAMPLES/$RDIR/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration.h +$TOOL "$EXAMPLES/$RDIR/_Bootscreen.h" >/dev/null 2>&1 && mv wgot Configuration.h +$TOOL "$EXAMPLES/$RDIR/_Statusscreen.h" >/dev/null 2>&1 && mv wgot Configuration.h +rm -f wgot cd - >/dev/null diff --git a/buildroot/share/fonts/uxggenpages.sh b/buildroot/share/fonts/uxggenpages.sh index 9207835148f6..46ad438f9c85 100755 --- a/buildroot/share/fonts/uxggenpages.sh +++ b/buildroot/share/fonts/uxggenpages.sh @@ -139,11 +139,14 @@ BEGIN { } EOF +which awk >/dev/null && AWK=awk +which gawk >/dev/null && AWK=gawk + grep -Hrn _UxGT . | grep '"' \ | sed 's/_UxGT("/\n&/g;s/[^\n]*\n_UxGT("\([^"]*\)[^\n]*/\1 /g;s/.$//' \ | ${EXEC_GENPAGES} \ | sort -k 1n -k 2n | uniq \ - | gawk -v EXEC_PREFIX=${DN_EXEC} -f "proc.awk" \ + | "$AWK" -v EXEC_PREFIX=${DN_EXEC} -f "proc.awk" \ | while read PAGE BEGIN END UTF8BEGIN UTF8END; do \ if [ ! -f ${DN_DATA}/fontpage_${PAGE}_${BEGIN}_${END}.h ]; then \ ${EXEC_BDF2U8G} -u ${PAGE} -b ${BEGIN} -e ${END} ${FN_FONT} fontpage_${PAGE}_${BEGIN}_${END} ${DN_DATA}/fontpage_${PAGE}_${BEGIN}_${END}.h > /dev/null 2>&1 ; diff --git a/buildroot/share/git/ghtp b/buildroot/share/git/ghtp index f7a6263012cd..a2fac985ddbb 100755 --- a/buildroot/share/git/ghtp +++ b/buildroot/share/git/ghtp @@ -13,14 +13,17 @@ case "$1" in -[Hh]) TYPE=HTTPS ; MATCH="git@" ; FORMULA="$GH_SSH/$GH_HTTPS" ;; -[Ss]) TYPE=SSH ; MATCH="https:" ; FORMULA="$GH_HTTPS/$GH_SSH" ;; *) - echo "usage: `basename $0` -h | -s" 1>&2 + echo "Usage: `basename $0` -h | -s" 1>&2 echo -e " \e[0;92m-h\e[0m to switch to HTTPS" 1>&2 echo -e " \e[0;92m-s\e[0m to switch to SSH" 1>&2 exit 1 ;; esac -REMOTES=$(git remote -v | egrep "\t$MATCH" | gawk '{print $1 " " $2}' | sort -u | sed "s/$FORMULA/") +which awk >/dev/null && AWK=awk +which gawk >/dev/null && AWK=gawk + +REMOTES=$(git remote -v | egrep "\t$MATCH" | "$AWK" '{print $1 " " $2}' | sort -u | sed "s/$FORMULA/") if [[ -z $REMOTES ]]; then echo "Nothing to do." ; exit @@ -29,5 +32,5 @@ fi echo "$REMOTES" | xargs -n2 git remote set-url echo -n "Remotes set to $TYPE: " -echo "$REMOTES" | gawk '{printf "%s ", $1}' +echo "$REMOTES" | "$AWK" '{printf "%s ", $1}' echo diff --git a/buildroot/share/git/mfclean b/buildroot/share/git/mfclean index f38997405bc8..b6ad2b5149ff 100755 --- a/buildroot/share/git/mfclean +++ b/buildroot/share/git/mfclean @@ -6,6 +6,9 @@ # Great way to clean up your branches after messing around a lot # +which awk >/dev/null && AWK=awk +which gawk >/dev/null && AWK=gawk + KEEP="RC|RCBugFix|dev|master|bugfix-1|bugfix-2" echo "Fetching latest upstream and origin..." @@ -18,7 +21,7 @@ git branch --merged | egrep -v "^\*|$KEEP" | xargs -n 1 git branch -d echo echo "Pruning Remotely-deleted Branches..." -git branch -vv | egrep -v "^\*|$KEEP" | grep ': gone]' | gawk '{print $1}' | xargs -n 1 git branch -D +git branch -vv | egrep -v "^\*|$KEEP" | grep ': gone]' | "$AWK" '{print $1}' | xargs -n 1 git branch -D echo # List fork branches that don't match local branches