aboutsummaryrefslogtreecommitdiffstats
path: root/sw/dart-70/src/ui.rs
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-31 23:18:07 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-31 23:18:07 +0100
commitd45189798c160cee329b7c59636b0caf538244f6 (patch)
treeeee15c379f3be80e46eb08626b68bbd96d618151 /sw/dart-70/src/ui.rs
parent98ba4a9c42fa946f26b2a6ffce98c03436c6dd2d (diff)
downloadpicardy-master.tar.gz
picardy-master.tar.bz2
picardy-master.zip
DART-70: get VOX and CW workingHEADmaster
Diffstat (limited to 'sw/dart-70/src/ui.rs')
-rw-r--r--sw/dart-70/src/ui.rs26
1 files changed, 19 insertions, 7 deletions
diff --git a/sw/dart-70/src/ui.rs b/sw/dart-70/src/ui.rs
index f607b2b..9db2988 100644
--- a/sw/dart-70/src/ui.rs
+++ b/sw/dart-70/src/ui.rs
@@ -31,7 +31,7 @@ use stm32f1xx_hal::{
gpio::gpioa::*,
gpio::gpiob::*,
gpio::gpioc::*,
- gpio::{Input, PullUp, Floating},
+ gpio::{Input, Floating},
};
use embedded_hal::blocking::delay::{DelayMs, DelayUs};
@@ -104,7 +104,6 @@ pub struct UI {
btn_enc : PC15<Input<Floating>>,
mic_ptt : PA3<Input<Floating>>,
- _vox_ptt_n : PA0<Input<PullUp>>,
previous_button_state : ButtonState,
}
@@ -112,7 +111,6 @@ pub struct UI {
impl UI {
pub fn new(
mic_ptt: PA3<Input<Floating>>,
- vox_ptt_n: PA0<Input<PullUp>>,
btn0: PB1<Input<Floating>>,
btn1: PB0<Input<Floating>>,
btn2: PB12<Input<Floating>>,
@@ -126,7 +124,6 @@ impl UI {
btn3,
btn_enc,
mic_ptt,
- _vox_ptt_n: vox_ptt_n,
previous_button_state: ButtonState::default(),
}
}
@@ -189,8 +186,9 @@ impl UI {
(UISelection::Mode, Mode::USB) => (UISelection::Mode, Mode::LSB),
(UISelection::Mode, Mode::LSB) => (UISelection::Mode, Mode::CW(CWMode::StraightKey)),
(UISelection::Mode, Mode::CW(CWMode::StraightKey)) => (UISelection::Mode, Mode::CW(CWMode::Iambic)),
- (UISelection::Mode, Mode::CW(CWMode::Iambic)) => (UISelection::Mode, Mode::USB),
- (UISelection::Mode, Mode::CustomShift(_)) => (UISelection::Mode, Mode::USB),
+ (UISelection::Mode, Mode::CW(CWMode::Iambic)) => (UISelection::Mode, Mode::DIG),
+ (UISelection::Mode, Mode::CustomShift(_)) => (UISelection::Mode, Mode::DIG),
+ (UISelection::Mode, Mode::DIG) => (UISelection::Mode, Mode::USB),
(_, f) => (UISelection::Mode, f),
};
@@ -322,7 +320,20 @@ pub fn update_disp<T: hd44780_driver::bus::DataBus, D: DelayUs<u16> + DelayMs<u8
if string.len() <= 16 - 4 {
// Avoids crash when frequency is very negative
- write!(string, " S{:1}", s_meter_value).unwrap();
+ write!(string, "S{:3}", s_meter_value).unwrap();
+ /*
+ write!(string, " {:2}",
+ match state.sequence_state {
+ SequenceState::Rx => "Rx",
+ SequenceState::MutingSpkr => "Ms",
+ SequenceState::SwitchingSSB => "Ss",
+ SequenceState::TxSSB => "Ts",
+ SequenceState::SwitchingCW => "Sc",
+ SequenceState::TxCW => "Tc",
+ SequenceState::SwitchingDIG => "Sd",
+ SequenceState::TxDIG => "Td",
+ }).unwrap();
+ */
}
lcd.set_cursor_pos(0, delay).unwrap();
@@ -348,6 +359,7 @@ pub fn update_disp<T: hd44780_driver::bus::DataBus, D: DelayUs<u16> + DelayMs<u8
Mode::CustomShift(_) => "IFs",
Mode::CW(CWMode::StraightKey) => "CWs",
Mode::CW(CWMode::Iambic) => "CWp",
+ Mode::DIG => "DIG",
};
write!(string, "{} 1/2", mode).unwrap();