git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@284 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-05-07 15:47:40 +00:00
parent f5551fd8d6
commit 3f9aac327b
3 changed files with 24 additions and 1 deletions

View File

@ -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();
}

View File

@ -24,6 +24,9 @@
#include <msp430x16x.h>
#endif
#define MCLK 8000000
#define ACLK 8000000
void hwinit(void);
#endif /* _BOARD_H_ */

View File

@ -79,7 +79,7 @@ typedef struct {
#define chSysIRQEnterI()
#define chSysIRQExitI() { \
if (chSchRescRequiredI1()) \
if (chSchRescRequiredI()) \
chSchDoRescheduleI(); \
}