Skip to content

Commit

Permalink
Fix ref-to-mut-static warnings in more examples
Browse files Browse the repository at this point in the history
Missed these in the previous commit because I did not test locally with
the `rt` feature enabled.
  • Loading branch information
BryanKadzban committed Feb 8, 2024
1 parent b21490e commit 3e18d19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/stm32f7disco-qspi-flash/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ fn memory_example_dma(

// Create pinned versions for DMA transfers
let mut stream = stream;
let mut read_buffer = unsafe { Pin::new(&mut READ_BUFFER) };
let mut page_buffer = unsafe { Pin::new(&mut PAGE_BUFFER) };
let mut read_buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(READ_BUFFER)) };
let mut page_buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(PAGE_BUFFER)) };

///////////////////////
// Test erase + read //
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f7disco-screen/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn main() -> ! {
let mut display = screen::Stm32F7DiscoDisplay::new(perif.LTDC, perif.DMA2D);
display
.controller
.config_layer(Layer::L1, unsafe { &mut FB_LAYER1 }, PixelFormat::RGB565);
.config_layer(Layer::L1, unsafe { &mut *core::ptr::addr_of_mut!(FB_LAYER1) }, PixelFormat::RGB565);

display.controller.enable_layer(Layer::L1);
display.controller.reload();
Expand Down

0 comments on commit 3e18d19

Please sign in to comment.