From 03ad81d7afaea119df607b6e65f19bd5362fab39 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 15 Apr 2021 13:07:56 +0200 Subject: Get FELDHELL to work --- sw/eval-clock-cw-tx/src/state.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'sw/eval-clock-cw-tx/src/state.rs') diff --git a/sw/eval-clock-cw-tx/src/state.rs b/sw/eval-clock-cw-tx/src/state.rs index a5891c5..cd89ede 100644 --- a/sw/eval-clock-cw-tx/src/state.rs +++ b/sw/eval-clock-cw-tx/src/state.rs @@ -29,13 +29,20 @@ pub enum CWMode { #[derive(PartialEq, Eq, Clone, Copy)] pub enum Mode { CW(CWMode), + FeldHell, +} + +#[derive(PartialEq, Eq, Clone, Copy)] +pub enum SequenceMode { + CW, + FeldHell, } #[derive(Clone, PartialEq, Eq)] pub enum SequenceState { Rx, - SwitchingCW, - TxCW, + Switching(SequenceMode), + Tx(SequenceMode), } #[derive(Clone)] @@ -55,7 +62,8 @@ impl State { pub fn new() -> Self { State { ui_sel : UISelection::VFO, - mode : Mode::CW(CWMode::StraightKey), + //mode : Mode::CW(CWMode::StraightKey), + mode : Mode::FeldHell, vfo_sel : VFOSelection::A, vfo_a : INITIAL_VFO, vfo_b : INITIAL_VFO, @@ -66,6 +74,13 @@ impl State { } } + pub fn set_vfo(&mut self, freq : u32) { + match self.vfo_sel { + VFOSelection::A => self.vfo_a = freq, + VFOSelection::B => self.vfo_b = freq, + } + } + pub fn vfo_display(&self) -> u32 { match self.vfo_sel { VFOSelection::A => self.vfo_a, @@ -90,4 +105,8 @@ impl State { TuneSpeed::Fast => 1000, } } + + pub fn allow_feldhell_keying(&self) -> bool { + self.sequence_state == SequenceState::Tx(SequenceMode::FeldHell) + } } -- cgit v1.2.3