aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eval-clock-cw-tx/src/state.rs
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-03-13 23:14:32 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-03-13 23:14:32 +0100
commite04fec33f079db4c5d42aa412f7b670784ec1b68 (patch)
tree3bed3e90faafcd3967dafae293277ad0b6dddd10 /sw/eval-clock-cw-tx/src/state.rs
parentde7b4aa1b04e1fcb226c596c819b5ff996c73238 (diff)
downloadpicardy-e04fec33f079db4c5d42aa412f7b670784ec1b68.tar.gz
picardy-e04fec33f079db4c5d42aa412f7b670784ec1b68.tar.bz2
picardy-e04fec33f079db4c5d42aa412f7b670784ec1b68.zip
Add WSPR TX to eval-clock-cw-tx
Diffstat (limited to 'sw/eval-clock-cw-tx/src/state.rs')
-rw-r--r--sw/eval-clock-cw-tx/src/state.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/eval-clock-cw-tx/src/state.rs b/sw/eval-clock-cw-tx/src/state.rs
index 44c64d2..4016a51 100644
--- a/sw/eval-clock-cw-tx/src/state.rs
+++ b/sw/eval-clock-cw-tx/src/state.rs
@@ -1,4 +1,4 @@
-const INITIAL_VFO : u32 = 10_100_000;
+const INITIAL_VFO : u32 = 10_140_000;
// Defines which parameter is changed by the encoder
#[derive(Clone, Copy, PartialEq, Eq)]
@@ -23,12 +23,14 @@ pub enum CWMode {
pub enum Mode {
CW(CWMode),
FeldHell,
+ WSPR,
}
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum SequenceMode {
CW,
FeldHell,
+ WSPR,
}
#[derive(Clone, PartialEq, Eq)]
@@ -48,19 +50,23 @@ pub struct State {
pub sequence_state : SequenceState,
pub update_disp_counter : u8,
pub cw_wpm : u32,
+ pub wspr_freq_offset_centihz : u32,
+ pub wspr_freq_offset_updated : bool,
}
impl State {
pub fn new() -> Self {
State {
ui_sel : UISelection::VFO,
- mode : Mode::CW(CWMode::StraightKey),
+ mode : Mode::WSPR,
vfo_sel : VFOSelection::A,
vfo_a : INITIAL_VFO,
vfo_b : INITIAL_VFO,
sequence_state : SequenceState::Rx,
update_disp_counter : 0,
cw_wpm : 14,
+ wspr_freq_offset_centihz : 0,
+ wspr_freq_offset_updated : false,
}
}
@@ -88,6 +94,7 @@ impl State {
}
}
+
pub fn allow_feldhell_keying(&self) -> bool {
self.sequence_state == SequenceState::Tx(SequenceMode::FeldHell)
}