Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin
Browse files Browse the repository at this point in the history
… into bugfix-2.1.x-November1
  • Loading branch information
classicrocker883 committed Nov 21, 2024
2 parents fbb0695 + 3810986 commit f5a25fd
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 2,022 deletions.
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-11-15"
//#define STRING_DISTRIBUTION_DATE "2024-11-21"

/**
* The protocol for communication to the host. Protocol indicates communication
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
uint32_t *p1 = (uint32_t*)addrflash;
uint32_t *p2 = (uint32_t*)data;
int count = 0;
for (i =0; i<PageSize >> 2; i++) {
for (i = 0; i < PageSize >> 2; i++) {
if (p1[i] != p2[i]) {
uint32_t delta = p1[i] ^ p2[i];
while (delta) {
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/RP2040/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ uint8_t get_pin_mode(const pin_t Ard_num) {

}

bool GET_PINMODE(const pin_t Ard_num) {
bool getValidPinMode(const pin_t Ard_num) {
const uint8_t pin_mode = get_pin_mode(Ard_num);
return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM
}
Expand All @@ -122,7 +122,7 @@ int8_t digital_pin_to_analog_pin(pin_t Ard_num) {
return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1;
}

bool IS_ANALOG(const pin_t Ard_num) {
bool isAnalogPin(const pin_t Ard_num) {
return digital_pin_to_analog_pin(Ard_num) != -1;
}

Expand All @@ -131,7 +131,7 @@ bool is_digital(const pin_t x) {
return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT;
}

void print_port(const pin_t Ard_num) {
void printPinPort(const pin_t Ard_num) {
SERIAL_ECHOPGM("Pin: ");
SERIAL_ECHO(Ard_num);
}
Expand All @@ -140,7 +140,7 @@ bool pwm_status(const pin_t Ard_num) {
return get_pin_mode(Ard_num) == MODE_PIN_ALT;
}

void pwm_details(const pin_t Ard_num) {
void printPinPWM(const pin_t Ard_num) {
if (PWM_PIN(Ard_num)) {
}
}
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/G35.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* 41 - Counter-Clockwise M4
* 50 - Clockwise M5
* 51 - Counter-Clockwise M5
**/
*/
void GcodeSuite::G35() {

DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING));
Expand Down
56 changes: 28 additions & 28 deletions Marlin/src/gcode/bedlevel/G42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,40 @@
* P : Flag to put the probe at the given point
*/
void GcodeSuite::G42() {
if (MOTION_CONDITIONS) {
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;
const bool hasJ = parser.seenval('J');
const int8_t iy = hasJ ? parser.value_int() : 0;
if (!MOTION_CONDITIONS) return;

if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
SERIAL_ECHOLNPGM(STR_ERR_MESH_XY);
return;
}
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;
const bool hasJ = parser.seenval('J');
const int8_t iy = hasJ ? parser.value_int() : 0;

// Move to current_position, as modified by I, J, P parameters
destination = current_position;
if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
SERIAL_ECHOLNPGM(STR_ERR_MESH_XY);
return;
}

if (hasI) destination.x = bedlevel.get_mesh_x(ix);
if (hasJ) destination.y = bedlevel.get_mesh_y(iy);
// Move to current_position, as modified by I, J, P parameters
destination = current_position;

#if HAS_PROBE_XY_OFFSET
if (parser.seen_test('P')) {
if (hasI) destination.x -= probe.offset_xy.x;
if (hasJ) destination.y -= probe.offset_xy.y;
}
#endif
if (hasI) destination.x = bedlevel.get_mesh_x(ix);
if (hasJ) destination.y = bedlevel.get_mesh_y(iy);

const feedRate_t fval = parser.linearval('F'),
fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
#if HAS_PROBE_XY_OFFSET
if (parser.seen_test('P')) {
if (hasI) destination.x -= probe.offset_xy.x;
if (hasJ) destination.y -= probe.offset_xy.y;
}
#endif

// SCARA kinematic has "safe" XY raw moves
#if IS_SCARA
prepare_internal_fast_move_to_destination(fr_mm_s);
#else
prepare_internal_move_to_destination(fr_mm_s);
#endif
}
const feedRate_t fval = parser.linearval('F'),
fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);

// SCARA kinematic has "safe" XY raw moves
#if IS_SCARA
prepare_internal_fast_move_to_destination(fr_mm_s);
#else
prepare_internal_move_to_destination(fr_mm_s);
#endif
}

