mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-28 21:30:44 +03:00
catch opening non-existing file for read on OTA
This commit is contained in:
@@ -99,6 +99,11 @@ static bool ota_update_task(std::string fn)
|
||||
int data_read;
|
||||
|
||||
FILE* f = OpenFileAndWait(fn.c_str(), "rb"); // vorher nur "r"
|
||||
|
||||
if (f == NULL) { // File does not exist
|
||||
return false;
|
||||
}
|
||||
|
||||
data_read = fread(ota_write_data, 1, BUFFSIZE, f);
|
||||
|
||||
while (data_read > 0) {
|
||||
|
||||
Reference in New Issue
Block a user