Part Number:TDA4VM
TI技术人员:你们好!
通过TimerP_create()创建的定时器,当前定时周期是20ms,timer_params.period参数设置为2*10*1000;但修改timer_params.period参数无法修改定时周期,如将timer_params.period修改为1*10*1000,实际定时周期仍然是20ms
代码如下:
/*Create Timer*/
TimerP_Params timer_params;
TimerP_Params_init(&timer_params);
timer_params.startMode = TimerP_StartMode_AUTO;
timer_params.periodType = TimerP_PeriodType_MICROSECS;
timer_params.period = TIMER_INTERVAL;
timer_params.intfreqLo = 1920000;
timer_params.intfreqHi = 0;
timer_handle = TimerP_create(TimerP_ANY, (TimerP_Fxn)example_mcu_timer_callback, &timer_params);
if (NULL == timer_handle)
{
printf("Failed to create timer\n");
}
else
{
printf("Create timer success!\n");
}
void TimerP_Params_init(TimerP_Params *params)
{
TIMOSAL_Assert((params == NULL_PTR));
if(params != NULL_PTR)
{
/* Set the default values */
params->arg = NULL_PTR;
params->extfreqHi = TimerP_USE_DEFAULT;
params->extfreqLo = TimerP_USE_DEFAULT;
params->name = (char *) NULL_PTR;
params->period = 0;
params->runMode = (uint32_t)TimerP_RunMode_CONTINUOUS;
params->startMode = (uint32_t)TimerP_StartMode_AUTO;
params->periodType = (uint32_t)TimerP_PeriodType_MICROSECS;
#if !defined(RTI_SUPPORT)
params->intNum = (int32_t)TimerP_USE_DEFAULT;
#endif
#if defined (TIMER64_SUPPORT)
params->timerMode = TimerP_Timer64Mode_UNCHAINED;
params->timerHalf = TimerP_Timer64Half_DEFAULT;
#endif
#if defined (_TMS320C6X) && !defined(RTI_SUPPORT)
params->eventId = TimerP_USE_DEFAULT;
#endif
}
return;
}
Nancy Wang:
请问是如何测试时间的?