aboutsummaryrefslogtreecommitdiffstats
path: root/boards/OLIMEX_AVR_CAN/board.c
diff options
context:
space:
mode:
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;