From 5664c02d077e028f84a24efd96c2eebe97ce8763 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Apr 2023 22:43:09 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Generalize?= =?UTF-8?q?=20SDSUPPORT=20as=20HAS=5FMEDIA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for single- and multi-volume refactoring. --- Marlin/Configuration_adv.h | 14 +++---- Marlin/src/HAL/AVR/HAL.cpp | 6 +-- Marlin/src/HAL/DUE/HAL.cpp | 2 +- Marlin/src/HAL/DUE/inc/SanityCheck.h | 2 +- Marlin/src/HAL/DUE/usb/conf_usb.h | 4 +- Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp | 4 +- Marlin/src/HAL/DUE/usb/udi_cdc_desc.c | 4 +- Marlin/src/HAL/DUE/usb/udi_composite_desc.c | 4 +- Marlin/src/HAL/DUE/usb/udi_msc.c | 4 +- Marlin/src/HAL/DUE/usb/usb_task.c | 12 +++--- Marlin/src/HAL/ESP32/HAL_SPI.cpp | 2 +- Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp | 2 +- Marlin/src/HAL/LINUX/spi_pins.h | 2 +- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- Marlin/src/HAL/LPC1768/spi_pins.h | 2 +- Marlin/src/HAL/NATIVE_SIM/spi_pins.h | 2 +- Marlin/src/HAL/SAMD21/HAL.cpp | 2 +- Marlin/src/HAL/SAMD51/HAL.cpp | 2 +- Marlin/src/HAL/STM32/HAL.cpp | 2 +- Marlin/src/HAL/STM32/inc/Conditionals_adv.h | 2 +- Marlin/src/HAL/STM32/inc/SanityCheck.h | 2 +- .../src/HAL/STM32F1/inc/Conditionals_post.h | 4 +- Marlin/src/HAL/STM32F1/inc/SanityCheck.h | 2 +- Marlin/src/MarlinCore.cpp | 14 +++---- Marlin/src/feature/binary_stream.h | 2 +- Marlin/src/feature/e_parser.cpp | 2 +- Marlin/src/feature/e_parser.h | 10 ++--- Marlin/src/feature/host_actions.cpp | 2 +- Marlin/src/feature/leds/printer_event_leds.h | 4 +- Marlin/src/feature/pause.cpp | 6 +-- Marlin/src/feature/power_monitor.h | 2 +- Marlin/src/gcode/control/M993_M994.cpp | 4 +- Marlin/src/gcode/feature/pause/M125.cpp | 2 +- Marlin/src/gcode/gcode.cpp | 10 ++--- Marlin/src/gcode/gcode.h | 12 +++--- Marlin/src/gcode/gcode_d.cpp | 4 +- Marlin/src/gcode/host/M115.cpp | 6 +-- Marlin/src/gcode/host/M360.cpp | 2 +- Marlin/src/gcode/queue.cpp | 12 +++--- Marlin/src/gcode/queue.h | 2 +- Marlin/src/gcode/sd/M1001.cpp | 4 +- Marlin/src/gcode/sd/M20.cpp | 4 +- Marlin/src/gcode/sd/M21_M22.cpp | 4 +- Marlin/src/gcode/sd/M23.cpp | 4 +- Marlin/src/gcode/sd/M24_M25.cpp | 8 ++-- Marlin/src/gcode/sd/M26.cpp | 4 +- Marlin/src/gcode/sd/M27.cpp | 4 +- Marlin/src/gcode/sd/M28_M29.cpp | 4 +- Marlin/src/gcode/sd/M30.cpp | 4 +- Marlin/src/gcode/sd/M524.cpp | 4 +- Marlin/src/gcode/sd/M928.cpp | 4 +- Marlin/src/inc/Conditionals_LCD.h | 6 ++- Marlin/src/inc/Conditionals_adv.h | 10 ++--- Marlin/src/inc/Conditionals_post.h | 4 +- Marlin/src/inc/SanityCheck.h | 18 ++++----- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 14 +++---- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 10 ++--- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 6 +-- Marlin/src/lcd/dogm/marlinui_DOGM.h | 6 +-- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 10 ++--- .../lcd/dogm/status_screen_lite_ST7920.cpp | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 6 +-- .../lcd/e3v2/marlinui/ui_status_480x272.cpp | 2 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 40 +++++++++---------- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 6 +-- .../lcd/extui/dgus/DGUSScreenHandlerBase.h | 4 +- Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 6 +-- .../lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp | 4 +- .../extui/dgus/fysetc/DGUSScreenHandler.cpp | 4 +- .../lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp | 4 +- .../extui/dgus/hiprecy/DGUSScreenHandler.cpp | 4 +- .../src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp | 4 +- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 6 +-- .../lcd/extui/dgus/mks/DGUSScreenHandler.h | 2 +- .../lcd/extui/dgus/origin/DGUSDisplayDef.cpp | 4 +- .../extui/dgus/origin/DGUSScreenHandler.cpp | 4 +- .../lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 6 +-- .../lcd/extui/dgus_reloaded/DGUSRxHandler.h | 2 +- .../extui/dgus_reloaded/DGUSScreenHandler.cpp | 6 +-- .../extui/dgus_reloaded/DGUSScreenHandler.h | 4 +- .../extui/dgus_reloaded/DGUSSetupHandler.cpp | 2 +- .../extui/dgus_reloaded/DGUSSetupHandler.h | 2 +- .../lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 4 +- .../lcd/extui/dgus_reloaded/DGUSTxHandler.h | 2 +- .../definition/DGUS_ScreenAddrList.cpp | 4 +- .../definition/DGUS_ScreenSetup.cpp | 2 +- .../dgus_reloaded/definition/DGUS_VPList.cpp | 4 +- .../dgus_reloaded/dgus_reloaded_extui.cpp | 6 +-- .../archim2-flash/flash_storage.cpp | 4 +- .../archim2-flash/media_file_reader.cpp | 2 +- .../archim2-flash/media_file_reader.h | 4 +- .../bioprinter/printing_dialog_box.cpp | 2 +- .../ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 4 +- .../generic/developer_menu.cpp | 4 +- .../generic/media_player_screen.cpp | 2 +- .../extui/ftdi_eve_touch_ui/generic/screens.h | 4 +- .../generic/status_screen.cpp | 2 +- .../extui/ftdi_eve_touch_ui/pin_mappings.h | 2 +- Marlin/src/lcd/extui/malyan/malyan.cpp | 8 ++-- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 2 +- Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp | 4 +- .../src/lcd/extui/mks_ui/draw_operation.cpp | 2 +- .../src/lcd/extui/mks_ui/draw_print_file.cpp | 28 ++++++------- Marlin/src/lcd/extui/mks_ui/draw_printing.cpp | 6 +-- Marlin/src/lcd/extui/mks_ui/draw_ui.cpp | 10 ++--- Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp | 4 +- Marlin/src/lcd/extui/mks_ui/mks_hardware.h | 2 +- Marlin/src/lcd/extui/mks_ui/pic_manager.cpp | 6 +-- .../lcd/extui/mks_ui/printer_operation.cpp | 2 +- .../extui/mks_ui/tft_lvgl_configuration.cpp | 6 +-- Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 22 +++++----- Marlin/src/lcd/extui/ui_api.cpp | 26 ++++++------ Marlin/src/lcd/marlinui.cpp | 26 ++++++------ Marlin/src/lcd/marlinui.h | 6 +-- Marlin/src/lcd/menu/menu.h | 4 +- Marlin/src/lcd/menu/menu_main.cpp | 12 +++--- Marlin/src/lcd/menu/menu_media.cpp | 4 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 4 +- Marlin/src/lcd/tft/ui_320x240.cpp | 4 +- Marlin/src/lcd/tft/ui_480x320.cpp | 4 +- Marlin/src/lcd/tft/ui_common.cpp | 2 +- Marlin/src/module/endstops.cpp | 4 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 2 +- Marlin/src/pins/esp32/pins_PANDA_common.h | 2 +- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 2 +- Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 4 +- Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h | 6 +-- .../src/pins/lpc1769/pins_COHESION3D_MINI.h | 2 +- Marlin/src/pins/mega/pins_CHEAPTRONICv2.h | 2 +- Marlin/src/pins/mega/pins_PICA.h | 2 +- Marlin/src/pins/mega/pins_WEEDO_62A.h | 2 +- Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h | 2 +- .../src/pins/ramps/pins_FORMBOT_TREX2PLUS.h | 2 +- Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS_OLD.h | 2 +- Marlin/src/pins/ramps/pins_RIGIDBOARD.h | 2 +- Marlin/src/pins/ramps/pins_RUMBA.h | 2 +- Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h | 2 +- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 2 +- Marlin/src/pins/sam/pins_DUE3DOM.h | 2 +- Marlin/src/pins/sam/pins_DUE3DOM_MINI.h | 2 +- Marlin/src/pins/sam/pins_RADDS.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_DUO.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_SMART.h | 2 +- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 2 +- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 2 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 2 +- Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 2 +- Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +- .../pins/stm32f4/pins_MKS_MONSTER8_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 4 +- Marlin/src/sd/SdBaseFile.cpp | 4 +- Marlin/src/sd/SdFatUtil.cpp | 4 +- Marlin/src/sd/SdFile.cpp | 4 +- Marlin/src/sd/SdVolume.cpp | 4 +- Marlin/src/sd/cardreader.cpp | 6 +-- Marlin/src/sd/cardreader.h | 6 +-- .../PlatformIO/scripts/common-dependencies.h | 2 +- ini/features.ini | 2 +- ini/samd51.ini | 2 +- 164 files changed, 399 insertions(+), 397 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 993e0d8dde..22c97c3b8c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1601,13 +1601,13 @@ #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time //#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction //#define M73_REPORT // Report M73 values to host - #if BOTH(M73_REPORT, SDSUPPORT) + #if BOTH(M73_REPORT, HAS_MEDIA) #define M73_REPORT_SD_ONLY // Report only when printing from SD #endif #endif // LCD Print Progress options. Multiple times may be displayed in turn. -#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY) +#if HAS_DISPLAY && EITHER(HAS_MEDIA, SET_PROGRESS_MANUALLY) #define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar) #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') //#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') @@ -1628,7 +1628,7 @@ #endif #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA /** * SD Card SPI Speed * May be required to resolve "volume init" errors. @@ -1868,7 +1868,7 @@ #define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE #endif -#endif // SDSUPPORT +#endif // HAS_MEDIA /** * By default an onboard SD card reader may be shared as a USB mass- @@ -2492,9 +2492,9 @@ // The number of linear moves that can be in the planner at once. // The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32) -#if BOTH(SDSUPPORT, DIRECT_STEPPING) +#if BOTH(HAS_MEDIA, DIRECT_STEPPING) #define BLOCK_BUFFER_SIZE 8 -#elif ENABLED(SDSUPPORT) +#elif HAS_MEDIA #define BLOCK_BUFFER_SIZE 16 #else #define BLOCK_BUFFER_SIZE 16 @@ -2527,7 +2527,7 @@ //#define SERIAL_XON_XOFF #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. //#define SERIAL_STATS_MAX_RX_QUEUED diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index 5382eb36a2..b3dcfbdf59 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -145,12 +145,12 @@ void MarlinHAL::reboot() { // Free Memory Accessor // ------------------------ -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../sd/SdFatUtil.h" int freeMemory() { return SdFatUtil::FreeRam(); } -#else // !SDSUPPORT +#else // !HAS_MEDIA extern "C" { extern char __bss_end; @@ -167,6 +167,6 @@ void MarlinHAL::reboot() { } } -#endif // !SDSUPPORT +#endif // !HAS_MEDIA #endif // __AVR__ diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index 4353f16497..1b57bdb2fa 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -45,7 +45,7 @@ uint16_t MarlinHAL::adc_result; #endif void MarlinHAL::init() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up #endif usb_task_init(); // Initialize the USB stack diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index 6bbf04a0ac..a8f5de8298 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -70,7 +70,7 @@ */ #define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN)) -#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130) +#if HAS_MEDIA && HAS_DRIVER(TMC2130) #if ENABLED(TMC_USE_SW_SPI) #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) #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." diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h index 4de9e347e2..f66194c6e6 100644 --- a/Marlin/src/HAL/DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/DUE/usb/conf_usb.h @@ -101,7 +101,7 @@ #define USB_DEVICE_SPECIFIC_REQUEST() usb_task_other_requests() //@} -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA /** * USB Device low level configuration * When only one interface is used, these configurations are defined by the class module. @@ -185,7 +185,7 @@ //! Enable id string of interface to add an extra USB string #define UDI_CDC_IAD_STRING_ID 4 -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA /** * USB CDC low level configuration * In standalone these configurations are defined by the CDC module. diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp index 34cc256b30..65a926ff36 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -6,7 +6,7 @@ #include "../../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../../sd/cardreader.h" extern "C" { @@ -138,5 +138,5 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { #endif // ACCESS_USB == true -#endif // SDSUPPORT +#endif // HAS_MEDIA #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c index 97c334e2a8..4c79e8df13 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c @@ -51,7 +51,7 @@ #include "udc_desc.h" #include "udi_cdc.h" -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA /** * \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 = { //@} //@} -#endif // SDSUPPORT +#endif // HAS_MEDIA #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c index da74fbe60d..b10d043b9f 100644 --- a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c @@ -50,7 +50,7 @@ #include "udd.h" #include "udc_desc.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA /** * \defgroup udi_group_desc Descriptors for a USB Device @@ -189,4 +189,4 @@ UDC_DESC_STORAGE udc_config_t udc_config = { #endif // ARDUINO_ARCH_SAM -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/HAL/DUE/usb/udi_msc.c b/Marlin/src/HAL/DUE/usb/udi_msc.c index dd34048772..a75b5936b3 100644 --- a/Marlin/src/HAL/DUE/usb/udi_msc.c +++ b/Marlin/src/HAL/DUE/usb/udi_msc.c @@ -57,7 +57,7 @@ #include "ctrl_access.h" #include -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #ifndef UDI_MSC_NOTIFY_TRANS_EXT # 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, //@} -#endif // SDSUPPORT +#endif // HAS_MEDIA #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/usb/usb_task.c b/Marlin/src/HAL/DUE/usb/usb_task.c index 86ab27217a..6f027f83a1 100644 --- a/Marlin/src/HAL/DUE/usb/usb_task.c +++ b/Marlin/src/HAL/DUE/usb/usb_task.c @@ -51,14 +51,14 @@ #include "conf_usb.h" #include "udc.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA static volatile bool main_b_msc_enable = false; #endif static volatile bool main_b_cdc_enable = false; static volatile bool main_b_dtr_active = false; void usb_task_idle(void) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // Attend SD card access from the USB MSD -- Prioritize access to improve speed int delay = 2; while (main_b_msc_enable && --delay > 0) { @@ -70,7 +70,7 @@ void usb_task_idle(void) { #endif } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); } void usb_task_msc_disable(void) { main_b_msc_enable = false; } bool usb_task_msc_isenabled(void) { return main_b_msc_enable; } @@ -206,13 +206,13 @@ static USB_MicrosoftExtendedPropertiesDescriptor microsoft_extended_properties_d bool usb_task_extra_string(void) { static uint8_t udi_msft_magic[] = "MSFT100\xEE"; static uint8_t udi_cdc_name[] = "CDC interface"; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static uint8_t udi_msc_name[] = "MSC interface"; #endif struct extra_strings_desc_t { usb_str_desc_t header; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA le16_t string[Max(Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msc_name) - 1), sizeof(udi_msft_magic) - 1)]; #else le16_t string[Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msft_magic) - 1)]; @@ -231,7 +231,7 @@ bool usb_task_extra_string(void) { str_lgt = sizeof(udi_cdc_name) - 1; str = udi_cdc_name; break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case UDI_MSC_STRING_ID: str_lgt = sizeof(udi_msc_name) - 1; str = udi_msc_name; diff --git a/Marlin/src/HAL/ESP32/HAL_SPI.cpp b/Marlin/src/HAL/ESP32/HAL_SPI.cpp index 868ab1b671..6dc540864e 100644 --- a/Marlin/src/HAL/ESP32/HAL_SPI.cpp +++ b/Marlin/src/HAL/ESP32/HAL_SPI.cpp @@ -53,7 +53,7 @@ static SPISettings spiConfig; // ------------------------ void spiBegin() { - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS) + #if HAS_MEDIA && PIN_EXISTS(SD_SS) OUT_WRITE(SD_SS_PIN, HIGH); #endif } diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp index bd7ecdc9f2..955c751e48 100644 --- a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -32,7 +32,7 @@ #include "HAL.h" #include "SPI.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../sd/cardreader.h" #if ENABLED(ESP3D_WIFISUPPORT) #include "sd_ESP32.h" diff --git a/Marlin/src/HAL/LINUX/spi_pins.h b/Marlin/src/HAL/LINUX/spi_pins.h index 9ecbb04987..f09d1decb8 100644 --- a/Marlin/src/HAL/LINUX/spi_pins.h +++ b/Marlin/src/HAL/LINUX/spi_pins.h @@ -24,7 +24,7 @@ #include "../../core/macros.h" #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) +#if BOTH(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 9f78f2a70d..f49bc34c92 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -201,7 +201,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1) #define PIN_IS_SDA0(P) (P##_PIN == P0_27) #define IS_SCL0(P) (P == P0_28) - #if ENABLED(SDSUPPORT) && PIN_IS_SDA0(SD_DETECT) + #if HAS_MEDIA && PIN_IS_SDA0(SD_DETECT) #error "SDA0 overlaps with SD_DETECT_PIN!" #elif PIN_IS_SDA0(E0_AUTO_FAN) #error "SDA0 overlaps with E0_AUTO_FAN_PIN!" diff --git a/Marlin/src/HAL/LPC1768/spi_pins.h b/Marlin/src/HAL/LPC1768/spi_pins.h index e716d00fb0..33a5b369ad 100644 --- a/Marlin/src/HAL/LPC1768/spi_pins.h +++ b/Marlin/src/HAL/LPC1768/spi_pins.h @@ -23,7 +23,7 @@ #include "../../core/macros.h" -#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) +#if BOTH(HAS_MEDIA, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use diff --git a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h index eb20a21c56..02fb359238 100644 --- a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h +++ b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h @@ -24,7 +24,7 @@ #include "../../core/macros.h" #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) +#if BOTH(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use diff --git a/Marlin/src/HAL/SAMD21/HAL.cpp b/Marlin/src/HAL/SAMD21/HAL.cpp index 14c439eeb9..1bc0406ab3 100644 --- a/Marlin/src/HAL/SAMD21/HAL.cpp +++ b/Marlin/src/HAL/SAMD21/HAL.cpp @@ -105,7 +105,7 @@ void MarlinHAL::dma_init() {} // HAL initialization task void MarlinHAL::init() { TERN_(DMA_IS_REQUIRED, dma_init()); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 8c102b643d..bc7a9b6d91 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -602,7 +602,7 @@ void MarlinHAL::dma_init() { // HAL initialization task void MarlinHAL::init() { TERN_(DMA_IS_REQUIRED, dma_init()); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index aff52f597f..d8a12aad7e 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -70,7 +70,7 @@ void MarlinHAL::init() { constexpr int cpuFreq = F_CPU; UNUSED(cpuFreq); - #if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1) + #if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up #endif diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h index 451c94f25d..ee8c49e4e0 100644 --- a/Marlin/src/HAL/STM32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/STM32/inc/Conditionals_adv.h @@ -21,7 +21,7 @@ */ #pragma once -#if BOTH(SDSUPPORT, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE) +#if BOTH(HAS_MEDIA, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE) #define HAS_SD_HOST_DRIVE 1 #endif diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index eaad8db4d3..9b0c232bdf 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -29,7 +29,7 @@ //#endif -#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) +#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise #if USE_FALLBACK_EEPROM #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h index 656fbe1ce2..228e869688 100644 --- a/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h @@ -28,7 +28,7 @@ #define USE_SHARED_EEPROM 1 #endif -// Allow SDSUPPORT to be disabled -#if DISABLED(SDSUPPORT) +// Allow for no media drives +#if !HAS_MEDIA #undef SDIO_SUPPORT #endif diff --git a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h index fe8f6e0ec2..1da42dcc8f 100644 --- a/Marlin/src/HAL/STM32F1/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32F1/inc/SanityCheck.h @@ -25,7 +25,7 @@ * Test STM32F1-specific configuration values for errors at compile-time. */ -#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) +#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise #if USE_FALLBACK_EEPROM #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8c0f7a29e8..e478a35445 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -160,7 +160,7 @@ #include "feature/spindle_laser.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA CardReader card; #endif @@ -363,7 +363,7 @@ void startOrResumeJob() { print_job_timer.start(); } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA inline void abortSDPrinting() { IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel()); @@ -397,7 +397,7 @@ void startOrResumeJob() { } } -#endif // SDSUPPORT +#endif // HAS_MEDIA /** * Minimal management of Marlin's core activities: @@ -834,7 +834,7 @@ void idle(const bool no_stepper_sleep/*=false*/) { #endif // Handle SD Card insert / remove - TERN_(SDSUPPORT, card.manage_media()); + TERN_(HAS_MEDIA, card.manage_media()); // Handle USB Flash Drive insert / remove TERN_(USB_FLASH_DRIVE_SUPPORT, card.diskIODriver()->idle()); @@ -1340,7 +1340,7 @@ void setup() { #endif #endif - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) + #if BOTH(HAS_MEDIA, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif @@ -1624,7 +1624,7 @@ void setup() { #endif #if HAS_TFT_LVGL_UI - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts #endif SETUP_RUN(tft_lvgl_init()); @@ -1688,7 +1688,7 @@ void loop() { do { idle(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (card.flag.abort_sd_printing) abortSDPrinting(); if (marlin_state == MF_SD_COMPLETE) finishSDPrinting(); #endif diff --git a/Marlin/src/feature/binary_stream.h b/Marlin/src/feature/binary_stream.h index 417e39c745..a9cd12b85e 100644 --- a/Marlin/src/feature/binary_stream.h +++ b/Marlin/src/feature/binary_stream.h @@ -281,7 +281,7 @@ public: uint8_t data = 0; millis_t transfer_window = millis() + RX_TIMESLICE; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA PORT_REDIRECT(SERIAL_PORTMASK(card.transfer_port_index)); #endif diff --git a/Marlin/src/feature/e_parser.cpp b/Marlin/src/feature/e_parser.cpp index cfe0956aa7..b50a12d1af 100644 --- a/Marlin/src/feature/e_parser.cpp +++ b/Marlin/src/feature/e_parser.cpp @@ -33,7 +33,7 @@ // Static data members bool EmergencyParser::killed_by_M112, // = false EmergencyParser::quickstop_by_M410, - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA EmergencyParser::sd_abort_by_M524, #endif EmergencyParser::enabled; diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 3a15a7ffa0..df4456d8d3 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -58,7 +58,7 @@ public: EP_M10, EP_M108, EP_M11, EP_M112, EP_M4, EP_M41, EP_M410, - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA EP_M5, EP_M52, EP_M524, #endif #if ENABLED(HOST_PROMPT_SUPPORT) @@ -79,7 +79,7 @@ public: static bool killed_by_M112; static bool quickstop_by_M410; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static bool sd_abort_by_M524; #endif @@ -152,7 +152,7 @@ public: case ' ': break; case '1': state = EP_M1; break; case '4': state = EP_M4; break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case '5': state = EP_M5; break; #endif #if ENABLED(HOST_PROMPT_SUPPORT) @@ -175,7 +175,7 @@ public: case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break; case EP_M41: state = (c == '0') ? EP_M410 : EP_IGNORE; break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case EP_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break; case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break; #endif @@ -215,7 +215,7 @@ public: case EP_M108: wait_for_user = wait_for_heatup = false; break; case EP_M112: killed_by_M112 = true; break; case EP_M410: quickstop_by_M410 = true; break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case EP_M524: sd_abort_by_M524 = true; break; #endif #if ENABLED(HOST_PROMPT_SUPPORT) diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 773b6ebc61..a1c1bad5bb 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -209,7 +209,7 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); break; case PROMPT_PAUSE_RESUME: - #if BOTH(ADVANCED_PAUSE_FEATURE, SDSUPPORT) + #if BOTH(ADVANCED_PAUSE_FEATURE, HAS_MEDIA) extern const char M24_STR[]; queue.inject_P(M24_STR); #endif diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index 2a4342e8f5..3a037eba96 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -59,7 +59,7 @@ public: static void onPidTuningDone(LEDColor c) { leds.set_color(c); } #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void onPrintCompleted() { leds.set_green(); @@ -80,7 +80,7 @@ public: #endif } - #endif // SDSUPPORT + #endif // HAS_MEDIA }; extern PrinterEventLEDs printerEventLEDs; diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 35d1fd79f9..7b814e57f7 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -91,7 +91,7 @@ static xyze_pos_t resume_position; fil_change_settings_t fc_settings[EXTRUDERS]; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../sd/cardreader.h" #endif @@ -420,7 +420,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool ++did_pause_print; // Pause the print job and timer - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA const bool was_sd_printing = IS_SD_PRINTING(); if (was_sd_printing) { card.pauseSDPrint(); @@ -701,7 +701,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (did_pause_print) { --did_pause_print; card.startOrResumeFilePrinting(); diff --git a/Marlin/src/feature/power_monitor.h b/Marlin/src/feature/power_monitor.h index fa06909053..89e92fb773 100644 --- a/Marlin/src/feature/power_monitor.h +++ b/Marlin/src/feature/power_monitor.h @@ -119,7 +119,7 @@ public: volts.reset(); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA display_item_ms = 0; display_item = 0; #endif diff --git a/Marlin/src/gcode/control/M993_M994.cpp b/Marlin/src/gcode/control/M993_M994.cpp index 598a73fab7..f6fe0f34ad 100644 --- a/Marlin/src/gcode/control/M993_M994.cpp +++ b/Marlin/src/gcode/control/M993_M994.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE) +#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE) #include "../gcode.h" #include "../../sd/cardreader.h" @@ -85,4 +85,4 @@ void GcodeSuite::M994() { card.closefile(); } -#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE +#endif // SPI_FLASH && HAS_MEDIA && MARLIN_DEV_MODE diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 9b18eda4fb..d6e6cb9315 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -88,7 +88,7 @@ void GcodeSuite::M125() { park_point += hotend_offset[active_extruder]; #endif - const bool sd_printing = TERN0(SDSUPPORT, IS_SD_PRINTING()); + const bool sd_printing = TERN0(HAS_MEDIA, IS_SD_PRINTING()); ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 9d1014e8bf..06a9600c43 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -519,7 +519,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 17: M17(); break; // M17: Enable all stepper motors - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 20: M20(); break; // M20: List SD card case 21: M21(); break; // M21: Init SD card case 22: M22(); break; // M22: Release SD card @@ -545,7 +545,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif case 928: M928(); break; // M928: Start SD write - #endif // SDSUPPORT + #endif // HAS_MEDIA case 31: M31(); break; // M31: Report time since the start of SD print or last M109 @@ -919,7 +919,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 524: M524(); break; // M524: Abort the current SD print job #endif @@ -1061,7 +1061,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe #endif - #if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE) + #if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE) case 993: M993(); break; // M993: Backup SPI Flash to SD case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash #endif @@ -1081,7 +1081,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index d49c544623..6a66fa911a 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -642,7 +642,7 @@ private: static void M18_M84(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void M20(); static void M21(); static void M22(); @@ -658,7 +658,7 @@ private: static void M31(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if HAS_MEDIA_SUBCALLS static void M32(); #endif @@ -1062,7 +1062,7 @@ private: #endif #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void M524(); #endif @@ -1195,7 +1195,7 @@ private: static void M910(); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void M928(); #endif @@ -1207,7 +1207,7 @@ private: static void M995(); #endif - #if BOTH(SPI_FLASH, SDSUPPORT) + #if BOTH(SPI_FLASH, HAS_MEDIA) static void M993(); static void M994(); #endif @@ -1229,7 +1229,7 @@ private: static void M423_report(const bool forReplay=true); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void M1001(); #endif diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index be431eed0d..28edf9dcdb 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -199,7 +199,7 @@ void GcodeSuite::D(const int16_t dcode) { SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); } break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 101: { // D101 Test SD Write card.openFileWrite("test.gco"); @@ -250,7 +250,7 @@ void GcodeSuite::D(const int16_t dcode) { card.closefile(); } break; - #endif // SDSUPPORT + #endif // HAS_MEDIA #if ENABLED(POSTMORTEM_DEBUGGING) diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index d28d53eedd..236895e107 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -168,10 +168,10 @@ void GcodeSuite::M115() { cap_line(F("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT)); // SDCARD (M20, M23, M24, etc.) - cap_line(F("SDCARD"), ENABLED(SDSUPPORT)); + cap_line(F("SDCARD"), ENABLED(HAS_MEDIA)); // MULTI_VOLUME (M21 S/M21 U) - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME)); #endif @@ -179,7 +179,7 @@ void GcodeSuite::M115() { cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS)); // SD_WRITE (M928, M28, M29) - cap_line(F("SD_WRITE"), ENABLED(SDSUPPORT) && DISABLED(SDCARD_READONLY)); + cap_line(F("SD_WRITE"), ENABLED(HAS_MEDIA) && DISABLED(SDCARD_READONLY)); // AUTOREPORT_SD_STATUS (M27 extension) cap_line(F("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS)); diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index d8e166dad8..9649e99e17 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -70,7 +70,7 @@ void GcodeSuite::M360() { config_line(F("InputBuffer"), MAX_CMD_SIZE); config_line(F("PrintlineCache"), BUFSIZE); config_line(F("MixingExtruder"), ENABLED(MIXING_EXTRUDER)); - config_line(F("SDCard"), ENABLED(SDSUPPORT)); + config_line(F("SDCard"), ENABLED(HAS_MEDIA)); config_line(F("Fan"), ENABLED(HAS_FAN)); config_line(F("LCD"), ENABLED(HAS_DISPLAY)); config_line(F("SoftwarePowerSwitch"), 1); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index edf0ddfdbf..af8e877436 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -512,7 +512,7 @@ void GCodeQueue::get_serial_commands() { serial.last_N = gcode_N; } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // Pronterface "M29" and "M29 " has no line number else if (card.flag.saving && !is_M29(command)) { gcode_line_error(F(STR_ERR_NO_CHECKSUM), p); @@ -562,7 +562,7 @@ void GCodeQueue::get_serial_commands() { } // queue has space, serial has data } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA /** * Get lines from the SD Card until the command buffer is full @@ -615,7 +615,7 @@ void GCodeQueue::get_serial_commands() { } } -#endif // SDSUPPORT +#endif // HAS_MEDIA /** * Add to the circular command queue the next command from: @@ -628,7 +628,7 @@ void GCodeQueue::get_available_commands() { get_serial_commands(); - TERN_(SDSUPPORT, get_sdcard_commands()); + TERN_(HAS_MEDIA, get_sdcard_commands()); } /** @@ -667,7 +667,7 @@ void GCodeQueue::advance() { } #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (card.flag.saving) { char * const cmd = ring_buffer.peek_next_command_string(); @@ -703,7 +703,7 @@ void GCodeQueue::advance() { gcode.process_next_command(); - #endif // SDSUPPORT + #endif // HAS_MEDIA // The queue may be reset by a command handler or by code invoked by idle() within a handler ring_buffer.advance_pos(ring_buffer.index_r, -1); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 19fb359e15..2cb72f2e15 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -256,7 +256,7 @@ private: static void get_serial_commands(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static void get_sdcard_commands(); #endif diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 1d1d1a4b7f..3c8f38a144 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../module/planner.h" @@ -114,4 +114,4 @@ void GcodeSuite::M1001() { TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M20.cpp b/Marlin/src/gcode/sd/M20.cpp index 2a7e0d08df..9dca2bb3e0 100644 --- a/Marlin/src/gcode/sd/M20.cpp +++ b/Marlin/src/gcode/sd/M20.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -51,4 +51,4 @@ void GcodeSuite::M20() { SERIAL_ECHO_MSG(STR_NO_MEDIA); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M21_M22.cpp b/Marlin/src/gcode/sd/M21_M22.cpp index aec0de27ca..3347168151 100644 --- a/Marlin/src/gcode/sd/M21_M22.cpp +++ b/Marlin/src/gcode/sd/M21_M22.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -52,4 +52,4 @@ void GcodeSuite::M22() { if (!IS_SD_PRINTING()) card.release(); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M23.cpp b/Marlin/src/gcode/sd/M23.cpp index 8722e9b6de..7727d4958f 100644 --- a/Marlin/src/gcode/sd/M23.cpp +++ b/Marlin/src/gcode/sd/M23.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -41,4 +41,4 @@ void GcodeSuite::M23() { TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0)); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M24_M25.cpp b/Marlin/src/gcode/sd/M24_M25.cpp index 847af65b12..45c596ae99 100644 --- a/Marlin/src/gcode/sd/M24_M25.cpp +++ b/Marlin/src/gcode/sd/M24_M25.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -101,9 +101,7 @@ void GcodeSuite::M25() { #else // Set initial pause flag to prevent more commands from landing in the queue while we try to pause - #if ENABLED(SDSUPPORT) - if (IS_SD_PRINTING()) card.pauseSDPrint(); - #endif + if (IS_SD_PRINTING()) card.pauseSDPrint(); #if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(DGUS_LCD_UI_MKS) if (recovery.enabled) recovery.save(true); @@ -125,4 +123,4 @@ void GcodeSuite::M25() { #endif } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M26.cpp b/Marlin/src/gcode/sd/M26.cpp index e0557bfa14..9ddc436e8c 100644 --- a/Marlin/src/gcode/sd/M26.cpp +++ b/Marlin/src/gcode/sd/M26.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -35,4 +35,4 @@ void GcodeSuite::M26() { card.setIndex(parser.value_long()); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M27.cpp b/Marlin/src/gcode/sd/M27.cpp index 88238190e2..590efbf79d 100644 --- a/Marlin/src/gcode/sd/M27.cpp +++ b/Marlin/src/gcode/sd/M27.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -49,4 +49,4 @@ void GcodeSuite::M27() { card.report_status(); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M28_M29.cpp b/Marlin/src/gcode/sd/M28_M29.cpp index 373938d99b..ac1ba08788 100644 --- a/Marlin/src/gcode/sd/M28_M29.cpp +++ b/Marlin/src/gcode/sd/M28_M29.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -69,4 +69,4 @@ void GcodeSuite::M29() { card.flag.saving = false; } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M30.cpp b/Marlin/src/gcode/sd/M30.cpp index b95a895f1e..da8e51bb8b 100644 --- a/Marlin/src/gcode/sd/M30.cpp +++ b/Marlin/src/gcode/sd/M30.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -37,4 +37,4 @@ void GcodeSuite::M30() { } } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index f2b9274223..a3c03e90ba 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -51,4 +51,4 @@ void GcodeSuite::M524() { } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/gcode/sd/M928.cpp b/Marlin/src/gcode/sd/M928.cpp index 03a7877a90..0d86b330c7 100644 --- a/Marlin/src/gcode/sd/M928.cpp +++ b/Marlin/src/gcode/sd/M928.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../gcode.h" #include "../../sd/cardreader.h" @@ -36,4 +36,4 @@ void GcodeSuite::M928() { } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 32a2eda7c7..b11ede3dc5 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -26,6 +26,10 @@ * Conditionals that need to be set before Configuration_adv.h or pins.h */ +#if ENABLED(SDSUPPORT) + #define HAS_MEDIA 1 +#endif + // MKS_LCD12864A/B is a variant of MKS_MINI_12864 #if EITHER(MKS_LCD12864A, MKS_LCD12864B) #define MKS_MINI_12864 @@ -217,7 +221,7 @@ #define IS_TFTGLCD_PANEL 1 #define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD - #if ENABLED(SDSUPPORT) && DISABLED(LCD_PROGRESS_BAR) + #if HAS_MEDIA && DISABLED(LCD_PROGRESS_BAR) #define LCD_PROGRESS_BAR #endif #if ENABLED(TFTGLCD_PANEL_I2C) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index fd7ba59224..929a7c78cf 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -794,7 +794,7 @@ #undef MENU_ADDAUTOSTART #endif -#if EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY) +#if EITHER(HAS_MEDIA, SET_PROGRESS_MANUALLY) #define HAS_PRINT_PROGRESS 1 #endif @@ -812,7 +812,7 @@ #define HAS_STATUS_MESSAGE_TIMEOUT 1 #endif -#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH +#if HAS_MEDIA && SD_PROCEDURE_DEPTH #define HAS_MEDIA_SUBCALLS 1 #endif @@ -850,7 +850,7 @@ #else #undef LED_POWEROFF_TIMEOUT #endif -#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT) +#if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, HAS_MEDIA) #define HAS_LEDS_OFF_FLAG 1 #endif #if DISPLAY_SLEEP_MINUTES || TOUCH_IDLE_SLEEP_MINS @@ -1148,7 +1148,7 @@ // SD Card connection methods // Defined here so pins and sanity checks can use them // -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define _SDCARD_LCD 1 #define _SDCARD_ONBOARD 2 #define _SDCARD_CUSTOM_CABLE 3 @@ -1228,7 +1228,7 @@ #endif // AVR are (usually) too limited in resources to store the configuration into the binary -#if ENABLED(CONFIGURATION_EMBEDDING) && !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || DISABLED(SDSUPPORT) || EITHER(SDCARD_READONLY, DISABLE_M503)) +#if ENABLED(CONFIGURATION_EMBEDDING) && !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || !HAS_MEDIA || EITHER(SDCARD_READONLY, DISABLE_M503)) #undef CONFIGURATION_EMBEDDING #define CANNOT_EMBED_CONFIGURATION defined(__AVR__) #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 59b5dab462..bf4810cd8a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -510,7 +510,7 @@ * Override the SD_DETECT_STATE set in Configuration_adv.h * and enable sharing of onboard SD host drives (all platforms but AGCM4) */ -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #if HAS_SD_HOST_DRIVE && SD_CONNECTION_IS(ONBOARD) // @@ -3351,7 +3351,7 @@ #endif // Fallback SPI Speed for SD -#if ENABLED(SDSUPPORT) && !defined(SD_SPI_SPEED) +#if HAS_MEDIA && !defined(SD_SPI_SPEED) #define SD_SPI_SPEED SPI_FULL_SPEED #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 034e472e84..40e76b6149 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -978,7 +978,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS * Progress Bar */ #if ENABLED(LCD_PROGRESS_BAR) - #if NONE(SDSUPPORT, SET_PROGRESS_MANUALLY) + #if NONE(HAS_MEDIA, SET_PROGRESS_MANUALLY) #error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY." #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)." @@ -1028,7 +1028,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS /** * SD Card Settings */ -#if ALL(SDSUPPORT, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW +#if ALL(HAS_MEDIA, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER." #endif #undef SD_CONNECTION_TYPICAL @@ -1176,8 +1176,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE." #elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." - #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER) - #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." + #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(HAS_MEDIA, IS_NEWPANEL, EMERGENCY_PARSER) + #error "PARK_HEAD_ON_PAUSE requires HAS_MEDIA, EMERGENCY_PARSER, or an LCD controller." #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT) #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT." #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH @@ -3266,7 +3266,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #if ENABLED(TFT_LVGL_UI) #if DISABLED(TFT_RES_480x320) #error "TFT_LVGL_UI requires TFT_RES_480x320." - #elif DISABLED(SDSUPPORT) + #elif !HAS_MEDIA #error "TFT_LVGL_UI requires SDSUPPORT." #endif #endif @@ -3282,7 +3282,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #if ENABLED(ANYCUBIC_LCD_CHIRON) #ifndef BEEPER_PIN #error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN" - #elif DISABLED(SDSUPPORT) + #elif !HAS_MEDIA #error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT" #elif TEMP_SENSOR_BED == 0 #error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)" @@ -3305,7 +3305,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS * Ender-3 V2 controller has some limitations */ #if ENABLED(DWIN_CREALITY_LCD) - #if DISABLED(SDSUPPORT) + #if !HAS_MEDIA #error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled." #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." @@ -3317,7 +3317,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif #elif ENABLED(DWIN_LCD_PROUI) - #if DISABLED(SDSUPPORT) + #if !HAS_MEDIA #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." @@ -4339,7 +4339,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); * Check to make sure MONITOR_DRIVER_STATUS isn't enabled * on boards where TMC drivers share the SPI bus with SD. */ -#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI) +#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, HAS_MEDIA, USES_SHARED_SPI) #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI." #endif diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 8a5e5c5ad9..e33814589c 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -41,7 +41,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) +#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) #include "../../feature/filwidth.h" #include "../../gcode/parser.h" #endif @@ -289,7 +289,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif // LCD_PROGRESS_BAR - #if BOTH(SDSUPPORT, HAS_MARLINUI_MENU) + #if BOTH(HAS_MEDIA, HAS_MARLINUI_MENU) // CHARSET_MENU const static PROGMEM byte refresh[8] = { @@ -313,7 +313,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS B00000 }; - #endif // SDSUPPORT + #endif // HAS_MEDIA #if ENABLED(SHOW_BOOTSCREEN) // Set boot screen corner characters @@ -339,7 +339,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif { createChar_P(LCD_STR_UPLEVEL[0], uplevel); - #if BOTH(SDSUPPORT, HAS_MARLINUI_MENU) + #if BOTH(HAS_MEDIA, HAS_MARLINUI_MENU) // SD Card sub-menu special characters createChar_P(LCD_STR_REFRESH[0], refresh); createChar_P(LCD_STR_FOLDER[0], folder); @@ -697,7 +697,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (progress > 2) return draw_progress_bar(progress); } - #elif BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #elif BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { @@ -709,7 +709,7 @@ void MarlinUI::draw_status_message(const bool blink) { return; } - #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT + #endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA #if ENABLED(STATUS_MESSAGE_SCROLLING) static bool last_blink = false; @@ -1218,7 +1218,7 @@ void MarlinUI::draw_status_screen() { } } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index fc568c55db..969b3fb036 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -52,7 +52,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) +#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) #include "../../feature/filwidth.h" #include "../../gcode/parser.h" #endif @@ -672,7 +672,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const void MarlinUI::draw_status_message(const bool blink) { if (!PanelDetected) return; lcd_moveto(0, 3); - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { @@ -689,7 +689,7 @@ void MarlinUI::draw_status_message(const bool blink) { return; } - #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT + #endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA // Get the UTF8 character count of the string uint8_t slen = utf8_strlen(status_message); @@ -1061,7 +1061,7 @@ void MarlinUI::draw_status_screen() { lcd.print_line(); } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (!PanelDetected) return; @@ -1074,7 +1074,7 @@ void MarlinUI::draw_status_screen() { lcd.print_line(); } - #endif // SDSUPPORT + #endif // HAS_MEDIA #if ENABLED(LCD_HAS_STATUS_INDICATORS) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index ce9a31668a..76fa7842a3 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -56,7 +56,7 @@ #include "../../module/printcounter.h" #include "../../MarlinCore.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../libs/duration_t.h" #endif @@ -545,7 +545,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { @@ -557,7 +557,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } } - #endif // SDSUPPORT + #endif // HAS_MEDIA #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index 2b9eb64a57..afdda5ac5b 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -36,10 +36,10 @@ // RepRapWorld Graphical LCD - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) + #if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL #define U8G_PARAM LCD_PINS_RS - #elif ENABLED(SDSUPPORT) && __SAMD21__ + #elif HAS_MEDIA && __SAMD21__ #define U8G_CLASS U8GLIB_ST7920_128X64_4X #define U8G_PARAM LCD_PINS_RS #else @@ -52,7 +52,7 @@ // RepRap Discount Full Graphics Smart Controller // and other variant LCDs using ST7920 - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) + #if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.) #define U8G_PARAM LCD_PINS_RS #else diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 22e71251ff..cb3515a694 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -67,7 +67,7 @@ #include "../../feature/power_monitor.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../sd/cardreader.h" #endif @@ -742,7 +742,7 @@ void MarlinUI::draw_status_screen() { #endif } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // // SD Card Symbol // @@ -756,7 +756,7 @@ void MarlinUI::draw_status_screen() { // Corner pixel u8g.drawPixel(50, 43); // 43 (or 42) } - #endif // SDSUPPORT + #endif // HAS_MEDIA #if HAS_PRINT_PROGRESS // Progress bar frame @@ -871,7 +871,7 @@ void MarlinUI::draw_status_screen() { // // Filament sensor display if SD is disabled // - #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) + #if ENABLED(FILAMENT_LCD_DISPLAY) && !HAS_MEDIA lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring); lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); lcd_put_u8str(F("%")); @@ -887,7 +887,7 @@ void MarlinUI::draw_status_screen() { if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) { lcd_moveto(0, STATUS_BASELINE); - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str(F(LCD_STR_FILAM_DIA)); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 96f2eeae96..a4ace1ce8a 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -81,7 +81,7 @@ #include "../../module/temperature.h" #include "../../libs/numtostr.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../sd/cardreader.h" #endif diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index a24adec8e9..e685fe16fd 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4389,7 +4389,7 @@ void CrealityDWINClass::Print_Screen_Control() { #endif TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); planner.synchronize(); - TERN_(SDSUPPORT, queue.inject(F("M24"))); + TERN_(HAS_MEDIA, queue.inject(F("M24"))); #endif } else { @@ -4427,7 +4427,7 @@ void CrealityDWINClass::Popup_Control() { #endif #if ENABLED(PARK_HEAD_ON_PAUSE) Popup_Handler(Home, true); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (IS_SD_PRINTING()) card.pauseSDPrint(); #endif planner.synchronize(); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index c267d32048..4b34d65100 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -39,7 +39,7 @@ #include "../../../module/temperature.h" #include "../../../module/printcounter.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../../libs/duration_t.h" #endif @@ -467,7 +467,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (yes) draw_boxed_string(true, yes, yesno); } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { @@ -487,7 +487,7 @@ void MarlinUI::draw_status_message(const bool blink) { } } - #endif // SDSUPPORT + #endif // HAS_MEDIA #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 5ec94b853f..cfa326667a 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -39,7 +39,7 @@ #include "../../../module/printcounter.h" #include "../../../module/planner.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../../libs/duration_t.h" #endif diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 1bc52bfcaf..36b24861fe 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -94,7 +94,7 @@ void AnycubicTFTClass::OnSetup() { delay_ms(10); // Init the state of the key pins running on the TFT - #if BOTH(SDSUPPORT, HAS_SD_DETECT) + #if BOTH(HAS_MEDIA, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) @@ -176,7 +176,7 @@ void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) { SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA /** * Need to handle the process of following states * "Nozzle Parked" @@ -380,7 +380,7 @@ void AnycubicTFTClass::HandleSpecialMenu() { } void AnycubicTFTClass::RenderCurrentFileList() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uint16_t selectedNumber = 0; SelectedDirectory[0] = 0; SelectedFile[0] = 0; @@ -404,7 +404,7 @@ void AnycubicTFTClass::RenderCurrentFileList() { RenderCurrentFolder(selectedNumber); } SENDLINE_PGM("END"); // Filelist stop - #endif // SDSUPPORT + #endif // HAS_MEDIA } void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) { @@ -516,7 +516,7 @@ void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) { } void AnycubicTFTClass::OnPrintTimerStarted() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (mediaPrintingState == AMPRINTSTATE_PRINTING) SENDLINE_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print @@ -524,7 +524,7 @@ void AnycubicTFTClass::OnPrintTimerStarted() { } void AnycubicTFTClass::OnPrintTimerPaused() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMedia()) { mediaPrintingState = AMPRINTSTATE_PAUSED; mediaPauseState = AMPAUSESTATE_PARKING; @@ -533,7 +533,7 @@ void AnycubicTFTClass::OnPrintTimerPaused() { } void AnycubicTFTClass::OnPrintTimerStopped() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (mediaPrintingState == AMPRINTSTATE_PRINTING) { mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; mediaPauseState = AMPAUSESTATE_NOT_PAUSED; @@ -608,7 +608,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { } break; case 6: // A6 GET SD CARD PRINTING STATUS - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMedia()) { SEND_PGM("A6V "); if (isMediaInserted()) @@ -637,28 +637,28 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 8: // A8 GET SD LIST - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA SelectedFile[0] = 0; RenderCurrentFileList(); #endif break; case 9: // A9 pause sd print - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMedia()) PausePrint(); #endif break; case 10: // A10 resume sd print - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMediaPaused()) ResumePrint(); #endif break; case 11: // A11 STOP SD PRINT - TERN_(SDSUPPORT, StopPrint()); + TERN_(HAS_MEDIA, StopPrint()); break; case 12: // A12 kill @@ -666,7 +666,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 13: // A13 SELECTION FILE - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isMediaInserted()) { starpos = (strchr(TFTstrchr_pointer + 4, '*')); if (TFTstrchr_pointer[4] == '/') { @@ -695,7 +695,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 14: // A14 START PRINTING - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!isPrinting() && strlen(SelectedFile) > 0) StartPrint(); #endif @@ -868,7 +868,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 26: // A26 refresh SD - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isMediaInserted()) { if (strlen(SelectedDirectory) > 0) { FileList currentFileList; @@ -924,7 +924,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { } void AnycubicTFTClass::DoSDCardStateCheck() { - #if BOTH(SDSUPPORT, HAS_SD_DETECT) + #if BOTH(HAS_MEDIA, HAS_SD_DETECT) bool isInserted = isMediaInserted(); if (isInserted) SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); @@ -954,7 +954,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() { } void AnycubicTFTClass::StartPrint() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!isPrinting() && strlen(SelectedFile) > 0) { #if ENABLED(ANYCUBIC_LCD_DEBUG) SERIAL_ECHOPGM("TFT Serial Debug: About to print file ... "); @@ -970,7 +970,7 @@ void AnycubicTFTClass::StartPrint() { } void AnycubicTFTClass::PausePrint() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMedia() && mediaPrintingState != AMPRINTSTATE_STOP_REQUESTED && mediaPauseState == AMPAUSESTATE_NOT_PAUSED) { mediaPrintingState = AMPRINTSTATE_PAUSE_REQUESTED; mediaPauseState = AMPAUSESTATE_NOT_PAUSED; // need the userconfirm method to update pause state @@ -984,7 +984,7 @@ void AnycubicTFTClass::PausePrint() { } void AnycubicTFTClass::ResumePrint() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if ENABLED(FILAMENT_RUNOUT_SENSOR) if (READ(FIL_RUNOUT1_PIN)) { #if ENABLED(ANYCUBIC_LCD_DEBUG) @@ -1020,7 +1020,7 @@ void AnycubicTFTClass::ResumePrint() { } void AnycubicTFTClass::StopPrint() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA mediaPrintingState = AMPRINTSTATE_STOP_REQUESTED; mediaPauseState = AMPAUSESTATE_NOT_PAUSED; SENDLINE_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16"); diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index b2363c4ee9..e8abc259a2 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -52,7 +52,7 @@ bool DGUSScreenHandler::ScreenComplete; void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA int16_t DGUSScreenHandler::top_file = 0, DGUSScreenHandler::file_to_print = 0; ExtUI::FileList filelist; @@ -260,7 +260,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void DGUSScreenHandler::ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) { // default action executed when there is a SD card, but not printing @@ -329,7 +329,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) GotoScreen(DGUSLCD_SCREEN_POPUP); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSScreenHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr) { DGUS_VP_Variable ramcopy; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h index 7ff9ac673f..9ebca87be1 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -114,7 +114,7 @@ public: static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // Callback for VP "Display wants to change screen when there is a SD card" static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); // Scroll buttons on the file listing screen. @@ -233,7 +233,7 @@ protected: static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static int16_t top_file; //< file on top of file chooser static int16_t file_to_print; //< touched file to be confirmed #endif diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 2fe4e03016..1d86d8bd55 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -48,9 +48,9 @@ namespace ExtUI { while (!ScreenHandler.loop()); // Wait while anything is left to be sent } - void onMediaInserted() { TERN_(SDSUPPORT, ScreenHandler.SDCardInserted()); } - void onMediaError() { TERN_(SDSUPPORT, ScreenHandler.SDCardError()); } - void onMediaRemoved() { TERN_(SDSUPPORT, ScreenHandler.SDCardRemoved()); } + void onMediaInserted() { TERN_(HAS_MEDIA, ScreenHandler.SDCardInserted()); } + void onMediaError() { TERN_(HAS_MEDIA, ScreenHandler.SDCardError()); } + void onMediaRemoved() { TERN_(HAS_MEDIA, ScreenHandler.SDCardRemoved()); } void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPrintTimerStarted() {} diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp index 3e731de438..6b670368b6 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp @@ -320,7 +320,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Helper to detect touch events VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), #endif VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), @@ -442,7 +442,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #endif // SDCard File listing. - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index 58f0ed8319..0c76454d74 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -40,7 +40,7 @@ #include "../../../../feature/powerloss.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern ExtUI::FileList filelist; @@ -124,7 +124,7 @@ ) GotoScreen(DGUSLCD_SCREEN_MAIN); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { uint8_t *tmp = (uint8_t*)val_ptr; diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp index a348a1f9a1..c278179e3f 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp @@ -317,7 +317,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Helper to detect touch events VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), #endif VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), @@ -435,7 +435,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #endif // SDCard File listing. - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index ebe3e3ba8a..83658cc8c0 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -40,7 +40,7 @@ #include "../../../../feature/powerloss.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern ExtUI::FileList filelist; @@ -124,7 +124,7 @@ ) GotoScreen(DGUSLCD_SCREEN_MAIN); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { uint8_t *tmp = (uint8_t*)val_ptr; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index 40f6a349d5..8dee8e26d7 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -502,7 +502,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Helper to detect touch events VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), #endif VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), @@ -751,7 +751,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // SDCard File listing - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index bdd5f4f018..8cddcb074e 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -47,7 +47,7 @@ #include "../../../../feature/powerloss.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern ExtUI::FileList filelist; #endif @@ -140,7 +140,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { #endif } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)BE16_P(val_ptr) + top_file; @@ -262,7 +262,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { const uint16_t value = BE16_P(val_ptr); if (value == 0x0F) GotoScreen(DGUSLCD_SCREEN_MAIN); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { uint8_t *tmp = (uint8_t*)val_ptr; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index 823ed4297c..69ded29ffb 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -83,7 +83,7 @@ public: static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr); #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // Marlin informed us about SD print completion. static void SDPrintingFinished(); #else diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp index 004b453e6e..c5711320ec 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp @@ -128,7 +128,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Helper to detect touch events VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), #endif VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), @@ -243,7 +243,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #endif // SDCard File listing. - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index edf9a5ca82..6921cdc737 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -40,7 +40,7 @@ #include "../../../../feature/powerloss.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern ExtUI::FileList filelist; @@ -124,7 +124,7 @@ ) GotoScreen(DGUSLCD_SCREEN_MAIN); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { uint8_t *tmp = (uint8_t*)val_ptr; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index 7a0318a555..40f3bbf1d5 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -46,7 +46,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { const DGUS_Screen screen = (DGUS_Screen)((uint8_t*)data_ptr)[1]; if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA IF_DISABLED(HAS_SD_DETECT, card.mount()); if (!ExtUI::isMediaInserted()) { @@ -76,7 +76,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { dgus_screen_handler.TriggerScreenChange(screen); } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void DGUSRxHandler::Scroll(DGUS_VP &vp, void *data_ptr) { UNUSED(vp); @@ -154,7 +154,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { ExtUI::printFile(dgus_screen_handler.filelist.shortFilename()); dgus_screen_handler.TriggerScreenChange(DGUS_Screen::PRINT_STATUS); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSRxHandler::PrintAbort(DGUS_VP &vp, void *data_ptr) { UNUSED(vp); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h index 4cad11fc0b..d6d5855b9d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h @@ -28,7 +28,7 @@ namespace DGUSRxHandler { void ScreenChange(DGUS_VP &, void *); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void Scroll(DGUS_VP &, void *); void SelectFile(DGUS_VP &, void *); void PrintFile(DGUS_VP &, void *); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index e1d8778567..e8c23b3226 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -34,7 +34,7 @@ uint8_t DGUSScreenHandler::debug_count = 0; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA ExtUI::FileList DGUSScreenHandler::filelist; uint16_t DGUSScreenHandler::filelist_offset = 0; int16_t DGUSScreenHandler::filelist_selected = -1; @@ -281,7 +281,7 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) { dgus_display.PlaySound(3); } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void DGUSScreenHandler::SDCardInserted() { if (current_screen == DGUS_Screen::HOME) @@ -299,7 +299,7 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) { TriggerScreenChange(DGUS_Screen::HOME); } -#endif // SDSUPPORT +#endif // HAS_MEDIA #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index 295df311df..0f71ebdc3d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -52,7 +52,7 @@ public: static void PrintTimerStopped(); static void FilamentRunout(const ExtUI::extruder_t extruder); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA /// Marlin informed us that a new SD has been inserted. static void SDCardInserted(); /// Marlin informed us that the SD Card has been removed(). @@ -89,7 +89,7 @@ public: static uint8_t debug_count; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA static ExtUI::FileList filelist; static uint16_t filelist_offset; static int16_t filelist_selected; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp index c95d7d0453..3b1a38502d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp @@ -31,7 +31,7 @@ #include "../../../gcode/queue.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA bool DGUSSetupHandler::Print() { dgus_screen_handler.filelist.refresh(); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h index 9e3866467f..10063446b7 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h @@ -23,7 +23,7 @@ namespace DGUSSetupHandler { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA bool Print(); #endif bool PrintStatus(); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index b27988a89f..c7d650c03e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -36,7 +36,7 @@ #include "../../../feature/pause.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void DGUSTxHandler::SetFileControlState(int16_t file, bool state) { DGUS_Control control; @@ -177,7 +177,7 @@ dgus_display.WriteString((uint16_t)vp.addr, dgus_screen_handler.filelist.filename(), vp.size); } -#endif // SDSUPPORT +#endif // HAS_MEDIA void DGUSTxHandler::PositionZ(DGUS_VP &vp) { const float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ? planner.get_axis_position_mm(Z_AXIS) : 0; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h index 161d73f813..6e4f1db5dc 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h @@ -28,7 +28,7 @@ namespace DGUSTxHandler { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void SetFileControlState(int16_t, bool); void FileType(DGUS_VP &); void FileName(DGUS_VP &); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp index 706038f0ed..4c99ff6a00 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp @@ -36,7 +36,7 @@ constexpr DGUS_Addr LIST_HOME[] PROGMEM = { (DGUS_Addr)0 }; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA constexpr DGUS_Addr LIST_PRINT[] PROGMEM = { DGUS_Addr::SD_Type, DGUS_Addr::SD_FileName0, @@ -210,7 +210,7 @@ constexpr DGUS_Addr LIST_WAIT[] PROGMEM = { const struct DGUS_ScreenAddrList screen_addr_list_map[] PROGMEM = { MAP_HELPER(DGUS_Screen::HOME, LIST_HOME), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA MAP_HELPER(DGUS_Screen::PRINT, LIST_PRINT), #endif MAP_HELPER(DGUS_Screen::PRINT_STATUS, LIST_PRINT_STATUS), diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp index a9f13b5ee5..e3ba393af2 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp @@ -35,7 +35,7 @@ .setup_fn = SETUP } const struct DGUS_ScreenSetup screen_setup_list[] PROGMEM = { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA SETUP_HELPER(DGUS_Screen::PRINT, &DGUSSetupHandler::Print), #endif SETUP_HELPER(DGUS_Screen::PRINT_STATUS, &DGUSSetupHandler::PrintStatus), diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp index 3f00dbb037..cd5408e190 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp @@ -80,7 +80,7 @@ const struct DGUS_VP vp_list[] PROGMEM = { VP_HELPER_RX(DGUS_Addr::SCREENCHANGE_Idle, &DGUSRxHandler::ScreenChange), VP_HELPER_RX(DGUS_Addr::SCREENCHANGE_Printing, &DGUSRxHandler::ScreenChange), - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VP_HELPER_RX(DGUS_Addr::SD_SelectFile, &DGUSRxHandler::SelectFile), VP_HELPER_RX(DGUS_Addr::SD_Scroll, &DGUSRxHandler::Scroll), VP_HELPER_RX_NODATA(DGUS_Addr::SD_Print, &DGUSRxHandler::PrintFile), @@ -150,7 +150,7 @@ const struct DGUS_VP vp_list[] PROGMEM = { // WRITE-ONLY VARIABLES - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA VP_HELPER_TX(DGUS_Addr::SD_Type, &DGUSTxHandler::FileType), VP_HELPER_TX_SIZE(DGUS_Addr::SD_FileName0, DGUS_FILENAME_LEN, diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index fb8ef8cc84..75ef5f5d66 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -50,9 +50,9 @@ namespace ExtUI { dgus_screen_handler.PrinterKilled(error, component); } - void onMediaInserted() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardInserted()); } - void onMediaError() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardError()); } - void onMediaRemoved() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardRemoved()); } + void onMediaInserted() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardInserted()); } + void onMediaError() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardError()); } + void onMediaRemoved() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardRemoved()); } void onPlayTone(const uint16_t frequency, const uint16_t duration) { dgus_screen_handler.PlayTone(frequency, duration); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index a23ad6e37e..c3a4118f20 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -416,7 +416,7 @@ bool UIFlashStorage::is_present = false; * files must be written sequentially following by a chip erase and it is not possible to * overwrite files. */ UIFlashStorage::error_t UIFlashStorage::write_media_file(FSTR_P filename, uint8_t slot) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uint32_t addr; uint8_t buff[write_page_size]; @@ -500,7 +500,7 @@ bool UIFlashStorage::is_present = false; } #else return VERIFY_ERROR; - #endif // SDSUPPORT + #endif // HAS_MEDIA } bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp index b4165a742a..99e875712a 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp @@ -25,7 +25,7 @@ #if ENABLED(TOUCH_UI_FTDI_EVE) #include "media_file_reader.h" - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA bool MediaFileReader::open(const char *filename) { root = CardReader::getroot(); return file.open(&root, filename, O_READ); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index 9a20c2a038..78b1652c50 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -24,14 +24,14 @@ #include "../../../../inc/MarlinConfigPre.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "../../../../sd/SdFile.h" #include "../../../../sd/cardreader.h" #endif class MediaFileReader { private: - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA MediaFile root, file; #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp index 4af38dcb9d..9b67f0e3c8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp @@ -75,7 +75,7 @@ void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) { .font(font_medium) .colors(isPrinting() ? action_btn : normal_btn) .tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu")) - .enabled(isPrinting() ? TERN0(SDSUPPORT, isPrintingFromMedia()) : 1) + .enabled(isPrinting() ? TERN0(HAS_MEDIA, isPrintingFromMedia()) : 1) .tag(3) .colors(isPrinting() ? normal_btn : action_btn) .button(BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index b82b4a07bd..86f470ee19 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -45,14 +45,14 @@ namespace ExtUI { } void onMediaInserted() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA sound.play(media_inserted, PLAY_ASYNCHRONOUS); StatusScreen::onMediaInserted(); #endif } void onMediaRemoved() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (isPrintingFromMedia()) { stopPrint(); InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp index 2ec8a3bbd1..4a60733723 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp @@ -44,7 +44,7 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { constexpr bool has_flash = false; #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA constexpr bool has_media = true; #else constexpr bool has_media = false; @@ -98,7 +98,7 @@ bool DeveloperMenu::onTouchEnd(uint8_t tag) { break; case 4: GOTO_SCREEN(TouchRegistersScreen); break; case 5: sound.play(js_bach_joy, PLAY_ASYNCHRONOUS); break; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 6: if (!MediaPlayerScreen::playCardMedia()) AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/media_player_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/media_player_screen.cpp index 061c8555df..fbfce19a75 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/media_player_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/media_player_screen.cpp @@ -57,7 +57,7 @@ void MediaPlayerScreen::onRedraw(draw_mode_t) { } bool MediaPlayerScreen::playCardMedia() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA char fname[15]; strcpy_P(fname, PSTR("STARTUP.AVI")); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h index b88e517576..e2df29cb83 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h @@ -83,7 +83,7 @@ enum { #if ENABLED(FILAMENT_RUNOUT_SENSOR) FILAMENT_RUNOUT_SCREEN_CACHE, #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA FILES_SCREEN_CACHE, #endif #if ENABLED(CUSTOM_MENU_MAIN) @@ -204,7 +204,7 @@ enum { #include "linear_advance_screen.h" #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "files_screen.h" #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index f1c65357e0..738d8ee64f 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -417,7 +417,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { using namespace ExtUI; switch (tag) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA case 3: GOTO_SCREEN(FilesScreen); break; #endif case 4: diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/pin_mappings.h index 167ea9d7cf..3963493841 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/pin_mappings.h @@ -137,7 +137,7 @@ #define CLCD_SPI_CS BTN_EN1 #define CLCD_MOD_RESET BTN_EN2 - #if MB(EINSY_RAMBO, EINSY_RETRO) && DISABLED(SDSUPPORT) + #if MB(EINSY_RAMBO, EINSY_RETRO) && !HAS_MEDIA #define CLCD_SPI_EXTRA_CS SDSS #endif diff --git a/Marlin/src/lcd/extui/malyan/malyan.cpp b/Marlin/src/lcd/extui/malyan/malyan.cpp index 66c52878cc..1c051f4504 100644 --- a/Marlin/src/lcd/extui/malyan/malyan.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan.cpp @@ -167,7 +167,7 @@ void process_lcd_eb_command(const char *command) { char message_buffer[MAX_CURLY_COMMAND]; uint8_t done_pct = print_job_timer.isRunning() ? (iteration * 10) : 100; iteration = (iteration + 1) % 10; // Provide progress animation - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (ExtUI::isPrintingFromMedia() || ExtUI::isPrintingFromMediaPaused()) done_pct = card.percentDone(); #endif @@ -180,7 +180,7 @@ void process_lcd_eb_command(const char *command) { #else 0, 0, #endif - TERN(SDSUPPORT, done_pct, 0), + TERN(HAS_MEDIA, done_pct, 0), elapsed_buffer ); write_to_lcd(message_buffer); @@ -257,7 +257,7 @@ void process_lcd_p_command(const char *command) { break; case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes default: { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // Print file 000 - a three digit number indicating which // file to print in the SD card. If it's a directory, // then switch to the directory. @@ -316,7 +316,7 @@ void process_lcd_s_command(const char *command) { } break; case 'L': { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!card.isMounted()) card.mount(); // A more efficient way to do this would be to diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index 8bffa442b6..042062b7c9 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -78,7 +78,7 @@ namespace ExtUI { while (LCD_SERIAL.available()) parse_lcd_byte((byte)LCD_SERIAL.read()); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA // The way last printing status works is simple: // The UI needs to see at least one TQ which is not 100% // and then when the print is complete, one which is. diff --git a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp index a214e7d1e0..f0609f4ebb 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp @@ -85,7 +85,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { lv_clear_dialog(); lv_draw_printing(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!gcode_preview_over) { char *cur_name; cur_name = strrchr(list_file.file_name[sel_id], '/'); @@ -121,7 +121,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { lv_clear_dialog(); lv_draw_ready_print(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uiCfg.print_state = IDLE; card.abortFilePrintSoon(); #endif diff --git a/Marlin/src/lcd/extui/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/mks_ui/draw_operation.cpp index ffe714fca9..bf39a52fe9 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_operation.cpp @@ -70,7 +70,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { uiCfg.extruderIndexBak = active_extruder; #endif if (uiCfg.print_state == WORKING) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA card.pauseSDPrint(); stop_print_time(); uiCfg.print_state = PAUSING; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index 6b41981fb8..4997641e15 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -55,7 +55,7 @@ extern char public_buf_m[100]; uint8_t sel_id = 0; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA static uint8_t search_file() { int valid_name_cnt = 0; @@ -100,10 +100,10 @@ uint8_t sel_id = 0; return valid_name_cnt; } -#endif // SDSUPPORT +#endif // HAS_MEDIA bool have_pre_pic(char *path) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA char *ps1, *ps2, *cur_name = strrchr(path, '/'); card.openFileRead(cur_name); card.read(public_buf, 512); @@ -130,7 +130,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA file_count = search_file(); #endif if (file_count != 0) { @@ -144,7 +144,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_last_offset > 0) { list_file.Sd_file_cnt = 0; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA file_count = search_file(); #endif if (file_count != 0) { @@ -161,7 +161,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); if (ch) { *ch = 0; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA card.cdup(); #endif dir_offset[curDirLever].curPage = 0; @@ -169,7 +169,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { dir_offset[curDirLever].cur_page_last_offset = 0; curDirLever--; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA file_count = search_file(); #endif lv_clear_print_file(); @@ -189,7 +189,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { strcpy(list_file.curDirPath, list_file.file_name[i]); curDirLever++; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA file_count = search_file(); #endif lv_clear_print_file(); @@ -222,7 +222,7 @@ void lv_draw_print_file() { ZERO(list_file.curDirPath); list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA card.mount(); file_count = search_file(); #endif @@ -359,7 +359,7 @@ void disp_gcode_icon(uint8_t file_num) { } uint32_t lv_open_gcode_file(char *path) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uint32_t *ps4; uintptr_t pre_sread_cnt = UINTPTR_MAX; char *cur_name; @@ -375,7 +375,7 @@ uint32_t lv_open_gcode_file(char *path) { card.setIndex(pre_sread_cnt); } return pre_sread_cnt; - #endif // SDSUPPORT + #endif // HAS_MEDIA } int ascii2dec_test(char *ascii) { @@ -395,7 +395,7 @@ int ascii2dec_test(char *ascii) { } void lv_gcode_file_read(uint8_t *data_buf) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uint16_t i = 0, j = 0, k = 0; uint16_t row_1 = 0; bool ignore_start = true; @@ -454,10 +454,10 @@ void lv_gcode_file_read(uint8_t *data_buf) { } #endif // !HAS_TFT_LVGL_UI_SPI memcpy(data_buf, public_buf, 200); - #endif // SDSUPPORT + #endif // HAS_MEDIA } -void lv_close_gcode_file() {TERN_(SDSUPPORT, card.closefile());} +void lv_close_gcode_file() {TERN_(HAS_MEDIA, card.closefile());} void lv_gcode_file_seek(uint32_t pos) { card.setIndex(pos); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp index 5dc3861f65..345c5dd732 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_printing.cpp @@ -80,7 +80,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_PAUSE: if (uiCfg.print_state == WORKING) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA card.pauseSDPrint(); stop_print_time(); uiCfg.print_state = PAUSING; @@ -274,13 +274,13 @@ void setProBarRate() { volatile long long rate_tmp_r; if (!gCfgItems.from_flash_pic) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA rate_tmp_r = (long long)card.getIndex() * 100; #endif rate = rate_tmp_r / gCfgItems.curFilesize; } else { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA rate_tmp_r = (long long)card.getIndex(); #endif rate = (rate_tmp_r - (PREVIEW_SIZE + To_pre_view)) * 100 / (gCfgItems.curFilesize - (PREVIEW_SIZE + To_pre_view)); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index b510e3c0c6..102109a136 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -563,7 +563,7 @@ char *creat_title_text() { uintptr_t gPicturePreviewStart = 0; void preview_gcode_prehandle(char *path) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uintptr_t pre_read_cnt = 0; uint32_t *p1; char *cur_name; @@ -593,7 +593,7 @@ char *creat_title_text() { } void gcode_preview(char *path, int xpos_pixel, int ypos_pixel) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA volatile uint32_t i, j; volatile uint16_t *p_index; char *cur_name; @@ -672,7 +672,7 @@ char *creat_title_text() { } return; } - #endif // SDSUPPORT + #endif // HAS_MEDIA } void draw_default_preview(int xpos_pixel, int ypos_pixel, uint8_t sel) { @@ -1345,7 +1345,7 @@ void lv_screen_menu_item_onoff_update(lv_obj_t *btn, const bool curValue) { lv_label_set_text((lv_obj_t*)btn->child_ll.head, curValue ? machine_menu.enable : machine_menu.disable); } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void sd_detection() { static bool last_sd_status; @@ -1377,7 +1377,7 @@ void LV_TASK_HANDLER() { if (TERN1(USE_SPI_DMA_TC, !get_lcd_dma_lock())) lv_task_handler(); - #if BOTH(MKS_TEST, SDSUPPORT) + #if BOTH(MKS_TEST, HAS_MEDIA) if (mks_test_flag == 0x1E) mks_hardware_test(); #endif diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index 24e177df39..45a54f6177 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -159,7 +159,7 @@ void mks_test_beeper() { buzzer.click(100); } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA void mks_gpio_test() { init_test_gpio(); @@ -677,7 +677,7 @@ void disp_assets_update_progress(FSTR_P const fmsg) { #endif } -#if BOTH(MKS_TEST, SDSUPPORT) +#if BOTH(MKS_TEST, HAS_MEDIA) uint8_t mks_test_flag = 0; const char *MKSTestPath = "MKS_TEST"; void mks_test_get() { diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.h b/Marlin/src/lcd/extui/mks_ui/mks_hardware.h index c0cdacd963..6a2574e3b0 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.h +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.h @@ -26,7 +26,7 @@ #include // Functions for MKS_TEST -#if BOTH(MKS_TEST, SDSUPPORT) +#if BOTH(MKS_TEST, HAS_MEDIA) void mks_hardware_test(); void mks_test_get(); void mks_gpio_test(); diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp index d642d81f6b..6570176a29 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp @@ -36,7 +36,7 @@ extern uint16_t DeviceCode; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern char *createFilename(char * const buffer, const dir_t &p); #endif @@ -374,7 +374,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { return Pic_SaveAddr; } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA static void dosName2LongName(const char dosName[11], char *longName) { uint8_t j = 0; @@ -547,7 +547,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { void spi_flash_read_test() { W25QXX.SPI_FLASH_BufferRead(public_buf, UNIGBK_FLASH_ADDR, BMP_WRITE_BUF_LEN); } #endif -#endif // SDSUPPORT +#endif // HAS_MEDIA void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff) { uint8_t i, j; diff --git a/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp index 8f5b89cf34..26979af270 100644 --- a/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp @@ -45,7 +45,7 @@ extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; void printer_state_polling() { char str_1[16]; if (uiCfg.print_state == PAUSING) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) uiCfg.waitEndMoves++; diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 08db5ae7ad..972349d287 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -78,7 +78,7 @@ XPT2046 touch; static lv_disp_buf_t disp_buf; lv_group_t* g; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void UpdateAssets(); #endif uint16_t DeviceCode = 0x9488; @@ -153,7 +153,7 @@ void tft_lvgl_init() { hal.watchdog_refresh(); // LVGL init takes time - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA UpdateAssets(); hal.watchdog_refresh(); // LVGL init takes time TERN_(MKS_TEST, mks_test_get()); @@ -246,7 +246,7 @@ void tft_lvgl_init() { if (ready) lv_draw_ready_print(); - #if BOTH(MKS_TEST, SDSUPPORT) + #if BOTH(MKS_TEST, HAS_MEDIA) if (mks_test_flag == 0x1E) mks_gpio_test(); #endif } diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index d6d2ce3945..cf2411ee7e 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -135,7 +135,7 @@ void wifi_reset() { void mount_file_sys(const uint8_t disk_type) { switch (disk_type) { - case FILE_SYS_SD: TERN_(SDSUPPORT, card.mount()); break; + case FILE_SYS_SD: TERN_(HAS_MEDIA, card.mount()); break; case FILE_SYS_USB: break; } } @@ -718,7 +718,7 @@ void get_file_list(const char * const path, const bool with_longnames) { if (!path) return; if (gCfgItems.fileSysType == FILE_SYS_SD) { - TERN_(SDSUPPORT, card.mount()); + TERN_(HAS_MEDIA, card.mount()); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { // udisk @@ -993,7 +993,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) { uiCfg.print_state = WORKING; lv_draw_printing(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!gcode_preview_over) { char *cur_name = strrchr(list_file.file_name[sel_id], '/'); @@ -1058,7 +1058,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) { clear_cur_ui(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA card.pauseSDPrint(); uiCfg.print_state = PAUSING; #endif @@ -1077,7 +1077,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) { stop_print_time(); clear_cur_ui(); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA uiCfg.print_state = IDLE; card.abortFilePrintSoon(); #endif @@ -1118,7 +1118,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) { } mount_file_sys(gCfgItems.fileSysType); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA char *cur_name = strrchr(list_file.file_name[sel_id], '/'); card.openFileWrite(cur_name); if (card.isFileOpen()) { @@ -1529,7 +1529,7 @@ static void file_first_msg_handle(const uint8_t * const msg, const uint16_t msgL ZERO(saveFilePath); if (gCfgItems.fileSysType == FILE_SYS_SD) { - TERN_(SDSUPPORT, card.mount()); + TERN_(HAS_MEDIA, card.mount()); } else if (gCfgItems.fileSysType == FILE_SYS_USB) { // nothing @@ -1541,11 +1541,11 @@ static void file_first_msg_handle(const uint8_t * const msg, const uint16_t msgL wifiTransError.start_tick = 0; wifiTransError.now_tick = 0; - TERN_(SDSUPPORT, card.closefile()); + TERN_(HAS_MEDIA, card.closefile()); wifi_delay(1000); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA char dosName[FILENAME_LENGTH]; @@ -1574,7 +1574,7 @@ static void file_first_msg_handle(const uint8_t * const msg, const uint16_t msgL return; } - #endif // SDSUPPORT + #endif // HAS_MEDIA wifi_link_state = WIFI_TRANS_FILE; @@ -1774,7 +1774,7 @@ void stopEspTransfer() { if (wifi_link_state == WIFI_TRANS_FILE) wifi_link_state = WIFI_CONNECTED; - TERN_(SDSUPPORT, card.closefile()); + TERN_(HAS_MEDIA, card.closefile()); if (upload_result != 3) { wifiTransError.flag = 1; diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 2b1f05d2bc..a742a82a5b 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1082,14 +1082,14 @@ namespace ExtUI { #endif void printFile(const char *filename) { - TERN(SDSUPPORT, card.openAndPrintFile(filename), UNUSED(filename)); + TERN(HAS_MEDIA, card.openAndPrintFile(filename), UNUSED(filename)); } bool isPrintingFromMediaPaused() { - return TERN0(SDSUPPORT, IS_SD_PAUSED()); + return TERN0(HAS_MEDIA, IS_SD_PAUSED()); } - bool isPrintingFromMedia() { return TERN0(SDSUPPORT, IS_SD_PRINTING() || IS_SD_PAUSED()); } + bool isPrintingFromMedia() { return TERN0(HAS_MEDIA, IS_SD_PRINTING() || IS_SD_PAUSED()); } bool isPrinting() { return commandsInQueue() || isPrintingFromMedia() || printJobOngoing() || printingIsPaused(); @@ -1099,7 +1099,7 @@ namespace ExtUI { return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused()); } - bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED()); } + bool isMediaInserted() { return TERN0(HAS_MEDIA, IS_SD_INSERTED()); } void pausePrint() { ui.pause_print(); } void resumePrint() { ui.resume_print(); } @@ -1138,7 +1138,7 @@ namespace ExtUI { void FileList::refresh() { } bool FileList::seek(const uint16_t pos, const bool skip_range_check) { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (!skip_range_check && (pos + 1) > count()) return false; card.selectFileByIndexSorted(pos); return card.filename[0] != '\0'; @@ -1150,35 +1150,35 @@ namespace ExtUI { } const char* FileList::filename() { - return TERN(SDSUPPORT, card.longest_filename(), ""); + return TERN(HAS_MEDIA, card.longest_filename(), ""); } const char* FileList::shortFilename() { - return TERN(SDSUPPORT, card.filename, ""); + return TERN(HAS_MEDIA, card.filename, ""); } const char* FileList::longFilename() { - return TERN(SDSUPPORT, card.longFilename, ""); + return TERN(HAS_MEDIA, card.longFilename, ""); } bool FileList::isDir() { - return TERN0(SDSUPPORT, card.flag.filenameIsDir); + return TERN0(HAS_MEDIA, card.flag.filenameIsDir); } uint16_t FileList::count() { - return TERN0(SDSUPPORT, card.get_num_items()); + return TERN0(HAS_MEDIA, card.get_num_items()); } bool FileList::isAtRootDir() { - return TERN1(SDSUPPORT, card.flag.workDirIsRoot); + return TERN1(HAS_MEDIA, card.flag.workDirIsRoot); } void FileList::upDir() { - TERN_(SDSUPPORT, card.cdup()); + TERN_(HAS_MEDIA, card.cdup()); } void FileList::changeDir(const char * const dirname) { - TERN(SDSUPPORT, card.cd(dirname), UNUSED(dirname)); + TERN(HAS_MEDIA, card.cd(dirname), UNUSED(dirname)); } } // namespace ExtUI diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index c1ec15dc19..0153a11a15 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -339,7 +339,7 @@ void MarlinUI::init() { uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) millis_t MarlinUI::next_filament_display; // = 0 #endif @@ -353,7 +353,7 @@ void MarlinUI::init() { bool MarlinUI::did_first_redraw; #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if MARLINUI_SCROLL_NAME uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max; @@ -670,7 +670,7 @@ void MarlinUI::init() { #if HAS_MARLINUI_MENU if (use_click()) { - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) pause_filament_display(); #endif goto_screen(menu_main); @@ -1490,7 +1490,7 @@ void MarlinUI::init() { FSTR_P msg; if (printingIsPaused()) msg = GET_TEXT_F(MSG_PRINT_PAUSED); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA else if (IS_SD_PRINTING()) return set_status(card.longest_filename(), true); #endif @@ -1587,7 +1587,7 @@ void MarlinUI::init() { #if HAS_WIRED_LCD - #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) const millis_t ms = millis(); #endif @@ -1598,7 +1598,7 @@ void MarlinUI::init() { #endif #endif - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) pause_filament_display(ms); // Show status message for 5s #endif @@ -1651,12 +1651,12 @@ void MarlinUI::init() { #if HAS_DISPLAY - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA extern bool wait_for_user, wait_for_heatup; #endif void MarlinUI::abort_print() { - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA wait_for_heatup = wait_for_user = false; card.abortFilePrintSoon(); #endif @@ -1699,7 +1699,7 @@ void MarlinUI::init() { #if ENABLED(PARK_HEAD_ON_PAUSE) pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); // Show message immediately to let user know about pause in progress queue.inject(F("M25 P\nM24")); - #elif ENABLED(SDSUPPORT) + #elif HAS_MEDIA queue.inject(F("M25")); #elif defined(ACTION_ON_PAUSE) hostui.pause(); @@ -1709,7 +1709,7 @@ void MarlinUI::init() { void MarlinUI::resume_print() { reset_status(); TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false); - TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR)); + TERN_(HAS_MEDIA, if (IS_SD_PAUSED()) queue.inject_P(M24_STR)); #ifdef ACTION_ON_RESUME hostui.resume(); #endif @@ -1754,7 +1754,7 @@ void MarlinUI::init() { MarlinUI::progress_t MarlinUI::_get_progress() { return ( TERN0(SET_PROGRESS_PERCENT, (progress_override & PROGRESS_MASK)) - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA ?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone()) #endif ); @@ -1784,7 +1784,7 @@ void MarlinUI::init() { #endif // HAS_PRINT_PROGRESS -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #if ENABLED(EXTENSIBLE_UI) #include "extui/ui_api.h" @@ -1837,7 +1837,7 @@ void MarlinUI::init() { #endif } -#endif // SDSUPPORT +#endif // HAS_MEDIA #if HAS_MARLINUI_MENU void MarlinUI::reset_settings() { diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index de1e30fe4e..65176507fc 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -248,7 +248,7 @@ public: } #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #define MEDIA_MENU_GATEWAY TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media) static void media_changed(const uint8_t old_stat, const uint8_t stat); #endif @@ -467,7 +467,7 @@ public: FORCE_INLINE static void refresh_contrast() { set_contrast(contrast); } #endif - #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) + #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) static millis_t next_filament_display; static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; } #endif @@ -529,7 +529,7 @@ public: static void completion_feedback(const bool=true) {} #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #if BOTH(SCROLL_LONG_FILENAMES, HAS_MARLINUI_MENU) #define MARLINUI_SCROLL_NAME 1 #endif diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 06d9c846cc..9d824e2a4c 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -191,7 +191,7 @@ class MenuEditItemBase : public MenuItemBase { static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } }; -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA class CardReader; class MenuItem_sdbase { public: @@ -207,7 +207,7 @@ class MenuEditItemBase : public MenuItemBase { void menu_main(); void menu_move(); -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void menu_media(); #endif diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 3b1cd73745..a202f624f7 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -43,10 +43,10 @@ #include "game/game.h" #endif -#if EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL) +#if EITHER(HAS_MEDIA, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL) #define MACHINE_CAN_STOP 1 #endif -#if ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE) +#if ANY(HAS_MEDIA, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE) #define MACHINE_CAN_PAUSE 1 #endif @@ -234,7 +234,7 @@ void menu_configuration(); void menu_main() { const bool busy = printingIsActive() - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA , card_detected = card.isMounted() , card_open = card_detected && card.isFileOpen() #endif @@ -243,7 +243,7 @@ void menu_main() { START_MENU(); BACK_ITEM(MSG_INFO_SCREEN); - #if ENABLED(SDSUPPORT) && !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL + #if HAS_MEDIA && !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL #define MEDIA_MENU_AT_TOP #endif @@ -273,7 +273,7 @@ void menu_main() { #endif } else { - #if BOTH(SDSUPPORT, MEDIA_MENU_AT_TOP) + #if BOTH(HAS_MEDIA, MEDIA_MENU_AT_TOP) // BEGIN MEDIA MENU #if ENABLED(MENU_ADDAUTOSTART) ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files @@ -388,7 +388,7 @@ void menu_main() { GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80")); #endif - #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP) + #if HAS_MEDIA && DISABLED(MEDIA_MENU_AT_TOP) // BEGIN MEDIA MENU #if ENABLED(MENU_ADDAUTOSTART) ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 79cca1d97a..e32f41a9a6 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_MENU, SDSUPPORT) +#if BOTH(HAS_MARLINUI_MENU, HAS_MEDIA) #include "menu_item.h" #include "../../sd/cardreader.h" @@ -161,4 +161,4 @@ void menu_media() { TERN(MULTI_VOLUME, menu_media_select, menu_media_filelist)(); } -#endif // HAS_MARLINUI_MENU && SDSUPPORT +#endif // HAS_MARLINUI_MENU && HAS_MEDIA diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 638e32a9b3..cf5911cdc1 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -36,7 +36,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) +#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) #include "../../feature/filwidth.h" #include "../../gcode/parser.h" #endif @@ -326,7 +326,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(TOUCH_SCREEN) add_control(900, y, menu_main, imgSettings); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA const bool cm = card.isMounted(), pa = printingIsActive(); if (cm && pa) add_control(12, y, STOP, imgCancel, true, COLOR_CONTROL_CANCEL); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index e606dca7ce..bac7586a25 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -36,7 +36,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) +#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) #include "../../feature/filwidth.h" #include "../../gcode/parser.h" #endif @@ -448,7 +448,7 @@ void MarlinUI::draw_status_screen() { #endif , menu_main, imgSettings ); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA const bool cm = card.isMounted(), pa = printingIsActive(); if (cm && pa) add_control(0, TERN(TFT_COLOR_UI_PORTRAIT, 210, 130), STOP, imgCancel, true, COLOR_CONTROL_CANCEL); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index edc3d321f2..efb58754c7 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -36,7 +36,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" -#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) +#if DISABLED(LCD_PROGRESS_BAR) && BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA) #include "../../feature/filwidth.h" #include "../../gcode/parser.h" #endif @@ -320,7 +320,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(TOUCH_SCREEN) add_control(404, y, menu_main, imgSettings); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA const bool cm = card.isMounted(), pa = printingIsActive(); if (cm && pa) add_control(12, y, STOP, imgCancel, true, COLOR_CONTROL_CANCEL); diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 6dee62820e..962daadb19 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -188,7 +188,7 @@ void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t s tft.add_text(TFT_WIDTH - 1 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string); } -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { menu_item(row, sel); diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 02af062eca..56444d1aee 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -38,7 +38,7 @@ #include HAL_PATH(../HAL, endstop_interrupts.h) #endif -#if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) +#if BOTH(SD_ABORT_ON_ENDSTOP_HIT, HAS_MEDIA) #include "printcounter.h" // for print_job_timer #endif @@ -352,7 +352,7 @@ void Endstops::event_handler() { ) ); - #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) + #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, HAS_MEDIA) if (planner.abort_on_endstop_hit) { card.abortFilePrintNow(); quickstop_stepper(); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 5bf809c955..3274136f41 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1929,7 +1929,7 @@ void Temperature::task() { quickstop_stepper(); } - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately emergency_parser.sd_abort_by_M524 = false; card.flag.abort_sd_printing = true; diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 493269cf2c..cfb682df54 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -179,7 +179,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - #if BOTH(MKS_MINI_12864_V3, SDSUPPORT) + #if BOTH(MKS_MINI_12864_V3, HAS_MEDIA) #define PAUSE_LCD_FOR_BUSY_SD #endif #else diff --git a/Marlin/src/pins/esp32/pins_PANDA_common.h b/Marlin/src/pins/esp32/pins_PANDA_common.h index c66bdf0bd1..971525622a 100644 --- a/Marlin/src/pins/esp32/pins_PANDA_common.h +++ b/Marlin/src/pins/esp32/pins_PANDA_common.h @@ -107,7 +107,7 @@ // // SD Card // -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SD_MOSI_PIN EXP2_06_PIN #define SD_MISO_PIN EXP2_01_PIN #define SD_SCK_PIN EXP2_02_PIN diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index d7f53568e6..b414c0015f 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -136,7 +136,7 @@ #define TEMP_BED_PIN 2 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index 7cbad6a7f9..423c89b8c9 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -134,7 +134,7 @@ #error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU B300 v1.0" #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #error "SDSUPPORT is not supported by the BIQU B300 v1.0 when an LCD controller is used" #endif @@ -146,7 +146,7 @@ * Software SPI is used to interface with a stand-alone SD card reader connected to EXP1. * Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board. */ -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SD_SCK_PIN P0_15 // EXP1-5 #define SD_MISO_PIN P0_16 // EXP1-4 #define SD_MOSI_PIN P0_18 // EXP1-3 diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h index 914a944027..278ba12dd5 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h @@ -111,7 +111,7 @@ #error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU BQ111-A4" #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #error "SDSUPPORT is not supported by the BIQU BQ111-A4 when an LCD controller is used" #endif @@ -123,7 +123,7 @@ * Software SPI is used to interface with a stand-alone SD card reader connected to EXP1. * Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board. */ -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SD_SCK_PIN P0_15 // EXP1-5 #define SD_MISO_PIN P0_16 // EXP1-4 @@ -131,7 +131,7 @@ #define SD_SS_PIN P1_30 // EXP1-2 #define SDSS SD_SS_PIN -#endif // SDSUPPORT +#endif // HAS_MEDIA /** * PWMS diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h index 6747a7c2bf..70781cb0b5 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h @@ -154,7 +154,7 @@ #define KILL_PIN P2_11 // EXP2-10 - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #error "SDSUPPORT is not currently supported by the Cohesion3D boards" #endif diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h index 4c8dd5c42a..62215a8224 100644 --- a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h @@ -128,7 +128,7 @@ // #define BEEPER_PIN 44 -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SDSS 53 #define SD_DETECT_PIN 49 #endif diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h index d9f4a858da..0541e1af58 100644 --- a/Marlin/src/pins/mega/pins_PICA.h +++ b/Marlin/src/pins/mega/pins_PICA.h @@ -123,7 +123,7 @@ #define SSR_PIN 6 // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/mega/pins_WEEDO_62A.h b/Marlin/src/pins/mega/pins_WEEDO_62A.h index 7b417c19a1..d13de7ed30 100644 --- a/Marlin/src/pins/mega/pins_WEEDO_62A.h +++ b/Marlin/src/pins/mega/pins_WEEDO_62A.h @@ -85,7 +85,7 @@ // // SD Support // -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SDSS 53 #define SD_DETECT_PIN 49 #endif diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h index b77c325029..f6ee06846d 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h @@ -116,7 +116,7 @@ #define TEMP_BED_PIN 14 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 2d92306f89..179bad04a5 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -113,7 +113,7 @@ #define TEMP_BED_PIN 3 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index d84a852915..fd799e0d49 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -119,7 +119,7 @@ #define TEMP_BED_PIN 14 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h index 663c6e4792..19b048ec81 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h @@ -76,7 +76,7 @@ #define TEMP_BED_PIN 1 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h index 8eab6c7d9b..afd31eeead 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h @@ -72,7 +72,7 @@ // SPI for MAX Thermocouple #undef TEMP_0_CS_PIN -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card #else #define TEMP_0_CS_PIN 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 258b9ccca6..ba3c97c87a 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -241,7 +241,7 @@ // #define BEEPER_PIN 44 -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SDSS 53 #define SD_DETECT_PIN 49 #endif diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h index dd9cafc306..f68b9ef8a6 100644 --- a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h +++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h @@ -125,7 +125,7 @@ #define TEMP_BED_PIN 14 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN -1 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN -1 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 56ebf2c663..7078b11b6b 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -178,7 +178,7 @@ #endif // SPI for MAX Thermocouple -//#if DISABLED(SDSUPPORT) +//#if !HAS_MEDIA // #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card //#else // #define TEMP_0_CS_PIN 66 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h index c8a168228d..bd6cb7a6cd 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -83,7 +83,7 @@ #define TEMP_BED_PIN 1 // Analog Input (BED thermistor) // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN -1 #else #define TEMP_0_CS_PIN -1 diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index 66d4f713f8..41d43c0b04 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -72,7 +72,7 @@ #define TEMP_BOARD_PIN 5 // Analog Input (OnBoard thermistor beta 3950) // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 53 #else #define TEMP_0_CS_PIN 53 diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index 7ebb24fde9..9301167959 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -180,7 +180,7 @@ #define TEMP_BED_PIN 4 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 53 #else #define TEMP_0_CS_PIN 49 diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index 04a4b69ae1..92de79bd7f 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -57,7 +57,7 @@ // SPI for MAX Thermocouple #undef TEMP_0_CS_PIN -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 69 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 69 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index e1b0d7edc8..c84d84105c 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -110,7 +110,7 @@ #define TEMP_BED_PIN 0 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 53 #else #define TEMP_0_CS_PIN 49 diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index b02ddef166..2a0733c601 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -82,7 +82,7 @@ #define TEMP_BED_PIN 11 // Analog Input // SPI for MAX Thermocouple -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 67 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 67 // Don't use 49 (SD_DETECT_PIN) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 8b078371e9..516063d158 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -145,7 +145,7 @@ // SPI for MAX Thermocouple /* -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN EXP1_08_PIN #else #define TEMP_0_CS_PIN 49 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 8f107ff4e5..9e9aeb9fec 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -135,7 +135,7 @@ // SPI for MAX Thermocouple /* -#if DISABLED(SDSUPPORT) +#if !HAS_MEDIA #define TEMP_0_CS_PIN 53 #else #define TEMP_0_CS_PIN 49 diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index dce01177be..1e449579cf 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -159,7 +159,7 @@ // // SD card // -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SDSS 4 #endif #define SD_DETECT_PIN -1 diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index 347ef8451d..bd8a2d9762 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -201,7 +201,7 @@ #define SDCARD_CONNECTION CUSTOM_CABLE #endif -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 869b1e859d..7b0206e287 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -173,7 +173,7 @@ // #define BEEPER_PIN PC13 - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #define SDSS PA15 #define SD_DETECT_PIN PD2 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index 367cace424..33dedf7e8e 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -238,7 +238,7 @@ #define EXP2_07_PIN PB11 #define EXP2_08_PIN -1 // RESET -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h index b281a8e2a3..c4a7cd886f 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h @@ -262,7 +262,7 @@ // SD Support // Onboard SD card use hardware SPI3 (defined in variant), LCD SD card use hardware SPI1 // -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION LCD #endif diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index a17d31f063..e4150f3bd2 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -160,7 +160,7 @@ #define KILL_PIN PD5 #define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #define SD_DETECT_PIN EXP2_07_PIN #define SD_SS_PIN PB15 // USD_CS -> CS for onboard SD #endif @@ -198,7 +198,7 @@ // #if HAS_WIRED_LCD - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #define SDSS PB6 // CS for SD card in LCD #endif diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 5ee0db2b9e..cf403d4b3a 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -35,7 +35,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "SdBaseFile.h" @@ -2269,4 +2269,4 @@ int16_t SdBaseFile::write(const void *buf, const uint16_t nbyte) { return -1; } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/sd/SdFatUtil.cpp b/Marlin/src/sd/SdFatUtil.cpp index e6f7a9a013..a68bd73ebe 100644 --- a/Marlin/src/sd/SdFatUtil.cpp +++ b/Marlin/src/sd/SdFatUtil.cpp @@ -31,7 +31,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "SdFatUtil.h" #include @@ -59,4 +59,4 @@ #endif -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/sd/SdFile.cpp b/Marlin/src/sd/SdFile.cpp index a1dd793727..c6a3577e1d 100644 --- a/Marlin/src/sd/SdFile.cpp +++ b/Marlin/src/sd/SdFile.cpp @@ -31,7 +31,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "SdFile.h" @@ -95,4 +95,4 @@ void SdFile::writeln_P(PGM_P const str) { write_P(PSTR("\r\n")); } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/sd/SdVolume.cpp b/Marlin/src/sd/SdVolume.cpp index 8c06c74537..1b8cdbdcae 100644 --- a/Marlin/src/sd/SdVolume.cpp +++ b/Marlin/src/sd/SdVolume.cpp @@ -31,7 +31,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA #include "SdVolume.h" @@ -402,4 +402,4 @@ bool SdVolume::init(DiskIODriver * const dev, const uint8_t part) { return true; } -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 3a377d694d..4e864e5672 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -22,7 +22,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA //#define DEBUG_CARDREADER @@ -172,7 +172,7 @@ CardReader::CardReader() { workDirDepth = 0; ZERO(workDirParents); - #if BOTH(SDSUPPORT, HAS_SD_DETECT) + #if BOTH(HAS_MEDIA, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif @@ -1368,4 +1368,4 @@ void CardReader::fileHasFinished() { #endif // POWER_LOSS_RECOVERY -#endif // SDSUPPORT +#endif // HAS_MEDIA diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index d5eca9c915..3b7b7debcf 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -23,7 +23,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(SDSUPPORT) +#if HAS_MEDIA extern const char M23_STR[], M24_STR[]; @@ -364,7 +364,7 @@ private: extern CardReader card; -#else // !SDSUPPORT +#else // !HAS_MEDIA #define IS_SD_PRINTING() false #define IS_SD_FETCHING() false @@ -373,4 +373,4 @@ extern CardReader card; #define LONG_FILENAME_LENGTH 0 -#endif // !SDSUPPORT +#endif // !HAS_MEDIA diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index 344669c49b..9bdcac5db1 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -68,7 +68,7 @@ #if ENABLED(ADVANCED_PAUSE_FEATURE) #define HAS_MENU_FILAMENT #endif - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #define HAS_MENU_MEDIA #endif #if ENABLED(MIXING_EXTRUDER) diff --git a/ini/features.ini b/ini/features.ini index 3c5eb1adec..a8ee50b9ed 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -220,7 +220,7 @@ BABYSTEPPING = src_filter=+ Z_PROBE_SLED = src_filter=+ G38_PROBE_TARGET = src_filter=+ MAGNETIC_PARKING_EXTRUDER = src_filter=+ -SDSUPPORT = src_filter=+ + + + + + + +HAS_MEDIA = src_filter=+ + + + + + + HAS_MEDIA_SUBCALLS = src_filter=+ GCODE_REPEAT_MARKERS = src_filter=+ + HAS_EXTRUDERS = src_filter=+ + + diff --git a/ini/samd51.ini b/ini/samd51.ini index d7d9b3a421..70bda9ca52 100644 --- a/ini/samd51.ini +++ b/ini/samd51.ini @@ -22,5 +22,5 @@ lib_deps = ${common.lib_deps} SoftwareSerialM extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py -custom_marlin.SDSUPPORT = SdFat - Adafruit Fork, Adafruit SPIFlash +custom_marlin.HAS_MEDIA = SdFat - Adafruit Fork, Adafruit SPIFlash debug_tool = jlink