diff --git a/examples/hpm5300evk/src/bin/embassy_tmpl.rs b/examples/hpm5300evk/src/bin/embassy_tmpl.rs index 5fe5559..81b7249 100644 --- a/examples/hpm5300evk/src/bin/embassy_tmpl.rs +++ b/examples/hpm5300evk/src/bin/embassy_tmpl.rs @@ -31,7 +31,7 @@ async fn blink(pin: AnyPin) { macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let _ = writeln!(unsafe {(&mut *(&raw mut UART)).as_mut().unwrap()}, $($arg)*); }; } diff --git a/examples/hpm5300evk/src/bin/mcan.rs b/examples/hpm5300evk/src/bin/mcan.rs index 3a5f28b..8a22de5 100644 --- a/examples/hpm5300evk/src/bin/mcan.rs +++ b/examples/hpm5300evk/src/bin/mcan.rs @@ -63,7 +63,7 @@ static mut LINE_INTERRUPTS: Option> = None static mut UART: Option> = None; macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let _ = writeln!(unsafe {(&mut *(&raw mut UART)).as_mut().unwrap()}, $($arg)*); }; } diff --git a/examples/hpm5300evk/src/bin/mcan_mi_motor.rs b/examples/hpm5300evk/src/bin/mcan_mi_motor.rs index b4a6545..7d2aa5b 100644 --- a/examples/hpm5300evk/src/bin/mcan_mi_motor.rs +++ b/examples/hpm5300evk/src/bin/mcan_mi_motor.rs @@ -87,7 +87,7 @@ static CAN_RX_WAKER: AtomicWaker = AtomicWaker::new(); static mut UART: Option> = None; macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let _ = writeln!(unsafe {(&mut *(&raw mut UART)).as_mut().unwrap()}, $($arg)*); }; } diff --git a/examples/hpm5300evk/src/bin/raw_pwm_in.rs b/examples/hpm5300evk/src/bin/raw_pwm_in.rs index b1e6d67..74b95fe 100644 --- a/examples/hpm5300evk/src/bin/raw_pwm_in.rs +++ b/examples/hpm5300evk/src/bin/raw_pwm_in.rs @@ -20,7 +20,7 @@ const BANNER: &str = include_str!("../../../assets/BANNER"); macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let _ = writeln!(unsafe {(&mut *(&raw mut UART)).as_mut().unwrap()}, $($arg)*); }; } diff --git a/examples/hpm5300evk/src/bin/raw_pwm_out.rs b/examples/hpm5300evk/src/bin/raw_pwm_out.rs index 690836d..c14c4ee 100644 --- a/examples/hpm5300evk/src/bin/raw_pwm_out.rs +++ b/examples/hpm5300evk/src/bin/raw_pwm_out.rs @@ -17,14 +17,14 @@ use {defmt_rtt as _, hpm_hal as hal}; const BOARD_NAME: &str = "HPM5300EVK"; const BANNER: &str = include_str!("../../../assets/BANNER"); +static mut UART: Option> = None; + macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let _ = writeln!(unsafe {(&mut *(&raw mut UART)).as_mut().unwrap()}, $($arg)*); }; } -static mut UART: Option> = None; - #[hal::entry] fn main() -> ! { let mut config = hal::Config::default(); diff --git a/src/dac.rs b/src/dac.rs index b8b1dd4..d8c4d69 100644 --- a/src/dac.rs +++ b/src/dac.rs @@ -417,7 +417,7 @@ impl<'d> Dac<'d, Buffered> { } // - MARK: Info and State - +#[allow(unused)] struct State { waker: AtomicWaker, } @@ -429,6 +429,7 @@ impl State { } } +#[allow(unused)] struct Info { regs: crate::pac::dac::Dac, interrupt: interrupt::Interrupt, diff --git a/src/usb/bus.rs b/src/usb/bus.rs index 4ada95a..1996b1a 100644 --- a/src/usb/bus.rs +++ b/src/usb/bus.rs @@ -245,6 +245,7 @@ impl Bus { } /// Get port speed: 00: full speed, 01: low speed, 10: high speed, 11: undefined + #[allow(unused)] pub(crate) fn get_port_speed(&mut self) -> u8 { let r = T::info().regs;