This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AT91 serial baud rate generation


Hi,

I slightly changed the macro to compute the serial baud
rate divider, to round the result instead of truncating
it.


diff -x CVS -Nru packages-orig/hal/arm/at91/var/current/ChangeLog packages/hal/arm/at91/var/current/ChangeLog
--- packages-orig/hal/arm/at91/var/current/ChangeLog	2003-10-29 16:10:48.000000000 +0100
+++ packages/hal/arm/at91/var/current/ChangeLog	2003-12-02 17:18:50.000000000 +0100
@@ -1,3 +1,8 @@
+2003-12-02  Thomas Koeller  <thomas.koeller@baslerweb.com>
+
+	* include/var_io.h: Improved accuracy for baud rate
+	divider computation.
+
 2003-10-23  Thomas Koeller  <thomas.koeller@baslerweb.com>
 
 	* src/at91_misc.c: Fixed recognition of spurious
diff -x CVS -Nru packages-orig/hal/arm/at91/var/current/include/var_io.h packages/hal/arm/at91/var/current/include/var_io.h
--- packages-orig/hal/arm/at91/var/current/include/var_io.h	2003-08-22 11:30:08.000000000 +0200
+++ packages/hal/arm/at91/var/current/include/var_io.h	2003-12-02 17:01:20.000000000 +0100
@@ -135,7 +135,7 @@
 #define AT91_US_TPR 0x38  // Transmit pointer register
 #define AT91_US_TCR 0x3c  // Transmit counter register
 
-#define AT91_US_BAUD(baud) (CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/(16*(baud)))
+#define AT91_US_BAUD(baud) ((CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/(8*(baud))+1)/2)
 
 //=============================================================================
 // PIO

-- 
--------------------------------------------------

Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-162
Fax +49 (4102) 463-239

mailto:thomas.koeller@baslerweb.com
http://www.baslerweb.com

==============================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]