diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-04-15 13:07:56 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-04-15 13:07:56 +0200 |
commit | 03ad81d7afaea119df607b6e65f19bd5362fab39 (patch) | |
tree | 38835bd11e550aa267acaf82dad2c63f5a566522 /sw/eval-clock-cw-tx/src/state.rs | |
parent | 1a65830bbfc9ea4cfb999f43beb67e15947ef358 (diff) | |
download | picardy-03ad81d7afaea119df607b6e65f19bd5362fab39.tar.gz picardy-03ad81d7afaea119df607b6e65f19bd5362fab39.tar.bz2 picardy-03ad81d7afaea119df607b6e65f19bd5362fab39.zip |
Get FELDHELL to work
Diffstat (limited to 'sw/eval-clock-cw-tx/src/state.rs')
-rw-r--r-- | sw/eval-clock-cw-tx/src/state.rs | 25 |
1 files changed, 22 insertions, 3 deletions
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) + } } |