From da5fa455f76a02038a36962f6baaf72b7e87d608 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 9 Aug 2022 04:08:48 -0400 Subject: [PATCH] added first_time_sstv flag for sending sstv1 and sstv2 --- cubesatsim/cubesatsim.ino | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 2cfafae1..754b2c5b 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -178,8 +178,12 @@ void loop() { else if (mode == SSTV) { char image_file[128]; -// strcpy(image_file, sstv1_filename); - strcpy(image_file, sstv2_filename); + if (first_time_sstv) { + strcpy(image_file, sstv1_filename); + first_time_sstv = false; + } else { + strcpy(image_file, sstv2_filename); + } Serial.print("\nSending SSTV image "); print_string(image_file); // send_sstv("/cam.raw"); @@ -310,8 +314,10 @@ void transmit_off() { pwm_set_gpio_level(BPSK_PWM_A_PIN, 0); pwm_set_gpio_level(BPSK_PWM_B_PIN, 0); } - if (mode == SSTV) + if (mode == SSTV) { + first_time_sstv = true; sstv_end(); + } } void config_telem() {