Skip to content

Commit 28808a0

Browse files
committed
Fix serial doctest
1 parent bbdd217 commit 28808a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
//!
156156
//! fn read(&mut self) -> nb::Result<u8, Error> {
157157
//! // read the status register
158-
//! let isr = self.usart.isr.read();
158+
//! let isr = self.usart.sr.read();
159159
//!
160160
//! if isr.ore().bit_is_set() {
161161
//! // Error: Buffer overrun
@@ -164,7 +164,7 @@
164164
//! // omitted: checks for other errors
165165
//! else if isr.rxne().bit_is_set() {
166166
//! // Data available: read the data register
167-
//! Ok(self.usart.rdr.read().bits() as u8)
167+
//! Ok(self.usart.dr.read().bits() as u8)
168168
//! } else {
169169
//! // No data available yet
170170
//! Err(nb::Error::WouldBlock)

0 commit comments

Comments
 (0)