Skip to content

Commit 1ec02ed

Browse files
committed
Improve docs
Closes #25
1 parent aae68be commit 1ec02ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bus.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ pub trait UsbBus: Sync + Sized {
4747
/// there is no need to perform a USB reset in this method.
4848
fn enable(&mut self);
4949

50-
/// Performs a USB reset. This method should reset the platform-specific peripheral as well as
51-
/// ensure that all endpoints previously allocate with alloc_ep are initialized as specified.
50+
/// Called when the host resets the device. This will be soon called after
51+
/// [`poll`](crate::device::UsbDevice::poll) returns [`PollResult::Reset`]. This method should
52+
/// reset the state of all endpoints and peripheral flags back to a state suitable for
53+
/// enumeration, as well as ensure that all endpoints previously allocated with alloc_ep are
54+
/// initialized as specified.
5255
fn reset(&self);
5356

5457
/// Sets the device USB address to `addr`.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub mod endpoint;
156156
/// loop {
157157
/// // Must be called more often than once every 10ms to handle events and stay USB compilant,
158158
/// // or from a device-specific interrupt handler.
159-
/// if (usb_dev.poll(&mut [&mut serial])) {}
159+
/// if (usb_dev.poll(&mut [&mut serial])) {
160160
/// // Call class-specific methods here
161161
/// serial.read(...);
162162
/// }

0 commit comments

Comments
 (0)