diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index 696f7fa14..811fc162a 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -112,7 +112,7 @@ typedef struct { * @brief Macro for baud rate computation. * @note Make sure the final baud rate is within tolerance. */ -#define UBRR(b) ((F_CPU / (b << 4)) - 1) +#define UBRR(b) (((F_CPU / b) >> 4) - 1) /*===========================================================================*/ /* External declarations. */ diff --git a/readme.txt b/readme.txt index 84afce848..2ad391d21 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,7 @@ ***************************************************************************** *** 2.2.4 *** +- FIX: Fixed invalid BRR() macro in AVR serial driver (bug 3299306). - FIX: Fixed missing IRQ vectors amicable names for STM32 XL devices (bug 3298889). - FIX: Fixed wrong identifier in AVR serial driver (bug 3292084).