🧑‍💻 Generalize SDSUPPORT as HAS_MEDIA

In preparation for single- and multi-volume refactoring.
This commit is contained in:
Scott Lahteine 2023-04-22 22:43:09 -05:00
parent ce85b98db4
commit 5664c02d07
164 changed files with 399 additions and 397 deletions

View file

@ -1601,13 +1601,13 @@
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time #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 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 //#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 #define M73_REPORT_SD_ONLY // Report only when printing from SD
#endif #endif
#endif #endif
// LCD Print Progress options. Multiple times may be displayed in turn. // 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_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') //#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
@ -1628,7 +1628,7 @@
#endif #endif
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* SD Card SPI Speed * SD Card SPI Speed
* May be required to resolve "volume init" errors. * May be required to resolve "volume init" errors.
@ -1868,7 +1868,7 @@
#define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE #define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE
#endif #endif
#endif // SDSUPPORT #endif // HAS_MEDIA
/** /**
* By default an onboard SD card reader may be shared as a USB mass- * 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 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) // 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 #define BLOCK_BUFFER_SIZE 8
#elif ENABLED(SDSUPPORT) #elif HAS_MEDIA
#define BLOCK_BUFFER_SIZE 16 #define BLOCK_BUFFER_SIZE 16
#else #else
#define BLOCK_BUFFER_SIZE 16 #define BLOCK_BUFFER_SIZE 16
@ -2527,7 +2527,7 @@
//#define SERIAL_XON_XOFF //#define SERIAL_XON_XOFF
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Enable this option to collect and display the maximum // Enable this option to collect and display the maximum
// RX queue usage after transferring a file to SD. // RX queue usage after transferring a file to SD.
//#define SERIAL_STATS_MAX_RX_QUEUED //#define SERIAL_STATS_MAX_RX_QUEUED

View file

@ -145,12 +145,12 @@ void MarlinHAL::reboot() {
// Free Memory Accessor // Free Memory Accessor
// ------------------------ // ------------------------
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../sd/SdFatUtil.h" #include "../../sd/SdFatUtil.h"
int freeMemory() { return SdFatUtil::FreeRam(); } int freeMemory() { return SdFatUtil::FreeRam(); }
#else // !SDSUPPORT #else // !HAS_MEDIA
extern "C" { extern "C" {
extern char __bss_end; extern char __bss_end;
@ -167,6 +167,6 @@ void MarlinHAL::reboot() {
} }
} }
#endif // !SDSUPPORT #endif // !HAS_MEDIA
#endif // __AVR__ #endif // __AVR__

View file

@ -45,7 +45,7 @@ uint16_t MarlinHAL::adc_result;
#endif #endif
void MarlinHAL::init() { 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 OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif #endif
usb_task_init(); // Initialize the USB stack usb_task_init(); // Initialize the USB stack

View file

@ -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)) #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 ENABLED(TMC_USE_SW_SPI)
#if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) #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." #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."

View file

@ -101,7 +101,7 @@
#define USB_DEVICE_SPECIFIC_REQUEST() usb_task_other_requests() #define USB_DEVICE_SPECIFIC_REQUEST() usb_task_other_requests()
//@} //@}
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* USB Device low level configuration * USB Device low level configuration
* When only one interface is used, these configurations are defined by the class module. * 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 //! Enable id string of interface to add an extra USB string
#define UDI_CDC_IAD_STRING_ID 4 #define UDI_CDC_IAD_STRING_ID 4
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* USB CDC low level configuration * USB CDC low level configuration
* In standalone these configurations are defined by the CDC module. * In standalone these configurations are defined by the CDC module.

View file

@ -6,7 +6,7 @@
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../../sd/cardreader.h" #include "../../../sd/cardreader.h"
extern "C" { 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 // ACCESS_USB == true
#endif // SDSUPPORT #endif // HAS_MEDIA
#endif // ARDUINO_ARCH_SAM #endif // ARDUINO_ARCH_SAM

View file

@ -51,7 +51,7 @@
#include "udc_desc.h" #include "udc_desc.h"
#include "udi_cdc.h" #include "udi_cdc.h"
#if DISABLED(SDSUPPORT) #if !HAS_MEDIA
/** /**
* \defgroup udi_cdc_group_single_desc USB device descriptors for a single interface * \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 #endif // ARDUINO_ARCH_SAM

View file

@ -50,7 +50,7 @@
#include "udd.h" #include "udd.h"
#include "udc_desc.h" #include "udc_desc.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* \defgroup udi_group_desc Descriptors for a USB Device * \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 // ARDUINO_ARCH_SAM
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -57,7 +57,7 @@
#include "ctrl_access.h" #include "ctrl_access.h"
#include <string.h> #include <string.h>
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#ifndef UDI_MSC_NOTIFY_TRANS_EXT #ifndef UDI_MSC_NOTIFY_TRANS_EXT
# define 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 #endif // ARDUINO_ARCH_SAM

View file

@ -51,14 +51,14 @@
#include "conf_usb.h" #include "conf_usb.h"
#include "udc.h" #include "udc.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static volatile bool main_b_msc_enable = false; static volatile bool main_b_msc_enable = false;
#endif #endif
static volatile bool main_b_cdc_enable = false; static volatile bool main_b_cdc_enable = false;
static volatile bool main_b_dtr_active = false; static volatile bool main_b_dtr_active = false;
void usb_task_idle(void) { void usb_task_idle(void) {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Attend SD card access from the USB MSD -- Prioritize access to improve speed // Attend SD card access from the USB MSD -- Prioritize access to improve speed
int delay = 2; int delay = 2;
while (main_b_msc_enable && --delay > 0) { while (main_b_msc_enable && --delay > 0) {
@ -70,7 +70,7 @@ void usb_task_idle(void) {
#endif #endif
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); } bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); }
void usb_task_msc_disable(void) { main_b_msc_enable = false; } void usb_task_msc_disable(void) { main_b_msc_enable = false; }
bool usb_task_msc_isenabled(void) { return main_b_msc_enable; } 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) { bool usb_task_extra_string(void) {
static uint8_t udi_msft_magic[] = "MSFT100\xEE"; static uint8_t udi_msft_magic[] = "MSFT100\xEE";
static uint8_t udi_cdc_name[] = "CDC interface"; static uint8_t udi_cdc_name[] = "CDC interface";
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static uint8_t udi_msc_name[] = "MSC interface"; static uint8_t udi_msc_name[] = "MSC interface";
#endif #endif
struct extra_strings_desc_t { struct extra_strings_desc_t {
usb_str_desc_t header; 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)]; le16_t string[Max(Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msc_name) - 1), sizeof(udi_msft_magic) - 1)];
#else #else
le16_t string[Max(sizeof(udi_cdc_name) - 1, sizeof(udi_msft_magic) - 1)]; 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_lgt = sizeof(udi_cdc_name) - 1;
str = udi_cdc_name; str = udi_cdc_name;
break; break;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case UDI_MSC_STRING_ID: case UDI_MSC_STRING_ID:
str_lgt = sizeof(udi_msc_name) - 1; str_lgt = sizeof(udi_msc_name) - 1;
str = udi_msc_name; str = udi_msc_name;

View file

@ -53,7 +53,7 @@ static SPISettings spiConfig;
// ------------------------ // ------------------------
void spiBegin() { void spiBegin() {
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS) #if HAS_MEDIA && PIN_EXISTS(SD_SS)
OUT_WRITE(SD_SS_PIN, HIGH); OUT_WRITE(SD_SS_PIN, HIGH);
#endif #endif
} }

View file

@ -32,7 +32,7 @@
#include "HAL.h" #include "HAL.h"
#include "SPI.h" #include "SPI.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#if ENABLED(ESP3D_WIFISUPPORT) #if ENABLED(ESP3D_WIFISUPPORT)
#include "sd_ESP32.h" #include "sd_ESP32.h"

View file

@ -24,7 +24,7 @@
#include "../../core/macros.h" #include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.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 #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. // 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 // This requirement can be removed if the SPI access to these devices is updated to use

View file

@ -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) #if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1)
#define PIN_IS_SDA0(P) (P##_PIN == P0_27) #define PIN_IS_SDA0(P) (P##_PIN == P0_27)
#define IS_SCL0(P) (P == P0_28) #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!" #error "SDA0 overlaps with SD_DETECT_PIN!"
#elif PIN_IS_SDA0(E0_AUTO_FAN) #elif PIN_IS_SDA0(E0_AUTO_FAN)
#error "SDA0 overlaps with E0_AUTO_FAN_PIN!" #error "SDA0 overlaps with E0_AUTO_FAN_PIN!"

View file

@ -23,7 +23,7 @@
#include "../../core/macros.h" #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 #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. // 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 // This requirement can be removed if the SPI access to these devices is updated to use

View file

@ -24,7 +24,7 @@
#include "../../core/macros.h" #include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.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 #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. // 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 // This requirement can be removed if the SPI access to these devices is updated to use

View file

@ -105,7 +105,7 @@ void MarlinHAL::dma_init() {}
// HAL initialization task // HAL initialization task
void MarlinHAL::init() { void MarlinHAL::init() {
TERN_(DMA_IS_REQUIRED, dma_init()); TERN_(DMA_IS_REQUIRED, dma_init());
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD)
SET_INPUT_PULLUP(SD_DETECT_PIN); SET_INPUT_PULLUP(SD_DETECT_PIN);
#endif #endif

View file

@ -602,7 +602,7 @@ void MarlinHAL::dma_init() {
// HAL initialization task // HAL initialization task
void MarlinHAL::init() { void MarlinHAL::init() {
TERN_(DMA_IS_REQUIRED, dma_init()); TERN_(DMA_IS_REQUIRED, dma_init());
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD)
SET_INPUT_PULLUP(SD_DETECT_PIN); SET_INPUT_PULLUP(SD_DETECT_PIN);
#endif #endif

View file

@ -70,7 +70,7 @@ void MarlinHAL::init() {
constexpr int cpuFreq = F_CPU; constexpr int cpuFreq = F_CPU;
UNUSED(cpuFreq); 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 OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif #endif

View file

@ -21,7 +21,7 @@
*/ */
#pragma once #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 #define HAS_SD_HOST_DRIVE 1
#endif #endif

