From c792c4695405e072e5b25414c00c25c674201e9e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 4 Dec 2022 15:22:03 -0500 Subject: [PATCH] enable clock for CW mode without SR_FRS --- cubesatsim/cubesatsim.ino | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 564102e5..400c0e74 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -2165,12 +2165,31 @@ void config_radio() pinMode(TEMPERATURE_PIN, INPUT); pinMode(AUDIO_IN_PIN, INPUT); */ - if ((mode == AFSK) || (mode == SSTV) || (mode == CW)) { + if ((mode == AFSK) || (mode == SSTV)) { digitalWrite(PD_PIN, HIGH); // Enable SR_FRS // pinMode(AUDIO_OUT_PIN, OUTPUT); // program_radio(); // remove for now + } else if (mode == CW) { + if (sr_frs_present) + digitalWrite(PD_PIN, HIGH); // Enable SR_FRS + else { + start_clockgen(); + if (clockgen.setClockFSK()) { + start_clockgen(); + clockgen.setClockFSK(); + Serial.println("Config clock for CW without SR_FRS!"); + } else { + Serial.println("Config clock for CW without SR_FRS"); + } + digitalWrite(PD_PIN, LOW); // disable SR_FRS + clockgen.enableOutputs(false); + digitalWrite(BPSK_CONTROL_B, LOW); + digitalWrite(BPSK_CONTROL_A, LOW); + + } + } else if (mode == BPSK) { /* int ret = 1;