Increased throughput of the USBtoSerial demo on systems that send multiple bytes...
[pub/USBasp.git] / LUFA / Drivers / Peripheral / Serial.h
index 433d55e..d00f9c1 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
                        /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is\r
                         *  not set.\r
                         */\r
                        /** 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
 \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
 \r
                /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r