@@ -25,6 +25,8 @@ MBRBlockDevice user_bd(root, 2);
25
25
FATFileSystem sys_fs (" sys" );
26
26
FATFileSystem user_fs (" user" );
27
27
28
+ int err = 0 ;
29
+
28
30
/* -------------------------------------------------------------------------- */
29
31
void printDirectoryContent (const char * name) {
30
32
/* -------------------------------------------------------------------------- */
@@ -67,7 +69,7 @@ void setup() {
67
69
Serial.println (" *** USB Mass Storage DEVICE on QSPI Flash ***" );
68
70
69
71
/* Mount the partition */
70
- int err = sys_fs.mount (&sys_bd);
72
+ err = sys_fs.mount (&sys_bd);
71
73
if (err) {
72
74
Serial.println (" Unable to mount system filesystem" );
73
75
while (1 ) {
@@ -77,9 +79,8 @@ void setup() {
77
79
/* Mount the partition */
78
80
err = user_fs.mount (&user_bd);
79
81
if (err) {
80
- Serial.println (" Unable to mount user filesystem" );
81
- while (1 ) {
82
- }
82
+ Serial.println (" Unable to mount user filesystem. Only FatFS is supported" );
83
+ /* Probably the user is using LittleFs. Go on and show only system fs */
83
84
}
84
85
}
85
86
@@ -89,7 +90,9 @@ void setup() {
89
90
void loop () {
90
91
Serial.println (" Content of the system partition:" );
91
92
printDirectoryContent (" /sys" );
92
- Serial.println (" Content of the user partition:" );
93
- printDirectoryContent (" /user" );
93
+ if (!err) {
94
+ Serial.println (" Content of the user partition:" );
95
+ printDirectoryContent (" /user" );
96
+ }
94
97
delay (2000 );
95
98
}
0 commit comments