Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' of github.com:MarlinFirmware/Marlin into …
Browse files Browse the repository at this point in the history
…leo_1S_S6_btt_mini
  • Loading branch information
JaxTheWolf committed Feb 17, 2024
2 parents 00e8642 + 9e879a5 commit e4d1276
Show file tree
Hide file tree
Showing 72 changed files with 334 additions and 184 deletions.
21 changes: 7 additions & 14 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,6 @@
// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)

#define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/

#elif ENABLED(MP_SCARA)

#define SCARA_OFFSET_THETA1 12 // degrees
Expand All @@ -1027,23 +1024,19 @@
#define DEFAULT_SEGMENTS_PER_SECOND 200

// Length of inner and outer support arms. Measure arm lengths precisely.
#define TPARA_LINKAGE_1 120 // (mm)
#define TPARA_LINKAGE_2 120 // (mm)
#define TPARA_LINKAGE_1 120 // (mm)
#define TPARA_LINKAGE_2 120 // (mm)

// SCARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
#define TPARA_OFFSET_X 0 // (mm)
#define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm)
// TPARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the TPARA space.
#define TPARA_OFFSET_X 0 // (mm)
#define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm)

#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly

// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)

// Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define THETA_HOMING_OFFSET 0
#define PSI_HOMING_OFFSET 0
#endif

// @section polar
Expand Down
3 changes: 3 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -4384,3 +4384,6 @@

// Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR.
//#define OPTIBOOT_RESET_REASON

// Shrink the build for smaller boards by sacrificing some serial feedback
//#define MARLIN_SMALL_BUILD
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-02-06"
//#define STRING_DISTRIBUTION_DATE "2024-02-11"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
20 changes: 19 additions & 1 deletion Marlin/src/HAL/HC32/endstop_interrupts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ void endstopIRQHandler() {
CHECK(X_MAX);
CHECK(X_MIN);

CHECK(X2_MAX);
CHECK(X2_MIN);

CHECK(Y_MAX);
CHECK(Y_MIN);

CHECK(Y2_MAX);
CHECK(Y2_MIN);

CHECK(Z_MAX);
CHECK(Z_MIN);

Expand All @@ -52,6 +58,9 @@ void endstopIRQHandler() {
CHECK(Z3_MAX);
CHECK(Z3_MIN);

CHECK(Z4_MAX);
CHECK(Z4_MIN);

CHECK(Z_MIN_PROBE);

// Update endstops
Expand All @@ -69,9 +78,15 @@ void setup_endstop_interrupts() {
SETUP(X_MAX);
SETUP(X_MIN);

SETUP(X2_MAX);
SETUP(X2_MIN);

SETUP(Y_MAX);
SETUP(Y_MIN);

SETUP(Y2_MAX);
SETUP(Y2_MIN);

SETUP(Z_MAX);
SETUP(Z_MIN);

Expand All @@ -81,14 +96,17 @@ void setup_endstop_interrupts() {
SETUP(Z3_MAX);
SETUP(Z3_MIN);

SETUP(Z4_MAX);
SETUP(Z4_MIN);

SETUP(Z_MIN_PROBE);

#undef SETUP
}

// Ensure 1 - 10 IRQs are registered
// Disable some endstops if you encounter this error
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_Y_MAX, USE_Y_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z_MIN_PROBE)
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_X2_MAX, USE_X2_MIN, USE_Y_MAX, USE_Y_MIN, USE_Y2_MAX, USE_Y2_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z4_MAX, USE_Z4_MIN, USE_Z_MIN_PROBE)
#if ENDSTOPS_INTERRUPTS_COUNT > 10
#error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts."
#elif ENDSTOPS_INTERRUPTS_COUNT == 0
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/HAL/STM32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
* Check for common serial pin conflicts
*/
#define _CHECK_SERIAL_PIN(N) (( \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \
BTN_EN1 == N || BTN_EN2 == N ||DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N || \
Y_STEP_PIN == N || Y_ENABLE_PIN == N || E0_ENABLE_PIN == N || POWER_LOSS_PIN == N \
))
#define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN)
#if SERIAL_IN_USE(1)
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/feature/fwretract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ void FWRetract::M207() {
}

