Increment byte_written after write has happened.

Co-authored-by: tdittr <tdittr@users.noreply.github.com>
This commit is contained in:
Nic0w 2021-04-25 20:00:56 +02:00 committed by GitHub
parent b9080d0a92
commit f9254fdffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,12 +209,12 @@ impl<D: UARTDevice> UARTPeripheral<Enabled, D> {
}
}
bytes_written += 1;
self.device.uartdr.write(|w| unsafe {
w.data().bits(*c);
w
})
});
bytes_written += 1;
}
Ok(bytes_written)
}