aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Campora2015-07-05 23:01:23 +0200
committerDaniel Campora2015-07-07 16:13:40 +0200
commit5685b565c3e4973a871d7f8a5831958106210f85 (patch)
treeae0a512b7f704da78379f3315b69630b1415ea84
parent76e52b5daf9c1440357723e610ff8d0a68eee416 (diff)
cc3200: Create /flash/sys and /flash/lib directories while booting.
-rw-r--r--cc3200/mptask.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index aa4632c45..152637e15 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -308,7 +308,6 @@ STATIC void mptask_init_sflash_filesystem (void) {
// Initialise the local flash filesystem.
// Create it if needed, and mount in on /flash.
- // try to mount the flash
FRESULT res = f_mount(sflash_fatfs, "/flash", 1);
if (res == FR_NO_FILESYSTEM) {
// no filesystem, so create a fresh one
@@ -334,6 +333,16 @@ STATIC void mptask_init_sflash_filesystem (void) {
// It is set to the internal flash filesystem by default.
f_chdrive("/flash");
+ // create /flash/sys and /flash/lib if they don't exist
+ if (FR_OK != f_chdir ("/flash/sys")) {
+ res = f_mkdir("/flash/sys");
+ }
+ if (FR_OK != f_chdir ("/flash/lib")) {
+ res = f_mkdir("/flash/lib");
+ }
+
+ f_chdir ("/flash");
+
// Make sure we have a /flash/boot.py. Create it if needed.
res = f_stat("/flash/boot.py", &fno);
if (res == FR_OK) {