Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95c2376caf | ||
|
|
b079b509ae | ||
|
|
a1ee228d72 |
4 changed files with 71 additions and 41 deletions
12
src/ble.rs
12
src/ble.rs
|
|
@ -120,17 +120,7 @@ pub async fn run(
|
|||
..
|
||||
} = stack.build();
|
||||
|
||||
let mut features = alloc::vec![];
|
||||
if cfg!(feature = "cam") {
|
||||
features.push("cam");
|
||||
}
|
||||
if cfg!(feature = "denm") {
|
||||
features.push("denm");
|
||||
}
|
||||
if cfg!(feature = "spat") {
|
||||
features.push("mapem");
|
||||
features.push("spatem");
|
||||
}
|
||||
let mut features = crate::util::get_rx_feature_list();
|
||||
info!(
|
||||
"Starting advertising and GATT service for {}",
|
||||
features.join(",")
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ mod io;
|
|||
mod screen;
|
||||
#[cfg(feature = "gnss_ubx")]
|
||||
mod ubx;
|
||||
mod util;
|
||||
|
||||
const WIFI_CHANNEL: radio::Channel = 180;
|
||||
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ where
|
|||
self.clear()?;
|
||||
|
||||
text::Text::with_alignment(
|
||||
"Searching...",
|
||||
"Searching\nupcoming\nintersection...",
|
||||
geometry::Point::new(i32::from(self.size.width) / 2, 130 + self.size.offset_top),
|
||||
Self::DEFAULT_TEXT_STYLE,
|
||||
text::Alignment::Center,
|
||||
|
|
@ -614,6 +614,8 @@ where
|
|||
|
||||
self.clear_all()?;
|
||||
|
||||
#[cfg(feature = "spat")]
|
||||
{
|
||||
let sig_width = i32::from(self.size.width) / 3;
|
||||
let circle_dia = 50;
|
||||
let circle_margin = (sig_width - circle_dia) / 2;
|
||||
|
|
@ -649,6 +651,11 @@ where
|
|||
text::Alignment::Center,
|
||||
)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
|
||||
// show features
|
||||
let enabled_features = crate::util::get_rx_feature_list();
|
||||
let enabled_tx_features = crate::util::get_tx_feature_list();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
32
src/util.rs
Normal file
32
src/util.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//! Some stuff used at several places
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[allow(unused)]
|
||||
pub(crate) fn get_rx_feature_list() -> Vec<&'static str> {
|
||||
let mut features = alloc::vec![];
|
||||
if cfg!(feature = "cam") {
|
||||
features.push("cam");
|
||||
}
|
||||
if cfg!(feature = "denm") {
|
||||
features.push("denm");
|
||||
}
|
||||
if cfg!(feature = "spat") {
|
||||
features.push("mapem");
|
||||
features.push("spatem");
|
||||
}
|
||||
|
||||
features
|
||||
}
|
||||
|
||||
pub(crate) fn get_tx_feature_list() -> Vec<&'static str> {
|
||||
let mut features = alloc::vec![];
|
||||
if cfg!(feature = "cam_tx") {
|
||||
features.push("cam-tx");
|
||||
}
|
||||
if cfg!(feature = "uart") {
|
||||
features.push("uart-tx");
|
||||
}
|
||||
|
||||
features
|
||||
}
|
||||
Loading…
Reference in a new issue