aboutsummaryrefslogtreecommitdiffstats
path: root/sw/picardy/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sw/picardy/src/state.rs')
-rw-r--r--sw/picardy/src/state.rs50
1 files changed, 13 insertions, 37 deletions
diff --git a/sw/picardy/src/state.rs b/sw/picardy/src/state.rs
index c275033..4e6af33 100644
--- a/sw/picardy/src/state.rs
+++ b/sw/picardy/src/state.rs
@@ -1,10 +1,9 @@
pub const VHF_BAND_EDGE : u32 = 144_000_000;
pub const VHF_INITIAL_VFO : u32 = 144_300_000;
-pub const VHF_LO : u32 = 114_286_400;
+pub const VHF_LO : u32 = 114_284_800;
pub const BFO_LSB : u32 = 6_000_700 + 1_100;
pub const BFO_USB : u32 = 6_000_700 - 1_100;
pub const BFO_CW : u32 = 6_000_700 - 1_100;
-pub const QRG_CORRECTION : i32 = -1_600;
// Defines which parameter is changed by the encoder
#[derive(Clone, Copy, PartialEq, Eq)]
@@ -14,19 +13,18 @@ pub enum UISelection {
Mode,
}
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub enum MenuPage {
+ One,
+ Two,
+}
+
#[derive(Clone, Copy)]
pub enum VFOSelection {
A,
B,
}
-#[derive(Clone)]
-pub enum TuneSpeed {
- Slow,
- Mid,
- Fast
-}
-
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum CWMode {
StraightKey,
@@ -59,13 +57,13 @@ impl SequenceState {
#[derive(Clone)]
pub struct State {
+ pub menu_page : MenuPage,
pub ui_sel : UISelection,
pub vfo_a : u32,
pub vfo_b : u32,
pub vfo_sel : VFOSelection,
pub rit : i32,
pub mode : Mode,
- pub tune_speed : TuneSpeed,
pub sequence_state : SequenceState,
pub update_disp_counter : u8,
pub cw_wpm : u32,
@@ -74,16 +72,16 @@ pub struct State {
impl State {
pub fn new() -> Self {
State {
- rit : 0,
+ menu_page : MenuPage::One,
ui_sel : UISelection::VFO,
- mode : Mode::USB,
- vfo_sel : VFOSelection::A,
vfo_a : VHF_INITIAL_VFO,
vfo_b : VHF_INITIAL_VFO,
- tune_speed : TuneSpeed::Mid,
+ vfo_sel : VFOSelection::A,
+ rit : 0,
+ mode : Mode::USB,
sequence_state : SequenceState::Rx,
update_disp_counter : 0,
- cw_wpm : 12,
+ cw_wpm : 14,
}
}
@@ -115,26 +113,4 @@ impl State {
if self.sequence_state.apply_rit() { self.rit } else { 0 };
vfo as u32
}
-
- pub fn vfo_incr(&self) -> i32 {
- match self.tune_speed {
- TuneSpeed::Slow => 10,
- TuneSpeed::Mid => 200,
- TuneSpeed::Fast => 1000,
- }
- }
-
- pub fn rit_incr(&self) -> i32 {
- // RIT is always slow because it's a fine setting
- 2
- }
-
- pub fn bfo_incr(&self) -> i32 {
- match self.tune_speed {
- TuneSpeed::Slow => 10,
- TuneSpeed::Mid => 50,
- TuneSpeed::Fast => 100,
- }
- }
-
}