From 63e68d94904560ed90245b30ea8987b50e6f20c6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:40:08 -0500 Subject: [PATCH] also change config for CW -> FSK mode change --- cubesatsim/cubesatsim.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 957efad5..379ca314 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -328,17 +328,21 @@ void loop() { /// ITimer1.detachInterrupt(); /// start_button_isr(); // restart button isr /// } + int old_mode = mode; + bool config_done = false; mode = new_mode; // change modes if button pressed write_mode(); - if (mode == BPSK) + if (mode == BPSK) || ((new_mode == FSK) && (old_mode == CW)) { config_telem(); // run this before cw only for BPSK mode + config_done = true; + } if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); - if (mode != BPSK) + if (!config_done) config_telem(); // run this here for all other modes config_radio();