Skip to content

Commit fbe2f13

Browse files
committed
Fixup doc code
1 parent 9448315 commit fbe2f13

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

type-c-service/src/wrapper/backing.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@
2222
//! use embedded_services::power;
2323
//! use embedded_usb_pd::GlobalPortId;
2424
//! use type_c_service::wrapper::backing::{Storage, IntermediateStorage, ReferencedStorage};
25+
//! use embassy_sync::channel::{Channel, DynamicReceiver, DynamicSender};
26+
//! use embedded_services::power::policy::policy;
2527
//!
2628
//! 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();
2830
//! let storage = STORAGE.init(Storage::new(
2931
//! context,
3032
//! ControllerId(0),
3133
//! 0x0, // CFU component ID (unused)
32-
//! [power::policy::DeviceId(0)],
34+
//! [GlobalPortId(0)],
3335
//! ));
3436
//!
35-
//! static INTERMEDIATE: StaticCell<type_c_service::wrapper::backing::IntermediateStorage<1, GlobalRawMutex>> =
37+
//! static INTERMEDIATE: StaticCell<type_c_service::wrapper::backing::IntermediateStorage<1, NoopRawMutex>> =
3638
//! StaticCell::new();
3739
//! let intermediate = INTERMEDIATE.init(storage.try_create_intermediate().expect("Failed to create intermediate storage"));
3840
//!
39-
//! static POLICY_CHANNEL: StaticCell<Channel<GlobalRawMutex, policy::RequestData, 1>> = StaticCell::new();
41+
//! static POLICY_CHANNEL: StaticCell<Channel<NoopRawMutex, policy::RequestData, 1>> = StaticCell::new();
4042
//! let policy_channel = POLICY_CHANNEL.init(Channel::new());
4143
//!
4244
//! let policy_sender = policy_channel.dyn_sender();
@@ -45,14 +47,14 @@
4547
//! static REFERENCED: StaticCell<
4648
//! type_c_service::wrapper::backing::ReferencedStorage<
4749
//! 1,
48-
//! GlobalRawMutex,
50+
//! NoopRawMutex,
4951
//! DynamicSender<'_, policy::RequestData>,
5052
//! DynamicReceiver<'_, policy::RequestData>,
5153
//! >,
5254
//! > = StaticCell::new();
5355
//! let referenced = REFERENCED.init(
5456
//! intermediate
55-
//! .try_create_referenced([(POWER0_ID, policy_sender, policy_receiver)])
57+
//! .try_create_referenced([(power::policy::DeviceId(0), policy_sender, policy_receiver)])
5658
//! .expect("Failed to create referenced storage"),
5759
//! );
5860
//! }

0 commit comments

Comments
 (0)