我想使用Timer模块,静态创建Timer后,程序运行进不了Timer的中断程序,大神们看下是哪里出问题了
Timer配置
Debug时出现的问题:
代码
/* ======== HwiHookExample.c ========
* This example demonstrates basic Hwi hook usage. */
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Timestamp.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Timer.h>
#include <ti/sysbios/hal/Hwi.h>
//#include "led.h"
int state=0;
int aa=0;
int bb=0;
int cc=0;
int dd=0;
extern Timer_Handle myTimer;
//Timer_Handle myTimer;
/* ======== myTimerFunc ========
* Timer interrupt handler */
Void myTimerFunc(UArg arg)
{
int i;
aa++;
/*led_ON_OFF(1);
for(i=0;i<5000;i++);
led_ON_OFF(0);*/
for(i=0;i<5000;i++);
//while(1);
}
/* ======== myTaskFunc ======== */
Void myTaskFunc(UArg arg0, UArg arg1)
{
bb++;
//Timer_setPeriodMicroSecs(myTimer,200);
//Timer_start(myTimer);
while(1);
}
/* ======== main ======== */
void main(Int argc, Char* argv[])
{
Task_Params taskParams;
Task_Handle task0;
Error_Block eb;
Timer_Params timerParams;
Error_init(&eb);
//led_init();
/* Create 1 task with priority 15 */
/*Task_Params_init(&taskParams);
taskParams.stackSize = 1000;
taskParams.priority = 15;
//task0 = Task_create(myTaskFunc, &taskParams, &eb);
task0 = Task_create(myTaskFunc, NULL, NULL);
if (task0 == NULL) //System_abort("Task create failed");
{
cc=1;
}*/
/*Timer_Params_init(&timerParams);
//timerParams.extFreq.lo=5000;
//timerParams.extFreq.hi=0;
timerParams.period = 1000;
timerParams.runMode = Timer_RunMode_CONTINUOUS;
timerParams.startMode = Timer_StartMode_AUTO;
timerParams.periodType = Timer_PeriodType_MICROSECS;
myTimer = Timer_create(Timer_ANY, myTimerFunc, &timerParams, &eb);
if (myTimer == NULL) //System_abort("Timer create failed");
{
dd=1;
}*/
BIOS_start();
//return (0);
}

