Skip to content

Commit 1684e8a

Browse files
committed
EthernetMacWithMII: implement DerefMut
1 parent b1ecee0 commit 1684e8a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/mac/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Ethernet MAC driver implementation
22
3-
use core::ops::Deref;
3+
use core::ops::{Deref, DerefMut};
44

55
use crate::{
66
hal::rcc::Clocks,
@@ -261,6 +261,16 @@ where
261261
}
262262
}
263263

264+
impl<MDIO, MDC> DerefMut for EthernetMACWithMii<MDIO, MDC>
265+
where
266+
MDIO: MdioPin,
267+
MDC: MdcPin,
268+
{
269+
fn deref_mut(&mut self) -> &mut Self::Target {
270+
&mut self.eth_mac
271+
}
272+
}
273+
264274
impl<MDIO, MDC> EthernetMACWithMii<MDIO, MDC>
265275
where
266276
MDIO: MdioPin,

0 commit comments

Comments
 (0)