blocking_mutex: refactor to work on stable. No GATs, and can be constructed in const.
This commit is contained in:
@ -2,6 +2,7 @@ use core::cell::Cell;
|
||||
use core::sync::atomic::{compiler_fence, AtomicU32, AtomicU8, Ordering};
|
||||
use core::{mem, ptr};
|
||||
use critical_section::CriticalSection;
|
||||
use embassy::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy::blocking_mutex::CriticalSectionMutex as Mutex;
|
||||
use embassy::interrupt::{Interrupt, InterruptExt};
|
||||
use embassy::time::driver::{AlarmHandle, Driver};
|
||||
@ -94,7 +95,7 @@ const ALARM_STATE_NEW: AlarmState = AlarmState::new();
|
||||
embassy::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
|
||||
period: AtomicU32::new(0),
|
||||
alarm_count: AtomicU8::new(0),
|
||||
alarms: Mutex::new([ALARM_STATE_NEW; ALARM_COUNT]),
|
||||
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]),
|
||||
});
|
||||
|
||||
impl RtcDriver {
|
||||
|
Reference in New Issue
Block a user