upload sstv files if not in FS

pico-v0.13
alanbjohnston 3 years ago committed by GitHub
parent 882b5e178d
commit 902dfe07e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3535,22 +3535,28 @@ void load_files() {
File f; File f;
f = LittleFS.open("sstv_image_1_320_x_240.jpg", "r"); f = LittleFS.open("sstv_image_1_320_x_240.jpg", "r");
Serial.print("Image sstv_image_1_320_x_240.jpg: "); if (f) {
Serial.println(f); Serial.print("Image sstv_image_1_320_x_240.jpg already in FS");
f.close(); f.close();
} else {
Serial.print("Loading image sstv_image_1_320_x_240.jpg into FS");
f = LittleFS.open("sstv_image_1_320_x_240.jpg", "w+");
if (f.write(sstv_image_1_320_x_240, sizeof(sstv_image_1_320_x_240)) < sizeof(sstv_image_1_320_x_240))
Serial.print("Loading image failed. Is Flash Size (FS) set to 1MB?");
f.close();
}
f = LittleFS.open("sstv_image_2_320_x_240.jpg", "r"); f = LittleFS.open("sstv_image_2_320_x_240.jpg", "r");
Serial.print("Image sstv_image_2_320_x_240.jpg: "); if (f) {
Serial.println(f); Serial.print("Image sstv_image_2_320_x_240.jpg already in FS");
f.close(); f.close();
} else {
f = LittleFS.open("sstv_image_1_320_x_240.jpg", "w+"); Serial.print("Loading image sstv_image_2_320_x_240.jpg into FS");
f.write(sstv_image_1_320_x_240, sizeof(sstv_image_1_320_x_240)); f = LittleFS.open("sstv_image_2_320_x_240.jpg", "w+");
f.close(); if (f.write(sstv_image_2_320_x_240, sizeof(sstv_image_2_320_x_240)) < sizeof(sstv_image_2_320_x_240))
Serial.print("Loading image failed. Is Flash Size (FS) set to 1MB?");
f = LittleFS.open("sstv_image_2_320_x_240.jpg", "w+"); f.close();
f.write(sstv_image_2_320_x_240, sizeof(sstv_image_2_320_x_240)); }
f.close();
show_dir(); show_dir();
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.