Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] bugfix-2.1.x from MarlinFirmware:bugfix-2.1.x #516

Merged
merged 17 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@

/**
* Minimum stepper driver pulse width (in ns)
* If undefined, these defaults (from Conditionals_adv.h) apply:
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
* 100 : Minimum for TMC2xxx stepper drivers
* 500 : Minimum for LV8729
* 1000 : Minimum for A4988 and A5984 stepper drivers
Expand All @@ -2574,7 +2574,7 @@

/**
* Maximum stepping rate (in Hz) the stepper driver allows
* If undefined, these defaults (from Conditionals_adv.h) apply:
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
* 5000000 : Maximum for TMC2xxx stepper drivers
* 1000000 : Maximum for LV8729 stepper driver
* 500000 : Maximum for A4988 stepper driver
Expand Down
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-08-31"
//#define STRING_DISTRIBUTION_DATE "2024-09-04"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
21 changes: 7 additions & 14 deletions Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ void sd_mmc_spi_mem_init() {
}

inline bool media_ready() {
return IS_SD_INSERTED() && !IS_SD_PRINTING() && !IS_SD_FILE_OPEN() && card.isMounted();
return DISABLED(DISABLE_DUE_SD_MMC)
&& IS_SD_MOUNTED() && IS_SD_INSERTED()
&& !IS_SD_FILE_OPEN() && !IS_SD_PRINTING();
}

bool sd_mmc_spi_unload(bool) { return true; }
Expand All @@ -29,17 +31,14 @@ bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() { return !media_ready(); }

Ctrl_status sd_mmc_spi_test_unit_ready() {
#ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT;
#endif
if (!media_ready()) return CTRL_NO_PRESENT;
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
return CTRL_GOOD;
}

// NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!media_ready()) return CTRL_NO_PRESENT;
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
*nb_sector = card.diskIODriver()->cardSize() - 1;
return CTRL_GOOD;
}
Expand All @@ -58,10 +57,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE];
// #define DEBUG_MMC

Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT;
#endif
if (!media_ready()) return CTRL_NO_PRESENT;
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;

#ifdef DEBUG_MMC
{
Expand Down Expand Up @@ -97,10 +93,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
}

Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT;
#endif
if (!media_ready()) return CTRL_NO_PRESENT;
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;

#ifdef DEBUG_MMC
{
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
10 changes: 3 additions & 7 deletions Marlin/src/feature/bltouch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ void BLTouch::init(const bool set_voltage/*=false*/) {
#else

#ifdef DEBUG_OUT
if (DEBUGGING(LEVELING)) {
PGMSTR(mode0, "OD");
PGMSTR(mode1, "5V");
DEBUG_ECHOPGM("BLTouch Mode: ");
DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
}
if (DEBUGGING(LEVELING))
DEBUG_ECHOLN( F("BLTouch Mode: "), bltouch.od_5v_mode ? F("5V") : F("OD"),
F(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")"));
#endif

const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE);
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/feature/pause/M125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void GcodeSuite::M125() {
park_point += hotend_offset[active_extruder];
#endif

const bool sd_printing = TERN0(HAS_MEDIA, IS_SD_PRINTING());
const bool sd_printing = IS_SD_PRINTING();

ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT);

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
Loading
Loading