Skip to content

Commit 02a3fc6

Browse files
authored
Merge pull request #10963 from mikeysklar/pr-sd-automount-timing
Mount SD card at filesystem init so macOS can see it via USB MSC
2 parents ca4636c + b12c140 commit 02a3fc6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

supervisor/shared/filesystem.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ bool filesystem_init(bool create_allowed, bool force_create) {
219219

220220
#if CIRCUITPY_SDCARDIO
221221
sdcardio_init();
222+
#if defined(DEFAULT_SD_CARD_DETECT) && CIRCUITPY_SDCARD_USB
223+
// Mount the SD card now so it's ready when USB enumerates.
224+
// Lazy mount from tud_msc_test_unit_ready_cb can lose races with
225+
// macOS's probe timing. Gated on CIRCUITPY_SDCARD_USB to match the
226+
// existing call site in usb_msc_flash.c (guarded by SDCARD_LUN).
227+
automount_sd_card();
228+
#endif
222229
#endif
223230

224231
return true;

0 commit comments

Comments
 (0)