aboutsummaryrefslogtreecommitdiffstats
path: root/sw/picardy/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sw/picardy/src/ui.rs')
-rw-r--r--sw/picardy/src/ui.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/picardy/src/ui.rs b/sw/picardy/src/ui.rs
index 0d42f88..1133582 100644
--- a/sw/picardy/src/ui.rs
+++ b/sw/picardy/src/ui.rs
@@ -92,7 +92,6 @@ impl fmt::Display for ButtonState {
#[derive(Default)]
pub struct ButtonResult {
- pub bfo_update : bool,
pub display_update : bool,
pub ptt : bool,
}
@@ -206,7 +205,6 @@ impl UI {
state.ui_sel = new_ui_sel;
state.filter_shift = new_filter_shift;
- result.bfo_update = true;
result.display_update = true;
}
@@ -227,7 +225,6 @@ impl UI {
},
UISelection::IFShift => {
state.filter_shift = FilterShift::USB;
- result.bfo_update = true;
},
}
@@ -273,7 +270,10 @@ pub fn update_disp<T: hd44780_driver::bus::DataBus>(lcd: &mut HD44780<T>, state:
write!(string, "{:<03}.{:<03} ", disp_freq / 1000, disp_freq % 1000).unwrap();
write!(string, "{}{:<03}", if state.rit >= 0 { "+" } else { "-" }, state.rit.abs()/10).unwrap();
- write!(string, "S{:3}", s_meter_value).unwrap();
+ if string.len() <= 16 - 4 {
+ // Avoids crash when frequency is very negative
+ write!(string, "S{:3}", s_meter_value).unwrap();
+ }
lcd.set_cursor_pos(0, delay).unwrap();
lcd.write_str(&string, delay).unwrap();