diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-05-07 15:47:40 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-05-07 15:47:40 +0000 |
commit | 3f9aac327ba999d67f9501ebf590d171e496b448 (patch) | |
tree | 669f25576940d178d74ee31c6d0cd5e6c4b0edf6 /demos | |
parent | f5551fd8d6e8b7db2537d8ec14b936d2ad897441 (diff) | |
download | ChibiOS-3f9aac327ba999d67f9501ebf590d171e496b448.tar.gz ChibiOS-3f9aac327ba999d67f9501ebf590d171e496b448.tar.bz2 ChibiOS-3f9aac327ba999d67f9501ebf590d171e496b448.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@284 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r-- | demos/MSP430-MSP430x1611-GCC/board.c | 20 | ||||
-rw-r--r-- | demos/MSP430-MSP430x1611-GCC/board.h | 3 |
2 files changed, 23 insertions, 0 deletions
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 <ch.h>
+#include <signal.h>
#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 <msp430x16x.h>
#endif
+#define MCLK 8000000
+#define ACLK 8000000
+
void hwinit(void);
#endif /* _BOARD_H_ */
|