diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-03-05 21:23:26 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-03-05 21:23:26 +0100 |
commit | 336048a49af662684a76871a4974f8fb93239b99 (patch) | |
tree | 55c52c0d5785ee9d58d82b38b41df6e30905a34c | |
parent | df04f120a103976631047b08a35c310abfb7f604 (diff) | |
download | picardy-336048a49af662684a76871a4974f8fb93239b99.tar.gz picardy-336048a49af662684a76871a4974f8fb93239b99.tar.bz2 picardy-336048a49af662684a76871a4974f8fb93239b99.zip |
Separate LM386 muting from switching, slow down a T/R switch a bit
-rw-r--r-- | sw/picardy/src/main.rs | 14 | ||||
-rw-r--r-- | sw/picardy/src/state.rs | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sw/picardy/src/main.rs b/sw/picardy/src/main.rs index 22b894b..efdc59d 100644 --- a/sw/picardy/src/main.rs +++ b/sw/picardy/src/main.rs @@ -387,6 +387,18 @@ fn TIM2() { shared.mute_micn.set_low().unwrap(); shared.seq2_switch.set_low().unwrap(); shared.seq0n.set_high().unwrap(); + if button_result.ptt || cw_ptt { + SequenceState::MutingSpkr + } + else { + SequenceState::Rx + } + }, + SequenceState::MutingSpkr => { + shared.mute_spkr.set_high().unwrap(); + shared.mute_micn.set_low().unwrap(); + shared.seq2_switch.set_low().unwrap(); + shared.seq0n.set_high().unwrap(); if button_result.ptt { SequenceState::SwitchingSSB } @@ -466,7 +478,7 @@ fn TIM2() { }, } - const SWITCHING_DELAY : u32 = TICKS_PER_SECOND * 40 / 1000; + const SWITCHING_DELAY : u32 = TICKS_PER_SECOND * 80 / 1000; if shared.state.sequence_state != next_state && shared.last_sequence_state_change + SWITCHING_DELAY <= *ticks { shared.state.sequence_state = next_state; diff --git a/sw/picardy/src/state.rs b/sw/picardy/src/state.rs index 7f4909f..c275033 100644 --- a/sw/picardy/src/state.rs +++ b/sw/picardy/src/state.rs @@ -44,6 +44,7 @@ pub enum Mode { #[derive(Clone, PartialEq, Eq)] pub enum SequenceState { Rx, + MutingSpkr, SwitchingSSB, TxSSB, SwitchingCW, |