Skip to content

Commit e0c2f1a

Browse files
armandasRahix
authored andcommitted
Update comments to address feedback in Rahix#562
1 parent e1c3b9d commit e0c2f1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

avr-hal-generic/src/usart_spi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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),

0 commit comments

Comments
 (0)