Browse Source

Fix broken POWER_LOSS_RECOVERY prompt (#18557)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Jason Smith 4 years ago
parent
commit
af8be58d92
No account linked to committer's email address

+ 2
- 2
Marlin/src/HAL/LPC1768/main.cpp View File

@@ -122,7 +122,7 @@ void HAL_init() {
122 122
   delay(1000);                              // Give OS time to notice
123 123
   USB_Connect(TRUE);
124 124
 
125
-  #if !BOTH(SHARED_SD_CARD, INIT_SDCARD_ON_BOOT) && DISABLED(NO_SD_HOST_DRIVE)
125
+  #if DISABLED(NO_SD_HOST_DRIVE)
126 126
     MSC_SD_Init(0);                         // Enable USB SD card access
127 127
   #endif
128 128
 
@@ -140,7 +140,7 @@ void HAL_init() {
140 140
 
141 141
 // HAL idle task
142 142
 void HAL_idletask() {
143
-  #if ENABLED(SHARED_SD_CARD)
143
+  #if HAS_SHARED_MEDIA
144 144
     // If Marlin is using the SD card we need to lock it to prevent access from
145 145
     // a PC via USB.
146 146
     // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but

+ 2
- 2
Marlin/src/HAL/STM32F1/HAL.cpp View File

@@ -258,7 +258,7 @@ void HAL_init() {
258 258
 // HAL idle task
259 259
 void HAL_idletask() {
260 260
   #ifdef USE_USB_COMPOSITE
261
-    #if ENABLED(SHARED_SD_CARD)
261
+    #if HAS_SHARED_MEDIA
262 262
       // If Marlin is using the SD card we need to lock it to prevent access from
263 263
       // a PC via USB.
264 264
       // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
@@ -266,7 +266,7 @@ void HAL_idletask() {
266 266
       // the disk if Marlin has it mounted. Unfortunately there is currently no way
267 267
       // to unmount the disk from the LCD menu.
268 268
       // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
269
-      /* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/
269
+      /* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/
270 270
     #endif
271 271
     // process USB mass storage device class loop
272 272
     MarlinMSC.loop();

+ 1
- 1
Marlin/src/HAL/STM32F1/onboard_sd.cpp View File

@@ -20,7 +20,7 @@
20 20
 #include "SPI.h"
21 21
 #include "fastio.h"
22 22
 
23
-#if ENABLED(SHARED_SD_CARD)
23
+#if HAS_SHARED_MEDIA
24 24
   #ifndef ON_BOARD_SPI_DEVICE
25 25
     #define ON_BOARD_SPI_DEVICE SPI_DEVICE
26 26
   #endif

+ 1
- 5
Marlin/src/inc/Conditionals_post.h View File

@@ -353,11 +353,7 @@
353 353
     // mount/unmount the card and refresh it. So we disable card detect.
354 354
     //
355 355
     #undef SD_DETECT_PIN
356
-    #define SHARED_SD_CARD
357
-  #endif
358
-
359
-  #if DISABLED(SHARED_SD_CARD)
360
-    #define INIT_SDCARD_ON_BOOT
356
+    #define HAS_SHARED_MEDIA 1
361 357
   #endif
362 358
 
363 359
   #if PIN_EXISTS(SD_DETECT)

+ 1
- 1
Marlin/src/sd/cardreader.cpp View File

@@ -389,7 +389,7 @@ void CardReader::mount() {
389 389
 #endif
390 390
 
391 391
 void CardReader::manage_media() {
392
-  static uint8_t prev_stat = TERN(INIT_SDCARD_ON_BOOT, 2, 0);
392
+  static uint8_t prev_stat = 2;       // First call, no prior state
393 393
   uint8_t stat = uint8_t(IS_SD_INSERTED());
394 394
   if (stat == prev_stat) return;
395 395
 

Loading…
Cancel
Save