Watch
0
0
Fork
You've already forked esp32-c_its-companion
0

Compare commits

...
Author SHA1 Message Date
Jannik Beyerstedt
95c2376caf WIP screen: Different slash screen for 2026-09-25 13:11:50 +02:00
Jannik Beyerstedt
b079b509ae ble: Move feature listing to own module 2026-09-25 13:11:43 +02:00
Jannik Beyerstedt
a1ee228d72 screen: More verbose "searching" text 2026-09-25 11:32:45 +02:00
4 changed files with 71 additions and 41 deletions

View file

@ -120,17 +120,7 @@ pub async fn run(
.. ..
} = stack.build(); } = stack.build();
let mut features = alloc::vec![]; let mut features = crate::util::get_rx_feature_list();
if cfg!(feature = "cam") {
features.push("cam");
}
if cfg!(feature = "denm") {
features.push("denm");
}
if cfg!(feature = "spat") {
features.push("mapem");
features.push("spatem");
}
info!( info!(
"Starting advertising and GATT service for {}", "Starting advertising and GATT service for {}",
features.join(",") features.join(",")

View file

@ -58,6 +58,7 @@ mod io;
mod screen; mod screen;
#[cfg(feature = "gnss_ubx")] #[cfg(feature = "gnss_ubx")]
mod ubx; mod ubx;
mod util;
const WIFI_CHANNEL: radio::Channel = 180; const WIFI_CHANNEL: radio::Channel = 180;
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20 const WIFI_TXPOWER: i8 = 10; // dBm, 2..20

View file

@ -356,7 +356,7 @@ where
self.clear()?; self.clear()?;
text::Text::with_alignment( text::Text::with_alignment(
"Searching...", "Searching\nupcoming\nintersection...",
geometry::Point::new(i32::from(self.size.width) / 2, 130 + self.size.offset_top), geometry::Point::new(i32::from(self.size.width) / 2, 130 + self.size.offset_top),
Self::DEFAULT_TEXT_STYLE, Self::DEFAULT_TEXT_STYLE,
text::Alignment::Center, text::Alignment::Center,
@ -614,6 +614,8 @@ where
self.clear_all()?; self.clear_all()?;
#[cfg(feature = "spat")]
{
let sig_width = i32::from(self.size.width) / 3; let sig_width = i32::from(self.size.width) / 3;
let circle_dia = 50; let circle_dia = 50;
let circle_margin = (sig_width - circle_dia) / 2; let circle_margin = (sig_width - circle_dia) / 2;
@ -649,6 +651,11 @@ where
text::Alignment::Center, text::Alignment::Center,
) )
.draw(&mut self.target)?; .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(()) Ok(())
} }

32
src/util.rs Normal file
View 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
}