🧑‍💻 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_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction
//#define M73_REPORT // Report M73 values to host
#if BOTH(M73_REPORT, SDSUPPORT)
#if BOTH(M73_REPORT, HAS_MEDIA)
#define M73_REPORT_SD_ONLY // Report only when printing from SD
#endif
#endif
// LCD Print Progress options. Multiple times may be displayed in turn.
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
#if HAS_DISPLAY && EITHER(HAS_MEDIA, SET_PROGRESS_MANUALLY)
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
@ -1628,7 +1628,7 @@
#endif
#endif
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
/**
* SD Card SPI Speed
* May be required to resolve "volume init" errors.
@ -1868,7 +1868,7 @@
#define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE
#endif
#endif // SDSUPPORT
#endif // HAS_MEDIA
/**
* By default an onboard SD card reader may be shared as a USB mass-
@ -2492,9 +2492,9 @@
// The number of linear moves that can be in the planner at once.
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
#if BOTH(SDSUPPORT, DIRECT_STEPPING)
#if BOTH(HAS_MEDIA, DIRECT_STEPPING)
#define BLOCK_BUFFER_SIZE 8
#elif ENABLED(SDSUPPORT)
#elif HAS_MEDIA
#define BLOCK_BUFFER_SIZE 16
#else
#define BLOCK_BUFFER_SIZE 16
@ -2527,7 +2527,7 @@
//#define SERIAL_XON_XOFF
#endif
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
// Enable this option to collect and display the maximum
// RX queue usage after transferring a file to SD.
//#define SERIAL_STATS_MAX_RX_QUEUED

View file

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

View file

@ -45,7 +45,7 @@ uint16_t MarlinHAL::adc_result;
#endif
void MarlinHAL::init() {
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif
usb_task_init(); // Initialize the USB stack

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))
#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
#if HAS_MEDIA && HAS_DRIVER(TMC2130)
#if ENABLED(TMC_USE_SW_SPI)
#if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
#error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."

View file

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

View file

@ -6,7 +6,7 @@
#include "../../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
#include "../../../sd/cardreader.h"
extern "C" {
@ -138,5 +138,5 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
#endif // ACCESS_USB == true
#endif // SDSUPPORT
#endif // HAS_MEDIA
#endif // ARDUINO_ARCH_SAM

View file

@ -51,7 +51,7 @@
#include "udc_desc.h"
#include "udi_cdc.h"
#if DISABLED(SDSUPPORT)
#if !HAS_MEDIA
/**
* \defgroup udi_cdc_group_single_desc USB device descriptors for a single interface
@ -256,6 +256,6 @@ UDC_DESC_STORAGE udc_config_t udc_config = {
//@}
//@}
#endif // SDSUPPORT
#endif // HAS_MEDIA
#endif // ARDUINO_ARCH_SAM

View file

@ -50,7 +50,7 @@
#include "udd.h"
#include "udc_desc.h"
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
/**
* \defgroup udi_group_desc Descriptors for a USB Device
@ -189,4 +189,4 @@ UDC_DESC_STORAGE udc_config_t udc_config = {
#endif // ARDUINO_ARCH_SAM
#endif // SDSUPPORT
#endif // HAS_MEDIA

View file

@ -57,7 +57,7 @@
#include "ctrl_access.h"
#include <string.h>
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
#ifndef UDI_MSC_NOTIFY_TRANS_EXT
# define UDI_MSC_NOTIFY_TRANS_EXT()
@ -1127,6 +1127,6 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
//@}
#endif // SDSUPPORT
#endif // HAS_MEDIA
#endif // ARDUINO_ARCH_SAM

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@
#include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#if BOTH(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use

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)
#define PIN_IS_SDA0(P) (P##_PIN == P0_27)
#define IS_SCL0(P) (P == P0_28)
#if ENABLED(SDSUPPORT) && PIN_IS_SDA0(SD_DETECT)
#if HAS_MEDIA && PIN_IS_SDA0(SD_DETECT)
#error "SDA0 overlaps with SD_DETECT_PIN!"
#elif PIN_IS_SDA0(E0_AUTO_FAN)
#error "SDA0 overlaps with E0_AUTO_FAN_PIN!"

View file

@ -23,7 +23,7 @@
#include "../../core/macros.h"
#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#if BOTH(HAS_MEDIA, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use

View file

@ -24,7 +24,7 @@
#include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#if BOTH(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
#define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use

View file

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

View file

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

View file

@ -70,7 +70,7 @@ void MarlinHAL::init() {
constexpr int cpuFreq = F_CPU;
UNUSED(cpuFreq);
#if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1)
#if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && (defined(SDSS) && SDSS != -1)
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif

View file

@ -21,7 +21,7 @@
*/
#pragma once
#if BOTH(SDSUPPORT, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
#if BOTH(HAS_MEDIA, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
#define HAS_SD_HOST_DRIVE 1
#endif

