Other Parts Discussed in Thread: SYSBIOS
Hi.
I am trying to enable a 1s timer in SYS/BIOS on c6472, but to make a code which is not dependant on specific target/device.
When I follow document, SPRUEX30, "SYS/BIOS User's Guide", Chap 8.3, Timer module, it recommends to use a standard interface for easy porting to any target/devices.
But, when I compile the code using example code in the document, it complains that "ti.sysbios.timers.timer64.Timer.Instance#1 : Timer 0 is already in use or reserved".
I believe if I use the standard API to create Timer handler, it should automatically allocate available timer in its lists.
So, I think one of my code is wrong but I can't find out any more documents in your site for timer configuration.
Would you give me a gudie what is wrong in my code?
Work environment : biso_6_41_04_54, xdctools_3_31_00_24_core, ccsv6.1
In .cfg
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
var timerParams = new Timer.Params();
timerParams.period = 1000000;
timerParams.runMode = Timer.RunMode_CONTINUOUS;
Timer.create(Timer.ANY, "&timerIsr", timerParams);
In main.c
Timer_Handle timerHandle;
void main(void)
{
Timer_Params timerParams;
Error_Block eb;
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = 1000000;
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.arg = 0;
timerHandle = Timer_create(Timer_ANY, timerIsr, &timerParams, &eb);
if(timerHandle == NULL)
{
Log_print("Failed to create Timer Handle");
}
....
} // end of main
void timerIsr()
{
..... // will be added
}