This repository has been archived on 2026-08-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
donglora/vendor/az/src/float.rs
T
swaitsandClaude Opus 4.6 3102fc747a 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>
2026-03-29 20:42:54 -06:00

70 lines
1.8 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright © 2019–2021 Trevor Spiteri
// This library is free software: you can redistribute it and/or
// modify it under the terms of either
//
// * the Apache License, Version 2.0 or
// * the MIT License
//
// at your option.
//
// You should have recieved copies of the Apache License and the MIT
// License along with the library. If not, see
// <https://www.apache.org/licenses/LICENSE-2.0> and
// <https://opensource.org/licenses/MIT>.
use crate::{cast, Cast, CheckedCast, Round, UnwrappedCast};
use core::fmt::{Debug, Display, Formatter, LowerExp, Result as FmtResult, UpperExp};
macro_rules! convert {
($($Src:ty),* => $Dst:ty) => { $(
impl Cast<$Dst> for $Src {
#[inline]
fn cast(self) -> $Dst {
self as $Dst
}
}
impl CheckedCast<$Dst> for $Src {
#[inline]
fn checked_cast(self) -> Option<$Dst> {
Some(cast(self))
}
}
impl UnwrappedCast<$Dst> for $Src {
#[inline]
fn unwrapped_cast(self) -> $Dst {
cast(self)
}
}
)* };
}
convert! { i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize, f32, f64 => f32 }
convert! { i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize, f32, f64 => f64 }
impl<T: Display> Display for Round<T> {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
Display::fmt(&self.0, f)
}
}
impl<T: Debug> Debug for Round<T> {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
Debug::fmt(&self.0, f)
}
}
impl<T: LowerExp> LowerExp for Round<T> {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
LowerExp::fmt(&self.0, f)
}
}
impl<T: UpperExp> UpperExp for Round<T> {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
UpperExp::fmt(&self.0, f)
}
}