diff options
-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, |