mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 22:54:52 +00:00
Write the flag sooner with a known value
This commit is contained in:
parent
92a489b6a1
commit
595ce48eb2
@ -350,6 +350,11 @@ mod dual_core {
|
|||||||
pub fn init_primary(config: Config, shared_data: &'static MaybeUninit<SharedData>) -> Peripherals {
|
pub fn init_primary(config: Config, shared_data: &'static MaybeUninit<SharedData>) -> Peripherals {
|
||||||
let shared_data = unsafe { shared_data.assume_init_ref() };
|
let shared_data = unsafe { shared_data.assume_init_ref() };
|
||||||
|
|
||||||
|
// Write the flag as soon as possible. Reading this flag uninitialized in the `init_secondary`
|
||||||
|
// is maybe unsound? Unclear. If it is indeed unsound, writing it sooner doesn't fix it all,
|
||||||
|
// but improves the odds of it going right
|
||||||
|
shared_data.init_flag.store(0, Ordering::SeqCst);
|
||||||
|
|
||||||
rcc::set_freqs_ptr(shared_data.clocks.get());
|
rcc::set_freqs_ptr(shared_data.clocks.get());
|
||||||
let p = init_hw(config);
|
let p = init_hw(config);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user