From aa41e071b2689d847f52f8a84bcc8319786f9fdc Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Mon, 4 Sep 2023 14:28:12 +0200 Subject: [PATCH 1/5] Fix compiler warning about using a const char pointer --- src/InternalStorage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InternalStorage.h b/src/InternalStorage.h index 3bd7ba5..b3d35c1 100644 --- a/src/InternalStorage.h +++ b/src/InternalStorage.h @@ -107,7 +107,7 @@ class InternalStorage : public Arduino_UnifiedStorage { #endif - char * partitionName = "user"; + char * partitionName = (char *) "user"; FileSystems fs = FS_FAT; }; From 6041f2c8def5cf055416b37ac9cf135215938b13 Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Mon, 4 Sep 2023 14:28:33 +0200 Subject: [PATCH 2/5] Add missing return value for error case --- src/InternalStorage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InternalStorage.cpp b/src/InternalStorage.cpp index e61f2dc..1d15f73 100644 --- a/src/InternalStorage.cpp +++ b/src/InternalStorage.cpp @@ -62,7 +62,7 @@ int InternalStorage::begin(){ int InternalStorage::unmount(){ int err = this -> userDataFileSystem -> unmount(); - if(err == 0) return 1; + return err == 0 ? 1 : 0; } Folder InternalStorage::getRootFolder(){ From dbb0a04dafe88436026e80cc94e996e6ac320519 Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Mon, 4 Sep 2023 14:37:12 +0200 Subject: [PATCH 3/5] Return error in begin function if we're not compiling for supported board --- src/InternalStorage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/InternalStorage.cpp b/src/InternalStorage.cpp index 1d15f73..09c2b21 100644 --- a/src/InternalStorage.cpp +++ b/src/InternalStorage.cpp @@ -57,6 +57,8 @@ int InternalStorage::begin(){ int err = this -> userDataFileSystem -> mount(this -> userData); if(err == 0) return 1; + #else + return 0; #endif } From e24d5e6af930bcc2c94451566783694537cd3d92 Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Mon, 4 Sep 2023 15:39:22 +0200 Subject: [PATCH 4/5] Add missing return statement --- src/SDStorage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDStorage.cpp b/src/SDStorage.cpp index 94ad710..8c2e798 100644 --- a/src/SDStorage.cpp +++ b/src/SDStorage.cpp @@ -14,7 +14,7 @@ int SDStorage::begin(){ int SDStorage::begin(FileSystems fs){ this -> fs = fs; - this -> begin(); + return this -> begin(); } int SDStorage::unmount(){ From e7186d99c622e6fa5a46fcd62962b93340e7c556 Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Mon, 4 Sep 2023 15:46:52 +0200 Subject: [PATCH 5/5] Add missing return statement --- src/USBStorage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USBStorage.cpp b/src/USBStorage.cpp index f1268e2..b2c97f8 100644 --- a/src/USBStorage.cpp +++ b/src/USBStorage.cpp @@ -18,7 +18,7 @@ USBStorage::USBStorage(){ int USBStorage::begin(FileSystems fs){ this -> fs = fs; - this -> begin(); + return this -> begin(); } int USBStorage::begin(){