Skip to content

Commit

Permalink
testsuite/subghz: fix static_mut_refs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
newAM committed May 11, 2024
1 parent 02e8930 commit 3f94069
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions testsuite/src/subghz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,12 @@ mod tests {
while rfbusys() {}
let start: u32 = DWT::cycle_count();
unwrap!(ta.sg.write_buffer(0, &DATA));
unwrap!(ta.sg.read_buffer(0, unsafe { &mut BUF }));
unwrap!(ta
.sg
.read_buffer(0, unsafe { unwrap!(core::ptr::addr_of_mut!(BUF).as_mut()) }));
let end: u32 = DWT::cycle_count();
defmt::info!("Cycles 255B: {}", end - start);
defmt::assert_eq!(DATA.as_ref(), unsafe { BUF }.as_ref());
defmt::assert_eq!(DATA, unsafe { BUF });

let mut buf: [u8; 0] = [];
while rfbusys() {}
Expand All @@ -348,10 +350,10 @@ mod tests {
while rfbusys() {}
let start: u32 = DWT::cycle_count();
unwrap!(sg.write_buffer(0, &DATA));
unwrap!(sg.read_buffer(0, unsafe { &mut BUF }));
unwrap!(sg.read_buffer(0, unsafe { unwrap!(core::ptr::addr_of_mut!(BUF).as_mut()) }));
let end: u32 = DWT::cycle_count();
defmt::info!("Cycles 255B: {}", end - start);
defmt::assert_eq!(DATA.as_ref(), unsafe { BUF }.as_ref());
defmt::assert_eq!(DATA, unsafe { BUF });

let mut buf: [u8; 0] = [];
while rfbusys() {}
Expand Down

0 comments on commit 3f94069

Please sign in to comment.