View file

@ -29,7 +29,7 @@
//#endif //#endif
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) #if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
#if USE_FALLBACK_EEPROM #if USE_FALLBACK_EEPROM
#warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."

View file

@ -28,7 +28,7 @@
#define USE_SHARED_EEPROM 1 #define USE_SHARED_EEPROM 1
#endif #endif
// Allow SDSUPPORT to be disabled // Allow for no media drives
#if DISABLED(SDSUPPORT) #if !HAS_MEDIA
#undef SDIO_SUPPORT #undef SDIO_SUPPORT
#endif #endif

View file

@ -25,7 +25,7 @@
* Test STM32F1-specific configuration values for errors at compile-time. * 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 #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
#if USE_FALLBACK_EEPROM #if USE_FALLBACK_EEPROM
#warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."

View file

@ -160,7 +160,7 @@
#include "feature/spindle_laser.h" #include "feature/spindle_laser.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
CardReader card; CardReader card;
#endif #endif
@ -363,7 +363,7 @@ void startOrResumeJob() {
print_job_timer.start(); print_job_timer.start();
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
inline void abortSDPrinting() { inline void abortSDPrinting() {
IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel()); 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: * Minimal management of Marlin's core activities:
@ -834,7 +834,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
#endif #endif
// Handle SD Card insert / remove // Handle SD Card insert / remove
TERN_(SDSUPPORT, card.manage_media()); TERN_(HAS_MEDIA, card.manage_media());
// Handle USB Flash Drive insert / remove // Handle USB Flash Drive insert / remove
TERN_(USB_FLASH_DRIVE_SUPPORT, card.diskIODriver()->idle()); TERN_(USB_FLASH_DRIVE_SUPPORT, card.diskIODriver()->idle());
@ -1340,7 +1340,7 @@ void setup() {
#endif #endif
#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 SETUP_RUN(card.mount()); // Mount media with settings before first_load
#endif #endif
@ -1624,7 +1624,7 @@ void setup() {
#endif #endif
#if HAS_TFT_LVGL_UI #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 if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
#endif #endif
SETUP_RUN(tft_lvgl_init()); SETUP_RUN(tft_lvgl_init());
@ -1688,7 +1688,7 @@ void loop() {
do { do {
idle(); idle();
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (card.flag.abort_sd_printing) abortSDPrinting(); if (card.flag.abort_sd_printing) abortSDPrinting();
if (marlin_state == MF_SD_COMPLETE) finishSDPrinting(); if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
#endif #endif

View file

@ -281,7 +281,7 @@ public:
uint8_t data = 0; uint8_t data = 0;
millis_t transfer_window = millis() + RX_TIMESLICE; millis_t transfer_window = millis() + RX_TIMESLICE;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
PORT_REDIRECT(SERIAL_PORTMASK(card.transfer_port_index)); PORT_REDIRECT(SERIAL_PORTMASK(card.transfer_port_index));
#endif #endif

View file

@ -33,7 +33,7 @@
// Static data members // Static data members
bool EmergencyParser::killed_by_M112, // = false bool EmergencyParser::killed_by_M112, // = false
EmergencyParser::quickstop_by_M410, EmergencyParser::quickstop_by_M410,
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
EmergencyParser::sd_abort_by_M524, EmergencyParser::sd_abort_by_M524,
#endif #endif
EmergencyParser::enabled; EmergencyParser::enabled;

View file

@ -58,7 +58,7 @@ public:
EP_M10, EP_M108, EP_M10, EP_M108,
EP_M11, EP_M112, EP_M11, EP_M112,
EP_M4, EP_M41, EP_M410, EP_M4, EP_M41, EP_M410,
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
EP_M5, EP_M52, EP_M524, EP_M5, EP_M52, EP_M524,
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
@ -79,7 +79,7 @@ public:
static bool killed_by_M112; static bool killed_by_M112;
static bool quickstop_by_M410; static bool quickstop_by_M410;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static bool sd_abort_by_M524; static bool sd_abort_by_M524;
#endif #endif
@ -152,7 +152,7 @@ public:
case ' ': break; case ' ': break;
case '1': state = EP_M1; break; case '1': state = EP_M1; break;
case '4': state = EP_M4; break; case '4': state = EP_M4; break;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case '5': state = EP_M5; break; case '5': state = EP_M5; break;
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
@ -175,7 +175,7 @@ public:
case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break; case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break;
case EP_M41: state = (c == '0') ? EP_M410 : 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_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break;
case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break; case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break;
#endif #endif
@ -215,7 +215,7 @@ public:
case EP_M108: wait_for_user = wait_for_heatup = false; break; case EP_M108: wait_for_user = wait_for_heatup = false; break;
case EP_M112: killed_by_M112 = true; break; case EP_M112: killed_by_M112 = true; break;
case EP_M410: quickstop_by_M410 = 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; case EP_M524: sd_abort_by_M524 = true; break;
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)

View file

@ -209,7 +209,7 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);
break; break;
case PROMPT_PAUSE_RESUME: case PROMPT_PAUSE_RESUME:
#if BOTH(ADVANCED_PAUSE_FEATURE, SDSUPPORT) #if BOTH(ADVANCED_PAUSE_FEATURE, HAS_MEDIA)
extern const char M24_STR[]; extern const char M24_STR[];
queue.inject_P(M24_STR); queue.inject_P(M24_STR);
#endif #endif

View file

@ -59,7 +59,7 @@ public:
static void onPidTuningDone(LEDColor c) { leds.set_color(c); } static void onPidTuningDone(LEDColor c) { leds.set_color(c); }
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void onPrintCompleted() { static void onPrintCompleted() {
leds.set_green(); leds.set_green();
@ -80,7 +80,7 @@ public:
#endif #endif
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
}; };
extern PrinterEventLEDs printerEventLEDs; extern PrinterEventLEDs printerEventLEDs;

View file

@ -91,7 +91,7 @@ static xyze_pos_t resume_position;
fil_change_settings_t fc_settings[EXTRUDERS]; fil_change_settings_t fc_settings[EXTRUDERS];
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../sd/cardreader.h" #include "../sd/cardreader.h"
#endif #endif
@ -420,7 +420,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
++did_pause_print; ++did_pause_print;
// Pause the print job and timer // Pause the print job and timer
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
const bool was_sd_printing = IS_SD_PRINTING(); const bool was_sd_printing = IS_SD_PRINTING();
if (was_sd_printing) { if (was_sd_printing) {
card.pauseSDPrint(); 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 // Resume the print job timer if it was running
if (print_job_timer.isPaused()) print_job_timer.start(); if (print_job_timer.isPaused()) print_job_timer.start();
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (did_pause_print) { if (did_pause_print) {
--did_pause_print; --did_pause_print;
card.startOrResumeFilePrinting(); card.startOrResumeFilePrinting();

View file

@ -119,7 +119,7 @@ public:
volts.reset(); volts.reset();
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
display_item_ms = 0; display_item_ms = 0;
display_item = 0; display_item = 0;
#endif #endif

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #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 "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -85,4 +85,4 @@ void GcodeSuite::M994() {
card.closefile(); card.closefile();
} }
#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE #endif // SPI_FLASH && HAS_MEDIA && MARLIN_DEV_MODE

View file

@ -88,7 +88,7 @@ void GcodeSuite::M125() {
park_point += hotend_offset[active_extruder]; park_point += hotend_offset[active_extruder];
#endif #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); ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT);

View file

@ -519,7 +519,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 17: M17(); break; // M17: Enable all stepper motors case 17: M17(); break; // M17: Enable all stepper motors
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 20: M20(); break; // M20: List SD card case 20: M20(); break; // M20: List SD card
case 21: M21(); break; // M21: Init SD card case 21: M21(); break; // M21: Init SD card
case 22: M22(); break; // M22: Release 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 #endif
case 928: M928(); break; // M928: Start SD write 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 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
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 524: M524(); break; // M524: Abort the current SD print job case 524: M524(); break; // M524: Abort the current SD print job
#endif #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 case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif #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 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif #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 case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
#endif #endif

View file

@ -642,7 +642,7 @@ private:
static void M18_M84(); static void M18_M84();
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void M20(); static void M20();
static void M21(); static void M21();
static void M22(); static void M22();
@ -658,7 +658,7 @@ private:
static void M31(); static void M31();
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#if HAS_MEDIA_SUBCALLS #if HAS_MEDIA_SUBCALLS
static void M32(); static void M32();
#endif #endif
@ -1062,7 +1062,7 @@ private:
#endif #endif
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void M524(); static void M524();
#endif #endif
@ -1195,7 +1195,7 @@ private:
static void M910(); static void M910();
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void M928(); static void M928();
#endif #endif
@ -1207,7 +1207,7 @@ private:
static void M995(); static void M995();
#endif #endif
#if BOTH(SPI_FLASH, SDSUPPORT) #if BOTH(SPI_FLASH, HAS_MEDIA)
static void M993(); static void M993();
static void M994(); static void M994();
#endif #endif
@ -1229,7 +1229,7 @@ private:
static void M423_report(const bool forReplay=true); static void M423_report(const bool forReplay=true);
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void M1001(); static void M1001();
#endif #endif

View file

@ -199,7 +199,7 @@ void GcodeSuite::D(const int16_t dcode) {
SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset.");
} break; } break;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 101: { // D101 Test SD Write case 101: { // D101 Test SD Write
card.openFileWrite("test.gco"); card.openFileWrite("test.gco");
@ -250,7 +250,7 @@ void GcodeSuite::D(const int16_t dcode) {
card.closefile(); card.closefile();
} break; } break;
#endif // SDSUPPORT #endif // HAS_MEDIA
#if ENABLED(POSTMORTEM_DEBUGGING) #if ENABLED(POSTMORTEM_DEBUGGING)

View file

@ -168,10 +168,10 @@ void GcodeSuite::M115() {
cap_line(F("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT)); cap_line(F("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
// SDCARD (M20, M23, M24, etc.) // SDCARD (M20, M23, M24, etc.)
cap_line(F("SDCARD"), ENABLED(SDSUPPORT)); cap_line(F("SDCARD"), ENABLED(HAS_MEDIA));
// MULTI_VOLUME (M21 S/M21 U) // MULTI_VOLUME (M21 S/M21 U)
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME)); cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME));
#endif #endif
@ -179,7 +179,7 @@ void GcodeSuite::M115() {
cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS)); cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
// SD_WRITE (M928, M28, M29) // 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) // AUTOREPORT_SD_STATUS (M27 extension)
cap_line(F("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS)); cap_line(F("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));

View file

@ -70,7 +70,7 @@ void GcodeSuite::M360() {
config_line(F("InputBuffer"), MAX_CMD_SIZE); config_line(F("InputBuffer"), MAX_CMD_SIZE);
config_line(F("PrintlineCache"), BUFSIZE); config_line(F("PrintlineCache"), BUFSIZE);
config_line(F("MixingExtruder"), ENABLED(MIXING_EXTRUDER)); 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("Fan"), ENABLED(HAS_FAN));
config_line(F("LCD"), ENABLED(HAS_DISPLAY)); config_line(F("LCD"), ENABLED(HAS_DISPLAY));
config_line(F("SoftwarePowerSwitch"), 1); config_line(F("SoftwarePowerSwitch"), 1);

View file

@ -512,7 +512,7 @@ void GCodeQueue::get_serial_commands() {
serial.last_N = gcode_N; serial.last_N = gcode_N;
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Pronterface "M29" and "M29 " has no line number // Pronterface "M29" and "M29 " has no line number
else if (card.flag.saving && !is_M29(command)) { else if (card.flag.saving && !is_M29(command)) {
gcode_line_error(F(STR_ERR_NO_CHECKSUM), p); gcode_line_error(F(STR_ERR_NO_CHECKSUM), p);
@ -562,7 +562,7 @@ void GCodeQueue::get_serial_commands() {
} // queue has space, serial has data } // queue has space, serial has data
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* Get lines from the SD Card until the command buffer is full * 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: * Add to the circular command queue the next command from:
@ -628,7 +628,7 @@ void GCodeQueue::get_available_commands() {
get_serial_commands(); get_serial_commands();
TERN_(SDSUPPORT, get_sdcard_commands()); TERN_(HAS_MEDIA, get_sdcard_commands());
} }
/** /**
@ -667,7 +667,7 @@ void GCodeQueue::advance() {
} }
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (card.flag.saving) { if (card.flag.saving) {
char * const cmd = ring_buffer.peek_next_command_string(); char * const cmd = ring_buffer.peek_next_command_string();
@ -703,7 +703,7 @@ void GCodeQueue::advance() {
gcode.process_next_command(); 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 // 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); ring_buffer.advance_pos(ring_buffer.index_r, -1);

View file

@ -256,7 +256,7 @@ private:
static void get_serial_commands(); static void get_serial_commands();
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static void get_sdcard_commands(); static void get_sdcard_commands();
#endif #endif

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../module/planner.h" #include "../../module/planner.h"
@ -114,4 +114,4 @@ void GcodeSuite::M1001() {
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -51,4 +51,4 @@ void GcodeSuite::M20() {
SERIAL_ECHO_MSG(STR_NO_MEDIA); SERIAL_ECHO_MSG(STR_NO_MEDIA);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -52,4 +52,4 @@ void GcodeSuite::M22() {
if (!IS_SD_PRINTING()) card.release(); if (!IS_SD_PRINTING()) card.release();
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -41,4 +41,4 @@ void GcodeSuite::M23() {
TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0)); TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -101,9 +101,7 @@ void GcodeSuite::M25() {
#else #else
// Set initial pause flag to prevent more commands from landing in the queue while we try to pause // 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(); if (IS_SD_PRINTING()) card.pauseSDPrint();
#endif
#if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(DGUS_LCD_UI_MKS) #if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(DGUS_LCD_UI_MKS)
if (recovery.enabled) recovery.save(true); if (recovery.enabled) recovery.save(true);
@ -125,4 +123,4 @@ void GcodeSuite::M25() {
#endif #endif
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -35,4 +35,4 @@ void GcodeSuite::M26() {
card.setIndex(parser.value_long()); card.setIndex(parser.value_long());
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -49,4 +49,4 @@ void GcodeSuite::M27() {
card.report_status(); card.report_status();
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -69,4 +69,4 @@ void GcodeSuite::M29() {
card.flag.saving = false; card.flag.saving = false;
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -37,4 +37,4 @@ void GcodeSuite::M30() {
} }
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -51,4 +51,4 @@ void GcodeSuite::M524() {
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
@ -36,4 +36,4 @@ void GcodeSuite::M928() {
} }
#endif // SDSUPPORT #endif // HAS_MEDIA

View file

@ -26,6 +26,10 @@
* Conditionals that need to be set before Configuration_adv.h or pins.h * 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 // MKS_LCD12864A/B is a variant of MKS_MINI_12864
#if EITHER(MKS_LCD12864A, MKS_LCD12864B) #if EITHER(MKS_LCD12864A, MKS_LCD12864B)
#define MKS_MINI_12864 #define MKS_MINI_12864
@ -217,7 +221,7 @@
#define IS_TFTGLCD_PANEL 1 #define IS_TFTGLCD_PANEL 1
#define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD #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 #define LCD_PROGRESS_BAR
#endif #endif
#if ENABLED(TFTGLCD_PANEL_I2C) #if ENABLED(TFTGLCD_PANEL_I2C)

View file

@ -794,7 +794,7 @@
#undef MENU_ADDAUTOSTART #undef MENU_ADDAUTOSTART
#endif #endif
#if EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY) #if EITHER(HAS_MEDIA, SET_PROGRESS_MANUALLY)
#define HAS_PRINT_PROGRESS 1 #define HAS_PRINT_PROGRESS 1
#endif #endif
@ -812,7 +812,7 @@
#define HAS_STATUS_MESSAGE_TIMEOUT 1 #define HAS_STATUS_MESSAGE_TIMEOUT 1
#endif #endif
#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH #if HAS_MEDIA && SD_PROCEDURE_DEPTH
#define HAS_MEDIA_SUBCALLS 1 #define HAS_MEDIA_SUBCALLS 1
#endif #endif
@ -850,7 +850,7 @@
#else #else
#undef LED_POWEROFF_TIMEOUT #undef LED_POWEROFF_TIMEOUT
#endif #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 #define HAS_LEDS_OFF_FLAG 1
#endif #endif
#if DISPLAY_SLEEP_MINUTES || TOUCH_IDLE_SLEEP_MINS #if DISPLAY_SLEEP_MINUTES || TOUCH_IDLE_SLEEP_MINS
@ -1148,7 +1148,7 @@
// SD Card connection methods // SD Card connection methods
// Defined here so pins and sanity checks can use them // Defined here so pins and sanity checks can use them
// //
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#define _SDCARD_LCD 1 #define _SDCARD_LCD 1
#define _SDCARD_ONBOARD 2 #define _SDCARD_ONBOARD 2
#define _SDCARD_CUSTOM_CABLE 3 #define _SDCARD_CUSTOM_CABLE 3
@ -1228,7 +1228,7 @@
#endif #endif
// AVR are (usually) too limited in resources to store the configuration into the binary // 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 #undef CONFIGURATION_EMBEDDING
#define CANNOT_EMBED_CONFIGURATION defined(__AVR__) #define CANNOT_EMBED_CONFIGURATION defined(__AVR__)
#endif #endif

View file

@ -510,7 +510,7 @@
* Override the SD_DETECT_STATE set in Configuration_adv.h * Override the SD_DETECT_STATE set in Configuration_adv.h
* and enable sharing of onboard SD host drives (all platforms but AGCM4) * 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) #if HAS_SD_HOST_DRIVE && SD_CONNECTION_IS(ONBOARD)
// //
@ -3351,7 +3351,7 @@
#endif #endif
// Fallback SPI Speed for SD // 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 #define SD_SPI_SPEED SPI_FULL_SPEED
#endif #endif

View file

@ -978,7 +978,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
* Progress Bar * Progress Bar
*/ */
#if ENABLED(LCD_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." #error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY."
#elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
#error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)." #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 * 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." #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER."
#endif #endif
#undef SD_CONNECTION_TYPICAL #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." #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
#elif ENABLED(EXTRUDER_RUNOUT_PREVENT) #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
#error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE." #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
#elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER) #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(HAS_MEDIA, IS_NEWPANEL, EMERGENCY_PARSER)
#error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller." #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) #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
#error "HOME_BEFORE_FILAMENT_CHANGE requires 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 #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 ENABLED(TFT_LVGL_UI)
#if DISABLED(TFT_RES_480x320) #if DISABLED(TFT_RES_480x320)
#error "TFT_LVGL_UI requires TFT_RES_480x320." #error "TFT_LVGL_UI requires TFT_RES_480x320."
#elif DISABLED(SDSUPPORT) #elif !HAS_MEDIA
#error "TFT_LVGL_UI requires SDSUPPORT." #error "TFT_LVGL_UI requires SDSUPPORT."
#endif #endif
#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) #if ENABLED(ANYCUBIC_LCD_CHIRON)
#ifndef BEEPER_PIN #ifndef BEEPER_PIN
#error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN" #error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN"
#elif DISABLED(SDSUPPORT) #elif !HAS_MEDIA
#error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT" #error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT"
#elif TEMP_SENSOR_BED == 0 #elif TEMP_SENSOR_BED == 0
#error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)" #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 * Ender-3 V2 controller has some limitations
*/ */
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#if DISABLED(SDSUPPORT) #if !HAS_MEDIA
#error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled." #error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled."
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
#error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or 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." #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY."
#endif #endif
#elif ENABLED(DWIN_LCD_PROUI) #elif ENABLED(DWIN_LCD_PROUI)
#if DISABLED(SDSUPPORT) #if !HAS_MEDIA
#error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled."
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
#error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or 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 * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
* on boards where TMC drivers share the SPI bus with SD. * 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." #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
#endif #endif

View file

@ -41,7 +41,7 @@
#include "../../module/planner.h" #include "../../module/planner.h"
#include "../../module/motion.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 "../../feature/filwidth.h"
#include "../../gcode/parser.h" #include "../../gcode/parser.h"
#endif #endif
@ -289,7 +289,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
#endif // LCD_PROGRESS_BAR #endif // LCD_PROGRESS_BAR
#if BOTH(SDSUPPORT, HAS_MARLINUI_MENU) #if BOTH(HAS_MEDIA, HAS_MARLINUI_MENU)
// CHARSET_MENU // CHARSET_MENU
const static PROGMEM byte refresh[8] = { const static PROGMEM byte refresh[8] = {
@ -313,7 +313,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
B00000 B00000
}; };
#endif // SDSUPPORT #endif // HAS_MEDIA
#if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(SHOW_BOOTSCREEN)
// Set boot screen corner characters // Set boot screen corner characters
@ -339,7 +339,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
#endif #endif
{ {
createChar_P(LCD_STR_UPLEVEL[0], uplevel); 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 // SD Card sub-menu special characters
createChar_P(LCD_STR_REFRESH[0], refresh); createChar_P(LCD_STR_REFRESH[0], refresh);
createChar_P(LCD_STR_FOLDER[0], folder); 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); 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 // Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) { if (ELAPSED(millis(), next_filament_display)) {
@ -709,7 +709,7 @@ void MarlinUI::draw_status_message(const bool blink) {
return; return;
} }
#endif // FILAMENT_LCD_DISPLAY && SDSUPPORT #endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA
#if ENABLED(STATUS_MESSAGE_SCROLLING) #if ENABLED(STATUS_MESSAGE_SCROLLING)
static bool last_blink = false; 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) { 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] : ' '); lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' ');

View file

@ -52,7 +52,7 @@
#include "../../module/planner.h" #include "../../module/planner.h"
#include "../../module/motion.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 "../../feature/filwidth.h"
#include "../../gcode/parser.h" #include "../../gcode/parser.h"
#endif #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) { void MarlinUI::draw_status_message(const bool blink) {
if (!PanelDetected) return; if (!PanelDetected) return;
lcd_moveto(0, 3); lcd_moveto(0, 3);
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
// Alternate Status message and Filament display // Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) { if (ELAPSED(millis(), next_filament_display)) {
@ -689,7 +689,7 @@ void MarlinUI::draw_status_message(const bool blink) {
return; return;
} }
#endif // FILAMENT_LCD_DISPLAY && SDSUPPORT #endif // FILAMENT_LCD_DISPLAY && HAS_MEDIA
// Get the UTF8 character count of the string // Get the UTF8 character count of the string
uint8_t slen = utf8_strlen(status_message); uint8_t slen = utf8_strlen(status_message);
@ -1061,7 +1061,7 @@ void MarlinUI::draw_status_screen() {
lcd.print_line(); 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) { void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
if (!PanelDetected) return; if (!PanelDetected) return;
@ -1074,7 +1074,7 @@ void MarlinUI::draw_status_screen() {
lcd.print_line(); lcd.print_line();
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
#if ENABLED(LCD_HAS_STATUS_INDICATORS) #if ENABLED(LCD_HAS_STATUS_INDICATORS)

View file

@ -56,7 +56,7 @@
#include "../../module/printcounter.h" #include "../../module/printcounter.h"
#include "../../MarlinCore.h" #include "../../MarlinCore.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../libs/duration_t.h" #include "../../libs/duration_t.h"
#endif #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 (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) { 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)) { 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) #if ENABLED(AUTO_BED_LEVELING_UBL)

View file

@ -36,10 +36,10 @@
// RepRapWorld Graphical LCD // 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_CLASS U8GLIB_ST7920_128X64_4X_HAL
#define U8G_PARAM LCD_PINS_RS #define U8G_PARAM LCD_PINS_RS
#elif ENABLED(SDSUPPORT) && __SAMD21__ #elif HAS_MEDIA && __SAMD21__
#define U8G_CLASS U8GLIB_ST7920_128X64_4X #define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_RS #define U8G_PARAM LCD_PINS_RS
#else #else
@ -52,7 +52,7 @@
// RepRap Discount Full Graphics Smart Controller // RepRap Discount Full Graphics Smart Controller
// and other variant LCDs using ST7920 // 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_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 #define U8G_PARAM LCD_PINS_RS
#else #else

View file

@ -67,7 +67,7 @@
#include "../../feature/power_monitor.h" #include "../../feature/power_monitor.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#endif #endif
@ -742,7 +742,7 @@ void MarlinUI::draw_status_screen() {
#endif #endif
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// //
// SD Card Symbol // SD Card Symbol
// //
@ -756,7 +756,7 @@ void MarlinUI::draw_status_screen() {
// Corner pixel // Corner pixel
u8g.drawPixel(50, 43); // 43 (or 42) u8g.drawPixel(50, 43); // 43 (or 42)
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
#if HAS_PRINT_PROGRESS #if HAS_PRINT_PROGRESS
// Progress bar frame // Progress bar frame
@ -871,7 +871,7 @@ void MarlinUI::draw_status_screen() {
// //
// Filament sensor display if SD is disabled // 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(56, EXTRAS_2_BASELINE, wstring);
lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring);
lcd_put_u8str(F("%")); 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)) { if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) {
lcd_moveto(0, STATUS_BASELINE); lcd_moveto(0, STATUS_BASELINE);
#if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) #if BOTH(FILAMENT_LCD_DISPLAY, HAS_MEDIA)
// Alternate Status message and Filament display // Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) { if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str(F(LCD_STR_FILAM_DIA)); lcd_put_u8str(F(LCD_STR_FILAM_DIA));

View file

@ -81,7 +81,7 @@
#include "../../module/temperature.h" #include "../../module/temperature.h"
#include "../../libs/numtostr.h" #include "../../libs/numtostr.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#endif #endif

View file

@ -4389,7 +4389,7 @@ void CrealityDWINClass::Print_Screen_Control() {
#endif #endif
TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan);
planner.synchronize(); planner.synchronize();
TERN_(SDSUPPORT, queue.inject(F("M24"))); TERN_(HAS_MEDIA, queue.inject(F("M24")));
#endif #endif
} }
else { else {
@ -4427,7 +4427,7 @@ void CrealityDWINClass::Popup_Control() {
#endif #endif
#if ENABLED(PARK_HEAD_ON_PAUSE) #if ENABLED(PARK_HEAD_ON_PAUSE)
Popup_Handler(Home, true); Popup_Handler(Home, true);
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (IS_SD_PRINTING()) card.pauseSDPrint(); if (IS_SD_PRINTING()) card.pauseSDPrint();
#endif #endif
planner.synchronize(); planner.synchronize();

View file

@ -39,7 +39,7 @@
#include "../../../module/temperature.h" #include "../../../module/temperature.h"
#include "../../../module/printcounter.h" #include "../../../module/printcounter.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../../libs/duration_t.h" #include "../../../libs/duration_t.h"
#endif #endif
@ -467,7 +467,7 @@ void MarlinUI::draw_status_message(const bool blink) {
if (yes) draw_boxed_string(true, yes, yesno); 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) { 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)) { 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) #if ENABLED(AUTO_BED_LEVELING_UBL)

View file

@ -39,7 +39,7 @@
#include "../../../module/printcounter.h" #include "../../../module/printcounter.h"
#include "../../../module/planner.h" #include "../../../module/planner.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../../libs/duration_t.h" #include "../../../libs/duration_t.h"
#endif #endif

View file

@ -94,7 +94,7 @@ void AnycubicTFTClass::OnSetup() {
delay_ms(10); delay_ms(10);
// Init the state of the key pins running on the TFT // 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); SET_INPUT_PULLUP(SD_DETECT_PIN);
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
@ -176,7 +176,7 @@ void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg); SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg);
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/** /**
* Need to handle the process of following states * Need to handle the process of following states
* "Nozzle Parked" * "Nozzle Parked"
@ -380,7 +380,7 @@ void AnycubicTFTClass::HandleSpecialMenu() {
} }
void AnycubicTFTClass::RenderCurrentFileList() { void AnycubicTFTClass::RenderCurrentFileList() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
uint16_t selectedNumber = 0; uint16_t selectedNumber = 0;
SelectedDirectory[0] = 0; SelectedDirectory[0] = 0;
SelectedFile[0] = 0; SelectedFile[0] = 0;
@ -404,7 +404,7 @@ void AnycubicTFTClass::RenderCurrentFileList() {
RenderCurrentFolder(selectedNumber); RenderCurrentFolder(selectedNumber);
} }
SENDLINE_PGM("END"); // Filelist stop SENDLINE_PGM("END"); // Filelist stop
#endif // SDSUPPORT #endif // HAS_MEDIA
} }
void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) { void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) {
@ -516,7 +516,7 @@ void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) {
} }
void AnycubicTFTClass::OnPrintTimerStarted() { void AnycubicTFTClass::OnPrintTimerStarted() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (mediaPrintingState == AMPRINTSTATE_PRINTING) if (mediaPrintingState == AMPRINTSTATE_PRINTING)
SENDLINE_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print SENDLINE_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print
@ -524,7 +524,7 @@ void AnycubicTFTClass::OnPrintTimerStarted() {
} }
void AnycubicTFTClass::OnPrintTimerPaused() { void AnycubicTFTClass::OnPrintTimerPaused() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMedia()) { if (isPrintingFromMedia()) {
mediaPrintingState = AMPRINTSTATE_PAUSED; mediaPrintingState = AMPRINTSTATE_PAUSED;
mediaPauseState = AMPAUSESTATE_PARKING; mediaPauseState = AMPAUSESTATE_PARKING;
@ -533,7 +533,7 @@ void AnycubicTFTClass::OnPrintTimerPaused() {
} }
void AnycubicTFTClass::OnPrintTimerStopped() { void AnycubicTFTClass::OnPrintTimerStopped() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (mediaPrintingState == AMPRINTSTATE_PRINTING) { if (mediaPrintingState == AMPRINTSTATE_PRINTING) {
mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;
mediaPauseState = AMPAUSESTATE_NOT_PAUSED; mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
@ -608,7 +608,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
} break; } break;
case 6: // A6 GET SD CARD PRINTING STATUS case 6: // A6 GET SD CARD PRINTING STATUS
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMedia()) { if (isPrintingFromMedia()) {
SEND_PGM("A6V "); SEND_PGM("A6V ");
if (isMediaInserted()) if (isMediaInserted())
@ -637,28 +637,28 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break; break;
case 8: // A8 GET SD LIST case 8: // A8 GET SD LIST
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
SelectedFile[0] = 0; SelectedFile[0] = 0;
RenderCurrentFileList(); RenderCurrentFileList();
#endif #endif
break; break;
case 9: // A9 pause sd print case 9: // A9 pause sd print
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMedia()) if (isPrintingFromMedia())
PausePrint(); PausePrint();
#endif #endif
break; break;
case 10: // A10 resume sd print case 10: // A10 resume sd print
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMediaPaused()) if (isPrintingFromMediaPaused())
ResumePrint(); ResumePrint();
#endif #endif
break; break;
case 11: // A11 STOP SD PRINT case 11: // A11 STOP SD PRINT
TERN_(SDSUPPORT, StopPrint()); TERN_(HAS_MEDIA, StopPrint());
break; break;
case 12: // A12 kill case 12: // A12 kill
@ -666,7 +666,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break; break;
case 13: // A13 SELECTION FILE case 13: // A13 SELECTION FILE
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isMediaInserted()) { if (isMediaInserted()) {
starpos = (strchr(TFTstrchr_pointer + 4, '*')); starpos = (strchr(TFTstrchr_pointer + 4, '*'));
if (TFTstrchr_pointer[4] == '/') { if (TFTstrchr_pointer[4] == '/') {
@ -695,7 +695,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break; break;
case 14: // A14 START PRINTING case 14: // A14 START PRINTING
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (!isPrinting() && strlen(SelectedFile) > 0) if (!isPrinting() && strlen(SelectedFile) > 0)
StartPrint(); StartPrint();
#endif #endif
@ -868,7 +868,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break; break;
case 26: // A26 refresh SD case 26: // A26 refresh SD
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isMediaInserted()) { if (isMediaInserted()) {
if (strlen(SelectedDirectory) > 0) { if (strlen(SelectedDirectory) > 0) {
FileList currentFileList; FileList currentFileList;
@ -924,7 +924,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
} }
void AnycubicTFTClass::DoSDCardStateCheck() { void AnycubicTFTClass::DoSDCardStateCheck() {
#if BOTH(SDSUPPORT, HAS_SD_DETECT) #if BOTH(HAS_MEDIA, HAS_SD_DETECT)
bool isInserted = isMediaInserted(); bool isInserted = isMediaInserted();
if (isInserted) if (isInserted)
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
@ -954,7 +954,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() {
} }
void AnycubicTFTClass::StartPrint() { void AnycubicTFTClass::StartPrint() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (!isPrinting() && strlen(SelectedFile) > 0) { if (!isPrinting() && strlen(SelectedFile) > 0) {
#if ENABLED(ANYCUBIC_LCD_DEBUG) #if ENABLED(ANYCUBIC_LCD_DEBUG)
SERIAL_ECHOPGM("TFT Serial Debug: About to print file ... "); SERIAL_ECHOPGM("TFT Serial Debug: About to print file ... ");
@ -970,7 +970,7 @@ void AnycubicTFTClass::StartPrint() {
} }
void AnycubicTFTClass::PausePrint() { void AnycubicTFTClass::PausePrint() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMedia() && mediaPrintingState != AMPRINTSTATE_STOP_REQUESTED && mediaPauseState == AMPAUSESTATE_NOT_PAUSED) { if (isPrintingFromMedia() && mediaPrintingState != AMPRINTSTATE_STOP_REQUESTED && mediaPauseState == AMPAUSESTATE_NOT_PAUSED) {
mediaPrintingState = AMPRINTSTATE_PAUSE_REQUESTED; mediaPrintingState = AMPRINTSTATE_PAUSE_REQUESTED;
mediaPauseState = AMPAUSESTATE_NOT_PAUSED; // need the userconfirm method to update pause state mediaPauseState = AMPAUSESTATE_NOT_PAUSED; // need the userconfirm method to update pause state
@ -984,7 +984,7 @@ void AnycubicTFTClass::PausePrint() {
} }
void AnycubicTFTClass::ResumePrint() { void AnycubicTFTClass::ResumePrint() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
if (READ(FIL_RUNOUT1_PIN)) { if (READ(FIL_RUNOUT1_PIN)) {
#if ENABLED(ANYCUBIC_LCD_DEBUG) #if ENABLED(ANYCUBIC_LCD_DEBUG)
@ -1020,7 +1020,7 @@ void AnycubicTFTClass::ResumePrint() {
} }
void AnycubicTFTClass::StopPrint() { void AnycubicTFTClass::StopPrint() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
mediaPrintingState = AMPRINTSTATE_STOP_REQUESTED; mediaPrintingState = AMPRINTSTATE_STOP_REQUESTED;
mediaPauseState = AMPAUSESTATE_NOT_PAUSED; mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
SENDLINE_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16"); SENDLINE_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16");

View file

@ -52,7 +52,7 @@ bool DGUSScreenHandler::ScreenComplete;
void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; void (*DGUSScreenHandler::confirm_action_cb)() = nullptr;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
int16_t DGUSScreenHandler::top_file = 0, int16_t DGUSScreenHandler::top_file = 0,
DGUSScreenHandler::file_to_print = 0; DGUSScreenHandler::file_to_print = 0;
ExtUI::FileList filelist; ExtUI::FileList filelist;
@ -260,7 +260,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void DGUSScreenHandler::ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) {
// default action executed when there is a SD card, but not printing // 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); GotoScreen(DGUSLCD_SCREEN_POPUP);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSScreenHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr) {
DGUS_VP_Variable ramcopy; DGUS_VP_Variable ramcopy;

View file

@ -114,7 +114,7 @@ public:
static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); static void HandleFilamentLoadUnload(DGUS_VP_Variable &var);
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Callback for VP "Display wants to change screen when there is a SD card" // Callback for VP "Display wants to change screen when there is a SD card"
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);
// Scroll buttons on the file listing screen. // 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"). 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 top_file; //< file on top of file chooser
static int16_t file_to_print; //< touched file to be confirmed static int16_t file_to_print; //< touched file to be confirmed
#endif #endif

View file

@ -48,9 +48,9 @@ namespace ExtUI {
while (!ScreenHandler.loop()); // Wait while anything is left to be sent while (!ScreenHandler.loop()); // Wait while anything is left to be sent
} }
void onMediaInserted() { TERN_(SDSUPPORT, ScreenHandler.SDCardInserted()); } void onMediaInserted() { TERN_(HAS_MEDIA, ScreenHandler.SDCardInserted()); }
void onMediaError() { TERN_(SDSUPPORT, ScreenHandler.SDCardError()); } void onMediaError() { TERN_(HAS_MEDIA, ScreenHandler.SDCardError()); }
void onMediaRemoved() { TERN_(SDSUPPORT, ScreenHandler.SDCardRemoved()); } void onMediaRemoved() { TERN_(HAS_MEDIA, ScreenHandler.SDCardRemoved()); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
void onPrintTimerStarted() {} void onPrintTimerStarted() {}

View file

@ -320,7 +320,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// Helper to detect touch events // Helper to detect touch events
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr),
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr),
#endif #endif
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
@ -442,7 +442,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
#endif #endif
// SDCard File listing. // SDCard File listing.
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),

View file

@ -40,7 +40,7 @@
#include "../../../../feature/powerloss.h" #include "../../../../feature/powerloss.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
extern ExtUI::FileList filelist; extern ExtUI::FileList filelist;
@ -124,7 +124,7 @@
) GotoScreen(DGUSLCD_SCREEN_MAIN); ) GotoScreen(DGUSLCD_SCREEN_MAIN);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
uint8_t *tmp = (uint8_t*)val_ptr; uint8_t *tmp = (uint8_t*)val_ptr;

View file

@ -317,7 +317,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// Helper to detect touch events // Helper to detect touch events
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr),
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr),
#endif #endif
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
@ -435,7 +435,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
#endif #endif
// SDCard File listing. // SDCard File listing.
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),

View file

@ -40,7 +40,7 @@
#include "../../../../feature/powerloss.h" #include "../../../../feature/powerloss.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
extern ExtUI::FileList filelist; extern ExtUI::FileList filelist;
@ -124,7 +124,7 @@
) GotoScreen(DGUSLCD_SCREEN_MAIN); ) GotoScreen(DGUSLCD_SCREEN_MAIN);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
uint8_t *tmp = (uint8_t*)val_ptr; uint8_t *tmp = (uint8_t*)val_ptr;

View file

@ -502,7 +502,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// Helper to detect touch events // Helper to detect touch events
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr),
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr),
#endif #endif
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
@ -751,7 +751,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// SDCard File listing // SDCard File listing
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),

View file

@ -47,7 +47,7 @@
#include "../../../../feature/powerloss.h" #include "../../../../feature/powerloss.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
extern ExtUI::FileList filelist; extern ExtUI::FileList filelist;
#endif #endif
@ -140,7 +140,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) {
#endif #endif
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t touched_nr = (int16_t)BE16_P(val_ptr) + top_file; 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); const uint16_t value = BE16_P(val_ptr);
if (value == 0x0F) GotoScreen(DGUSLCD_SCREEN_MAIN); if (value == 0x0F) GotoScreen(DGUSLCD_SCREEN_MAIN);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
uint8_t *tmp = (uint8_t*)val_ptr; uint8_t *tmp = (uint8_t*)val_ptr;

View file

@ -83,7 +83,7 @@ public:
static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr); static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr);
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Marlin informed us about SD print completion. // Marlin informed us about SD print completion.
static void SDPrintingFinished(); static void SDPrintingFinished();
#else #else

View file

@ -128,7 +128,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// Helper to detect touch events // Helper to detect touch events
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr), VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr), VPHELPER(VP_SCREENCHANGE_ASK, nullptr, ScreenHandler.ScreenChangeHookIfIdle, nullptr),
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr), VPHELPER(VP_SCREENCHANGE_WHENSD, nullptr, ScreenHandler.ScreenChangeHookIfSD, nullptr),
#endif #endif
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr), VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
@ -243,7 +243,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
#endif #endif
// SDCard File listing. // SDCard File listing.
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),

View file

@ -40,7 +40,7 @@
#include "../../../../feature/powerloss.h" #include "../../../../feature/powerloss.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
extern ExtUI::FileList filelist; extern ExtUI::FileList filelist;
@ -124,7 +124,7 @@
) GotoScreen(DGUSLCD_SCREEN_MAIN); ) GotoScreen(DGUSLCD_SCREEN_MAIN);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
uint8_t *tmp = (uint8_t*)val_ptr; uint8_t *tmp = (uint8_t*)val_ptr;

View file

@ -46,7 +46,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
const DGUS_Screen screen = (DGUS_Screen)((uint8_t*)data_ptr)[1]; const DGUS_Screen screen = (DGUS_Screen)((uint8_t*)data_ptr)[1];
if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) { if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
IF_DISABLED(HAS_SD_DETECT, card.mount()); IF_DISABLED(HAS_SD_DETECT, card.mount());
if (!ExtUI::isMediaInserted()) { if (!ExtUI::isMediaInserted()) {
@ -76,7 +76,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
dgus_screen_handler.TriggerScreenChange(screen); dgus_screen_handler.TriggerScreenChange(screen);
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void DGUSRxHandler::Scroll(DGUS_VP &vp, void *data_ptr) { void DGUSRxHandler::Scroll(DGUS_VP &vp, void *data_ptr) {
UNUSED(vp); UNUSED(vp);
@ -154,7 +154,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
ExtUI::printFile(dgus_screen_handler.filelist.shortFilename()); ExtUI::printFile(dgus_screen_handler.filelist.shortFilename());
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::PRINT_STATUS); dgus_screen_handler.TriggerScreenChange(DGUS_Screen::PRINT_STATUS);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
void DGUSRxHandler::PrintAbort(DGUS_VP &vp, void *data_ptr) { void DGUSRxHandler::PrintAbort(DGUS_VP &vp, void *data_ptr) {
UNUSED(vp); UNUSED(vp);

View file

@ -28,7 +28,7 @@ namespace DGUSRxHandler {
void ScreenChange(DGUS_VP &, void *); void ScreenChange(DGUS_VP &, void *);
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void Scroll(DGUS_VP &, void *); void Scroll(DGUS_VP &, void *);
void SelectFile(DGUS_VP &, void *); void SelectFile(DGUS_VP &, void *);
void PrintFile(DGUS_VP &, void *); void PrintFile(DGUS_VP &, void *);

View file

@ -34,7 +34,7 @@
uint8_t DGUSScreenHandler::debug_count = 0; uint8_t DGUSScreenHandler::debug_count = 0;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
ExtUI::FileList DGUSScreenHandler::filelist; ExtUI::FileList DGUSScreenHandler::filelist;
uint16_t DGUSScreenHandler::filelist_offset = 0; uint16_t DGUSScreenHandler::filelist_offset = 0;
int16_t DGUSScreenHandler::filelist_selected = -1; int16_t DGUSScreenHandler::filelist_selected = -1;
@ -281,7 +281,7 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) {
dgus_display.PlaySound(3); dgus_display.PlaySound(3);
} }
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void DGUSScreenHandler::SDCardInserted() { void DGUSScreenHandler::SDCardInserted() {
if (current_screen == DGUS_Screen::HOME) if (current_screen == DGUS_Screen::HOME)
@ -299,7 +299,7 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) {
TriggerScreenChange(DGUS_Screen::HOME); TriggerScreenChange(DGUS_Screen::HOME);
} }
#endif // SDSUPPORT #endif // HAS_MEDIA
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)

View file

@ -52,7 +52,7 @@ public:
static void PrintTimerStopped(); static void PrintTimerStopped();
static void FilamentRunout(const ExtUI::extruder_t extruder); static void FilamentRunout(const ExtUI::extruder_t extruder);
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
/// Marlin informed us that a new SD has been inserted. /// Marlin informed us that a new SD has been inserted.
static void SDCardInserted(); static void SDCardInserted();
/// Marlin informed us that the SD Card has been removed(). /// Marlin informed us that the SD Card has been removed().
@ -89,7 +89,7 @@ public:
static uint8_t debug_count; static uint8_t debug_count;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
static ExtUI::FileList filelist; static ExtUI::FileList filelist;
static uint16_t filelist_offset; static uint16_t filelist_offset;
static int16_t filelist_selected; static int16_t filelist_selected;

View file

@ -31,7 +31,7 @@
#include "../../../gcode/queue.h" #include "../../../gcode/queue.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
bool DGUSSetupHandler::Print() { bool DGUSSetupHandler::Print() {
dgus_screen_handler.filelist.refresh(); dgus_screen_handler.filelist.refresh();

View file

@ -23,7 +23,7 @@
namespace DGUSSetupHandler { namespace DGUSSetupHandler {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
bool Print(); bool Print();
#endif #endif
bool PrintStatus(); bool PrintStatus();

View file

@ -36,7 +36,7 @@
#include "../../../feature/pause.h" #include "../../../feature/pause.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void DGUSTxHandler::SetFileControlState(int16_t file, bool state) { void DGUSTxHandler::SetFileControlState(int16_t file, bool state) {
DGUS_Control control; DGUS_Control control;
@ -177,7 +177,7 @@
dgus_display.WriteString((uint16_t)vp.addr, dgus_screen_handler.filelist.filename(), vp.size); 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) { void DGUSTxHandler::PositionZ(DGUS_VP &vp) {
const float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ? planner.get_axis_position_mm(Z_AXIS) : 0; const float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ? planner.get_axis_position_mm(Z_AXIS) : 0;

View file

@ -28,7 +28,7 @@
namespace DGUSTxHandler { namespace DGUSTxHandler {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
void SetFileControlState(int16_t, bool); void SetFileControlState(int16_t, bool);
void FileType(DGUS_VP &); void FileType(DGUS_VP &);
void FileName(DGUS_VP &); void FileName(DGUS_VP &);

View file

@ -36,7 +36,7 @@ constexpr DGUS_Addr LIST_HOME[] PROGMEM = {
(DGUS_Addr)0 (DGUS_Addr)0
}; };
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
constexpr DGUS_Addr LIST_PRINT[] PROGMEM = { constexpr DGUS_Addr LIST_PRINT[] PROGMEM = {
DGUS_Addr::SD_Type, DGUS_Addr::SD_Type,
DGUS_Addr::SD_FileName0, DGUS_Addr::SD_FileName0,
@ -210,7 +210,7 @@ constexpr DGUS_Addr LIST_WAIT[] PROGMEM = {
const struct DGUS_ScreenAddrList screen_addr_list_map[] PROGMEM = { const struct DGUS_ScreenAddrList screen_addr_list_map[] PROGMEM = {
MAP_HELPER(DGUS_Screen::HOME, LIST_HOME), MAP_HELPER(DGUS_Screen::HOME, LIST_HOME),
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
MAP_HELPER(DGUS_Screen::PRINT, LIST_PRINT), MAP_HELPER(DGUS_Screen::PRINT, LIST_PRINT),
#endif #endif
MAP_HELPER(DGUS_Screen::PRINT_STATUS, LIST_PRINT_STATUS), MAP_HELPER(DGUS_Screen::PRINT_STATUS, LIST_PRINT_STATUS),

View file

@ -35,7 +35,7 @@
.setup_fn = SETUP } .setup_fn = SETUP }
const struct DGUS_ScreenSetup screen_setup_list[] PROGMEM = { const struct DGUS_ScreenSetup screen_setup_list[] PROGMEM = {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
SETUP_HELPER(DGUS_Screen::PRINT, &DGUSSetupHandler::Print), SETUP_HELPER(DGUS_Screen::PRINT, &DGUSSetupHandler::Print),
#endif #endif
SETUP_HELPER(DGUS_Screen::PRINT_STATUS, &DGUSSetupHandler::PrintStatus), SETUP_HELPER(DGUS_Screen::PRINT_STATUS, &DGUSSetupHandler::PrintStatus),

View file

@ -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_Idle, &DGUSRxHandler::ScreenChange),
VP_HELPER_RX(DGUS_Addr::SCREENCHANGE_Printing, &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_SelectFile, &DGUSRxHandler::SelectFile),
VP_HELPER_RX(DGUS_Addr::SD_Scroll, &DGUSRxHandler::Scroll), VP_HELPER_RX(DGUS_Addr::SD_Scroll, &DGUSRxHandler::Scroll),
VP_HELPER_RX_NODATA(DGUS_Addr::SD_Print, &DGUSRxHandler::PrintFile), VP_HELPER_RX_NODATA(DGUS_Addr::SD_Print, &DGUSRxHandler::PrintFile),
@ -150,7 +150,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
// WRITE-ONLY VARIABLES // WRITE-ONLY VARIABLES
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
VP_HELPER_TX(DGUS_Addr::SD_Type, &DGUSTxHandler::FileType), VP_HELPER_TX(DGUS_Addr::SD_Type, &DGUSTxHandler::FileType),
VP_HELPER_TX_SIZE(DGUS_Addr::SD_FileName0, VP_HELPER_TX_SIZE(DGUS_Addr::SD_FileName0,
DGUS_FILENAME_LEN, DGUS_FILENAME_LEN,

View file

@ -50,9 +50,9 @@ namespace ExtUI {
dgus_screen_handler.PrinterKilled(error, component); dgus_screen_handler.PrinterKilled(error, component);
} }
void onMediaInserted() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardInserted()); } void onMediaInserted() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardInserted()); }
void onMediaError() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardError()); } void onMediaError() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardError()); }
void onMediaRemoved() { TERN_(SDSUPPORT, dgus_screen_handler.SDCardRemoved()); } void onMediaRemoved() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardRemoved()); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) { void onPlayTone(const uint16_t frequency, const uint16_t duration) {
dgus_screen_handler.PlayTone(frequency, duration); dgus_screen_handler.PlayTone(frequency, duration);

View file

@ -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 * files must be written sequentially following by a chip erase and it is not possible to
* overwrite files. */ * overwrite files. */
UIFlashStorage::error_t UIFlashStorage::write_media_file(FSTR_P filename, uint8_t slot) { UIFlashStorage::error_t UIFlashStorage::write_media_file(FSTR_P filename, uint8_t slot) {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
uint32_t addr; uint32_t addr;
uint8_t buff[write_page_size]; uint8_t buff[write_page_size];
@ -500,7 +500,7 @@ bool UIFlashStorage::is_present = false;
} }
#else #else
return VERIFY_ERROR; return VERIFY_ERROR;
#endif // SDSUPPORT #endif // HAS_MEDIA
} }
bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) { bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) {

View file

@ -25,7 +25,7 @@
#if ENABLED(TOUCH_UI_FTDI_EVE) #if ENABLED(TOUCH_UI_FTDI_EVE)
#include "media_file_reader.h" #include "media_file_reader.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
bool MediaFileReader::open(const char *filename) { bool MediaFileReader::open(const char *filename) {
root = CardReader::getroot(); root = CardReader::getroot();
return file.open(&root, filename, O_READ); return file.open(&root, filename, O_READ);

View file

@ -24,14 +24,14 @@
#include "../../../../inc/MarlinConfigPre.h" #include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "../../../../sd/SdFile.h" #include "../../../../sd/SdFile.h"
#include "../../../../sd/cardreader.h" #include "../../../../sd/cardreader.h"
#endif #endif
class MediaFileReader { class MediaFileReader {
private: private:
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
MediaFile root, file; MediaFile root, file;
#endif #endif

View file

@ -75,7 +75,7 @@ void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) {
.font(font_medium) .font(font_medium)
.colors(isPrinting() ? action_btn : normal_btn) .colors(isPrinting() ? action_btn : normal_btn)
.tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu")) .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) .tag(3)
.colors(isPrinting() ? normal_btn : action_btn) .colors(isPrinting() ? normal_btn : action_btn)
.button(BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); .button(BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back"));

View file

@ -45,14 +45,14 @@ namespace ExtUI {
} }
void onMediaInserted() { void onMediaInserted() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
sound.play(media_inserted, PLAY_ASYNCHRONOUS); sound.play(media_inserted, PLAY_ASYNCHRONOUS);
StatusScreen::onMediaInserted(); StatusScreen::onMediaInserted();
#endif #endif
} }
void onMediaRemoved() { void onMediaRemoved() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (isPrintingFromMedia()) { if (isPrintingFromMedia()) {
stopPrint(); stopPrint();
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED); InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED);

View file

@ -44,7 +44,7 @@ void DeveloperMenu::onRedraw(draw_mode_t what) {
constexpr bool has_flash = false; constexpr bool has_flash = false;
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
constexpr bool has_media = true; constexpr bool has_media = true;
#else #else
constexpr bool has_media = false; constexpr bool has_media = false;
@ -98,7 +98,7 @@ bool DeveloperMenu::onTouchEnd(uint8_t tag) {
break; break;
case 4: GOTO_SCREEN(TouchRegistersScreen); break; case 4: GOTO_SCREEN(TouchRegistersScreen); break;
case 5: sound.play(js_bach_joy, PLAY_ASYNCHRONOUS); break; case 5: sound.play(js_bach_joy, PLAY_ASYNCHRONOUS); break;
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 6: case 6:
if (!MediaPlayerScreen::playCardMedia()) if (!MediaPlayerScreen::playCardMedia())
AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); AlertDialogBox::showError(F("Cannot open STARTUP.AVI"));

View file

@ -57,7 +57,7 @@ void MediaPlayerScreen::onRedraw(draw_mode_t) {
} }
bool MediaPlayerScreen::playCardMedia() { bool MediaPlayerScreen::playCardMedia() {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
char fname[15]; char fname[15];
strcpy_P(fname, PSTR("STARTUP.AVI")); strcpy_P(fname, PSTR("STARTUP.AVI"));

View file

@ -83,7 +83,7 @@ enum {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
FILAMENT_RUNOUT_SCREEN_CACHE, FILAMENT_RUNOUT_SCREEN_CACHE,
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
FILES_SCREEN_CACHE, FILES_SCREEN_CACHE,
#endif #endif
#if ENABLED(CUSTOM_MENU_MAIN) #if ENABLED(CUSTOM_MENU_MAIN)
@ -204,7 +204,7 @@ enum {
#include "linear_advance_screen.h" #include "linear_advance_screen.h"
#endif #endif
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
#include "files_screen.h" #include "files_screen.h"
#endif #endif

View file

@ -417,7 +417,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
using namespace ExtUI; using namespace ExtUI;
switch (tag) { switch (tag) {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
case 3: GOTO_SCREEN(FilesScreen); break; case 3: GOTO_SCREEN(FilesScreen); break;
#endif #endif
case 4: case 4:

View file

@ -137,7 +137,7 @@
#define CLCD_SPI_CS BTN_EN1 #define CLCD_SPI_CS BTN_EN1
#define CLCD_MOD_RESET BTN_EN2 #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 #define CLCD_SPI_EXTRA_CS SDSS
#endif #endif

View file

@ -167,7 +167,7 @@ void process_lcd_eb_command(const char *command) {
char message_buffer[MAX_CURLY_COMMAND]; char message_buffer[MAX_CURLY_COMMAND];
uint8_t done_pct = print_job_timer.isRunning() ? (iteration * 10) : 100; uint8_t done_pct = print_job_timer.isRunning() ? (iteration * 10) : 100;
iteration = (iteration + 1) % 10; // Provide progress animation iteration = (iteration + 1) % 10; // Provide progress animation
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (ExtUI::isPrintingFromMedia() || ExtUI::isPrintingFromMediaPaused()) if (ExtUI::isPrintingFromMedia() || ExtUI::isPrintingFromMediaPaused())
done_pct = card.percentDone(); done_pct = card.percentDone();
#endif #endif
@ -180,7 +180,7 @@ void process_lcd_eb_command(const char *command) {
#else #else
0, 0, 0, 0,
#endif #endif
TERN(SDSUPPORT, done_pct, 0), TERN(HAS_MEDIA, done_pct, 0),
elapsed_buffer elapsed_buffer
); );
write_to_lcd(message_buffer); write_to_lcd(message_buffer);
@ -257,7 +257,7 @@ void process_lcd_p_command(const char *command) {
break; break;
case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes
default: { default: {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
// Print file 000 - a three digit number indicating which // Print file 000 - a three digit number indicating which
// file to print in the SD card. If it's a directory, // file to print in the SD card. If it's a directory,
// then switch to the directory. // then switch to the directory.
@ -316,7 +316,7 @@ void process_lcd_s_command(const char *command) {
} break; } break;
case 'L': { case 'L': {
#if ENABLED(SDSUPPORT) #if HAS_MEDIA
if (!card.isMounted()) card.mount(); if (!card.isMounted()) card.mount();
// A more efficient way to do this would be to // A more efficient way to do this would be to

Some files were not shown because too many files have changed in this diff Show more