diff options
| author | Dion Dokter <[email protected]> | 2024-07-09 09:53:01 +0200 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2024-07-09 09:53:01 +0200 |
| commit | 6db0daf79b5d3316b101f057702b62312c5d2986 (patch) | |
| tree | 694b789eba223b2b96990ee6ef9b1942741ea0d4 | |
| parent | f6f312270f9b2c42b0112545ac356cd6f595505b (diff) | |
Fix errors
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/dsihost.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rtc/low_power.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usb/usb.rs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 7a7d7cd8e..f20585ec3 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -77,7 +77,7 @@ pub(crate) fn blocking_delay_us(us: u32) { | |||
| 77 | embassy_time::block_for(embassy_time::Duration::from_micros(us as u64)); | 77 | embassy_time::block_for(embassy_time::Duration::from_micros(us as u64)); |
| 78 | #[cfg(not(feature = "time"))] | 78 | #[cfg(not(feature = "time"))] |
| 79 | { | 79 | { |
| 80 | let freq = unsafe { crate::rcc::get_freqs() }.sys.unwrap().0 as u64; | 80 | let freq = unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 as u64; |
| 81 | let us = us as u64; | 81 | let us = us as u64; |
| 82 | let cycles = freq * us / 1_000_000; | 82 | let cycles = freq * us / 1_000_000; |
| 83 | cortex_m::asm::delay(cycles as u32); | 83 | cortex_m::asm::delay(cycles as u32); |
diff --git a/embassy-stm32/src/dsihost.rs b/embassy-stm32/src/dsihost.rs index 51f124542..77c3d95c3 100644 --- a/embassy-stm32/src/dsihost.rs +++ b/embassy-stm32/src/dsihost.rs | |||
| @@ -14,7 +14,7 @@ pub fn blocking_delay_ms(ms: u32) { | |||
| 14 | #[cfg(feature = "time")] | 14 | #[cfg(feature = "time")] |
| 15 | embassy_time::block_for(embassy_time::Duration::from_millis(ms as u64)); | 15 | embassy_time::block_for(embassy_time::Duration::from_millis(ms as u64)); |
| 16 | #[cfg(not(feature = "time"))] | 16 | #[cfg(not(feature = "time"))] |
| 17 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.unwrap().0 / 1_000 * ms); | 17 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 1_000 * ms); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | /// PacketTypes extracted from CubeMX | 20 | /// PacketTypes extracted from CubeMX |
diff --git a/embassy-stm32/src/rtc/low_power.rs b/embassy-stm32/src/rtc/low_power.rs index a4ff1acbc..b9aaa63b9 100644 --- a/embassy-stm32/src/rtc/low_power.rs +++ b/embassy-stm32/src/rtc/low_power.rs | |||
| @@ -132,7 +132,7 @@ impl Rtc { | |||
| 132 | 132 | ||
| 133 | // Panic if the rcc mod knows we're not using low-power rtc | 133 | // Panic if the rcc mod knows we're not using low-power rtc |
| 134 | #[cfg(any(rcc_wb, rcc_f4, rcc_f410))] | 134 | #[cfg(any(rcc_wb, rcc_f4, rcc_f410))] |
| 135 | unsafe { crate::rcc::get_freqs() }.rtc.unwrap(); | 135 | unsafe { crate::rcc::get_freqs() }.rtc.to_hertz().unwrap(); |
| 136 | 136 | ||
| 137 | let requested_duration = requested_duration.as_ticks().clamp(0, u32::MAX as u64); | 137 | let requested_duration = requested_duration.as_ticks().clamp(0, u32::MAX as u64); |
| 138 | let rtc_hz = Self::frequency().0 as u64; | 138 | let rtc_hz = Self::frequency().0 as u64; |
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 1d9d19a73..9384c8688 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -270,7 +270,7 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 270 | #[cfg(feature = "time")] | 270 | #[cfg(feature = "time")] |
| 271 | embassy_time::block_for(embassy_time::Duration::from_millis(100)); | 271 | embassy_time::block_for(embassy_time::Duration::from_millis(100)); |
| 272 | #[cfg(not(feature = "time"))] | 272 | #[cfg(not(feature = "time"))] |
| 273 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.unwrap().0 / 10); | 273 | cortex_m::asm::delay(unsafe { crate::rcc::get_freqs() }.sys.to_hertz().unwrap().0 / 10); |
| 274 | 274 | ||
| 275 | #[cfg(not(usb_v4))] | 275 | #[cfg(not(usb_v4))] |
| 276 | regs.btable().write(|w| w.set_btable(0)); | 276 | regs.btable().write(|w| w.set_btable(0)); |
