File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -90,20 +90,18 @@ impl MmioSerialPort {
90
90
91
91
/// Sends a raw byte on the serial port, intended for binary data.
92
92
pub fn send_raw ( & mut self , data : u8 ) {
93
- let self_data = self . data . load ( Ordering :: Relaxed ) ;
94
93
wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
94
+ let self_data = self . data . load ( Ordering :: Relaxed ) ;
95
95
unsafe {
96
96
self_data. write ( data) ;
97
97
}
98
98
}
99
99
100
100
/// Receives a byte on the serial port.
101
101
pub fn receive ( & mut self ) -> u8 {
102
+ wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: INPUT_FULL ) ) ;
102
103
let self_data = self . data . load ( Ordering :: Relaxed ) ;
103
- unsafe {
104
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: INPUT_FULL ) ) ;
105
- self_data. read ( )
106
- }
104
+ unsafe { self_data. read ( ) }
107
105
}
108
106
}
109
107
You can’t perform that action at this time.
0 commit comments