From 3f9aac327ba999d67f9501ebf590d171e496b448 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 7 May 2008 15:47:40 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@284 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/MSP430-MSP430x1611-GCC/board.c | 20 ++++++++++++++++++++ demos/MSP430-MSP430x1611-GCC/board.h | 3 +++ 2 files changed, 23 insertions(+) (limited to 'demos/MSP430-MSP430x1611-GCC') diff --git a/demos/MSP430-MSP430x1611-GCC/board.c b/demos/MSP430-MSP430x1611-GCC/board.c index 68131b345..09f93075a 100644 --- a/demos/MSP430-MSP430x1611-GCC/board.c +++ b/demos/MSP430-MSP430x1611-GCC/board.c @@ -18,6 +18,7 @@ */ #include +#include #include "board.h" @@ -26,4 +27,23 @@ * NOTE: Interrupts are still disabled. */ void hwinit(void) { + + /* + * I/O ports initialization. + */ + + /* + * Timer 0 setup. + */ + TACCR0 = ACLK / CH_FREQUENCY; /* Counter limit. */ + TACTL = TACLR; /* Clean start. */ + TACTL = TASSEL_1 | MC_1; /* Src=ACLK, cmp=TACCR0. */ + TACCTL0 = CCIE; /* Interrupt on compare. */ +} + +interrupt(TIMERA0_VECTOR) tmr0irq(void) { + + chSysIRQEnterI(); + chSysTimerHandlerI(); + chSysIRQExitI(); } diff --git a/demos/MSP430-MSP430x1611-GCC/board.h b/demos/MSP430-MSP430x1611-GCC/board.h index 38ebf3f60..005b019a9 100644 --- a/demos/MSP430-MSP430x1611-GCC/board.h +++ b/demos/MSP430-MSP430x1611-GCC/board.h @@ -24,6 +24,9 @@ #include #endif +#define MCLK 8000000 +#define ACLK 8000000 + void hwinit(void); #endif /* _BOARD_H_ */ -- cgit v1.2.3