关于msp430固件库使用问题

2019-03-24 13:03发布

我在使用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;                       
} 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
2条回答
wstt
1楼-- · 2019-03-24 16:57
 精彩回答 2  元偷偷看……
wq5551291
2楼-- · 2019-03-24 20:52
< :TI_MSP430_内容页_SA7 --> 楼上正解

一周热门 更多>

相关问题

    相关文章