aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/eth
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-11-13 14:42:14 -0600
committerxoviat <[email protected]>2025-11-13 14:42:14 -0600
commit64b9c28eca4822a3ba1bd07d20964c2291c01cf5 (patch)
tree2263e3e12375ce83b14bf4ca42ba62eec21c3b85 /embassy-stm32/src/eth
parent86fbcbdd7b9a5d37f6a7b1553e1ad0b5e5c8aa96 (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.rs14
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};
8use futures_util::FutureExt; 8use futures_util::FutureExt;
9 9
10use super::{Phy, StationManagement}; 10use super::{Phy, StationManagement};
11use crate::block_for_us as blocking_delay_us;
11 12
12#[allow(dead_code)] 13#[allow(dead_code)]
13mod phy_consts { 14mod phy_consts {
@@ -76,19 +77,6 @@ impl GenericPhy {
76 } 77 }
77} 78}
78 79
79// TODO: Factor out to shared functionality
80fn 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
92impl Phy for GenericPhy { 80impl 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