1use crate::os_trait::{
2 AtomicNotifier, AtomicNotifyWaiter, FakeRawMutex, TickDelay, TickTimeoutNs, TickTimeoutState,
3 prelude::*,
4};
5use crate::timer::SysTickInstant;
6
7pub struct RawOs;
14impl OsInterface for RawOs {
15 type RawMutex = FakeRawMutex;
16 type Notifier = AtomicNotifier<RawOs>;
17 type NotifyWaiter = AtomicNotifyWaiter<RawOs>;
18 type Timeout = TickTimeoutNs<SysTickInstant>;
19 type TimeoutState = TickTimeoutState<SysTickInstant>;
20 type Delay = TickDelay<SysTickInstant>;
21
22 const O: Self = Self {};
23
24 fn yield_thread() {}
25
26 #[inline]
27 fn timeout() -> Self::Timeout {
28 TickTimeoutNs::<SysTickInstant>::new()
29 }
30
31 #[inline]
32 fn delay() -> Self::Delay {
33 TickDelay::<SysTickInstant>::default()
34 }
35
36 #[inline]
37 fn notify() -> (Self::Notifier, Self::NotifyWaiter) {
38 AtomicNotifier::<RawOs>::new()
39 }
40}