aboutsummaryrefslogtreecommitdiffstats
path: root/demos/MSP430-MSP430x1611-GCC/board.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-14 13:10:38 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-14 13:10:38 +0000
commit6ab7ea31f114af0e0d98494156d456279dd5ecd4 (patch)
treeeea62185afe26a8428a5d6b42c40910ec1e6aeba /demos/MSP430-MSP430x1611-GCC/board.c
parent03aef59589a44aec94456526a9e207c27149a750 (diff)
downloadChibiOS-6ab7ea31f114af0e0d98494156d456279dd5ecd4.tar.gz
ChibiOS-6ab7ea31f114af0e0d98494156d456279dd5ecd4.tar.bz2
ChibiOS-6ab7ea31f114af0e0d98494156d456279dd5ecd4.zip
PAL support for MSP430, various other fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1037 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/MSP430-MSP430x1611-GCC/board.c')
-rw-r--r--demos/MSP430-MSP430x1611-GCC/board.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/demos/MSP430-MSP430x1611-GCC/board.c b/demos/MSP430-MSP430x1611-GCC/board.c
index 794070803..c94b4141b 100644
--- a/demos/MSP430-MSP430x1611-GCC/board.c
+++ b/demos/MSP430-MSP430x1611-GCC/board.c
@@ -18,6 +18,8 @@
*/
#include <ch.h>
+#include <pal.h>
+
#include <signal.h>
#include "board.h"
@@ -45,31 +47,27 @@ void hwinit(void) {
BCSCTL2 = VAL_BCSCTL2;
/*
- * I/O ports initialization.
+ * I/O ports initialization. PxSEL registers are assumed to be cleared after
+ * the reset.
*/
- P1OUT = VAL_P1OUT;
- P1DIR = VAL_P1DIR;
- P1SEL = VAL_P1SEL;
+ palInit();
+ palWritePort(IOPORT_A, VAL_P1OUT);
+ pal_lld_msp430_set_direction(IOPORT_A, VAL_P1DIR);
- P2OUT = VAL_P2OUT;
- P2DIR = VAL_P2DIR;
- P2SEL = VAL_P2SEL;
+ palWritePort(IOPORT_B, VAL_P2OUT);
+ pal_lld_msp430_set_direction(IOPORT_B, VAL_P2DIR);
- P3OUT = VAL_P3OUT;
- P3DIR = VAL_P3DIR;
- P3SEL = VAL_P3SEL;
+ palWritePort(IOPORT_C, VAL_P3OUT);
+ pal_lld_msp430_set_direction(IOPORT_C, VAL_P3DIR);
- P4OUT = VAL_P4OUT;
- P4DIR = VAL_P4DIR;
- P4SEL = VAL_P4SEL;
+ palWritePort(IOPORT_D, VAL_P4OUT);
+ pal_lld_msp430_set_direction(IOPORT_D, VAL_P4DIR);
- P5OUT = VAL_P5OUT;
- P5DIR = VAL_P5DIR;
- P5SEL = VAL_P5SEL;
+ palWritePort(IOPORT_E, VAL_P5OUT);
+ pal_lld_msp430_set_direction(IOPORT_E, VAL_P5DIR);
- P6OUT = VAL_P6OUT;
- P6DIR = VAL_P6DIR;
- P6SEL = VAL_P6SEL;
+ palWritePort(IOPORT_F, VAL_P6OUT);
+ pal_lld_msp430_set_direction(IOPORT_F, VAL_P6DIR);
/*
* Timer 0 setup, uses SMCLK as source.