From c35358f475ea02428952079f6ad901cdd048d928 Mon Sep 17 00:00:00 2001 From: Nic0w Date: Wed, 5 May 2021 08:02:53 +0200 Subject: [PATCH] Change comment on baudrate calculation --- rp2040-hal/src/uart.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rp2040-hal/src/uart.rs b/rp2040-hal/src/uart.rs index 7ffb553..0de5dc5 100644 --- a/rp2040-hal/src/uart.rs +++ b/rp2040-hal/src/uart.rs @@ -361,7 +361,8 @@ fn calculate_baudrate_dividers( wanted_baudrate: &Baud, frequency: &Hertz, ) -> Result<(u16, u16), Error> { - // baudrate_div = frequency * 8 / wanted_baudrate + // See Chapter 4, Section 2 ยง7.1 from the datasheet for an explanation of how baudrate is + // calculated let baudrate_div = frequency.integer() .checked_mul(8) .and_then(|r| r.checked_div(*wanted_baudrate.integer()))