Skip to content

Commit

Permalink
fix: compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Nov 25, 2024
1 parent 295f3d2 commit 34e929c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/hpm5300evk/src/bin/embassy_tmpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*);
};
}

Expand Down
2 changes: 1 addition & 1 deletion examples/hpm5300evk/src/bin/mcan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static mut LINE_INTERRUPTS: Option<OwnedInterruptSet<peripherals::MCAN3>> = None
static mut UART: Option<hal::uart::Uart<'static, Blocking>> = 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)*);
};
}

Expand Down
2 changes: 1 addition & 1 deletion examples/hpm5300evk/src/bin/mcan_mi_motor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static CAN_RX_WAKER: AtomicWaker = AtomicWaker::new();
static mut UART: Option<hal::uart::Uart<'static, Blocking>> = 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)*);
};
}

Expand Down
2 changes: 1 addition & 1 deletion examples/hpm5300evk/src/bin/raw_pwm_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*);
};
}

Expand Down
6 changes: 3 additions & 3 deletions examples/hpm5300evk/src/bin/raw_pwm_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<hal::uart::Uart<'static, Blocking>> = 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<hal::uart::Uart<'static, Blocking>> = None;

#[hal::entry]
fn main() -> ! {
let mut config = hal::Config::default();
Expand Down
3 changes: 2 additions & 1 deletion src/dac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ impl<'d> Dac<'d, Buffered> {
}

// - MARK: Info and State

#[allow(unused)]
struct State {
waker: AtomicWaker,
}
Expand All @@ -429,6 +429,7 @@ impl State {
}
}

#[allow(unused)]
struct Info {
regs: crate::pac::dac::Dac,
interrupt: interrupt::Interrupt,
Expand Down
1 change: 1 addition & 0 deletions src/usb/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl<T: Instance> Bus<T> {
}

/// 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;

Expand Down

0 comments on commit 34e929c

Please sign in to comment.