@@ -97,10 +97,10 @@ void performUpdate() {
9797 backingUP = true ;
9898 unsigned lastUpdateBytes = lastUpdateFile.readAsString ().toInt (); // Read the last update size from the file
9999
100- debugPrint (" Last update bytes: " + String (lastUpdateBytes));
100+ Arduino_UnifiedStorage:: debugPrint (" Last update bytes: " + String (lastUpdateBytes));
101101
102102 if (lastUpdateBytes >= bytesWritten) {
103- debugPrint (" No new data to copy. " );
103+ Arduino_UnifiedStorage:: debugPrint (" No new data to copy. " );
104104 backupFile.close ();
105105 lastUpdateFile.close ();
106106 backingUP = false ;
@@ -109,14 +109,14 @@ void performUpdate() {
109109
110110 logFile.seek (lastUpdateBytes); // Move the file pointer to the last update position
111111 unsigned long totalBytesToMove = bytesWritten - lastUpdateBytes;
112- debugPrint (" New update bytes: " + String (totalBytesToMove));
112+ Arduino_UnifiedStorage:: debugPrint (" New update bytes: " + String (totalBytesToMove));
113113
114114 uint8_t * buffer = new uint8_t [totalBytesToMove];
115115
116116 size_t bytesRead = logFile.read (buffer, totalBytesToMove);
117117 size_t bytesMoved = backupFile.write (buffer, bytesRead); // Only write the bytes that haven't been backed up yet
118118
119- debugPrint (" Successfully copied " + String (bytesMoved) + " new bytes. " );
119+ Arduino_UnifiedStorage:: debugPrint (" Successfully copied " + String (bytesMoved) + " new bytes. " );
120120
121121 lastUpdateFile.changeMode (FileMode::WRITE); // Open the last update file in write mode
122122 lastUpdateFile.write (String (lastUpdateBytes + bytesMoved)); // Update the last update size
@@ -138,32 +138,32 @@ void performUpdate() {
138138void backupToUSB () {
139139 if (usbAvailable && !usbIntialized){
140140 usbStorage.begin ();
141- debugPrint (" First drive insertion, creating folders... " );
141+ Arduino_UnifiedStorage:: debugPrint (" First drive insertion, creating folders... " );
142142 Folder usbRoot = usbStorage.getRootFolder ();
143143 String folderName = " LoggerBackup" + String (random (9999 ));
144144 backupFolder = usbRoot.createSubfolder (folderName);
145- debugPrint (" Successfully created backup folder: " + backupFolder.getPathAsString ());
145+ Arduino_UnifiedStorage:: debugPrint (" Successfully created backup folder: " + backupFolder.getPathAsString ());
146146 usbStorage.unmount ();
147147 usbIntialized = true ;
148148 }
149149 else if (usbAvailable && usbIntialized) {
150- debugPrint (" USB Mass storage is available " );
150+ Arduino_UnifiedStorage:: debugPrint (" USB Mass storage is available " );
151151 delay (100 );
152152 if (!usbStorage.isMounted ()) {
153153
154- debugPrint (" Mounting USB Mass Storage " );
154+ Arduino_UnifiedStorage:: debugPrint (" Mounting USB Mass Storage " );
155155 digitalWrite (USB_MOUNTED_LED, LOW);
156156 if (usbStorage.begin ()){
157157 performUpdate ();
158158 }
159159
160160 } else if (usbStorage.isMounted ()) {
161- debugPrint (" USB Mass storage is connected, performing update " );
161+ Arduino_UnifiedStorage:: debugPrint (" USB Mass storage is connected, performing update " );
162162 performUpdate ();
163163
164164 }
165165 } else {
166- debugPrint (" USB Mass storage is not available " );
166+ Arduino_UnifiedStorage:: debugPrint (" USB Mass storage is not available " );
167167 }
168168
169169
@@ -185,17 +185,17 @@ void setup() {
185185 usbStorage.onDisconnect (disconnectionCallback);
186186
187187 pinMode (USB_MOUNTED_LED, OUTPUT);
188- debugPrint (" Formatting internal storage... " );
188+ Arduino_UnifiedStorage:: debugPrint (" Formatting internal storage... " );
189189 int formatted = internalStorage.format (FS_LITTLEFS);
190- debugPrint (" QSPI Format status: " + String (formatted));
190+ Arduino_UnifiedStorage:: debugPrint (" QSPI Format status: " + String (formatted));
191191
192192
193193
194194 if (!internalStorage.begin ()) {
195- debugPrint (" Failed to initialize internal storage " );
195+ Arduino_UnifiedStorage:: debugPrint (" Failed to initialize internal storage " );
196196 return ;
197197 } else {
198- debugPrint (" Initialized storage " );
198+ Arduino_UnifiedStorage:: debugPrint (" Initialized storage " );
199199 }
200200
201201}
0 commit comments