Part Number:TMS320C6678Other Parts Discussed in Thread:SYSBIOS
ti专家你好:
我使用DSP6678 ,用的操作系统sysbios,我在mian函数一个任务里面初始化了两个定时器,两个定时器代码如下:(两个中断函数里面分别就是两个打印为了说明是那个定时器用)
Timer_Handle TimerHandle;
Timer_Params TimerParams;
Timer_Params_init(&TimerParams);
TimerParams.period = 5000000; // 5 秒
TimerParams.periodType = Timer_PeriodType_MICROSECS;
TimerParams.intNum =5;
TimerHandle = Timer_create(15, TimerIsr, &TimerParams, NULL);
if(TimerHandle == NULL)
{
platform_write("Timer create failed.\n");
}
Timer_Handle TimerHandle2;
Timer_Params TimerParams2;
Timer_Params_init(&TimerParams);
TimerParams2.period = 3000000; // 3 秒
TimerParams2.periodType = Timer_PeriodType_MICROSECS;
TimerParams2.intNum =15;
TimerHandle2 = Timer_create(10, TimerIsr2, &TimerParams2, NULL);
if(TimerHandle2 == NULL)
{
platform_write("Timer create failed.\n");
}
刚开始正常打印,在中断使能寄存器中看到IER15和IER5是1正常被使能,但是打印几次后(大概TimerHandle2 打印5次后) ,就看到IER5和IER15全部变0没有被使能,然后报错如下:(感觉是两个中断在抢中断控制权造成)
目前我分别在定时器初始化里面加了下面两句话但是还是不行,麻烦ti专家帮忙解答一下:
TimerParams.hwiParams->priority =9;
TimerParams.hwiParrams->maskSetting =Hwi_MaskingOption_None;
TimerParams2.hwiParrams->priority =4;
TimerParams2.hwiParrams->maskSetting =Hwi_MaskingOption_None;
Nancy Wang:
请问优先级配置生效了吗?建议结合ROV工具分析看一下。
software-dl.ti.com/…/rov.html