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/fixed/src/impl_bytemuck.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

67 lines
2.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 © 2018–2025 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::types::extra::{LeEqU8, LeEqU16, LeEqU32, LeEqU64, LeEqU128};
use crate::{
FixedI8, FixedI16, FixedI32, FixedI64, FixedI128, FixedU8, FixedU16, FixedU32, FixedU64,
FixedU128, Unwrapped, Wrapping,
};
use bytemuck::{Contiguous, Pod, TransparentWrapper, Zeroable};
macro_rules! unsafe_impl_traits {
($Fixed:ident, $LeEqU:ident, $Inner:ident) => {
unsafe impl<Frac> Zeroable for $Fixed<Frac> {}
unsafe impl<Frac: 'static> Pod for $Fixed<Frac> {}
unsafe impl<Frac: 'static> Contiguous for $Fixed<Frac> {
type Int = $Inner;
const MAX_VALUE: $Inner = $Inner::MAX;
const MIN_VALUE: $Inner = $Inner::MIN;
}
unsafe impl<Frac> TransparentWrapper<$Inner> for $Fixed<Frac> {}
unsafe impl<Frac: $LeEqU> Zeroable for Wrapping<$Fixed<Frac>> {}
unsafe impl<Frac: $LeEqU> Pod for Wrapping<$Fixed<Frac>> {}
unsafe impl<Frac: $LeEqU> Contiguous for Wrapping<$Fixed<Frac>> {
type Int = $Inner;
const MAX_VALUE: $Inner = $Inner::MAX;
const MIN_VALUE: $Inner = $Inner::MIN;
}
unsafe impl<Frac: $LeEqU> TransparentWrapper<$Fixed<Frac>> for Wrapping<$Fixed<Frac>> {}
unsafe impl<Frac: $LeEqU> Zeroable for Unwrapped<$Fixed<Frac>> {}
unsafe impl<Frac: $LeEqU> Pod for Unwrapped<$Fixed<Frac>> {}
unsafe impl<Frac: $LeEqU> Contiguous for Unwrapped<$Fixed<Frac>> {
type Int = $Inner;
const MAX_VALUE: $Inner = $Inner::MAX;
const MIN_VALUE: $Inner = $Inner::MIN;
}
unsafe impl<Frac: $LeEqU> TransparentWrapper<$Fixed<Frac>> for Unwrapped<$Fixed<Frac>> {}
};
}
// SAFETY: all fixed-point numbers are repr(transparent) over primitive integer
// types which are both Pod and Zeroable, and Wrapping and Unwrapped are both
// repr(transparent) over fixed-point numbers.
unsafe_impl_traits! { FixedI8, LeEqU8, i8 }
unsafe_impl_traits! { FixedI16, LeEqU16, i16 }
unsafe_impl_traits! { FixedI32, LeEqU32, i32 }
unsafe_impl_traits! { FixedI64, LeEqU64, i64 }
unsafe_impl_traits! { FixedI128, LeEqU128, i128 }
unsafe_impl_traits! { FixedU8, LeEqU8, u8 }
unsafe_impl_traits! { FixedU16, LeEqU16, u16 }
unsafe_impl_traits! { FixedU32, LeEqU32, u32 }
unsafe_impl_traits! { FixedU64, LeEqU64, u64 }
unsafe_impl_traits! { FixedU128, LeEqU128, u128 }