View file

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

View file

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

View file

@ -25,7 +25,7 @@
* Test STM32F1-specific configuration values for errors at compile-time.
*/
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
#if USE_FALLBACK_EEPROM
#warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -88,7 +88,7 @@ void GcodeSuite::M125() {
park_point += hotend_offset[active_extruder];
#endif
const bool sd_printing = TERN0(SDSUPPORT, IS_SD_PRINTING());
const bool sd_printing = TERN0(HAS_MEDIA, IS_SD_PRINTING());
ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT);

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
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
case 20: M20(); break; // M20: List SD card
case 21: M21(); break; // M21: Init SD card
case 22: M22(); break; // M22: Release SD card
@ -545,7 +545,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif
case 928: M928(); break; // M928: Start SD write
#endif // SDSUPPORT
#endif // HAS_MEDIA
case 31: M31(); break; // M31: Report time since the start of SD print or last M109
@ -919,7 +919,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif
#endif
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
case 524: M524(); break; // M524: Abort the current SD print job
#endif
@ -1061,7 +1061,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE)
case 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif
@ -1081,7 +1081,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss
#endif
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
#endif

View file

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

View file

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

View file

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

View file

@ -70,7 +70,7 @@ void GcodeSuite::M360() {
config_line(F("InputBuffer"), MAX_CMD_SIZE);
config_line(F("PrintlineCache"), BUFSIZE);
config_line(F("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
config_line(F("SDCard"), ENABLED(SDSUPPORT));
config_line(F("SDCard"), ENABLED(HAS_MEDIA));
config_line(F("Fan"), ENABLED(HAS_FAN));
config_line(F("LCD"), ENABLED(HAS_DISPLAY));
config_line(F("SoftwarePowerSwitch"), 1);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -978,7 +978,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
* Progress Bar
*/
#if ENABLED(LCD_PROGRESS_BAR)
#if NONE(SDSUPPORT, SET_PROGRESS_MANUALLY)
#if NONE(HAS_MEDIA, SET_PROGRESS_MANUALLY)
#error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY."
#elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
#error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
@ -1028,7 +1028,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
/**
* SD Card Settings
*/
#if ALL(SDSUPPORT, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW
#if ALL(HAS_MEDIA, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW
#error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER."
#endif
#undef SD_CONNECTION_TYPICAL
@ -1176,8 +1176,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
#elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
#error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
#elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER)
#error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
#elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(HAS_MEDIA, IS_NEWPANEL, EMERGENCY_PARSER)
#error "PARK_HEAD_ON_PAUSE requires HAS_MEDIA, EMERGENCY_PARSER, or an LCD controller."
#elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
#error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
#elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
@ -3266,7 +3266,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#if ENABLED(TFT_LVGL_UI)
#if DISABLED(TFT_RES_480x320)
#error "TFT_LVGL_UI requires TFT_RES_480x320."
#elif DISABLED(SDSUPPORT)
#elif !HAS_MEDIA
#error "TFT_LVGL_UI requires SDSUPPORT."
#endif
#endif
@ -3282,7 +3282,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#if ENABLED(ANYCUBIC_LCD_CHIRON)
#ifndef BEEPER_PIN
#error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN"
#elif DISABLED(SDSUPPORT)
#elif !HAS_MEDIA
#error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT"
#elif TEMP_SENSOR_BED == 0
#error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)"
@ -3305,7 +3305,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
* Ender-3 V2 controller has some limitations
*/
#if ENABLED(DWIN_CREALITY_LCD)
#if DISABLED(SDSUPPORT)
#if !HAS_MEDIA
#error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled."
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
#error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
@ -3317,7 +3317,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY."
#endif
#elif ENABLED(DWIN_LCD_PROUI)
#if DISABLED(SDSUPPORT)
#if !HAS_MEDIA
#error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled."
#elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
#error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
@ -4339,7 +4339,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
* Check to make sure MONITOR_DRIVER_STATUS isn't enabled
* on boards where TMC drivers share the SPI bus with SD.
*/
#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, HAS_MEDIA, USES_SHARED_SPI)
#error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
#endif

View file

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

View file

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

View file

@ -56,7 +56,7 @@
#include "../../module/printcounter.h"
#include "../../MarlinCore.h"
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
#include "../../libs/duration_t.h"
#endif
@ -545,7 +545,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno);
}
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
if (mark_as_selected(row, sel)) {
@ -557,7 +557,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
}
}
#endif // SDSUPPORT
#endif // HAS_MEDIA
#if ENABLED(AUTO_BED_LEVELING_UBL)

