AnsweredAssumed Answered

The question about timer task.

Question asked by Robin Zou on Nov 28, 2014
Latest reply on Dec 4, 2014 by Carlos_Musich

I create a timer task. I want it to run per 10ms.

 

The source code.

 

_timer_create_component(2U,
2000U);

 

_time_init_ticks(&dticks,
0U);

_time_add_msec_to_ticks(&dticks,
10U);

 

on_timer =
_timer_start_periodic_at_ticks(IO_BUS_cycle_task, 0, TIMER_ELAPSED_TIME_MODE,
&dticks, &dticks);

 

But I find that the timer
task runs per 80ms.It does not runs per 10ms.

 

 

Is there any error in my
source code?

 

 

Also I want to delay 300us.

 

The source code.

 

       MQX_TICK_STRUCT dticks;

 

 

       _time_init_ticks(&dticks, 0U);  

 

 

 

       _time_add_usec_to_ticks(&dticks, (unsigned int)300);

 

 

       _time_delay_for(&dticks);/*It will block the task untill
time out*/

 

 

But I find that the timer delay is 5ms.

 

 

My hardware is Freescale_MQX_4_1_TWRK64F120M.

Outcomes