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
  • Loading branch information
fnsign committed Sep 2, 2024
2 parents 1a85a50 + f234fbf commit 30a0500
Show file tree
Hide file tree
Showing 62 changed files with 3,454 additions and 4,506 deletions.
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,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 @@ -2593,7 +2593,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-29"
//#define STRING_DISTRIBUTION_DATE "2024-09-02"

/**
* 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
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/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
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_axes.h
* Conditionals-1-axes.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-1-axes.h"
//========================================================

/**
* Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_LCD.h
* Conditionals-2-LCD.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "Conditionals-1-axes.h"
//========================================================

// Support for SD Card and other file storage
#if ENABLED(SDSUPPORT)
#define HAS_MEDIA 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_etc.h
* Conditionals-3-etc.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "Conditionals-2-LCD.h"
//========================================================

#ifndef STRING_CONFIG_H_AUTHOR
#define STRING_CONFIG_H_AUTHOR "(anonymous)"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_adv.h
* Conditionals-4-adv.h
* Conditionals set before pins.h and which depend on Configuration_adv.h.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-4-adv.h"
//========================================================

#if ENABLED(MARLIN_SMALL_BUILD)
#undef EEPROM_CHITCHAT
#undef CAPABILITIES_REPORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_post.h
* Conditionals-5-post.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-5-post.h"
//========================================================

#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
Expand All @@ -50,7 +56,7 @@
// Determine which type of 'EEPROM' is in use
#if ENABLED(EEPROM_SETTINGS)
// EEPROM type may be defined by compile flags, configs, HALs, or pins
// Set additional flags to let HALs choose in their Conditionals_post.h
// Set additional flags to let HALs choose in their Conditionals-5-post.h
#if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM)
#define USE_EMULATED_EEPROM 1
#elif ANY(I2C_EEPROM, SPI_EEPROM)
Expand Down Expand Up @@ -3513,6 +3519,8 @@
#define LCD_WIDTH 21
#elif IS_DWIN_MARLINUI
// Defined by header
#elif HAS_GRAPHICAL_TFT
#define LCD_WIDTH ((TFT_WIDTH) / 16)
#else
#define LCD_WIDTH TERN(IS_ULTIPANEL, 20, 16)
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
#pragma once

/**
* Conditionals_type.h
* Conditionals-6-type.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
* Define conditionals in this file if they depend on core/types.h.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-6-type.h"
//========================================================

#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
Expand Down
23 changes: 2 additions & 21 deletions Marlin/src/inc/MarlinConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,11 @@
// Prefix header for all Marlin sources
//

#include "MarlinConfigPre.h"

#ifdef __MARLIN_DEPS__
#include "../HAL/shared/fauxpins.h"
#else
#include "../HAL/HAL.h"
#endif

#include "../pins/pins.h"
#include "MarlinConfigPre-6-type.h" // Include even with __MARLIN_DEPS__

#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., timers.h)
#include HAL_PATH(.., spi_pins.h)
#endif

#include "Conditionals_post.h"

#ifndef __MARLIN_DEPS__

#include HAL_PATH(.., inc/Conditionals_post.h)

#include "../core/types.h" // Ahead of sanity-checks

#include "Conditionals_type.h"
#include "Conditionals-6-type.h"
#include HAL_PATH(.., inc/Conditionals_type.h)

#include "Changes.h"
Expand Down
53 changes: 53 additions & 0 deletions Marlin/src/inc/MarlinConfigPre-1-axes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef __MARLIN_FIRMWARE__
#define __MARLIN_FIRMWARE__
#endif

#if __has_include("../../Config.h")
#include "../../Config.h"
#else
#define USE_STD_CONFIGS 1
#endif

#include <stdint.h>

#ifndef __MARLIN_DEPS__
#include "../HAL/platforms.h"
#endif

#include "../core/macros.h"
#include "../core/boards.h"

#if USE_STD_CONFIGS
#include "../../Configuration.h"
#endif

#ifdef CUSTOM_VERSION_FILE
#if __has_include(STRINGIFY(../../CUSTOM_VERSION_FILE))
#include STRINGIFY(../../CUSTOM_VERSION_FILE)
#endif
#endif

#include "Version.h"
34 changes: 34 additions & 0 deletions Marlin/src/inc/MarlinConfigPre-4-adv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "Conditionals-3-etc.h"

#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., inc/Conditionals_LCD.h)
#endif

#include "../core/drivers.h"

#if USE_STD_CONFIGS
#include "../../Configuration_adv.h"
#endif
37 changes: 37 additions & 0 deletions Marlin/src/inc/MarlinConfigPre-5-post.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "MarlinConfigPre.h"

#ifdef __MARLIN_DEPS__
#include "../HAL/shared/fauxpins.h"
#else
#include "../HAL/HAL.h"
#endif

#include "../pins/pins.h"

#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., timers.h)
#include HAL_PATH(.., spi_pins.h)
#endif
Loading

0 comments on commit 30a0500

Please sign in to comment.