/** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is\r
* not set.\r
*/\r
- #define SERIAL_UBBRVAL(baud) (((F_CPU / 16) / (baud)) - 1)\r
+ #define SERIAL_UBBRVAL(baud) ((((F_CPU / 16) + (baud / 2)) / (baud)) - 1)\r
\r
/** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is\r
* set.\r
*/\r
- #define SERIAL_2X_UBBRVAL(baud) (((F_CPU / 8) / (baud)) - 1)\r
+ #define SERIAL_2X_UBBRVAL(baud) ((((F_CPU / 8) + (baud / 2)) / (baud)) - 1)\r
\r
/* Pseudo-Function Macros: */\r
#if defined(__DOXYGEN__)\r
* - Fixed EEPROM and FLASH ISP programming in the AVRISP project\r
* - Fixed incorrect values of USB_CONFIG_ATTR_SELFPOWERED and USB_CONFIG_ATTR_REMOTEWAKEUP tokens (thanks to Claus Christensen)\r
* - Fixed SerialStream driver blocking while waiting for characters to be received instead of returning EOF\r
- * - Fixed SerialStream driver not setting stdin to the created serial stream\r
+ * - Fixed SerialStream driver not setting stdin to the created serial stream (thanks to Mike Alexander)\r
* - Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes\r
* - Fixed AVRISP project not extending the command delay after each successful page/word/byte program\r
+ * - Fixed accuracy of the SERIAL_UBBRVAL() and SERIAL_2X_UBBRVAL() macros for higher baudrates (thanks to Renaud Cerrato)\r
*\r
* \section Sec_ChangeLog091223 Version 091223\r
*\r
* - Fixed Still Image Host Class driver truncating the PIMA response code (thanks to Daniel Seibert)\r
* - Fixed USB_CurrentMode not being reset to USB_MODE_NONE when the USB interface is shut down and both Host and Device modes can be\r
* used (thanks to Daniel Levy)\r
- * - Fixed TeensyHID bootloader not enumerating to the host correctly\r
+ * - Fixed TeensyHID bootloader not enumerating to the host correctly (thanks to Clint Fisher)\r
* - Fixed AVRISP project timeouts not checking for the correct timeout period (thanks to Carl Ott)\r
* - Fixed STK525 Dataflash driver using incorrect bit-shifting for Dataflash addresses (thanks to Tim Mitchell)\r
*\r
* -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
* -# Add standardized descriptor names to class driver structures\r
* -# Correct mishandling of error cases in Mass Storage demos\r
- * -# Add BOARD=NONE Option\r
* - Documentation/Support\r
* -# Remake AVRStudio project files\r
* -# Add detailed overviews of how each demo works\r