From 712a646ccfedbd2d540d251f3a0d4a31ecb43d99 Mon Sep 17 00:00:00 2001 From: Koppany Pazman Date: Thu, 22 Aug 2024 12:29:07 +0200 Subject: [PATCH] fix for issue #114447 --- examples/ethernet_hal.rs | 2 +- src/ethernet.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ethernet_hal.rs b/examples/ethernet_hal.rs index 3f52cfc..02a6eb8 100644 --- a/examples/ethernet_hal.rs +++ b/examples/ethernet_hal.rs @@ -119,7 +119,7 @@ fn main() -> ! { dp.ETHERNET_MAC, dp.ETHERNET_MTL, dp.ETHERNET_DMA, - &mut ETHERNET_DESCRIPTOR_RING, + &mut *core::ptr::addr_of_mut!(ETHERNET_DESCRIPTOR_RING), mac_addr.clone(), ccdr.peripheral.ETH1MAC, &ccdr.clocks, diff --git a/src/ethernet.rs b/src/ethernet.rs index 43a9fe5..e8cd840 100644 --- a/src/ethernet.rs +++ b/src/ethernet.rs @@ -187,7 +187,7 @@ impl<'a> EthernetInterface<'a> { let mut interface = EthernetInterface::new(pins); let timeout_timer = match interface.up( - unsafe { &mut ETHERNET_STORAGE }, + unsafe { &mut *core::ptr::addr_of_mut!(ETHERNET_STORAGE) }, mac_address, ip_address, eth1mac, @@ -248,7 +248,7 @@ impl<'a> EthernetInterface<'a> { dp.ETHERNET_MAC, dp.ETHERNET_MTL, dp.ETHERNET_DMA, - &mut ETHERNET_DESCRIPTOR_RING, + &mut *core::ptr::addr_of_mut!(ETHERNET_DESCRIPTOR_RING), ethernet_address, eth1mac, ccdr_clocks,