git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1371 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
c2ad391323
commit
8400c8e42e
|
@ -45,7 +45,7 @@
|
||||||
* @brief Enables the CAN subsystem.
|
* @brief Enables the CAN subsystem.
|
||||||
*/
|
*/
|
||||||
#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__)
|
#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||||
#define CH_HAL_USE_CAN TRUE
|
#define CH_HAL_USE_CAN FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,6 +40,8 @@ LDSCRIPT = mspgcc/msp430x1611.x
|
||||||
|
|
||||||
# Imported source files
|
# Imported source files
|
||||||
CHIBIOS = ../..
|
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/ports/GCC/MSP430/port.mk
|
||||||
include ${CHIBIOS}/os/kernel/kernel.mk
|
include ${CHIBIOS}/os/kernel/kernel.mk
|
||||||
include ${CHIBIOS}/test/test.mk
|
include ${CHIBIOS}/test/test.mk
|
||||||
|
@ -48,10 +50,8 @@ include ${CHIBIOS}/test/test.mk
|
||||||
CSRC = ${PORTSRC} \
|
CSRC = ${PORTSRC} \
|
||||||
${KERNSRC} \
|
${KERNSRC} \
|
||||||
${TESTSRC} \
|
${TESTSRC} \
|
||||||
${CHIBIOS}/os/io/pal.c \
|
${HALSRC} \
|
||||||
${CHIBIOS}/os/io/serial.c \
|
${PLATFORMSRC} \
|
||||||
${CHIBIOS}/os/io/platforms/MSP430/pal_lld.c \
|
|
||||||
${CHIBIOS}/os/io/platforms/MSP430/serial_lld.c \
|
|
||||||
${CHIBIOS}/os/various/evtimer.c \
|
${CHIBIOS}/os/various/evtimer.c \
|
||||||
board.c main.c
|
board.c main.c
|
||||||
|
|
||||||
|
@ -61,9 +61,7 @@ CPPSRC =
|
||||||
# List ASM source files here
|
# List ASM source files here
|
||||||
ASMSRC = $(PORTASM)
|
ASMSRC = $(PORTASM)
|
||||||
|
|
||||||
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
|
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \
|
||||||
${CHIBIOS}/os/io \
|
|
||||||
${CHIBIOS}/os/io/platforms/MSP430 \
|
|
||||||
${CHIBIOS}/os/various
|
${CHIBIOS}/os/various
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -17,66 +17,10 @@
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
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 <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},
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
CH_IRQ_HANDLER(TIMERA0_VECTOR) {
|
CH_IRQ_HANDLER(TIMERA0_VECTOR) {
|
||||||
|
|
||||||
|
@ -88,3 +32,23 @@ CH_IRQ_HANDLER(TIMERA0_VECTOR) {
|
||||||
|
|
||||||
CH_IRQ_EPILOGUE();
|
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. */
|
||||||
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
#ifndef _BOARD_H_
|
#ifndef _BOARD_H_
|
||||||
#define _BOARD_H_
|
#define _BOARD_H_
|
||||||
|
|
||||||
#include <msp430x16x.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clock settings.
|
* Clock settings.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,12 +17,9 @@
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ch.h>
|
#include "ch.h"
|
||||||
#include <pal.h>
|
#include "hal.h"
|
||||||
#include <serial.h>
|
#include "test.h"
|
||||||
#include <test.h>
|
|
||||||
|
|
||||||
#include "board.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Red LEDs blinker thread, times are in milliseconds.
|
* Red LEDs blinker thread, times are in milliseconds.
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ch.h>
|
#include "ch.h"
|
||||||
#include <pal.h>
|
#include "hal.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief MSP430 I/O ports configuration.
|
* @brief MSP430 I/O ports configuration.
|
||||||
|
|
|
@ -277,6 +277,8 @@ typedef union __ioport * ioportid_t;
|
||||||
#define pal_lld_setgroupmode(port, mask, mode) \
|
#define pal_lld_setgroupmode(port, mask, mode) \
|
||||||
_pal_lld_setgroupmode(port, mask, mode)
|
_pal_lld_setgroupmode(port, mask, mode)
|
||||||
|
|
||||||
|
extern const MSP430DIOConfig pal_default_config;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,12 +24,10 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ch.h>
|
|
||||||
#include <serial.h>
|
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "board.h"
|
#include "ch.h"
|
||||||
|
#include "hal.h"
|
||||||
|
|
||||||
#if USE_MSP430_USART0 || defined(__DOXYGEN__)
|
#if USE_MSP430_USART0 || defined(__DOXYGEN__)
|
||||||
/** @brief USART0 serial driver identifier.*/
|
/** @brief USART0 serial driver identifier.*/
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file STM32/hal_lld.c
|
* @file STM32/hal_lld.c
|
||||||
* @brief STM32 HAL subsystem low level driver source
|
* @brief STM32 HAL subsystem low level driver source.
|
||||||
* @addtogroup STM32_HAL
|
* @addtogroup STM32_HAL
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file STM32/hal_lld.h
|
* @file STM32/hal_lld.h
|
||||||
* @brief STM32 HAL subsystem low level driver header
|
* @brief STM32 HAL subsystem low level driver header.
|
||||||
* @addtogroup STM32_HAL
|
* @addtogroup STM32_HAL
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
#undef FALSE
|
#undef FALSE
|
||||||
#undef TRUE
|
#undef TRUE
|
||||||
#include <stm32f10x.h>
|
#include "stm32f10x.h"
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#define TRUE (!FALSE)
|
#define TRUE (!FALSE)
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ch.h>
|
#include "ch.h"
|
||||||
#include <hal.h>
|
#include "hal.h"
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Low Level Driver exported variables. */
|
/* Low Level Driver exported variables. */
|
||||||
|
|
Loading…
Reference in New Issue