Skip to content

Commit 52b77b9

Browse files
committed
Fix Serial Write
In order to guarantee the width of the start bit in a serial transfer we need ot make sure that we are waiting for the correct amount of time. Since the timer is already started we have no guarantee of the current count value and therefore should add an initial wait.
1 parent 9c16bcd commit 52b77b9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/serial.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ where
5858
type Error = crate::serial::Error<E>;
5959

6060
fn write(&mut self, byte: u8) -> nb::Result<(), Self::Error> {
61+
self.wait_for_timer();
6162
let mut data_out = byte;
6263
self.tx.set_low().map_err(Error::Bus)?; // start bit
6364
self.wait_for_timer();

0 commit comments

Comments
 (0)