/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
/* Standard Includes */
#include <stdint.h>
/* Statics */
const Timer_A_ContinuousModeConfig continuousModeConfig =
{
TIMER_A_CLOCKSOURCE_ACLK,
TIMER_A_CLOCKSOURCE_DIVIDER_8,
TIMER_A_TAIE_INTERRUPT_ENABLE,
TIMER_A_DO_CLEAR // Clear Counter
};
int main(void)
{
/* Stop watchdog timer */
WDT_A_holdTimer();
/* Configuring P1.0 as output */
GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
/* Starting and enabling ACLK (32kHz) */
CS_setReferenceOscillatorFrequency(CS_REFO_128KHZ);
CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_4);
/* Configuring Continuous Mode */
Timer_A_configureContinuousMode(TIMER_A0_BASE, &continuousModeConfig);
/* Enabling interrupts and going to sleep */
Interrupt_enableSleepOnIsrExit();
Interrupt_enableInterrupt(INT_TA0_N);
/* Enabling MASTER interrupts */
Interrupt_enableMaster();
/* Starting the Timer_A0 in continuous mode */
Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_CONTINUOUS_MODE);
int a;
while(1)
{
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
}
}
void TA0_N_IRQHandler(void)
{
Timer_A_clearInterruptFlag(TIMER_A0_BASE);
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
}
跳不出去定时器A中断,没法执行主函数里面的程序。
调试的时候单步执行的时候可以跳出去。但是一运行就不行了