|
22 | 22 | //! use embedded_services::power; |
23 | 23 | //! use embedded_usb_pd::GlobalPortId; |
24 | 24 | //! use type_c_service::wrapper::backing::{Storage, IntermediateStorage, ReferencedStorage}; |
| 25 | +//! use embassy_sync::channel::{Channel, DynamicReceiver, DynamicSender}; |
| 26 | +//! use embedded_services::power::policy::policy; |
25 | 27 | //! |
26 | 28 | //! fn init(context: &'static embedded_services::type_c::controller::Context) { |
27 | | -//! static STORAGE: StaticCell<Storage<1, GlobalRawMutex>> = StaticCell::new(); |
| 29 | +//! static STORAGE: StaticCell<Storage<1, NoopRawMutex>> = StaticCell::new(); |
28 | 30 | //! let storage = STORAGE.init(Storage::new( |
29 | 31 | //! context, |
30 | 32 | //! ControllerId(0), |
31 | 33 | //! 0x0, // CFU component ID (unused) |
32 | | -//! [power::policy::DeviceId(0)], |
| 34 | +//! [GlobalPortId(0)], |
33 | 35 | //! )); |
34 | 36 | //! |
35 | | -//! static INTERMEDIATE: StaticCell<type_c_service::wrapper::backing::IntermediateStorage<1, GlobalRawMutex>> = |
| 37 | +//! static INTERMEDIATE: StaticCell<type_c_service::wrapper::backing::IntermediateStorage<1, NoopRawMutex>> = |
36 | 38 | //! StaticCell::new(); |
37 | 39 | //! let intermediate = INTERMEDIATE.init(storage.try_create_intermediate().expect("Failed to create intermediate storage")); |
38 | 40 | //! |
39 | | -//! static POLICY_CHANNEL: StaticCell<Channel<GlobalRawMutex, policy::RequestData, 1>> = StaticCell::new(); |
| 41 | +//! static POLICY_CHANNEL: StaticCell<Channel<NoopRawMutex, policy::RequestData, 1>> = StaticCell::new(); |
40 | 42 | //! let policy_channel = POLICY_CHANNEL.init(Channel::new()); |
41 | 43 | //! |
42 | 44 | //! let policy_sender = policy_channel.dyn_sender(); |
|
45 | 47 | //! static REFERENCED: StaticCell< |
46 | 48 | //! type_c_service::wrapper::backing::ReferencedStorage< |
47 | 49 | //! 1, |
48 | | -//! GlobalRawMutex, |
| 50 | +//! NoopRawMutex, |
49 | 51 | //! DynamicSender<'_, policy::RequestData>, |
50 | 52 | //! DynamicReceiver<'_, policy::RequestData>, |
51 | 53 | //! >, |
52 | 54 | //! > = StaticCell::new(); |
53 | 55 | //! let referenced = REFERENCED.init( |
54 | 56 | //! intermediate |
55 | | -//! .try_create_referenced([(POWER0_ID, policy_sender, policy_receiver)]) |
| 57 | +//! .try_create_referenced([(power::policy::DeviceId(0), policy_sender, policy_receiver)]) |
56 | 58 | //! .expect("Failed to create referenced storage"), |
57 | 59 | //! ); |
58 | 60 | //! } |
|
0 commit comments