what happens if an interrupt occurs if a task is running? it will break the task and go to the ISR then back to the task?
another thing:
why is this not working? maybe somth. do to with the priorities? only task PRIO_Blink is running;/ the context switch to the other task is not working?
code:
#define PRIO_COUNT 10 /* task priorities*/
#define PRIO_SHOW 10 /* "" */
#define PRIO_Blink 2 /* "" */void TaskCount( void )
{
InitPORT();
for (; ;) {
counter++;
if ( !(counter & 0x01FF) )
OSSignalBinSem(BINSEM_UPDATE_PORT_P);
OS_Yield(TaskCount1);
}
}
void TaskShow( void )
{
for (; ;) {
OS_WaitBinSem(BINSEM_UPDATE_PORT_P, OSNO_TIMEOUT, TaskShow1);
PORT = (PORT & ~0xFE) | ((counter >> 8) & 0xFE);
OS_Yield(TaskShow1);
}
}
void TaskStepperMotorDriver()
{
static int toggle = 0;
DDRB |= (1<<PB1);
for (; ;)
{
if(toggle == 0)
{
PORTB |= (1 << PB1);
toggle = 1;
}
else
{
PORTB |= (0 << PB1);
toggle = 0;
}
OS_Yield(TaskBlink1);
}
}
bye
[This message has been edited by Gerald (edited March 13, 2008).]
[This message has been edited by aek (edited March 13, 2008).]