Help taskdelay

dragie wrote on Monday, June 09, 2008:

heej all,

i am making a robot, with freertos only i am getting some problems.
the Microcontroller = ATmega32.

i made 2 tasks (they work fine).

task 1, says what dance move he must do.
task 2, says what ports he must set high (to dance).

then i got an external interrupt. when he sees an interrupt on the front is has to stop and move backwards. the commands it sets are in task 2 to.

somehow it seems it is doing 2 commands @ the same time but i have no clue why.
in the external interrupt it wil put temp on 0.
example code:

for(;:wink:
{
if (temp == 1)
{
if ((x == 1) && (y == 0) && (z == 0) && (w == 0))
{
        PORTB = ~0x10;
    vTaskDelay( 3000 / ( portTickType ) 2 );
}
etc to dance
}

if (temp == 0)
{
    if (evede == 1)
    {
        temp = 0;
        PORTB = ~0xFF;
        vTaskDelay( 3000 / ( portTickType ) 2 );
        PORTB = ~0xA0;
        vTaskDelay( 3000 / ( portTickType ) 2 );
        temp = 1;
    }   
}

i also tryed to just make 2 task instate of temp == 0 amd temp == 1;

but i can’t get the tasksuspend and resume to work (they are turned on 1 in the config file)

anny1 know what is going wrong, if you wanne / can help you can always contact me on MSN messenger to: xxxx@xxxx

grtz

dragie