void FWRetract::M207_report() {
TERN_(MARLIN_SMALL_BUILD, return);

SERIAL_ECHOLNPGM_P(
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
Expand All @@ -237,6 +239,8 @@ void FWRetract::M208() {
}

void FWRetract::M208_report() {
TERN_(MARLIN_SMALL_BUILD, return);

SERIAL_ECHOLNPGM(
" M208 S", LINEAR_UNIT(settings.retract_recover_extra)
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
Expand All @@ -258,6 +262,8 @@ void FWRetract::M208_report() {
}

void FWRetract::M209_report() {
TERN_(MARLIN_SMALL_BUILD, return);

SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled));
}

Expand Down
24 changes: 12 additions & 12 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ void GcodeSuite::G26() {

if (bedtemp) {
if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) {
SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."));
return;
}
g26.bed_temp = bedtemp;
Expand All @@ -543,7 +543,7 @@ void GcodeSuite::G26() {
if (parser.seenval('L')) {
g26.layer_height = parser.value_linear_units();
if (!WITHIN(g26.layer_height, 0.0, 2.0)) {
SERIAL_ECHOLNPGM("?Specified layer height not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified layer height not plausible."));
return;
}
}
Expand All @@ -552,20 +552,20 @@ void GcodeSuite::G26() {
if (parser.has_value()) {
g26.retraction_multiplier = parser.value_float();
if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) {
SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified Retraction Multiplier not plausible."));
return;
}
}
else {
SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Retraction Multiplier must be specified."));
return;
}
}

if (parser.seenval('S')) {
g26.nozzle = parser.value_float();
if (!WITHIN(g26.nozzle, 0.1, 2.0)) {
SERIAL_ECHOLNPGM("?Specified nozzle size not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle size not plausible."));
return;
}
}
Expand All @@ -575,15 +575,15 @@ void GcodeSuite::G26() {
#if HAS_MARLINUI_MENU
g26.prime_flag = -1;
#else
SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Prime length must be specified when not using an LCD."));
return;
#endif
}
else {
g26.prime_flag++;
g26.prime_length = parser.value_linear_units();
if (!WITHIN(g26.prime_length, 0.0, 25.0)) {
SERIAL_ECHOLNPGM("?Specified prime length not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified prime length not plausible."));
return;
}
}
Expand All @@ -592,7 +592,7 @@ void GcodeSuite::G26() {
if (parser.seenval('F')) {
g26.filament_diameter = parser.value_linear_units();
if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) {
SERIAL_ECHOLNPGM("?Specified filament size not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified filament size not plausible."));
return;
}
}
Expand All @@ -616,7 +616,7 @@ void GcodeSuite::G26() {
// If any preset or temperature was specified
if (noztemp) {
if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) {
SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle temperature not plausible."));
return;
}
g26.hotend_temp = noztemp;
Expand All @@ -637,20 +637,20 @@ void GcodeSuite::G26() {
if (parser.seen('R'))
g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
else {
SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat must be specified when not using an LCD."));
return;
}
#endif
if (g26_repeats < 1) {
SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat value not plausible; must be at least 1."));
return;
}

// Set a position with 'X' and/or 'Y'. Default: current_position
g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y);
if (!position_is_reachable(g26.xy_pos)) {
SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified X,Y coordinate out of bounds."));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/G35.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void GcodeSuite::G35() {

const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD);
if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) {
SERIAL_ECHOLNPGM("?(S)crew thread must be 30, 31, 40, 41, 50, or 51.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)crew thread must be 30, 31, 40, 41, 50, or 51."));
return;
}

Expand Down
9 changes: 5 additions & 4 deletions Marlin/src/gcode/bedlevel/M420.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ void GcodeSuite::M420() {
const int16_t a = settings.calc_num_meshes();

if (!a) {
SERIAL_ECHOLNPGM("?EEPROM storage not available.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return;
}

if (!WITHIN(storage_slot, 0, a - 1)) {
SERIAL_ECHOLNPGM("?Invalid storage slot.");
SERIAL_ECHOLNPGM("?Use 0 to ", a - 1);
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid storage slot. Use 0 to ", a - 1));
return;
}

Expand All @@ -120,7 +119,7 @@ void GcodeSuite::M420() {

#else

SERIAL_ECHOLNPGM("?EEPROM storage not available.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return;

#endif
Expand Down Expand Up @@ -245,6 +244,8 @@ void GcodeSuite::M420() {
}

void GcodeSuite::M420_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);

report_heading_etc(forReplay, F(
TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling"))
));
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ G29_TYPE GcodeSuite::G29() {

abl.verbose_level = parser.intval('V');
if (!WITHIN(abl.verbose_level, 0, 4)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4)."));
G29_RETURN(false, false);
}

Expand All @@ -365,11 +365,11 @@ G29_TYPE GcodeSuite::G29() {
if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int();

if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) {
SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ").");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."));
G29_RETURN(false, false);
}
if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) {
SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ").");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."));
G29_RETURN(false, false);
}

Expand Down Expand Up @@ -404,7 +404,7 @@ G29_TYPE GcodeSuite::G29() {
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
}
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (L,R,F,B) out of bounds."));
G29_RETURN(false, false);
}

Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void GcodeSuite::G33() {

const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
if (!WITHIN(probe_points, 0, 10)) {
SERIAL_ECHOLNPGM("?(P)oints implausible (0-10).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(P)oints implausible (0-10)."));
return;
}

Expand All @@ -409,19 +409,19 @@ void GcodeSuite::G33() {

const float calibration_precision = parser.floatval('C', 0.0f);
if (calibration_precision < 0) {
SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(C)alibration precision implausible (>=0)."));
return;
}

const int8_t force_iterations = parser.intval('F', 0);
if (!WITHIN(force_iterations, 0, 30)) {
SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(F)orce iteration implausible (0-30)."));
return;
}

const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 3)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3).");
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-3)."));
return;
}

Expand Down
Loading

0 comments on commit e4d1276

Please sign in to comment.