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>
60 lines
2.1 KiB
Rust
60 lines
2.1 KiB
Rust
#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
|
|
|
|
windows_link::link!("kernel32.dll" "system" fn GetTimeZoneInformationForYear(wyear : u16, pdtzi : *const DYNAMIC_TIME_ZONE_INFORMATION, ptzi : *mut TIME_ZONE_INFORMATION) -> BOOL);
|
|
windows_link::link!("kernel32.dll" "system" fn SystemTimeToFileTime(lpsystemtime : *const SYSTEMTIME, lpfiletime : *mut FILETIME) -> BOOL);
|
|
windows_link::link!("kernel32.dll" "system" fn SystemTimeToTzSpecificLocalTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lpuniversaltime : *const SYSTEMTIME, lplocaltime : *mut SYSTEMTIME) -> BOOL);
|
|
windows_link::link!("kernel32.dll" "system" fn TzSpecificLocalTimeToSystemTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lplocaltime : *const SYSTEMTIME, lpuniversaltime : *mut SYSTEMTIME) -> BOOL);
|
|
pub type BOOL = i32;
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy)]
|
|
pub struct DYNAMIC_TIME_ZONE_INFORMATION {
|
|
pub Bias: i32,
|
|
pub StandardName: [u16; 32],
|
|
pub StandardDate: SYSTEMTIME,
|
|
pub StandardBias: i32,
|
|
pub DaylightName: [u16; 32],
|
|
pub DaylightDate: SYSTEMTIME,
|
|
pub DaylightBias: i32,
|
|
pub TimeZoneKeyName: [u16; 128],
|
|
pub DynamicDaylightTimeDisabled: bool,
|
|
}
|
|
impl Default for DYNAMIC_TIME_ZONE_INFORMATION {
|
|
fn default() -> Self {
|
|
unsafe { core::mem::zeroed() }
|
|
}
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Default)]
|
|
pub struct FILETIME {
|
|
pub dwLowDateTime: u32,
|
|
pub dwHighDateTime: u32,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Default)]
|
|
pub struct SYSTEMTIME {
|
|
pub wYear: u16,
|
|
pub wMonth: u16,
|
|
pub wDayOfWeek: u16,
|
|
pub wDay: u16,
|
|
pub wHour: u16,
|
|
pub wMinute: u16,
|
|
pub wSecond: u16,
|
|
pub wMilliseconds: u16,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy)]
|
|
pub struct TIME_ZONE_INFORMATION {
|
|
pub Bias: i32,
|
|
pub StandardName: [u16; 32],
|
|
pub StandardDate: SYSTEMTIME,
|
|
pub StandardBias: i32,
|
|
pub DaylightName: [u16; 32],
|
|
pub DaylightDate: SYSTEMTIME,
|
|
pub DaylightBias: i32,
|
|
}
|
|
impl Default for TIME_ZONE_INFORMATION {
|
|
fn default() -> Self {
|
|
unsafe { core::mem::zeroed() }
|
|
}
|
|
}
|