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.
This commit is contained in:
MrKevinWeiss 2019-01-03 16:17:26 +01:00
parent 019c1aba16
commit 3ce03df0ff

View File

@ -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);