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
@@ -0,0 +1,24 @@
|
||||
use zerocopy_derive::*;
|
||||
|
||||
// The only valid value of this type are the bytes `0xC0C0`.
|
||||
#[derive(TryFromBytes, KnownLayout, Immutable)]
|
||||
#[repr(u16)]
|
||||
pub enum C0C0 {
|
||||
_XC0C0 = 0xC0C0,
|
||||
}
|
||||
|
||||
#[derive(FromBytes, KnownLayout, Immutable, SplitAt)]
|
||||
#[repr(C, align(4))]
|
||||
pub struct Packet<Magic> {
|
||||
magic_number: Magic,
|
||||
milk: u8,
|
||||
mug_size: u8,
|
||||
temperature: [u8; 5],
|
||||
marshmallows: [[u8; 3]],
|
||||
}
|
||||
|
||||
/// A packet begining with the magic number `0xC0C0`.
|
||||
pub type CocoPacket = Packet<C0C0>;
|
||||
|
||||
/// A packet beginning with any two initialized bytes.
|
||||
pub type LocoPacket = Packet<[u8; 2]>;
|
||||
@@ -0,0 +1,27 @@
|
||||
use zerocopy_derive::*;
|
||||
|
||||
// The only valid value of this type are the bytes `0xC0C0`.
|
||||
#[derive(TryFromBytes, KnownLayout, Immutable, IntoBytes)]
|
||||
#[repr(u16)]
|
||||
pub enum C0C0 {
|
||||
_XC0C0 = 0xC0C0,
|
||||
}
|
||||
|
||||
macro_rules! define_packet {
|
||||
($name: ident, $trait: ident, $leading_field: ty) => {
|
||||
#[derive($trait, KnownLayout, Immutable, IntoBytes, SplitAt)]
|
||||
#[repr(C, align(2))]
|
||||
pub struct $name {
|
||||
magic_number: $leading_field,
|
||||
mug_size: u8,
|
||||
temperature: u8,
|
||||
marshmallows: [[u8; 2]],
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Packet begins with bytes 0xC0C0.
|
||||
define_packet!(CocoPacket, TryFromBytes, C0C0);
|
||||
|
||||
/// Packet begins with any two bytes.
|
||||
define_packet!(LocoPacket, FromBytes, [u8; 2]);
|
||||
@@ -0,0 +1,27 @@
|
||||
use zerocopy_derive::*;
|
||||
|
||||
// The only valid value of this type are the bytes `0xC0C0`.
|
||||
#[derive(TryFromBytes, KnownLayout, Immutable, IntoBytes)]
|
||||
#[repr(u16)]
|
||||
pub enum C0C0 {
|
||||
_XC0C0 = 0xC0C0,
|
||||
}
|
||||
|
||||
macro_rules! define_packet {
|
||||
($name: ident, $trait: ident, $leading_field: ty) => {
|
||||
#[derive($trait, KnownLayout, Immutable, IntoBytes)]
|
||||
#[repr(C, align(2))]
|
||||
pub struct $name {
|
||||
magic_number: $leading_field,
|
||||
mug_size: u8,
|
||||
temperature: u8,
|
||||
marshmallows: [u8; 2],
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Packet begins with bytes 0xC0C0.
|
||||
define_packet!(CocoPacket, TryFromBytes, C0C0);
|
||||
|
||||
/// Packet begins with any two bytes.
|
||||
define_packet!(LocoPacket, FromBytes, [u8; 2]);
|
||||
Reference in new issue
Block a user