X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/7f9f97c792dee6875fbca9806422bdd7d6c5a657..7d51e51c79c3af7791f4c3e8c7e5e8196a2c3f93:/LUFA/Drivers/Peripheral/Serial.h diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index ba466f314..d00f9c1c0 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -68,12 +68,12 @@ /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is * not set. */ - #define SERIAL_UBBRVAL(baud) (((F_CPU / 16) / (baud)) - 1) + #define SERIAL_UBBRVAL(baud) ((((F_CPU / 16) + (baud / 2)) / (baud)) - 1) /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is * set. */ - #define SERIAL_2X_UBBRVAL(baud) (((F_CPU / 8) / (baud)) - 1) + #define SERIAL_2X_UBBRVAL(baud) ((((F_CPU / 8) + (baud / 2)) / (baud)) - 1) /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__)