Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into X5SA-2E-Bug…
Browse files Browse the repository at this point in the history
…fix-2.0.x
  • Loading branch information
effgarces committed Aug 10, 2020
2 parents ae3df4e + 911cdd4 commit 32f694b
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 30 deletions.
16 changes: 15 additions & 1 deletion Marlin/src/gcode/config/M575.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@
* B<baudrate> - 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: {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
22 changes: 18 additions & 4 deletions Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/dogm/status_screen_lite_ST7920.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 10 additions & 7 deletions buildroot/bin/use_example_configs
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion buildroot/share/fonts/uxggenpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
9 changes: 6 additions & 3 deletions buildroot/share/git/ghtp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 4 additions & 1 deletion buildroot/share/git/mfclean
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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
Expand Down

0 comments on commit 32f694b

Please sign in to comment.