我在使用MSP430F5xx_6xx的driverlib时 在调用#include "timer_a.c"时会报错,错误如下:
Error[Pe020]: identifier "OFS_TAxCTL" is undefined F:driverlibMSP430F5xx_6xx imer_a.c 79
Error[Pe020]: identifier "OFS_TAxCTL" is undefined F:driverlibMSP430F5xx_6xx imer_a.c 183
。。。。。。。。
此类错误有十几个,把#include "timer_a.c“屏蔽 就ok了,请问大家是什么问题? 源程序如下
#include "debug.h"
#include <msp430f5529.h>
#include "inc/hw_memmap.h"
#include "ucs.h"
#include "ucs.c"
#include "pmm.h"
#include "pmm.c"
#include "wdt_a.h"
#include "wdt_a.c"
#include "gpio.h"
#include "gpio.c"
#include "sfr.h"
#include "sfr.c"
#include "timer_a.h"
#include "timer_a.c"
#define TIMER_A_PERIOD 32768
//*****************************************************************************
//
//Target frequency for MCLK in kHz
//
//*****************************************************************************
#define UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ 12000
//*****************************************************************************
//
//MCLK/FLLRef Ratio
//
//*****************************************************************************
#define UCS_MCLK_FLLREF_RATIO 366
//*****************************************************************************
//
//Variable to store current Clock values
//
//*****************************************************************************
unsigned long clockValue = 0;
//*****************************************************************************
//
//Variable to store status of Oscillator fault flags
//
//*****************************************************************************
unsigned int status;
void main(void)
{
//Stop WDT
WDT_A_hold(WDT_A_BASE);
//Set VCore = 1 for 12MHz clock
PMM_setVCore(PMM_BASE,
PMM_CORE_LEVEL_1
);
//Set P8.0 ,P8.1to output direction
GPIO_setAsOutputPin(
GPIO_PORT_P8,
GPIO_PIN0+GPIO_PIN1
);
//Set DCO FLL reference = XT1CLK
UCS_clockSignalInit(
UCS_BASE,
UCS_FLLREF,
UCS_XT1CLK_SELECT,
UCS_CLOCK_DIVIDER_1
);
//Set ACLK = REFO
UCS_clockSignalInit(
UCS_BASE,
UCS_ACLK,
UCS_XT1CLK_SELECT,
UCS_CLOCK_DIVIDER_1
);
//Set Ratio and Desired MCLK Frequency 12MHz and initialize DCO
UCS_initFLLSettle(
UCS_BASE,
UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ,
UCS_MCLK_FLLREF_RATIO
);
// Enable global oscillator fault flag
SFR_enableInterrupt(SFR_BASE,
SFR_OSCILLATOR_FAULT_INTERRUPT
);
TIMER_A_configureUpDownMode(
TIMER_A1_BASE,
TIMER_A_CLOCKSOURCE_ACLK,
TIMER_A_CLOCKSOURCE_DIVIDER_1,
TIMER_A_PERIOD,
TIMER_A_TAIE_INTERRUPT_ENABLE,
TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE,
TIMER_A_DO_CLEAR
);
TIMER_A_startCounter(
TIMER_A1_BASE,
TIMER_A_UPDOWN_MODE
);
// Enable global interrupt
__bis_SR_register(GIE);
//Start timer in up down mode
//Enter LPM3
__bis_SR_register(LPM3_bits);
//For debugger
__no_operation();
//Verify if the Clock settings are as expected
clockValue = UCS_getSMCLK(UCS_BASE);
clockValue = UCS_getMCLK(UCS_BASE);
clockValue = UCS_getACLK(UCS_BASE);
while (1) // Test LED
{
P8OUT = (BIT2);
P8OUT = (BIT1);
}
}
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR(void)
{
P8OUT ^= (BIT2);
P8OUT ^= (BIT1);
LPM3_EXIT;
}
此帖出自
小平头技术问答
一周热门 更多>