allow enable/disable of presenting SD card to USB; suppress auto-relo… · MicroPythonNexus/circuitpython@3e1441e · GitHub
Skip to content

Commit 3e1441e

Browse files
committed
allow enable/disable of presenting SD card to USB; suppress auto-reload when writing dirty bit
1 parent 3472567 commit 3e1441e

6 files changed

Lines changed: 44 additions & 12 deletions

File tree

ports/atmel-samd/mpconfigport.h

Lines changed: 3 additions & 0 deletions

ports/cxd56/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
#define MICROPY_PY_SYS_PLATFORM "CXD56"
1010

11+
// SD card socket on board is configured for sdioio, which is not supported for automatic USB presentation.
12+
#define CIRCUITPY_SDCARD_USB (0)
13+
1114
// 64kiB stack
1215
#define CIRCUITPY_DEFAULT_STACK_SIZE (0x10000)
1316

ports/espressif/mpconfigport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1)
1919

20+
// // Present SD card as USB MSC device by default
21+
// #ifndef CIRCUITPY_SDCARD_USB
22+
// #define CIRCUITPY_SDCARD_USB (1)
23+
// #endif
24+
2025
#include "py/circuitpy_mpconfig.h"
2126

2227
#define MICROPY_NLR_SETJMP (1)

shared-module/sdcardio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,5 @@ void automount_sd_card(void) {
123123
sdcard_vfs->next = MP_STATE_VM(vfs_mount_table);
124124
MP_STATE_VM(vfs_mount_table) = sdcard_vfs;
125125
_mounted = true;
126-
#endif
126+
#endif // DEFAULT_SD_CARD_DETECT
127127
}

supervisor/shared/filesystem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ bool filesystem_init(bool create_allowed, bool force_create) {
148148
res = f_mkdir(&circuitpy->fatfs, "/sd");
149149
#if CIRCUITPY_FULL_BUILD
150150
MAKE_FILE_WITH_OPTIONAL_CONTENTS(&circuitpy->fatfs, "/sd/placeholder.txt",
151-
"SD cards mounted at /sd will hide this file from Python."
152-
" SD cards are not visible via USB CIRCUITPY.\n");
151+
"SD cards mounted at /sd will hide this file from Python.\n");
153152
#endif
154153
#endif
155154

supervisor/shared/usb/usb_msc_flash.c

Lines changed: 31 additions & 9 deletions

0 commit comments

Comments
 (0)