This commit is contained in:
Dion Dokter 2024-07-09 09:37:49 +02:00
parent 203297b569
commit f6f312270f
5 changed files with 18 additions and 21 deletions

View File

@ -280,13 +280,12 @@ pub fn init(config: Config) -> Peripherals {
#[cfg(feature = "_dual-core")]
mod dual_core {
use core::mem::MaybeUninit;
use core::sync::atomic::{AtomicUsize, Ordering};
use rcc::Clocks;
use super::*;
use core::{
mem::MaybeUninit,
sync::atomic::{AtomicUsize, Ordering},
};
/// Object containing data that embassy needs to share between cores.
///

View File

@ -78,7 +78,9 @@ pub(crate) unsafe fn set_freqs(freqs: Clocks) {
/// Safety: Sets a mutable global.
pub(crate) unsafe fn set_freqs(freqs: Clocks) {
debug!("rcc: {:?}", freqs);
CLOCK_FREQS_PTR.load(core::sync::atomic::Ordering::SeqCst).write(MaybeUninit::new(freqs));
CLOCK_FREQS_PTR
.load(core::sync::atomic::Ordering::SeqCst)
.write(MaybeUninit::new(freqs));
}
#[cfg(not(feature = "_dual-core"))]

View File

@ -5,10 +5,8 @@ use core::mem::MaybeUninit;
use defmt::*;
use embassy_executor::Spawner;
use embassy_stm32::{
gpio::{Level, Output, Speed},
SharedData,
};
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::SharedData;
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};

View File

@ -5,10 +5,8 @@ use core::mem::MaybeUninit;
use defmt::*;
use embassy_executor::Spawner;
use embassy_stm32::{
gpio::{Level, Output, Speed},
SharedData,
};
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::SharedData;
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};