avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [PATCH] two small header patches for more unification


From: Stephan Linz
Subject: [avr-libc-dev] [PATCH] two small header patches for more unification
Date: Sun, 19 Oct 2003 16:00:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:0.9.8) Gecko/20020204

Hi all,

last week I've seen the preparing work for 1.0.1 release of avr-libc. Time to post two small patches I've made for more than one year and used in my CDK4AVR project. Look into the patches -- I think it's self-explanatory, but discussion will be wellcome.

(patch IDs 2106 and 2107 at http://savannah.nongnu.org/patch/?group=avr-libc or attachment)



Bye,
Stephan

--
___________________________________________________________________
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|    *_     Stephan Linz                                          |
|   / \     mailto:address@hidden                                |
|   ~^~     http://www.li-pro.net  (final release in Dec. 2002)   |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
-------------------------------------------------------------------

diff -Nru avr-libc-1.0/include/avr/timer.h 
avr-libc-1.0-mega128timer/include/avr/timer.h
--- avr-libc-1.0/include/avr/timer.h    Tue Jun 10 21:12:25 2003
+++ avr-libc-1.0-mega128timer/include/avr/timer.h       Sun Oct 19 14:54:03 2003
@@ -34,6 +34,24 @@
 extern "C" {
 #endif
 
+#if defined(__AVR_ATmega128__)
+
+/* Atmel changed the Clock Select Bit Description for timer0 on the
+   mega128. */
+
+enum {
+  STOP             = 0,
+  CK               = 1,
+  CK8              = 2,
+  CK32             = 3,
+  CK64             = 4,
+  CK128            = 5,
+  CK256            = 6,
+  CK1024           = 7,
+};
+
+#else
+
 enum {
   STOP             = 0,
   CK               = 1,
@@ -44,6 +62,8 @@
   T0_FALLING_EDGE  = 6,
   T0_RISING_EDGE   = 7
 };
+
+#endif
 
 static inline void timer0_source (unsigned int src)
 {
diff -Nru avr-libc-1.0-mega128timer/include/avr/io.h 
avr-libc-1.0-hdrcleanup/include/avr/io.h
--- avr-libc-1.0-mega128timer/include/avr/io.h  Sat Mar  1 00:03:40 2003
+++ avr-libc-1.0-hdrcleanup/include/avr/io.h    Sun Oct 19 14:54:46 2003
@@ -149,6 +149,46 @@
 #define    EEWE         1
 #define    EERE         0
 
+/* Port Data Register (generic) */
+#define    PORT7        7
+#define    PORT6        6
+#define    PORT5        5
+#define    PORT4        4
+#define    PORT3        3
+#define    PORT2        2
+#define    PORT1        1
+#define    PORT0        0
+
+/* Port Data Direction Register (generic) */
+#define    DD7          7
+#define    DD6          6
+#define    DD5          5
+#define    DD4          4
+#define    DD3          3
+#define    DD2          2
+#define    DD1          1
+#define    DD0          0
+
+/* Port Input Pins (generic) */
+#define    PIN7         7
+#define    PIN6         6
+#define    PIN5         5
+#define    PIN4         4
+#define    PIN3         3
+#define    PIN2         2
+#define    PIN1         1
+#define    PIN0         0
+
+/* Status Register - SREG */
+#define    SREG_I       7
+#define    SREG_T       6
+#define    SREG_H       5
+#define    SREG_S       4
+#define    SREG_V       3
+#define    SREG_N       2
+#define    SREG_Z       1
+#define    SREG_C       0
+
 #if defined (__AVR_AT94K__)
 #  include <avr/ioat94k.h>
 #elif defined (__AVR_AT43USB320__)
diff -Nru avr-libc-1.0-mega128timer/include/avr/iom128.h 
avr-libc-1.0-hdrcleanup/include/avr/iom128.h
--- avr-libc-1.0-mega128timer/include/avr/iom128.h      Mon Feb 17 10:57:28 2003
+++ avr-libc-1.0-hdrcleanup/include/avr/iom128.h        Sun Oct 19 14:54:46 2003
@@ -680,36 +680,6 @@
 #define    PSR0         1
 #define    PSR321       0
 
-/* Port Data Register (generic) */
-#define    PORT7        7
-#define    PORT6        6
-#define    PORT5        5
-#define    PORT4        4
-#define    PORT3        3
-#define    PORT2        2
-#define    PORT1        1
-#define    PORT0        0
-
-/* Port Data Direction Register (generic) */
-#define    DD7          7
-#define    DD6          6
-#define    DD5          5
-#define    DD4          4
-#define    DD3          3
-#define    DD2          2
-#define    DD1          1
-#define    DD0          0
-
-/* Port Input Pins (generic) */
-#define    PIN7         7
-#define    PIN6         6
-#define    PIN5         5
-#define    PIN4         4
-#define    PIN3         3
-#define    PIN2         2
-#define    PIN1         1
-#define    PIN0         0
-
 /* SPI Status Register - SPSR */
 #define    SPIF         7
 #define    WCOL         6
diff -Nru avr-libc-1.0-mega128timer/include/avr/iom162.h 
avr-libc-1.0-hdrcleanup/include/avr/iom162.h
--- avr-libc-1.0-mega128timer/include/avr/iom162.h      Mon Sep 22 05:47:58 2003
+++ avr-libc-1.0-hdrcleanup/include/avr/iom162.h        Sun Oct 19 14:54:46 2003
@@ -723,7 +723,7 @@
 #define UDRE0  5
 #define FE0    4
 #define DOR0   3
-#define PE0    2
+#define UPE0   2
 #define U2X0   1
 #define MPCM0  0
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]