diff options
| author | xoviat <[email protected]> | 2025-11-13 14:42:14 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-11-13 14:42:14 -0600 |
| commit | 64b9c28eca4822a3ba1bd07d20964c2291c01cf5 (patch) | |
| tree | 2263e3e12375ce83b14bf4ca42ba62eec21c3b85 /embassy-stm32/src/eth | |
| parent | 86fbcbdd7b9a5d37f6a7b1553e1ad0b5e5c8aa96 (diff) | |
stm32: extract block_for_us
remove from pub api
Diffstat (limited to 'embassy-stm32/src/eth')
| -rw-r--r-- | embassy-stm32/src/eth/generic_phy.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/embassy-stm32/src/eth/generic_phy.rs b/embassy-stm32/src/eth/generic_phy.rs index 774beef80..947874d7f 100644 --- a/embassy-stm32/src/eth/generic_phy.rs +++ b/embassy-stm32/src/eth/generic_phy.rs | |||
| @@ -8,6 +8,7 @@ use embassy_time::{Duration, Timer}; | |||
| 8 | use futures_util::FutureExt; | 8 | use futures_util::FutureExt; |
| 9 | 9 | ||
| 10 | use super::{Phy, StationManagement}; | 10 | use super::{Phy, StationManagement}; |
| 11 | use crate::block_for_us as blocking_delay_us; | ||
| 11 | 12 | ||
| 12 | #[allow(dead_code)] | 13 | #[allow(dead_code)] |
| 13 | mod phy_consts { | 14 | mod phy_consts { |
| @@ -76,19 +77,6 @@ impl GenericPhy { | |||
| 76 | } | 77 | } |
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | // TODO: Factor out to shared functionality | ||
| 80 | fn blocking_delay_us(us: u32) { | ||
| 81 | #[cfg(feature = "time")] | ||
| 82 | embassy_time::block_for(Duration::from_micros(us as u64)); | ||
| 83 | #[cfg(not(feature = "time"))] | ||
| 84 | { | ||
| 85 | let freq = unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 as u64; | ||
| 86 | let us = us as u64; | ||
| 87 | let cycles = freq * us / 1_000_000; | ||
| 88 | cortex_m::asm::delay(cycles as u32); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | impl Phy for GenericPhy { | 80 | impl Phy for GenericPhy { |
| 93 | fn phy_reset<S: StationManagement>(&mut self, sm: &mut S) { | 81 | fn phy_reset<S: StationManagement>(&mut self, sm: &mut S) { |
| 94 | // Detect SMI address | 82 | // Detect SMI address |
