From 336048a49af662684a76871a4974f8fb93239b99 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 5 Mar 2021 21:23:26 +0100 Subject: Separate LM386 muting from switching, slow down a T/R switch a bit --- sw/picardy/src/main.rs | 14 +++++++++++++- sw/picardy/src/state.rs | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'sw') 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, -- cgit v1.2.3