aboutsummaryrefslogtreecommitdiffstats
path: root/boards/OLIMEX_AVR_CAN/board.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-10-10 18:08:37 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-10-10 18:08:37 +0000
commit36d1e0978ac7cce6074470ac5a09d14b9986f922 (patch)
tree7bbd4c3a7d0efdb0a0ccca7f561f7ac45b6c65b5 /boards/OLIMEX_AVR_CAN/board.c
parent977abf0c51adfac84351ac5c9d93edf4719fd094 (diff)
downloadChibiOS-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/OLIMEX_AVR_CAN/board.c')
-rw-r--r--boards/OLIMEX_AVR_CAN/board.c44
1 files changed, 26 insertions, 18 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;