diff options
| author | xoviat <[email protected]> | 2023-07-17 16:24:09 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-17 16:24:09 -0500 |
| commit | 55ac480cb000b466571feee712d4ff075a1c64f8 (patch) | |
| tree | 1a48785871c73873e1f04f726cfd392fcb2a2276 /embassy-stm32/src/eth | |
| parent | c7ec45a004750f590c1d9ea4a721972efe133b8e (diff) | |
stm32/eth: fix cfg(not(time))
Diffstat (limited to 'embassy-stm32/src/eth')
| -rw-r--r-- | embassy-stm32/src/eth/generic_smi.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/eth/generic_smi.rs b/embassy-stm32/src/eth/generic_smi.rs index 90631b175..2ed46ca2c 100644 --- a/embassy-stm32/src/eth/generic_smi.rs +++ b/embassy-stm32/src/eth/generic_smi.rs | |||
| @@ -45,20 +45,19 @@ use self::phy_consts::*; | |||
| 45 | pub struct GenericSMI { | 45 | pub struct GenericSMI { |
| 46 | #[cfg(feature = "time")] | 46 | #[cfg(feature = "time")] |
| 47 | poll_interval: Duration, | 47 | poll_interval: Duration, |
| 48 | #[cfg(not(feature = "time"))] | ||
| 49 | _private: (), | ||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | impl GenericSMI { | 52 | impl GenericSMI { |
| 51 | #[cfg(feature = "time")] | ||
| 52 | pub fn new() -> Self { | 53 | pub fn new() -> Self { |
| 53 | Self { | 54 | Self { |
| 55 | #[cfg(feature = "time")] | ||
| 54 | poll_interval: Duration::from_millis(500), | 56 | poll_interval: Duration::from_millis(500), |
| 57 | #[cfg(not(feature = "time"))] | ||
| 58 | _private: (), | ||
| 55 | } | 59 | } |
| 56 | } | 60 | } |
| 57 | |||
| 58 | #[cfg(not(feature = "time"))] | ||
| 59 | pub fn new() -> Self { | ||
| 60 | Self {} | ||
| 61 | } | ||
| 62 | } | 61 | } |
| 63 | 62 | ||
| 64 | unsafe impl PHY for GenericSMI { | 63 | unsafe impl PHY for GenericSMI { |
| @@ -102,6 +101,7 @@ unsafe impl PHY for GenericSMI { | |||
| 102 | 101 | ||
| 103 | /// Public functions for the PHY | 102 | /// Public functions for the PHY |
| 104 | impl GenericSMI { | 103 | impl GenericSMI { |
| 104 | #[cfg(feature = "time")] | ||
| 105 | pub fn set_poll_interval(&mut self, poll_interval: Duration) { | 105 | pub fn set_poll_interval(&mut self, poll_interval: Duration) { |
| 106 | self.poll_interval = poll_interval | 106 | self.poll_interval = poll_interval |
| 107 | } | 107 | } |
