aboutsummaryrefslogtreecommitdiffstats
path: root/demos/MSP430-MSP430x1611-GCC
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-02 20:13:51 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-02 20:13:51 +0000
commit8400c8e42e3644eec40ec85703cedabae6fd986e (patch)
tree46cff05539a88fa7a2f85b5484829183c8529eb8 /demos/MSP430-MSP430x1611-GCC
parentc2ad39132395d52a3894c13f978da2349f650201 (diff)
downloadChibiOS-8400c8e42e3644eec40ec85703cedabae6fd986e.tar.gz
ChibiOS-8400c8e42e3644eec40ec85703cedabae6fd986e.tar.bz2
ChibiOS-8400c8e42e3644eec40ec85703cedabae6fd986e.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1371 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/MSP430-MSP430x1611-GCC')
-rw-r--r--demos/MSP430-MSP430x1611-GCC/Makefile12
-rw-r--r--demos/MSP430-MSP430x1611-GCC/board.c64
-rw-r--r--demos/MSP430-MSP430x1611-GCC/board.h2
-rw-r--r--demos/MSP430-MSP430x1611-GCC/main.c9
4 files changed, 22 insertions, 65 deletions
diff --git a/demos/MSP430-MSP430x1611-GCC/Makefile b/demos/MSP430-MSP430x1611-GCC/Makefile
index 7a7a720a8..97de20466 100644
--- a/demos/MSP430-MSP430x1611-GCC/Makefile
+++ b/demos/MSP430-MSP430x1611-GCC/Makefile
@@ -40,6 +40,8 @@ LDSCRIPT = mspgcc/msp430x1611.x
# Imported source files
CHIBIOS = ../..
+include ${CHIBIOS}/os/hal/hal.mk
+include ${CHIBIOS}/os/hal/platforms/MSP430/platform.mk
include ${CHIBIOS}/os/ports/GCC/MSP430/port.mk
include ${CHIBIOS}/os/kernel/kernel.mk
include ${CHIBIOS}/test/test.mk
@@ -48,10 +50,8 @@ include ${CHIBIOS}/test/test.mk
CSRC = ${PORTSRC} \
${KERNSRC} \
${TESTSRC} \
- ${CHIBIOS}/os/io/pal.c \
- ${CHIBIOS}/os/io/serial.c \
- ${CHIBIOS}/os/io/platforms/MSP430/pal_lld.c \
- ${CHIBIOS}/os/io/platforms/MSP430/serial_lld.c \
+ ${HALSRC} \
+ ${PLATFORMSRC} \
${CHIBIOS}/os/various/evtimer.c \
board.c main.c
@@ -61,9 +61,7 @@ CPPSRC =
# List ASM source files here
ASMSRC = $(PORTASM)
-INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
- ${CHIBIOS}/os/io \
- ${CHIBIOS}/os/io/platforms/MSP430 \
+INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \
${CHIBIOS}/os/various
#
diff --git a/demos/MSP430-MSP430x1611-GCC/board.c b/demos/MSP430-MSP430x1611-GCC/board.c
index 32f7c325b..93197bcfd 100644
--- a/demos/MSP430-MSP430x1611-GCC/board.c
+++ b/demos/MSP430-MSP430x1611-GCC/board.c
@@ -17,26 +17,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ch.h>
-#include <pal.h>
-#include <serial.h>
-
#include <signal.h>
-#include "board.h"
+#include "ch.h"
+#include "hal.h"
-/*
- * Digital I/O ports static configuration as defined in @p board.h.
- */
-static const MSP430DIOConfig config =
-{
- {VAL_P1OUT, VAL_P1DIR},
- {VAL_P2OUT, VAL_P2DIR},
- {VAL_P3OUT, VAL_P3DIR},
- {VAL_P4OUT, VAL_P4DIR},
- {VAL_P5OUT, VAL_P5DIR},
- {VAL_P6OUT, VAL_P6DIR},
-};
+CH_IRQ_HANDLER(TIMERA0_VECTOR) {
+
+ CH_IRQ_PROLOGUE();
+
+ chSysLockFromIsr();
+ chSysTimerHandlerI();
+ chSysUnlockFromIsr();
+
+ CH_IRQ_EPILOGUE();
+}
/*
* Hardware initialization goes here.
@@ -45,24 +40,9 @@ static const MSP430DIOConfig config =
void hwinit(void) {
/*
- * Clock sources setup.
- */
- DCOCTL = VAL_DCOCTL;
- BCSCTL1 = VAL_BCSCTL1;
-#if defined(MSP_USE_XT2CLK)
- do {
- int i;
- IFG1 &= ~OFIFG;
- for (i = 255; i > 0; i--)
- asm("nop");
- } while (IFG1 & OFIFG);
-#endif
- BCSCTL2 = VAL_BCSCTL2;
-
- /*
- * I/O ports initialization.
+ * HAL initialization.
*/
- palInit(&config);
+ halInit();
/*
* Timer 0 setup, uses SMCLK as source.
@@ -71,20 +51,4 @@ void hwinit(void) {
TACTL = TACLR; /* Clean start. */
TACTL = TASSEL_2 | ID_2 | MC_1; /* Src=SMCLK, ID=4, cmp=TACCR0. */
TACCTL0 = CCIE; /* Interrupt on compare. */
-
- /*
- * Other subsystems.
- */
- sdInit();
-}
-
-CH_IRQ_HANDLER(TIMERA0_VECTOR) {
-
- CH_IRQ_PROLOGUE();
-
- chSysLockFromIsr();
- chSysTimerHandlerI();
- chSysUnlockFromIsr();
-
- CH_IRQ_EPILOGUE();
}
diff --git a/demos/MSP430-MSP430x1611-GCC/board.h b/demos/MSP430-MSP430x1611-GCC/board.h
index 235a8303a..836603f80 100644
--- a/demos/MSP430-MSP430x1611-GCC/board.h
+++ b/demos/MSP430-MSP430x1611-GCC/board.h
@@ -20,8 +20,6 @@
#ifndef _BOARD_H_
#define _BOARD_H_
-#include <msp430x16x.h>
-
/*
* Clock settings.
*/
diff --git a/demos/MSP430-MSP430x1611-GCC/main.c b/demos/MSP430-MSP430x1611-GCC/main.c
index 3e729296b..91fb26f83 100644
--- a/demos/MSP430-MSP430x1611-GCC/main.c
+++ b/demos/MSP430-MSP430x1611-GCC/main.c
@@ -17,12 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ch.h>
-#include <pal.h>
-#include <serial.h>
-#include <test.h>
-
-#include "board.h"
+#include "ch.h"
+#include "hal.h"
+#include "test.h"
/*
* Red LEDs blinker thread, times are in milliseconds.