Skip to content

Commit

Permalink
Merge remote-tracking branch 'MarlinFirmware/bugfix-2.1.x' into sanit…
Browse files Browse the repository at this point in the history
…ize_Z_CLEARANCE_FOR_HOMING
  • Loading branch information
DerAndere1 committed Sep 3, 2024
2 parents 4083827 + 8c15a09 commit 1380ae0
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 38 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-09-02"
//#define STRING_DISTRIBUTION_DATE "2024-09-03"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ bool wait_for_heatup = false;

// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE
bool wait_for_user; // = false;
bool wait_for_user; // = false

void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
UNUSED(no_sleep);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/filwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

FilamentWidthSensor filwidth;

bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF.
bool FilamentWidthSensor::enabled; // = false // (M405-M406) Filament Width Sensor ON/OFF.
uint32_t FilamentWidthSensor::accum; // = 0 // ADC accumulator
uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only
float FilamentWidthSensor::nominal_mm = DEFAULT_NOMINAL_FILAMENT_DIA, // (M104) Nominal filament width
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Joystick joystick;

void Joystick::inject_jog_moves() {
// Recursion barrier
static bool injecting_now; // = false;
static bool injecting_now; // = false
if (injecting_now) return;

#if ENABLED(NO_MOTION_BEFORE_HOMING)
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 @@ -350,7 +350,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 0: case 1: // G0: Fast Move, G1: Linear Move
G0_G1(TERN_(HAS_FAST_MOVES, parser.codenum == 0)); break;

#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
#if ENABLED(ARC_SUPPORT)
case 2: case 3: G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC
#endif

Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#include "../../module/planner.h"
#include "../../module/temperature.h"

#if ENABLED(DELTA)
#include "../../module/delta.h"
#elif ENABLED(SCARA)
#include "../../module/scara.h"
#endif

#if N_ARC_CORRECTION < 1
#undef N_ARC_CORRECTION
#define N_ARC_CORRECTION 1
Expand Down
20 changes: 14 additions & 6 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
*/
void GcodeSuite::G30() {

xy_pos_t old_pos = current_position,
probepos = current_position;
xy_pos_t probepos = current_position;

const bool seenX = parser.seenval('X');
if (seenX) probepos.x = RAW_X_POSITION(parser.value_linear_units());
Expand All @@ -62,21 +61,28 @@ void GcodeSuite::G30() {

if (probe.can_reach(probepos)) {

if (seenX) old_pos.x = probepos.x;
if (seenY) old_pos.y = probepos.y;

// Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));

// Disable feedrate scaling so movement speeds are correct
remember_feedrate_scaling_off();

// With VERBOSE_SINGLE_PROBE home only if needed
TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O")));

// Raise after based on the 'E' parameter
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;

// Use 'C' to set Probe Temperature Compensation ON/OFF (on by default)
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));

// Probe the bed, optionally raise, and return the measured height
const float measured_z = probe.probe_at_point(probepos, raise_after);

// After probing always re-enable Probe Temperature Compensation
TERN_(HAS_PTC, ptc.set_enabled(true));

// Report a good probe result to the host and LCD
if (!isnan(measured_z)) {
const xy_pos_t lpos = probepos.asLogical();
SString<30> msg(
Expand All @@ -88,9 +94,11 @@ void GcodeSuite::G30() {
TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg));
}

// Restore feedrate scaling
restore_feedrate_and_scaling();

do_blocking_move_to(old_pos);
// Move the nozzle to the position of the probe
do_blocking_move_to(probepos);

if (raise_after == PROBE_PT_STOW)
probe.move_z_after_probing();
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
* Babystepping
*/
#if ENABLED(BABYSTEPPING)
#if ENABLED(SCARA)
#if IS_SCARA
#error "BABYSTEPPING is not implemented for SCARA yet."
#elif ENABLED(BABYSTEP_XY) && ANY(MARKFORGED_XY, MARKFORGED_YX)
#error "BABYSTEPPING only implemented for Z axis on MarkForged."
Expand Down Expand Up @@ -4321,9 +4321,9 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y && SHAPING_FREQ_Y == SHAPING_FREQ_Z, "SHAPING_FREQ_X, SHAPING_FREQ_Y and SHAPING_FREQ_Z must be the same for DELTA.");
static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y && SHAPING_ZETA_Y == SHAPING_ZETA_Z, "SHAPING_ZETA_X, SHAPING_ZETA_Y and SHAPING_ZETA_Z must be the same for DELTA.");
#endif
#elif ENABLED(SCARA)
#elif IS_SCARA
#error "Input Shaping is not compatible with SCARA kinematics."
#elif ENABLED(TPARA)
#elif ENABLED(AXEL_TPARA)
#error "Input Shaping is not compatible with TPARA kinematics."
#elif ENABLED(POLAR)
#error "Input Shaping is not compatible with POLAR kinematics."
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 "2024-09-02"
#define STRING_DISTRIBUTION_DATE "2024-09-03"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ constexpr uint8_t DGUS_CMD_WRITEVAR = 0x82;
constexpr uint8_t DGUS_CMD_READVAR = 0x83;

