Merge pull request #1665 from xoviat/eth

stm32/eth: fix cfg(not(time))
This commit is contained in:
Dario Nieuwenhuis 2023-07-18 11:22:42 +00:00 committed by GitHub
commit 15a6e04887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,19 +45,18 @@ use self::phy_consts::*;
pub struct GenericSMI {
#[cfg(feature = "time")]
poll_interval: Duration,
#[cfg(not(feature = "time"))]
_private: (),
}
impl GenericSMI {
#[cfg(feature = "time")]
pub fn new() -> Self {
Self {
#[cfg(feature = "time")]
poll_interval: Duration::from_millis(500),
}
}
#[cfg(not(feature = "time"))]
pub fn new() -> Self {
Self {}
_private: (),
}
}
}
@ -102,6 +101,7 @@ unsafe impl PHY for GenericSMI {
/// Public functions for the PHY
impl GenericSMI {
#[cfg(feature = "time")]
pub fn set_poll_interval(&mut self, poll_interval: Duration) {
self.poll_interval = poll_interval
}