|
|
|
@ -24,6 +24,8 @@
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
|
|
|
|
|
|
//#define DEBUG_CARDREADER
|
|
|
|
|
|
|
|
|
|
#include "cardreader.h"
|
|
|
|
|
|
|
|
|
|
#include "../MarlinCore.h"
|
|
|
|
@ -51,6 +53,9 @@
|
|
|
|
|
#include "../feature/pause.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define DEBUG_OUT ENABLED(DEBUG_CARDREADER)
|
|
|
|
|
#include "../core/debug_out.h"
|
|
|
|
|
|
|
|
|
|
// public:
|
|
|
|
|
|
|
|
|
|
card_flags_t CardReader::flag;
|
|
|
|
@ -405,6 +410,8 @@ void CardReader::manage_media() {
|
|
|
|
|
uint8_t stat = uint8_t(IS_SD_INSERTED());
|
|
|
|
|
if (stat == prev_stat) return;
|
|
|
|
|
|
|
|
|
|
DEBUG_ECHOLNPAIR("SD: Status changed from ", prev_stat, " to ", stat);
|
|
|
|
|
|
|
|
|
|
flag.workDirIsRoot = true; // Return to root on mount/release
|
|
|
|
|
|
|
|
|
|
if (ui.detected()) {
|
|
|
|
@ -431,12 +438,15 @@ void CardReader::manage_media() {
|
|
|
|
|
if (stat) {
|
|
|
|
|
TERN_(SDCARD_EEPROM_EMULATION, settings.first_load());
|
|
|
|
|
if (old_stat == 2) // First mount?
|
|
|
|
|
DEBUG_ECHOLNPGM("First mount.");
|
|
|
|
|
TERN(POWER_LOSS_RECOVERY,
|
|
|
|
|
recovery.check(), // Check for PLR file. (If not there it will beginautostart)
|
|
|
|
|
beginautostart() // Look for auto0.g on the next loop
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
DEBUG_ECHOLNPGM("SD: No UI Detected.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CardReader::release() {
|
|
|
|
|