#endif // HAS_MESH
2 changes: 1 addition & 1 deletion Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void GcodeSuite::M115() {
SERIAL_ECHO(F("CEDE2A2F-"));
for (uint8_t i = 1; i <= 6; i++) {
print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
if (i <= 3) SERIAL_ECHO(C('-'));
if (i <= 3) SERIAL_CHAR('-');
}
#endif
#endif
Expand Down
29 changes: 14 additions & 15 deletions Marlin/src/gcode/motion/G5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,24 @@
* G5: Cubic B-spline
*/
void GcodeSuite::G5() {
if (MOTION_CONDITIONS) {
if (!MOTION_CONDITIONS) return;

#if ENABLED(CNC_WORKSPACE_PLANES)
if (workspace_plane != PLANE_XY) {
SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
return;
}
#endif
#if ENABLED(CNC_WORKSPACE_PLANES)
if (workspace_plane != PLANE_XY) {
SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
return;
}
#endif

get_destination_from_command();
get_destination_from_command();

const xy_pos_t offsets[2] = {
{ parser.linearval('I'), parser.linearval('J') },
{ parser.linearval('P'), parser.linearval('Q') }
};
const xy_pos_t offsets[2] = {
{ parser.linearval('I'), parser.linearval('J') },
{ parser.linearval('P'), parser.linearval('Q') }
};

cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
current_position = destination;
}
cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
current_position = destination;
}

#endif // BEZIER_CURVE_SUPPORT
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 "2024-11-15"
#define STRING_DISTRIBUTION_DATE "2024-11-21"
#endif

/**
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/mega/pins_MINITRONICS.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
//
// Limit Switches
//
#define X_MIN_PIN 5
#define Y_MIN_PIN 2
#define Z_MIN_PIN 6
#define X_STOP_PIN 5
#define Y_STOP_PIN 2
#define Z_STOP_PIN 6

//
// Steppers
Expand Down
12 changes: 9 additions & 3 deletions buildroot/bin/build_all_examples
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ fi
echo -e "=====================\nProceed with builds...\n====================="
shopt -s nullglob

export PAUSE=1

# Get a list of all folders that contain a file matching "Configuration*.h"
find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d '' CONF; do
find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d $'\0' CONF; do

# Remove the file name and slash from the end of the path
CONF=${CONF%/*}
Expand Down Expand Up @@ -198,10 +200,14 @@ find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Conf
fi

echo
((--LIMIT)) || { echo "Specified limit reached" ; PAUSE=1 ; break ; }
((--LIMIT)) || { echo "Specified limit reached" ; break ; }
echo

export PAUSE=0

done

echo "Exiting"

# Delete the build state if not paused early
[[ $PAUSE ]] || rm -f "$STAT_FILE"
((PAUSE)) || rm -f "$STAT_FILE"
80 changes: 45 additions & 35 deletions buildroot/bin/build_example
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PATH="$HERE:$PATH"
. mfutil

annc() { echo -e "\033[0;32m$1\033[0m" ; }
alrt() { echo -e "\033[0;31m$1\033[0m" ; }

# Get arguments
BUILD=./.pio/build
Expand Down Expand Up @@ -153,8 +154,7 @@ ENAME=("-name" "marlin_config.json" \
"-o" "-name" "schema.yml")

# Possible built firmware names (in the build folder)
BNAME=("-type" "f" \
"-name" 'firmware*.hex' \
BNAME=("-name" 'firmware*.hex' \
"-o" "-name" "firmware*.bin" \
"-o" "-name" "project*.bin" \
"-o" "-name" "Robin*.bin" \
Expand All @@ -176,44 +176,54 @@ set +e
echo "Building example $CONFIG ..."
mftest -s -a -n1 ; ERR=$?

((ERR)) && echo "Failed" || echo "Success"
((ERR)) && alrt "Failed ($ERR)" || annc "Success"

set -e

# Copy exports back to the configs
if [[ -n $EXPNUM ]]; then
annc "Exporting $EXPNUM"
[[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
find "$BUILD" "${ENAME[@]}" -exec cp "{}" "$ARCSUB" \;
fi
if [[ $ERR -gt 0 ]]; then

# Copy potential firmware files into the config folder
# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
if ((ARCHIVE)); then
annc "Archiving"
rm -f "$ARCSUB"/*.bin.tar.gz "$ARCSUB"/*.hex.tar.gz
find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c '
ARCSUB="$1"
CONFIG="$2"
shift 2
for FILE in "$@"; do
cd "${FILE%/*}"
BASE=${FILE##*/}
SHRT=${BASE%.*}
SHASUM=$(sha256sum "$BASE" | cut -d" " -f1)
tar -czf "$ARCSUB/$SHRT.tar.gz" "$BASE"
echo "$CONFIG\n$SHASUM" > "$ARCSUB/$BASE.sha256.txt"
rm "$BASE"
cd - >/dev/null
done
' sh "$ARCSUB" "$CONFIG" {} +
fi
# Error? For --nofail simply log. Otherwise return the error.
if [[ -n $NOFAIL ]]; then
date +"%F %T [FAIL] $CONFIG" >>./.pio/error-log.txt
else
exit $ERR
fi

# Exit with error unless --nofail is set
[[ $ERR -gt 0 && -z $NOFAIL ]] && exit $ERR
else

# Reveal the configs after the build, if requested
((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; }
# Copy exports back to the configs
if [[ -n $EXPNUM ]]; then
annc "Exporting $EXPNUM"
[[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
find "$BUILD" \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \;
fi

# Copy potential firmware files into the config folder
# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
if ((ARCHIVE)); then
annc "Archiving"
rm -f "$ARCSUB"/*.tar.gz "$ARCSUB"/*.sha256.txt
find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c '
ARCSUB="$1"
CONFIG="$2"
shift 2
for FILE in "$@"; do
cd "${FILE%/*}"
NAME=${FILE##*/}
SHRT=${NAME%.*}
SHASUM=$(sha256sum "$NAME" | cut -d" " -f1)
tar -czf "$ARCSUB/$SHRT.tar.gz" "$NAME"
echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt"
rm "$NAME"
cd - >/dev/null
done
' sh "$ARCSUB" "$CONFIG" {} +
fi

# Reveal the configs after the build, if requested
((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; }

fi

exit 0
40 changes: 0 additions & 40 deletions buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt

This file was deleted.

Loading

0 comments on commit f5a25fd

Please sign in to comment.