Skip to content

Commit cf23006

Browse files
BryanKadzbaneldruin
authored andcommitted
Fix ref-to-mut-static warnings in more examples
Missed these in the previous commit because I did not test locally with the `rt` feature enabled.
1 parent 033e812 commit cf23006

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/stm32f7disco-qspi-flash/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ fn memory_example_dma(
123123

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

129129
///////////////////////
130130
// Test erase + read //

examples/stm32f7disco-screen/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn main() -> ! {
103103
let mut display = screen::Stm32F7DiscoDisplay::new(perif.LTDC, perif.DMA2D);
104104
display
105105
.controller
106-
.config_layer(Layer::L1, unsafe { &mut FB_LAYER1 }, PixelFormat::RGB565);
106+
.config_layer(Layer::L1, unsafe { &mut *core::ptr::addr_of_mut!(FB_LAYER1) }, PixelFormat::RGB565);
107107

108108
display.controller.enable_layer(Layer::L1);
109109
display.controller.reload();

0 commit comments

Comments
 (0)