We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent befe931 commit ccaa7b8Copy full SHA for ccaa7b8
examples/PortentaH7Logger/PortentaH7Logger.ino
@@ -97,7 +97,8 @@ void performUpdate() {
97
unsigned long totalBytesToMove = bytesWritten - lastUpdateBytes;
98
Serial.print("New update bytes: "); Serial.println(totalBytesToMove);
99
100
- uint8_t buffer[totalBytesToMove];
+ uint8_t* buffer = new uint8_t[totalBytesToMove];
101
+
102
size_t bytesRead = logFile.read(buffer, totalBytesToMove);
103
size_t bytesMoved = backupFile.write(buffer, bytesRead); // Only write the bytes that haven't been backed up yet
104
@@ -115,6 +116,7 @@ void performUpdate() {
115
116
117
digitalWrite(USB_MOUNTED_LED, HIGH);
118
backingUP = false;
119
+ delete[] buffer;
120
}
121
122
0 commit comments