diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-10-10 18:08:37 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-10-10 18:08:37 +0000 |
commit | 36d1e0978ac7cce6074470ac5a09d14b9986f922 (patch) | |
tree | 7bbd4c3a7d0efdb0a0ccca7f561f7ac45b6c65b5 /boards | |
parent | 977abf0c51adfac84351ac5c9d93edf4719fd094 (diff) | |
download | ChibiOS-36d1e0978ac7cce6074470ac5a09d14b9986f922.tar.gz ChibiOS-36d1e0978ac7cce6074470ac5a09d14b9986f922.tar.bz2 ChibiOS-36d1e0978ac7cce6074470ac5a09d14b9986f922.zip |
Finalized AVR PAL driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3441 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'boards')
-rw-r--r-- | boards/OLIMEX_AVR_CAN/board.c | 44 | ||||
-rw-r--r-- | boards/OLIMEX_AVR_CAN/board.h | 4 |
2 files changed, 28 insertions, 20 deletions
diff --git a/boards/OLIMEX_AVR_CAN/board.c b/boards/OLIMEX_AVR_CAN/board.c index de1af241c..cd84a8086 100644 --- a/boards/OLIMEX_AVR_CAN/board.c +++ b/boards/OLIMEX_AVR_CAN/board.c @@ -21,6 +21,32 @@ #include "ch.h"
#include "hal.h"
+/**
+ * @brief PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ * This variable is used by the HAL when initializing the PAL driver.
+ */
+#if HAL_USE_PAL || defined(__DOXYGEN__)
+const PALConfig pal_default_config =
+{
+#if defined(PORTA)
+ {VAL_PORTA, VAL_DDRA},
+#endif
+#if defined(PORTA)
+ {VAL_PORTB, VAL_DDRB},
+#endif
+#if defined(PORTA)
+ {VAL_PORTC, VAL_DDRC},
+#endif
+#if defined(PORTA)
+ {VAL_PORTD, VAL_DDRD},
+#endif
+#if defined(PORTA)
+ {VAL_PORTE, VAL_DDRE},
+#endif
+};
+#endif /* HAL_USE_PAL */
+
CH_IRQ_HANDLER(TIMER0_COMP_vect) {
CH_IRQ_PROLOGUE();
@@ -38,24 +64,6 @@ CH_IRQ_HANDLER(TIMER0_COMP_vect) { void boardInit(void) {
/*
- * I/O ports setup.
- */
- DDRA = VAL_DDRA;
- PORTA = VAL_PORTA;
- DDRB = VAL_DDRB;
- PORTB = VAL_PORTB;
- DDRC = VAL_DDRC;
- PORTC = VAL_PORTC;
- DDRD = VAL_DDRD;
- PORTD = VAL_PORTD;
- DDRE = VAL_DDRE;
- PORTE = VAL_PORTE;
- DDRF = VAL_DDRF;
- PORTF = VAL_PORTF;
- DDRG = VAL_DDRG;
- PORTG = VAL_PORTG;
-
- /*
* External interrupts setup, all disabled initially.
*/
EICRA = 0x00;
diff --git a/boards/OLIMEX_AVR_CAN/board.h b/boards/OLIMEX_AVR_CAN/board.h index b1d6038c3..c4db2338a 100644 --- a/boards/OLIMEX_AVR_CAN/board.h +++ b/boards/OLIMEX_AVR_CAN/board.h @@ -87,8 +87,8 @@ #define VAL_DDRG 0x00
#define VAL_PORTG 0x07
-#define PORTE_LED (1 << 4)
-#define PORTE_BUTTON (1 << 5)
+#define PORTE_LED 4
+#define PORTE_BUTTON 5
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
|