#if ENABLED(DEBUG_DGUSLCD)
bool dguslcd_local_debug; // = false;
bool dguslcd_local_debug; // = false
#endif

void DGUSDisplay::initDisplay() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#endif

// Relative Mode. Enable with G91, disable with G90.
bool relative_mode; // = false;
bool relative_mode; // = false

/**
* Cartesian Current Position
Expand Down
13 changes: 9 additions & 4 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,15 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p
* with the previously active tool.
*
*/
float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/,
const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/,
const_float_t z_min_point/*=Z_PROBE_LOW_POINT*/, const_float_t z_clearance/*=Z_TWEEN_SAFE_CLEARANCE*/,
const bool raise_after_is_relative/*=false*/
float Probe::probe_at_point(
const_float_t rx, const_float_t ry,
const ProbePtRaise raise_after, // = PROBE_PT_NONE
const uint8_t verbose_level, // = 0
const bool probe_relative, // = true
const bool sanity_check, // = true
const_float_t z_min_point, // = Z_PROBE_LOW_POINT
const_float_t z_clearance, // = Z_TWEEN_SAFE_CLEARANCE
const bool raise_after_is_relative // = false
) {
DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));

Expand Down
30 changes: 21 additions & 9 deletions Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,27 @@ class Probe {

#endif // !IS_KINEMATIC

static float probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after=PROBE_PT_NONE,
const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true,
const_float_t z_min_point=Z_PROBE_LOW_POINT, const_float_t z_clearance=Z_TWEEN_SAFE_CLEARANCE,
const bool raise_after_is_relative=false);

static float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE,
const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true,
const_float_t z_min_point=Z_PROBE_LOW_POINT, float z_clearance=Z_TWEEN_SAFE_CLEARANCE,
const bool raise_after_is_relative=false
static float probe_at_point(
const_float_t rx,
const_float_t ry,
const ProbePtRaise raise_after = PROBE_PT_NONE,
const uint8_t verbose_level = 0,
const bool probe_relative = true,
const bool sanity_check = true,
const_float_t z_min_point = Z_PROBE_LOW_POINT,
const_float_t z_clearance = Z_TWEEN_SAFE_CLEARANCE,
const bool raise_after_is_rel = false
);

static float probe_at_point(
const xy_pos_t &pos,
const ProbePtRaise raise_after = PROBE_PT_NONE,
const uint8_t verbose_level = 0,
const bool probe_relative = true,
const bool sanity_check = true,
const_float_t z_min_point = Z_PROBE_LOW_POINT,
const_float_t z_clearance = Z_TWEEN_SAFE_CLEARANCE,
const bool raise_after_is_rel = false
) {
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check, z_min_point, z_clearance, raise_after_is_relative);
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
#endif

#if ANY(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)
bool Temperature::fans_paused; // = false;
bool Temperature::fans_paused; // = false
uint8_t Temperature::saved_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, FAN_OFF_PWM);
#endif

Expand Down Expand Up @@ -1954,7 +1954,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T
#endif

#if ANY(CHAMBER_FAN, CHAMBER_VENT) || DISABLED(PIDTEMPCHAMBER)
static bool flag_chamber_excess_heat; // = false;
static bool flag_chamber_excess_heat; // = false
#endif

#if ANY(CHAMBER_FAN, CHAMBER_VENT)
Expand Down

0 comments on commit 1380ae0

Please sign in to comment.