11#include < Arduino_UnifiedStorage.h>
2+ #include " Utils.h"
3+
4+ #define ARDUINO_UNIFIED_STORAGE_DEBUG
25
36
47InternalStorage internalStorage = InternalStorage();
@@ -25,26 +28,26 @@ void setup() {
2528
2629
2730 // Test copyTo
28- printToSerialOrRS485 (" Testing copyTo... \n " );
31+ debugPrint (" Testing copyTo..." );
2932 Folder sourceFolder2 = root.createSubfolder (" source_folder" );
30- printToSerialOrRS485 (" Folder 1 created \n " );
33+ debugPrint (" Folder 1 created" );
3134
32- printToSerialOrRS485 (" Trying to create a folder on top of an existing one... without overwrite \n " );
35+ debugPrint (" Trying to create a folder on top of an existing one... without overwrite" );
3336 Folder sourceFolder3 = root.createSubfolder (" source_folder" );
3437
35- printToSerialOrRS485 (" Trying to create a folder on top of an existing one... with overwrite \n " );
38+ debugPrint (" Trying to create a folder on top of an existing one... with overwrite" );
3639 Folder sourceFolder4 = root.createSubfolder (" source_folder" , true );
3740
3841 Folder destinationFolder2 = root.createSubfolder (" destination_folder" );
39- printToSerialOrRS485 (" Folder 2 created \n " );
42+ debugPrint (" Folder 2 created" );
4043
4144
4245
4346 bool copyResult = sourceFolder2.copyTo (destinationFolder2, true ); // Overwrite if exists
4447 if (copyResult) {
45- printToSerialOrRS485 (" Copy successful \n " );
48+ debugPrint (" Copy successful" );
4649 } else {
47- printToSerialOrRS485 (" Copy failed \n " );
50+ debugPrint (" Copy failed" );
4851 }
4952
5053
@@ -54,12 +57,12 @@ void setup() {
5457 Folder sourceFolder = root.createSubfolder (" source" );
5558 Folder destinationFolder = root.createSubfolder (" destination" );
5659
57- printToSerialOrRS485 (" Testing moveTo... \n " );
60+ debugPrint (" Testing moveTo... " );
5861 bool moveResult = sourceFolder.moveTo (destinationFolder, true ); // Overwrite if exists
5962 if (moveResult) {
60- printToSerialOrRS485 (" Move successful \n " );
63+ debugPrint (" Move successful" );
6164 } else {
62- printToSerialOrRS485 (" Move failed \n " );
65+ debugPrint (" Move failed" );
6366 }
6467
6568
@@ -73,10 +76,10 @@ void setup() {
7376
7477
7578 bool success = someFile.copyTo (someOtherFolder);
76- printToSerialOrRS485 (" trying to copy file without overwrite: %d\n " , success);
79+ debugPrint (" trying to copy file without overwrite: %d" , success);
7780
7881 success = someFile.copyTo (someOtherFolder,true );
79- printToSerialOrRS485 (" trying to copy file with overwrite: %d \n " , success);
82+ debugPrint (" trying to copy file with overwrite: %d " , success);
8083
8184}
8285
0 commit comments