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-March2
  • Loading branch information
classicrocker883 committed Nov 21, 2024
2 parents 9182086 + 3810986 commit 953d2ac
Show file tree
Hide file tree
Showing 21 changed files with 164 additions and 2,038 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-13"
//#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
40 changes: 37 additions & 3 deletions Marlin/src/gcode/calibrate/G34_M422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,28 @@ void GcodeSuite::G34() {
// Probe a Z height for each stepper.
// Probing sanity check is disabled, as it would trigger even in normal cases because
// current_position.z has been manually altered in the "dirty trick" above.
const float z_probed_height = probe.probe_at_point(DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), raise_after, 0, true, false, (Z_PROBE_LOW_POINT) - z_probe * 0.5f, z_probe * 0.5f);

if (DEBUGGING(LEVELING))
DEBUG_ECHOLNPGM(
"Z_PROBE_LOW_POINT: ", p_float_t(Z_PROBE_LOW_POINT, 2),
"z_probe: ", p_float_t(z_probe, 2),
"Probe Tgt: ", p_float_t((Z_PROBE_LOW_POINT) - z_probe * 0.5f, 2)
);

const float z_probed_height = probe.probe_at_point(
DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), // xy
raise_after, // raise_after
(DEBUGGING(LEVELING) || DEBUGGING(INFO)) ? 3 : 0, // verbose_level
true, false, // probe_relative, sanity_check
(Z_PROBE_LOW_POINT) - (z_probe * 0.5f), // z_min_point
Z_TWEEN_SAFE_CLEARANCE // z_clearance
);

if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM_P(PSTR("Probing X"), ppos.x, SP_Y_STR, ppos.y);
DEBUG_ECHOLNPGM("Height = ", z_probed_height);
}

if (isnan(z_probed_height)) {
SERIAL_ECHOLNPGM(STR_ERR_PROBING_FAILED);
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
Expand All @@ -236,7 +257,12 @@ void GcodeSuite::G34() {
// Adapt the next probe clearance height based on the new measurements.
// Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment.
z_maxdiff = z_measured_max - z_measured_min;
z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; //Not sure we need z_maxdiff, but leaving it in for safety.

// The intent of the line below seems to be to clamp the probe depth on successive iterations of G34, but in reality if the amplification
// factor is not completely accurate, this was causing probing to fail as the probe stopped fractions of a mm from the trigger point
// on the second iteration very reliably. This may be restored with an uncertainty factor at some point, however its usefulness after
// all probe points have seen a successful probe is questionable.
//z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; // Not sure we need z_maxdiff, but leaving it in for safety.

#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
// Replace the initial values in z_measured with calculated heights at
Expand Down Expand Up @@ -401,7 +427,15 @@ void GcodeSuite::G34() {
// Use the probed height from the last iteration to determine the Z height.
// z_measured_min is used, because all steppers are aligned to z_measured_min.
// Ideally, this would be equal to the 'z_probe * 0.5f' which was added earlier.
current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); //we shouldn't want to subtract the clearance from here right? (Depends if we added it further up)
if (DEBUGGING(LEVELING))
DEBUG_ECHOLNPGM(
"z_measured_min: ", p_float_t(z_measured_min, 2),
"Z_TWEEN_SAFE_CLEARANCE: ", p_float_t(Z_TWEEN_SAFE_CLEARANCE, 2),
"zoffs: ", p_float_t(zoffs, 2)
);

if (!err_break)
current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); // We shouldn't want to subtract the clearance from here right? (Depends if we added it further up)
sync_plan_position();
#endif

Expand Down
21 changes: 14 additions & 7 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
* M84 - Disable steppers until next move, or use S<seconds> to specify an idle
* duration after which steppers should turn off. S0 disables the timeout.
* M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
* M86 - Set / Report Hotend Idle Timeout. (Requires HOTEND_IDLE_TIMEOUT)
* M87 - Cancel Hotend Idle Timeout (by setting the timeout period to 0). (Requires HOTEND_IDLE_TIMEOUT)
* M92 - Set planner.settings.axis_steps_per_mm for one or more axes. (Requires EDITABLE_STEPS_PER_UNIT)
*
* M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
Expand Down Expand Up @@ -213,6 +215,8 @@
* M281 - Set servo min|max position: "M281 P<index> L<min> U<max>". (Requires EDITABLE_SERVO_ANGLES)
* M282 - Detach servo: "M282 P<index>". (Requires SERVO_DETACH_GCODE)
* M290 - Babystepping (Requires BABYSTEPPING)
* M293 - Babystep Z UP (Requires EP_BABYSTEPPING)
* M294 - Babystep Z DOWN (Requires EP_BABYSTEPPING)
* M300 - Play beep sound S<frequency Hz> P<duration ms>
* M301 - Set PID parameters P I and D. (Requires PIDTEMP)
* M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
Expand Down Expand Up @@ -246,6 +250,7 @@
* M430 - Read the system current, voltage, and power (Requires POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE, or POWER_MONITOR_FIXED_VOLTAGE)
* M485 - Send RS485 packets (Requires RS485_SERIAL_PORT)
* M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS)
* M493 - Get or set input FT Motion / Shaping parameters. (Requires FT_MOTION)
* M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
Expand All @@ -261,7 +266,7 @@
* M554 - Get or set IP gateway. (Requires enabled Ethernet port)
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
* M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION)
* M592 - Get or set Nonlinear Extrusion parameters. (Requires NONLINEAR_EXTRUSION)
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
Expand All @@ -274,15 +279,17 @@
* M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
* M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
*
* M704 - Preload to MMU (Requires PRUSA_MMU3)
* M705 - Eject filament (Requires PRUSA_MMU3)
* M706 - Cut filament (Requires PRUSA_MMU3)
* M707 - Read from MMU register (Requires PRUSA_MMU3)
* M708 - Write to MMU register (Requires PRUSA_MMU3)
* M709 - MMU power & reset (Requires PRUSA_MMU3)
*** PRUSA_MMU3 ***
* M704 - Preload to MMU
* M705 - Eject filament
* M706 - Cut filament
* M707 - Read from MMU register
* M708 - Write to MMU register
* M709 - MMU power & reset
*
* M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS)
* M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
* M820 - Report all defined M810-M819 G-code macros (Requires GCODE_MACROS)
* M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below)
* M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, plus SKEW_CORRECTION_FOR_Z for IJ)
*
Expand Down
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-13"
#define STRING_DISTRIBUTION_DATE "2024-11-21"
#endif

/**
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@
// Servos
//
#ifndef SERVO0_PIN
#define SERVO0_PIN PB0 // BLTouch OUT *
#define SERVO0_PIN PB1
#endif

//
// Limit Switches
//
#define X_STOP_PIN PA5
#define Y_STOP_PIN PA6
#define Z_STOP_PIN PB0 // BLTOUCH *
#define Z_STOP_PIN PB0

#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PB1 // BLTouch IN *
#define Z_MIN_PROBE_PIN PB2
#endif

//
// Filament Runout Sensor
//
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN PC15 // "Pulled-high" *
#define FIL_RUNOUT_PIN PA4 // "Pulled-high" *
#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"
Loading

0 comments on commit 953d2ac

Please sign in to comment.