Skip to content
Snippets Groups Projects
Commit 3ce03df0 authored by MrKevinWeiss's avatar MrKevinWeiss
Browse files

cpu/atmega_common/uart: Comment why brr calc is different from datasheet

The brr calculation on the datasheet is different than what is implmented.
This is intentional since it provides better rounding due to truncation.
There was no comment explaining that so this comment should prevent confusion.
parent 019c1aba
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,7 @@ static void _set_brr(uart_t uart, uint32_t baudrate)
return;
}
#endif
/* brr calculation is different from the datasheet to provide better rounding */
#if defined(UART_DOUBLE_SPEED)
brr = (CLOCK_CORECLOCK + 4UL * baudrate) / (8UL * baudrate) - 1UL;
_update_brr(uart, brr, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment