feat: add display UI with splash screen, dashboard, and RSSI sparkline
Implement full SSD1306 OLED display support: - Splash screen on boot (1.5s) with project name, version, board - Dashboard showing radio state, config, counters, RSSI/SNR - RSSI history sparkline (64-sample ring buffer, 2px-wide bars) - DisplayOn/DisplayOff host commands routed via dedicated channel - Pure render functions against generic DrawTarget (no hardware coupling) - Display on/off control bypasses radio task entirely Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
17624 files changed
+4564928
-38
No files matched your search
+61
@@ -0,0 +1,61 @@
|
||||
//! An example of implementing the `BitFlags` trait manually for a flags type.
|
||||
//!
|
||||
//! This example doesn't use any macros.
|
||||
|
||||
use std::{fmt, str};
|
||||
|
||||
use bitflags::{Flag, Flags};
|
||||
|
||||
// First: Define your flags type. It just needs to be `Sized + 'static`.
|
||||
pub struct ManualFlags(u32);
|
||||
|
||||
// Not required: Define some constants for valid flags
|
||||
impl ManualFlags {
|
||||
pub const A: ManualFlags = ManualFlags(0b00000001);
|
||||
pub const B: ManualFlags = ManualFlags(0b00000010);
|
||||
pub const C: ManualFlags = ManualFlags(0b00000100);
|
||||
pub const ABC: ManualFlags = ManualFlags(0b00000111);
|
||||
}
|
||||
|
||||
// Next: Implement the `BitFlags` trait, specifying your set of valid flags
|
||||
// and iterators
|
||||
impl Flags for ManualFlags {
|
||||
const FLAGS: &'static [Flag<Self>] = &[
|
||||
Flag::new("A", Self::A),
|
||||
Flag::new("B", Self::B),
|
||||
Flag::new("C", Self::C),
|
||||
];
|
||||
|
||||
type Bits = u32;
|
||||
|
||||
fn bits(&self) -> u32 {
|
||||
self.0
|
||||
}
|
||||
|
||||
fn from_bits_retain(bits: u32) -> Self {
|
||||
Self(bits)
|
||||
}
|
||||
}
|
||||
|
||||
// Not required: Add parsing support
|
||||
impl str::FromStr for ManualFlags {
|
||||
type Err = bitflags::parser::ParseError;
|
||||
|
||||
fn from_str(input: &str) -> Result<Self, Self::Err> {
|
||||
bitflags::parser::from_str(input)
|
||||
}
|
||||
}
|
||||
|
||||
// Not required: Add formatting support
|
||||
impl fmt::Display for ManualFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
bitflags::parser::to_writer(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!(
|
||||
"{}",
|
||||
ManualFlags::A.union(ManualFlags::B).union(ManualFlags::C)
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user