diff options
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
|