Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document split, and reader / writer halves
  • Loading branch information
mciantyre committed Dec 4, 2020
1 parent 008ea60 commit 66b792a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/usb.rs
Expand Up @@ -3,7 +3,8 @@
//! The USB stack provides a [`log`] implementation for logging over USB
//!
//! This is `Serial.println()` in Rust. Use the macros of the
//! [`log`] crate to write data over USB.
//! [`log`] crate to write data over USB. Or, acquire a raw [`Reader`]
//! and [`Writer`] to perform your own USB I/O.
//!
//! [`log`]: https://crates.io/crates/log
//!
Expand Down Expand Up @@ -131,6 +132,7 @@ pub fn init(_: &crate::SysTick, config: LoggingConfig) -> Result<Reader, Error>
Ok(Reader(core::marker::PhantomData))
}

/// Splits the USB stack into reading and writing halves, and returns both halves
pub fn split(_: &crate::SysTick) -> Result<(Reader, Writer), Error> {
let taken = TAKEN.swap(true, Ordering::SeqCst);
if taken {
Expand Down

0 comments on commit 66b792a

Please sign in to comment.