Hi, I'm new on MQX and making a test, I made a project with two tasks, on a KL25Z - Arm M0 Freedom Board. The first and the second task only blink a LED.
Red for Task 1 and Blue for task 2, using a simple delay routine.
These two tasks only run at a first time and do not repeat.
I was wainting Task1, Task 2 and Task 1... again and repeat it forever.
I made many changes, but nothing change this ?
If I make only one task, it repeat, but do why with more than one do not?
I use codewarrior 10.4.
Original Attachment has been moved to: Exercicio2.rar.zip
已解决! 转到解答。
hi
in the task whatever you want to must be in a while(1) loop.
// task 1 while 1 loop
while(1) {
counter++;
_time_delay_ticks(50);
/* Write your code here ... */
}
// task 2 while 1 loop
while(1) {
counter++;
RED_NegVal(NULL);
_time_delay_ticks(250);
/* Write your code here ... */
}
Note: Lite only support FIFO scheduling , we are using the _time_delay_ticks to block the task.
In this case taks 1 and task2 will called again and again and they will be time delay block for the number of ticks mentioned in the API called for.
Hope this helps
hi
in the task whatever you want to must be in a while(1) loop.
// task 1 while 1 loop
while(1) {
counter++;
_time_delay_ticks(50);
/* Write your code here ... */
}
// task 2 while 1 loop
while(1) {
counter++;
RED_NegVal(NULL);
_time_delay_ticks(250);
/* Write your code here ... */
}
Note: Lite only support FIFO scheduling , we are using the _time_delay_ticks to block the task.
In this case taks 1 and task2 will called again and again and they will be time delay block for the number of ticks mentioned in the API called for.
Hope this helps