Fixed accuracy of the SERIAL_UBBRVAL() and SERIAL_2X_UBBRVAL() macros for higher baudrates (thanks to Renaud Cerrato).

pull/1469/head
Dean Camera 15 years ago
parent d49cc0f783
commit a71820b259

@ -68,12 +68,12 @@
/** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is
* not set. * 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 /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is
* set. * 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: */ /* Pseudo-Function Macros: */
#if defined(__DOXYGEN__) #if defined(__DOXYGEN__)

@ -57,9 +57,10 @@
* - Fixed EEPROM and FLASH ISP programming in the AVRISP project * - Fixed EEPROM and FLASH ISP programming in the AVRISP project
* - Fixed incorrect values of USB_CONFIG_ATTR_SELFPOWERED and USB_CONFIG_ATTR_REMOTEWAKEUP tokens (thanks to Claus Christensen) * - Fixed incorrect values of USB_CONFIG_ATTR_SELFPOWERED and USB_CONFIG_ATTR_REMOTEWAKEUP tokens (thanks to Claus Christensen)
* - Fixed SerialStream driver blocking while waiting for characters to be received instead of returning EOF * - Fixed SerialStream driver blocking while waiting for characters to be received instead of returning EOF
* - Fixed SerialStream driver not setting stdin to the created serial stream * - Fixed SerialStream driver not setting stdin to the created serial stream (thanks to Mike Alexander)
* - Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes * - Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes
* - Fixed AVRISP project not extending the command delay after each successful page/word/byte program * - Fixed AVRISP project not extending the command delay after each successful page/word/byte program
* - Fixed accuracy of the SERIAL_UBBRVAL() and SERIAL_2X_UBBRVAL() macros for higher baudrates (thanks to Renaud Cerrato)
* *
* \section Sec_ChangeLog091223 Version 091223 * \section Sec_ChangeLog091223 Version 091223
* *
@ -122,7 +123,7 @@
* - Fixed Still Image Host Class driver truncating the PIMA response code (thanks to Daniel Seibert) * - Fixed Still Image Host Class driver truncating the PIMA response code (thanks to Daniel Seibert)
* - 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 * - 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
* used (thanks to Daniel Levy) * used (thanks to Daniel Levy)
* - Fixed TeensyHID bootloader not enumerating to the host correctly * - Fixed TeensyHID bootloader not enumerating to the host correctly (thanks to Clint Fisher)
* - Fixed AVRISP project timeouts not checking for the correct timeout period (thanks to Carl Ott) * - Fixed AVRISP project timeouts not checking for the correct timeout period (thanks to Carl Ott)
* - Fixed STK525 Dataflash driver using incorrect bit-shifting for Dataflash addresses (thanks to Tim Mitchell) * - Fixed STK525 Dataflash driver using incorrect bit-shifting for Dataflash addresses (thanks to Tim Mitchell)
* *

@ -17,7 +17,6 @@
* -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error * -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error
* -# Add standardized descriptor names to class driver structures * -# Add standardized descriptor names to class driver structures
* -# Correct mishandling of error cases in Mass Storage demos * -# Correct mishandling of error cases in Mass Storage demos
* -# Add BOARD=NONE Option
* - Documentation/Support * - Documentation/Support
* -# Remake AVRStudio project files * -# Remake AVRStudio project files
* -# Add detailed overviews of how each demo works * -# Add detailed overviews of how each demo works

Loading…
Cancel
Save