reboot if size == 15360

pico-v0.39
alanbjohnston 3 years ago committed by GitHub
parent de327d8d78
commit 1df763194a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -176,6 +176,7 @@ void deleteFile(fs::FS &fs, const char * path) {
void setup() {
// delay(5000);
delay(1000);
Serial.begin(115200);
@ -384,7 +385,13 @@ void save_camera_image(char* filename)
return;
}
Serial.printf("\nImage length: %d \n", pic->len);
Serial.printf("\nImage length: %d \n", pic->len);
if (pic->len == 15360) {
Serial.println("Invalid JPEG - rebooting!");
delay(1000);
esp_reboot();
}
for (int k = 0; k < pic->len; k++) {
file.write(pic->buf[k]);

Loading…
Cancel
Save

Powered by TurnKey Linux.