Skip to content

Commit 99616c7

Browse files
committed
Fix conversion
1 parent c333210 commit 99616c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nrf-hal-common/src/uarte.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ where
453453
{
454454
_marker: core::marker::PhantomData<T>,
455455
tx_buf: &'a mut [u8],
456-
written: u16,
456+
written: usize,
457457
}
458458

459459
/// Interface for the RX part of a UART instance that can be used independently of the TX part.
@@ -588,9 +588,8 @@ pub mod serial {
588588
return Err(nb::Error::WouldBlock);
589589
}
590590

591-
let written = self.written as usize;
592-
if written < self.tx_buf.len() {
593-
self.tx_buf[written] = b;
591+
if self.written < self.tx_buf.len() {
592+
self.tx_buf[self.written] = b;
594593
self.written += 1;
595594
Ok(())
596595
} else {
@@ -662,7 +661,7 @@ pub mod serial {
662661
uarte
663662
.txd
664663
.maxcnt
665-
.write(|w| unsafe { w.maxcnt().bits(self.written) });
664+
.write(|w| unsafe { w.maxcnt().bits(self.written as _) });
666665

667666
// Start UARTE Transmit transaction.
668667
// `1` is a valid value to write to task registers.

0 commit comments

Comments
 (0)