2 posts / 0 new
The Last post
z20121202038
Offline
Last seen:3 years 8 have a line
Joined:The 2016-03-30 12:51 p.m.
About the software timer

hello
There are several questions to consult:
1) under the task A create multiple timers, respectively belong to the task. A, B task, task C, such as:
Ke_timer_set (APP_A_TIMER TASK_A, 500);
Ke_timer_set (APP_B_TIMER TASK_B, 500);
Ke_timer_set (APP_C_TIMER TASK_C, 500);
Then, the three timer timer handler is just under the task A file, so is there A problem?

2) software timer, if only it's task is not disable state, will start, once the disable task into the state, the timer will not work.For example:
Ke_timer_set (APP_ABC_TIMER TASK_ONE, 500);
When TASK_ONE after entering the disable state, even if in the program execution ke_timer_set (APP_ABC_TIMER TASK_ONE, 500);, after the 5 s is still not timer handler app_abc_timer_handle?

Thank you very much!

Device:
snowdream1
Offline
Last seen:4 have 1 week a line
The Staff
Joined:The 2014-08-17 now
On the working principle of the timer, brief description is as follows:

On the working principle of the timer, brief description is as follows:
Ke_timer_set there are three parameters, the first is the message id of the timer, the second is the process the timer messages id of the Task, the third is the time delay.Will call after, ID and TASK as a combination of binding, and according to insert into the timer queue delay time length.IP core will be triggered by hardware interrupt, timer to set up the corresponding message, triggered the callback function ke_timer_schedule, is used to check whether there is a timeout in the timer queue item before.If you have, and needs to receive timer messages before sent to the Task.The last is the Task of the message processing function, the timer messages accordingly.So the accuracy of this timer is very high.

Now for the first question, this basic no problem.But have A bit cautious, 580 kernel preemptive, there is no guarantee that process the timer messages, is in the order before setting, namely A - > B > C.
In addition, if a TASK to handle the message time is too long, will delay the other two TASK real time processing.

The second problem, see you how to write the timer message processing function.If you are in the condition of the disable, not to receive any news, of course will not be performed.