From 19ac3f30d0e26626959120ebe167bd826f90e950 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 Oct 2022 10:18:04 -0400 Subject: [PATCH] only rotate if not stored image --- cubesatsim/cubesatsim.ino | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index f7eb55a0..3274e1f4 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -209,6 +209,7 @@ void loop() { } else if (mode == SSTV) { + bool stored_image = false; first_time_sstv = false; char image_file[128]; if (first_time_sstv) { @@ -217,12 +218,15 @@ void loop() { first_time_sstv = false; } else { if (camera_detected = get_camera_image()) { - Serial.println("Getting image file"); -// Serial.println("Got image file"); +// Serial.println("Getting image file"); + Serial.println("Using camera image file"); char camera_file[] = "/cam.jpg"; strcpy(image_file, camera_file); - } else + } else { + Serial.println("Using stored image") strcpy(image_file, sstv1_filename); // 2nd stored image + store_image = true; + } } if (debug_mode) { Serial.print("\nSending SSTV image "); @@ -239,7 +243,10 @@ void loop() { char telem_display[] = " BATT: STATUS: TEMP: "; char output_file[] = "/cam.bin"; digitalWrite(PTT_PIN, HIGH); // shouldn't need this but - rotate_image(output_file2, output_file, telem_display); + if (!stored_image) { + Serial.println("Rotating image (takes 30 seconds)"); + rotate_image(output_file2, output_file, telem_display); + } show_dir(); if (debug_mode)