Added Parameter for enabling/disabling of SD mount
This commit is contained in:
parent
1be01b04dc
commit
cdb8fc41a9
2 changed files with 17 additions and 2 deletions
|
|
@ -1739,6 +1739,15 @@
|
||||||
*/
|
*/
|
||||||
//#define SDSUPPORT
|
//#define SDSUPPORT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SD CARD: MOUNT ON INSERT
|
||||||
|
*
|
||||||
|
* If you do not want to mount the SD Card when it´s inserted to the slot, comment the following line.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SD_MOUNT_ON_INSERT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SD CARD: SPI SPEED
|
* SD CARD: SPI SPEED
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,9 @@ void CardReader::manage_media() {
|
||||||
|
|
||||||
if (stat) { // Media Inserted
|
if (stat) { // Media Inserted
|
||||||
safe_delay(500); // Some boards need a delay to get settled
|
safe_delay(500); // Some boards need a delay to get settled
|
||||||
mount(); // Try to mount the media
|
if (ENABLED(SD_MOUNT_ON_INSERT) && old_stat == 2) {
|
||||||
|
mount(); // Try to mount the media
|
||||||
|
}
|
||||||
#if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II)
|
#if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II)
|
||||||
reset_stepper_drivers(); // Workaround for Cheetah bug
|
reset_stepper_drivers(); // Workaround for Cheetah bug
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -441,7 +443,11 @@ void CardReader::manage_media() {
|
||||||
|
|
||||||
if (stat) {
|
if (stat) {
|
||||||
TERN_(SDCARD_EEPROM_EMULATION, settings.first_load());
|
TERN_(SDCARD_EEPROM_EMULATION, settings.first_load());
|
||||||
if (old_stat == 2) // First mount?
|
if (
|
||||||
|
old_stat == 2
|
||||||
|
&&
|
||||||
|
ENABLED(SD_MOUNT_ON_INSERT)
|
||||||
|
) // First mount?
|
||||||
DEBUG_ECHOLNPGM("First mount.");
|
DEBUG_ECHOLNPGM("First mount.");
|
||||||
TERN(POWER_LOSS_RECOVERY,
|
TERN(POWER_LOSS_RECOVERY,
|
||||||
recovery.check(), // Check for PLR file. (If not there it will beginautostart)
|
recovery.check(), // Check for PLR file. (If not there it will beginautostart)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue