aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eval-clock-cw-tx/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sw/eval-clock-cw-tx/src/state.rs')
-rw-r--r--sw/eval-clock-cw-tx/src/state.rs25
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)
+ }
}