各位开发者:
大家好。我在BIOS下使用定时器模块,如下所示:
Timer_Handle timerHandle;
UInt32 count = 0;
Void tickFxn(UArg a0)
{
++count;
System_printf("count = %d\n", count);
}
Void main()
{ Timer_Params timerParams;
Error_Block eb;
printf("enter main()\n");
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = 1000000; // 单位为us
// timerParams.runMode = ti_sysbios_interfaces_ITimer_RunMode_ONESHOT;
timerParams.startMode = ti_sysbios_interfaces_ITimer_StartMode_USER;
timerHandle = Timer_create(Timer_ANY, tickFxn, &timerParams, &eb);
if (timerHandle == NULL) {
System_printf("Timer_create() failed!\n");
BIOS_exit(0);
}
Timer_start(timerHandle);
BIOS_start(); /* enable interrupts and start SYS/BIOS */
}
现在我想了解下,这个Timer定时器的中断优先级是如何设定的?谢谢
Tony Tang:
中断优先级是由中断号决定的,可以把相应的中断事件映射到低的中断号上去以得到高的优先级。