1
1
#include < Arduino_UnifiedStorage.h>
2
+ #include " Utils.h"
3
+
4
+ #define ARDUINO_UNIFIED_STORAGE_DEBUG
2
5
3
6
4
7
InternalStorage internalStorage = InternalStorage();
@@ -25,26 +28,26 @@ void setup() {
25
28
26
29
27
30
// Test copyTo
28
- printToSerialOrRS485 (" Testing copyTo... \n " );
31
+ debugPrint (" Testing copyTo..." );
29
32
Folder sourceFolder2 = root.createSubfolder (" source_folder" );
30
- printToSerialOrRS485 (" Folder 1 created \n " );
33
+ debugPrint (" Folder 1 created" );
31
34
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" );
33
36
Folder sourceFolder3 = root.createSubfolder (" source_folder" );
34
37
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" );
36
39
Folder sourceFolder4 = root.createSubfolder (" source_folder" , true );
37
40
38
41
Folder destinationFolder2 = root.createSubfolder (" destination_folder" );
39
- printToSerialOrRS485 (" Folder 2 created \n " );
42
+ debugPrint (" Folder 2 created" );
40
43
41
44
42
45
43
46
bool copyResult = sourceFolder2.copyTo (destinationFolder2, true ); // Overwrite if exists
44
47
if (copyResult) {
45
- printToSerialOrRS485 (" Copy successful \n " );
48
+ debugPrint (" Copy successful" );
46
49
} else {
47
- printToSerialOrRS485 (" Copy failed \n " );
50
+ debugPrint (" Copy failed" );
48
51
}
49
52
50
53
@@ -54,12 +57,12 @@ void setup() {
54
57
Folder sourceFolder = root.createSubfolder (" source" );
55
58
Folder destinationFolder = root.createSubfolder (" destination" );
56
59
57
- printToSerialOrRS485 (" Testing moveTo... \n " );
60
+ debugPrint (" Testing moveTo... " );
58
61
bool moveResult = sourceFolder.moveTo (destinationFolder, true ); // Overwrite if exists
59
62
if (moveResult) {
60
- printToSerialOrRS485 (" Move successful \n " );
63
+ debugPrint (" Move successful" );
61
64
} else {
62
- printToSerialOrRS485 (" Move failed \n " );
65
+ debugPrint (" Move failed" );
63
66
}
64
67
65
68
@@ -73,10 +76,10 @@ void setup() {
73
76
74
77
75
78
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);
77
80
78
81
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);
80
83
81
84
}
82
85
0 commit comments