diff options
author | Damien George <damien.p.george@gmail.com> | 2017-02-07 12:35:39 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-02-07 12:35:39 +1100 |
commit | 9779c99317f229435c07f11fd18223956de77b41 (patch) | |
tree | db4be3014ee250ce8cae18b05ca255a5407bfd06 /stmhal/main.c | |
parent | de48a27d607f0e7acbcbd841a8a4c685574114dc (diff) |
stmhal: Add ability to skip booting from SD card via /flash/SKIPSD file.
Diffstat (limited to 'stmhal/main.c')
-rw-r--r-- | stmhal/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/stmhal/main.c b/stmhal/main.c index 7bf6f6a3a..7bfdc52c3 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -568,7 +568,10 @@ soft_reset: #if MICROPY_HW_HAS_SDCARD // if an SD card is present then mount it on /sd/ if (sdcard_is_present()) { - mounted_sdcard = init_sdcard_fs(first_soft_reset); + // if there is a file in the flash called "SKIPSD", then we don't mount the SD card + if (!mounted_flash || f_stat(&fs_user_mount_flash.fatfs, "/SKIPSD", NULL) != FR_OK) { + mounted_sdcard = init_sdcard_fs(first_soft_reset); + } } #endif |