diff options
author | Damien George <damien.p.george@gmail.com> | 2014-09-29 09:48:35 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-09-29 15:26:11 +0100 |
commit | 3a2795e200bd3b1248768b6b0fef6bb28487ed42 (patch) | |
tree | a86d10fe441592c153da82f54fd61eec5ef6792d | |
parent | f042d7a4d7197d87798bc9727e9df094a3edd7c1 (diff) | |
download | micropython-3a2795e200bd3b1248768b6b0fef6bb28487ed42.tar.gz micropython-3a2795e200bd3b1248768b6b0fef6bb28487ed42.zip |
stmhal: Add label to internal flash drive on creation.
-rw-r--r-- | stmhal/fatfs/src/ff.c | 1 | ||||
-rw-r--r-- | stmhal/ffconf.h | 2 | ||||
-rw-r--r-- | stmhal/main.c | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/stmhal/fatfs/src/ff.c b/stmhal/fatfs/src/ff.c index 5b0ba240c6..b7d8d27c4d 100644 --- a/stmhal/fatfs/src/ff.c +++ b/stmhal/fatfs/src/ff.c @@ -3793,6 +3793,7 @@ FRESULT f_setlabel ( /* Create a volume label in directory form */
vn[0] = 0;
+ if (label[0] == '/') label++;
for (sl = 0; label[sl]; sl++) ; /* Get name length */
for ( ; sl && label[sl-1] == ' '; sl--) ; /* Remove trailing spaces */
if (sl) { /* Create volume label in directory form */
diff --git a/stmhal/ffconf.h b/stmhal/ffconf.h index 4e01423ef8..0e5dcfa895 100644 --- a/stmhal/ffconf.h +++ b/stmhal/ffconf.h @@ -70,7 +70,7 @@ /* To enable fast seek feature, set _USE_FASTSEEK to 1. */ -#define _USE_LABEL 0 /* 0:Disable or 1:Enable */ +#define _USE_LABEL 1 /* 0:Disable or 1:Enable */ /* To enable volume label functions, set _USE_LAVEL to 1 */ diff --git a/stmhal/main.c b/stmhal/main.c index 05b097b7b3..84ce6353a4 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -350,6 +350,9 @@ soft_reset: __fatal_error("could not create LFS"); } + // set label + f_setlabel("/flash/pybflash"); + // create empty main.py FIL fp; f_open(&fp, "/flash/main.py", FA_WRITE | FA_CREATE_ALWAYS); |