From ccfd2617dcd69543e01ccfdc56453099964f39bc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 8 Jul 2024 16:01:11 -0400 Subject: [PATCH] Update main.c fixed delay detection --- main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index de204f25..d4c4ce91 100644 --- a/main.c +++ b/main.c @@ -47,11 +47,12 @@ int main(int argc, char * argv[]) { if (command_file == NULL) { pi_zero_2_offset = 500; printf("Command and control is OFF\n"); - } - command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r"); - if (command_file == NULL) { - pi_zero_2_offset = 500; - printf("Command and control Carrier (squelch) is ON\n"); + } else { + command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r"); + if (command_file == NULL) { + pi_zero_2_offset = 500; + printf("Command and control Carrier (squelch) is ON\n"); + } } sleep(10); }