@@ -14,29 +14,29 @@ InternalStorage::InternalStorage(){
1414InternalStorage::InternalStorage (int partition, const char * name, FileSystems fs){
1515 this -> setQSPIPartition (partition);
1616 this -> setQSPIPartitionName (name);
17- this -> fs = fs;
17+ this -> fileSystem = fs;
1818}
1919
2020bool InternalStorage::begin (FileSystems fs){
21- this -> fs = fs;
21+ this -> fileSystem = fs;
2222 return this -> begin ();
2323}
2424
2525bool InternalStorage::begin (){
2626 #if defined(ARDUINO_PORTENTA_C33)
2727 this -> blockDevice = BlockDevice::get_default_instance ();
2828 this -> userData = new MBRBlockDevice (this ->blockDevice , this ->partitionNumber );
29- if (this -> fs == FS_FAT){
29+ if (this -> fileSystem == FS_FAT){
3030 this -> userDataFileSystem = new FATFileSystem (this ->partitionName );
3131 } else {
3232 this -> userDataFileSystem = new LittleFileSystem (this ->partitionName );
3333 }
3434 int err = this -> userDataFileSystem -> mount (userData);
35- return err == 0 ? true : false ;
35+ return err == 0 ;
3636 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
3737 this -> blockDevice = QSPIFBlockDevice::get_default_instance ();
3838 this -> userData = new mbed::MBRBlockDevice (this ->blockDevice , this ->partitionNumber );
39- if (this -> fs == FS_FAT){
39+ if (this -> fileSystem == FS_FAT){
4040
4141 if (this -> userDataFileSystem != nullptr ){
4242 delete (this -> userDataFileSystem);
@@ -51,13 +51,15 @@ bool InternalStorage::begin(){
5151 this -> userDataFileSystem = new mbed::LittleFileSystem (this ->partitionName );
5252 }
5353 int err = this -> userDataFileSystem -> mount (this -> userData);
54- return err == 0 ? true : false ;
54+ return err == 0 ;
55+ #else
56+ return false ; // Unsupported board
5557 #endif
5658}
5759
5860bool InternalStorage::unmount (){
5961 int err = this -> userDataFileSystem -> unmount ();
60- return err == 0 ? true : false ;
62+ return err == 0 ;
6163}
6264
6365Folder InternalStorage::getRootFolder (){
@@ -75,24 +77,24 @@ void InternalStorage::setQSPIPartitionName(const char * name){
7577bool InternalStorage::format (FileSystems fs){
7678 this -> begin ();
7779 this -> unmount ();
78- this -> fs = fs;
80+ this -> fileSystem = fs;
7981
8082
8183 if (fs == FS_FAT){
8284 #if defined(ARDUINO_PORTENTA_C33)
8385 this -> userDataFileSystem = new FATFileSystem (this ->partitionName );
84- return this -> userDataFileSystem -> reformat (this -> userData) == 0 ? true : false ;
86+ return this -> userDataFileSystem -> reformat (this -> userData) == 0 ;
8587 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
8688 this -> userDataFileSystem = new mbed::FATFileSystem (this ->partitionName );
87- return this -> userDataFileSystem -> reformat (this -> userData) == 0 ? true : false ;
89+ return this -> userDataFileSystem -> reformat (this -> userData) == 0 ;
8890 #endif
8991 } if (fs == FS_LITTLEFS) {
9092 #if defined(ARDUINO_PORTENTA_C33)
9193 this -> userDataFileSystem = new LittleFileSystem (this ->partitionName );
92- return this -> userDataFileSystem -> reformat (this -> userData) == 0 ? true : false ;
94+ return this -> userDataFileSystem -> reformat (this -> userData) == 0 ;
9395 #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
9496 this -> userDataFileSystem = new mbed::LittleFileSystem (this ->partitionName );
95- return this -> userDataFileSystem -> reformat (this -> userData) == 0 ? true : false ;
97+ return this -> userDataFileSystem -> reformat (this -> userData) == 0 ;
9698 #endif
9799 }
98100
0 commit comments