Skip to content

Commit d403352

Browse files
committed
♻️ SDSUPPORT => HAS_MEDIA
1 parent 2e4b037 commit d403352

File tree

161 files changed

+385
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+385
-380
lines changed

Marlin/src/HAL/AVR/HAL.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ void MarlinHAL::reboot() {
145145
// Free Memory Accessor
146146
// ------------------------
147147

148-
#if ENABLED(SDSUPPORT)
148+
#if HAS_MEDIA
149149

150150
#include "../../sd/SdFatUtil.h"
151151
int freeMemory() { return SdFatUtil::FreeRam(); }
152152

153-
#else // !SDSUPPORT
153+
#else // !HAS_MEDIA
154154

155155
extern "C" {
156156
extern char __bss_end;
@@ -167,6 +167,6 @@ void MarlinHAL::reboot() {
167167
}
168168
}
169169

170-
#endif // !SDSUPPORT
170+
#endif // !HAS_MEDIA
171171

172172
#endif // __AVR__

Marlin/src/HAL/DUE/HAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ uint16_t MarlinHAL::adc_result;
4545
#endif
4646

4747
void MarlinHAL::init() {
48-
#if ENABLED(SDSUPPORT)
48+
#if HAS_MEDIA
4949
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
5050
#endif
5151
usb_task_init(); // Initialize the USB stack

Marlin/src/HAL/DUE/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
*/
7171
#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == SD_MOSI_PIN || TMC_SW_##P == SD_MISO_PIN || TMC_SW_##P == SD_SCK_PIN))
7272

73-
#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
73+
#if HAS_MEDIA && HAS_DRIVER(TMC2130)
7474
#if ENABLED(TMC_USE_SW_SPI)
7575
#if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
7676
#error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."

Marlin/src/HAL/DUE/usb/conf_usb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
#define USB_DEVICE_SPECIFIC_REQUEST() usb_task_other_requests()
102102
//@}
103103

104-
#if ENABLED(SDSUPPORT)
104+
#if HAS_MEDIA
105105
/**
106106
* USB Device low level configuration
107107
* When only one interface is used, these configurations are defined by the class module.
@@ -185,7 +185,7 @@
185185
//! Enable id string of interface to add an extra USB string
186186
#define UDI_CDC_IAD_STRING_ID 4
187187

188-
#if ENABLED(SDSUPPORT)
188+
#if HAS_MEDIA
189189
/**
190190
* USB CDC low level configuration
191191
* In standalone these configurations are defined by the CDC module.

Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "../../../inc/MarlinConfig.h"
88

9-
#if ENABLED(SDSUPPORT)
9+
#if HAS_MEDIA
1010

1111
#include "../../../sd/cardreader.h"
1212
extern "C" {
@@ -138,5 +138,5 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
138138

139139
#endif // ACCESS_USB == true
140140

141-
#endif // SDSUPPORT
141+
#endif // HAS_MEDIA
142142
#endif // ARDUINO_ARCH_SAM

Marlin/src/HAL/DUE/usb/udi_cdc_desc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include "udc_desc.h"
5252
#include "udi_cdc.h"
5353

54-
#if DISABLED(SDSUPPORT)
54+
#if !HAS_MEDIA
5555

5656
/**
5757
* \defgroup udi_cdc_group_single_desc USB device descriptors for a single interface
@@ -256,6 +256,6 @@ UDC_DESC_STORAGE udc_config_t udc_config = {
256256
//@}
257257
//@}
258258

259-
#endif // SDSUPPORT
259+
#endif // HAS_MEDIA
260260

261261
#endif // ARDUINO_ARCH_SAM

Marlin/src/HAL/DUE/usb/udi_composite_desc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include "udd.h"
5151
#include "udc_desc.h"
5252

53-
#if ENABLED(SDSUPPORT)
53+
#if HAS_MEDIA
5454

5555
/**
5656
* \defgroup udi_group_desc Descriptors for a USB Device
@@ -189,4 +189,4 @@ UDC_DESC_STORAGE udc_config_t udc_config = {
189189

190190
#endif // ARDUINO_ARCH_SAM
191191

192-
#endif // SDSUPPORT
192+
#endif // HAS_MEDIA

Marlin/src/HAL/DUE/usb/udi_msc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#include "ctrl_access.h"
5858
#include <string.h>
5959

60-
#if ENABLED(SDSUPPORT)
60+
#if HAS_MEDIA
6161

6262
#ifndef UDI_MSC_NOTIFY_TRANS_EXT
6363
# define UDI_MSC_NOTIFY_TRANS_EXT()
@@ -1127,6 +1127,6 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
11271127

11281128
//@}
11291129

1130-
#endif // SDSUPPORT
1130+
#endif // HAS_MEDIA
11311131

11321132
#endif // ARDUINO_ARCH_SAM

Marlin/src/HAL/DUE/usb/usb_task.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
#include "conf_usb.h"
5252
#include "udc.h"
5353

54-
#if ENABLED(SDSUPPORT)
54+
#if HAS_MEDIA
5555
static volatile bool main_b_msc_enable = false;
5656
#endif
5757
static volatile bool main_b_cdc_enable = false;
5858
static volatile bool main_b_dtr_active = false;
5959

6060
void usb_task_idle(void) {
61-
#if ENABLED(SDSUPPORT)
61+
#if HAS_MEDIA
6262
// Attend SD card access from the USB MSD -- Prioritize access to improve speed
6363
int delay = 2;
6464
while (main_b_msc_enable && --delay > 0) {
@@ -70,7 +70,7 @@ void usb_task_idle(void) {
7070
#endif
7171
}
7272

73-
#if ENABLED(SDSUPPORT)
73+
#if HAS_MEDIA
7474
bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); }
7575
void usb_task_msc_disable(void) { main_b_msc_enable = false; }
7676
bool usb_task_msc_isenabled(void) { return main_b_msc_enable; }
@@ -206,13 +206,13 @@ static USB_MicrosoftExtendedPropertiesDescriptor microsoft_extended_properties_d
206206
bool usb_task_extra_string(void) {
207207
static uint8_t udi_msft_magic[] = "MSFT100\xEE";
208208
static uint8_t udi_cdc_name[] = "CDC interface";
209-
#if ENABLED(SDSUPPORT)
209+
#if HAS_MEDIA
210210
static uint8_t udi_msc_name[] = "MSC interface";
211211
#endif
212212

213213
struct extra_strings_desc_t {
214214
usb_str_desc_t header;
215-
#if ENABLED(SDSUPPORT)
215+
#if HAS_MEDIA
216216
le16_t string[Max(Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msc_name) - 1), sizeof(udi_msft_magic) - 1)];
217217
#else
218218
le16_t string[Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msft_magic) - 1)];
@@ -231,7 +231,7 @@ bool usb_task_extra_string(void) {
231231
str_lgt = sizeof(udi_cdc_name) - 1;
232232
str = udi_cdc_name;
233233
break;
234-
#if ENABLED(SDSUPPORT)
234+
#if HAS_MEDIA
235235
case UDI_MSC_STRING_ID:
236236
str_lgt = sizeof(udi_msc_name) - 1;
237237
str = udi_msc_name;

Marlin/src/HAL/ESP32/HAL_SPI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static SPISettings spiConfig;
5353
// ------------------------
5454

5555
void spiBegin() {
56-
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS)
56+
#if HAS_MEDIA && PIN_EXISTS(SD_SS)
5757
OUT_WRITE(SD_SS_PIN, HIGH);
5858
#endif
5959
}

Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "HAL.h"
3333
#include "SPI.h"
3434

35-
#if ENABLED(SDSUPPORT)
35+
#if HAS_MEDIA
3636
#include "../../sd/cardreader.h"
3737
#if ENABLED(ESP3D_WIFISUPPORT)
3838
#include "sd_ESP32.h"

Marlin/src/HAL/LINUX/spi_pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "../../core/macros.h"
2525
#include "../../inc/MarlinConfigPre.h"
2626

27-
#if ALL(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
27+
#if ALL(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
2828
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
2929
// needed due to the speed and mode required for communicating with each device being different.
3030
// This requirement can be removed if the SPI access to these devices is updated to use

Marlin/src/HAL/LPC1768/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
201201
#if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1)
202202
#define PIN_IS_SDA0(P) (P##_PIN == P0_27)
203203
#define IS_SCL0(P) (P == P0_28)
204-
#if ENABLED(SDSUPPORT) && PIN_IS_SDA0(SD_DETECT)
204+
#if HAS_MEDIA && PIN_IS_SDA0(SD_DETECT)
205205
#error "SDA0 overlaps with SD_DETECT_PIN!"
206206
#elif PIN_IS_SDA0(E0_AUTO_FAN)
207207
#error "SDA0 overlaps with E0_AUTO_FAN_PIN!"

Marlin/src/HAL/LPC1768/spi_pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "../../core/macros.h"
2525

26-
#if ALL(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
26+
#if ALL(HAS_MEDIA, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
2727
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
2828
// needed due to the speed and mode required for communicating with each device being different.
2929
// This requirement can be removed if the SPI access to these devices is updated to use

Marlin/src/HAL/NATIVE_SIM/spi_pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "../../core/macros.h"
2525
#include "../../inc/MarlinConfigPre.h"
2626

27-
#if ALL(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
27+
#if ALL(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
2828
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
2929
// needed due to the speed and mode required for communicating with each device being different.
3030
// This requirement can be removed if the SPI access to these devices is updated to use

Marlin/src/HAL/SAMD21/HAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void MarlinHAL::dma_init() {}
105105
// HAL initialization task
106106
void MarlinHAL::init() {
107107
TERN_(DMA_IS_REQUIRED, dma_init());
108-
#if ENABLED(SDSUPPORT)
108+
#if HAS_MEDIA
109109
#if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD)
110110
SET_INPUT_PULLUP(SD_DETECT_PIN);
111111
#endif

Marlin/src/HAL/SAMD51/HAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ void MarlinHAL::dma_init() {
602602
// HAL initialization task
603603
void MarlinHAL::init() {
604604
TERN_(DMA_IS_REQUIRED, dma_init());
605-
#if ENABLED(SDSUPPORT)
605+
#if HAS_MEDIA
606606
#if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD)
607607
SET_INPUT_PULLUP(SD_DETECT_PIN);
608608
#endif

Marlin/src/HAL/STM32/HAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void MarlinHAL::init() {
7070
constexpr int cpuFreq = F_CPU;
7171
UNUSED(cpuFreq);
7272

73-
#if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1)
73+
#if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1)
7474
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
7575
#endif
7676

Marlin/src/HAL/STM32/inc/Conditionals_adv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
#pragma once
2323

24-
#if ALL(SDSUPPORT, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
24+
#if ALL(HAS_MEDIA, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
2525
#define HAS_SD_HOST_DRIVE 1
2626
#endif
2727

Marlin/src/HAL/STM32/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//#endif
3030

3131

32-
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
32+
#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA
3333
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
3434
#if USE_FALLBACK_EEPROM
3535
#warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."

Marlin/src/HAL/STM32F1/inc/Conditionals_post.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
#endif
3030

3131
// Allow SDSUPPORT to be disabled
32-
#if DISABLED(SDSUPPORT)
32+
#if !HAS_MEDIA
3333
#undef SDIO_SUPPORT
3434
#endif

Marlin/src/HAL/STM32F1/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* Test STM32F1-specific configuration values for errors at compile-time.
2626
*/
2727

28-
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
28+
#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA
2929
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
3030
#if USE_FALLBACK_EEPROM
3131
#warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."

Marlin/src/MarlinCore.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
#include "feature/spindle_laser.h"
158158
#endif
159159

160-
#if ENABLED(SDSUPPORT)
160+
#if HAS_MEDIA
161161
CardReader card;
162162
#endif
163163

@@ -358,7 +358,7 @@ void startOrResumeJob() {
358358
print_job_timer.start();
359359
}
360360

361-
#if ENABLED(SDSUPPORT)
361+
#if HAS_MEDIA
362362

363363
inline void abortSDPrinting() {
364364
IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel());
@@ -392,7 +392,7 @@ void startOrResumeJob() {
392392
}
393393
}
394394

395-
#endif // SDSUPPORT
395+
#endif // HAS_MEDIA
396396

397397
/**
398398
* Minimal management of Marlin's core activities:
@@ -829,7 +829,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
829829
#endif
830830

831831
// Handle SD Card insert / remove
832-
TERN_(SDSUPPORT, card.manage_media());
832+
TERN_(HAS_MEDIA, card.manage_media());
833833

834834
// Handle USB Flash Drive insert / remove
835835
TERN_(USB_FLASH_DRIVE_SUPPORT, card.diskIODriver()->idle());
@@ -1331,7 +1331,7 @@ void setup() {
13311331
#endif
13321332
#endif
13331333

1334-
#if ALL(SDSUPPORT, SDCARD_EEPROM_EMULATION)
1334+
#if ALL(HAS_MEDIA, SDCARD_EEPROM_EMULATION)
13351335
SETUP_RUN(card.mount()); // Mount media with settings before first_load
13361336
#endif
13371337

@@ -1615,7 +1615,7 @@ void setup() {
16151615
#endif
16161616

16171617
#if HAS_TFT_LVGL_UI
1618-
#if ENABLED(SDSUPPORT)
1618+
#if HAS_MEDIA
16191619
if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
16201620
#endif
16211621
SETUP_RUN(tft_lvgl_init());
@@ -1673,7 +1673,7 @@ void loop() {
16731673
do {
16741674
idle();
16751675

1676-
#if ENABLED(SDSUPPORT)
1676+
#if HAS_MEDIA
16771677
if (card.flag.abort_sd_printing) abortSDPrinting();
16781678
if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
16791679
#endif

Marlin/src/feature/binary_stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class BinaryStream {
281281
uint8_t data = 0;
282282
millis_t transfer_window = millis() + RX_TIMESLICE;
283283

284-
#if ENABLED(SDSUPPORT)
284+
#if HAS_MEDIA
285285
PORT_REDIRECT(SERIAL_PORTMASK(card.transfer_port_index));
286286
#endif
287287

Marlin/src/feature/e_parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// Static data members
3434
bool EmergencyParser::killed_by_M112, // = false
3535
EmergencyParser::quickstop_by_M410,
36-
#if ENABLED(SDSUPPORT)
36+
#if HAS_MEDIA
3737
EmergencyParser::sd_abort_by_M524,
3838
#endif
3939
EmergencyParser::enabled;

0 commit comments

Comments
 (0)