File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,7 @@ macro_rules! add_usart_spi {
5555 fn raw_setup( & mut self , settings: & $crate:: spi:: Settings ) {
5656 use $crate:: hal:: spi;
5757
58- // Setup control registers
59- // We start by setting the UBBRn to 0
58+ // UBRRn must be zero at the time the transmitter is enabled.
6059 self . [ <ubrr $n>] . write( |w| unsafe { w. bits( 0 ) } ) ;
6160
6261 // We have to translate the character size register into the 2 bits which are the MSB/LSB and the phase
@@ -84,13 +83,14 @@ macro_rules! add_usart_spi {
8483 }
8584 } ) ;
8685
87- // Enable receiver and transmitter, and also the rec interrupt .
86+ // Enable receiver and transmitter.
8887 self . [ <ucsr $n b>] . write( |w| w
8988 . [ <txen $n>] ( ) . set_bit( )
9089 . [ <rxen $n>] ( ) . set_bit( )
9190 ) ;
9291
9392 // Set the clock divider for SPI clock.
93+ // This must be done after the transmitter is enabled.
9494 self . [ <ubrr $n>] . write( |w| {
9595 match settings. clock {
9696 $crate:: spi:: SerialClockRate :: OscfOver2 => w. bits( 0 ) ,
You can’t perform that action at this time.
0 commit comments