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

This commit is contained in:
gdisirio 2009-12-02 20:13:51 +00:00
parent c2ad391323
commit 8400c8e42e
11 changed files with 42 additions and 85 deletions

View File

@ -45,7 +45,7 @@
* @brief Enables the CAN subsystem.
*/
#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__)
#define CH_HAL_USE_CAN TRUE
#define CH_HAL_USE_CAN FALSE
#endif
/**

View File

@ -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
#

View File

@ -17,66 +17,10 @@
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"
/*
* 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},
};
/*
* Hardware initialization goes here.
* NOTE: Interrupts are still disabled.
*/
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.
*/
palInit(&config);
/*
* Timer 0 setup, uses SMCLK as source.
*/
TACCR0 = SMCLK / 4 / CH_FREQUENCY - 1;/* Counter limit. */
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();
}
#include "ch.h"
#include "hal.h"
CH_IRQ_HANDLER(TIMERA0_VECTOR) {
@ -88,3 +32,23 @@ CH_IRQ_HANDLER(TIMERA0_VECTOR) {
CH_IRQ_EPILOGUE();
}
/*
* Hardware initialization goes here.
* NOTE: Interrupts are still disabled.
*/
void hwinit(void) {
/*
* HAL initialization.
*/
halInit();
/*
* Timer 0 setup, uses SMCLK as source.
*/
TACCR0 = SMCLK / 4 / CH_FREQUENCY - 1;/* Counter limit. */
TACTL = TACLR; /* Clean start. */
TACTL = TASSEL_2 | ID_2 | MC_1; /* Src=SMCLK, ID=4, cmp=TACCR0. */
TACCTL0 = CCIE; /* Interrupt on compare. */
}

View File

@ -20,8 +20,6 @@
#ifndef _BOARD_H_
#define _BOARD_H_
#include <msp430x16x.h>
/*
* Clock settings.
*/

View File

@ -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.

View File

@ -24,8 +24,8 @@
* @{
*/
#include <ch.h>
#include <pal.h>
#include "ch.h"
#include "hal.h"
/**
* @brief MSP430 I/O ports configuration.

View File

@ -277,6 +277,8 @@ typedef union __ioport * ioportid_t;
#define pal_lld_setgroupmode(port, mask, mode) \
_pal_lld_setgroupmode(port, mask, mode)
extern const MSP430DIOConfig pal_default_config;
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -24,12 +24,10 @@
* @{
*/
#include <ch.h>
#include <serial.h>
#include <signal.h>
#include "board.h"
#include "ch.h"
#include "hal.h"
#if USE_MSP430_USART0 || defined(__DOXYGEN__)
/** @brief USART0 serial driver identifier.*/

View File

@ -19,7 +19,7 @@
/**
* @file STM32/hal_lld.c
* @brief STM32 HAL subsystem low level driver source
* @brief STM32 HAL subsystem low level driver source.
* @addtogroup STM32_HAL
* @{
*/

View File

@ -19,7 +19,7 @@
/**
* @file STM32/hal_lld.h
* @brief STM32 HAL subsystem low level driver header
* @brief STM32 HAL subsystem low level driver header.
* @addtogroup STM32_HAL
* @{
*/
@ -33,7 +33,7 @@
*/
#undef FALSE
#undef TRUE
#include <stm32f10x.h>
#include "stm32f10x.h"
#define FALSE 0
#define TRUE (!FALSE)

View File

@ -24,8 +24,8 @@
* @{
*/
#include <ch.h>
#include <hal.h>
#include "ch.h"
#include "hal.h"
/*===========================================================================*/
/* Low Level Driver exported variables. */