About the task's running question.

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Locked
findfrienda

About the task's running question.

Post by findfrienda »

Hi,Dear,
Now, I wrote a LED Demo based on ERIKA:A task to turn/off the LED Light.
(1)The task handle:

Code: Select all

 TASK(Task1)
 {
    while(1) {
    	int i = 0;
        for ( ; i < 8; i++) {
            if (num & (1 << i))
                led_on(i);
            else 
                led_off(i);
        }
    }
}
(2).The main function:

Code: Select all

int main() 
{
    led_init();
    ActivateTask(Task1);
    while(1);
    return 0;
}
(3).The related configuration of kernel in eecfg.h

Code: Select all

#define __RTD_CYGWIN__
#define __TRICORE1__
#define __TRICORE_GNU__
#define __TC1796__
#define __TC13__
#define __INT__
#define __TRAP__
#define __FP__
#define __MONO__
#define __FP_NO_RESOURCE__
However, when I run the code and set a breakpoint in the task handle's while statement, I found the code wasn't executed.

So,My question:
When we call ActiveTask to active a task, wy the its code wasn't executed?

Thanks!
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: About the task's running question.

Post by paolo.gai »

There is no reason why it does not work. Just execute the ActivateTask step by step and you'll discover what is happening. It could be some kind of error reported. Maybe the Task is not specified in the OIL file?

PJ
Locked