1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

Merge pull request #10699 from MrKevinWeiss/pr/fixbaudmega2560

cpu/atmega_common/uart: Comment why brr calc is different from datasheet
This commit is contained in:
ZetaR60 2019-01-07 10:21:15 -05:00 committed by GitHub
commit 859ba1a71f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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