View file

@ -36,10 +36,10 @@
// RepRapWorld Graphical LCD
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
#if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL
#define U8G_PARAM LCD_PINS_RS
#elif ENABLED(SDSUPPORT) && __SAMD21__
#elif HAS_MEDIA && __SAMD21__
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_RS
#else
@ -52,7 +52,7 @@
// RepRap Discount Full Graphics Smart Controller
// and other variant LCDs using ST7920
#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
#if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.)
#define U8G_PARAM LCD_PINS_RS
#else

View file

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

View file

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

View file

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

View file

@ -39,7 +39,7 @@
#include "../../../module/temperature.h"
#include "../../../module/printcounter.h"
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
#include "../../../libs/duration_t.h"
#endif
@ -467,7 +467,7 @@ void MarlinUI::draw_status_message(const bool blink) {
if (yes) draw_boxed_string(true, yes, yesno);
}
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) {
if (mark_as_selected(row, sel)) {
@ -487,7 +487,7 @@ void MarlinUI::draw_status_message(const bool blink) {
}
}
#endif // SDSUPPORT
#endif // HAS_MEDIA
#if ENABLED(AUTO_BED_LEVELING_UBL)

View file

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

View file

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

View file

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

View file

@ -114,7 +114,7 @@ public:
static void HandleFilamentLoadUnload(DGUS_VP_Variable &var);
#endif
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
// Callback for VP "Display wants to change screen when there is a SD card"
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);
// Scroll buttons on the file listing screen.
@ -233,7 +233,7 @@ protected:
static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK").
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
static int16_t top_file; //< file on top of file chooser
static int16_t file_to_print; //< touched file to be confirmed
#endif

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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

View file

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

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
* overwrite files. */
UIFlashStorage::error_t UIFlashStorage::write_media_file(FSTR_P filename, uint8_t slot) {
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA
uint32_t addr;
uint8_t buff[write_page_size];
@ -500,7 +500,7 @@ bool UIFlashStorage::is_present = false;
}
#else
return VERIFY_ERROR;
#endif // SDSUPPORT
#endif // HAS_MEDIA
}
bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) {

View file

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

View file

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

View file

@ -75,7 +75,7 @@ void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) {
.font(font_medium)
.colors(isPrinting() ? action_btn : normal_btn)
.tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu"))
.enabled(isPrinting() ? TERN0(SDSUPPORT, isPrintingFromMedia()) : 1)
.enabled(isPrinting() ? TERN0(HAS_MEDIA, isPrintingFromMedia()) : 1)
.tag(3)
.colors(isPrinting() ? normal_btn : action_btn)
.button(BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back"));

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -137,7 +137,7 @@
#define CLCD_SPI_CS BTN_EN1
#define CLCD_MOD_RESET BTN_EN2
#if MB(EINSY_RAMBO, EINSY_RETRO) && DISABLED(SDSUPPORT)
#if MB(EINSY_RAMBO, EINSY_RETRO) && !HAS_MEDIA
#define CLCD_SPI_EXTRA_CS SDSS
#endif

View file

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

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