File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,7 @@ where
455
455
{
456
456
_marker : core:: marker:: PhantomData < T > ,
457
457
tx_buf : & ' a mut [ u8 ] ,
458
- written : u16 ,
458
+ written : usize ,
459
459
}
460
460
461
461
/// Interface for the RX part of a UART instance that can be used independently of the TX part.
@@ -590,9 +590,8 @@ pub mod serial {
590
590
return Err ( nb:: Error :: WouldBlock ) ;
591
591
}
592
592
593
- let written = self . written as usize ;
594
- if written < self . tx_buf . len ( ) {
595
- self . tx_buf [ written] = b;
593
+ if self . written < self . tx_buf . len ( ) {
594
+ self . tx_buf [ self . written ] = b;
596
595
self . written += 1 ;
597
596
Ok ( ( ) )
598
597
} else {
@@ -664,7 +663,7 @@ pub mod serial {
664
663
uarte
665
664
. txd
666
665
. maxcnt
667
- . write ( |w| unsafe { w. maxcnt ( ) . bits ( self . written ) } ) ;
666
+ . write ( |w| unsafe { w. maxcnt ( ) . bits ( self . written as _ ) } ) ;
668
667
669
668
// Start UARTE Transmit transaction.
670
669
// `1` is a valid value to write to task registers.
You can’t perform that action at this time.
0 commit comments