brutus
Junior Member level 1
I create this program under salvo 2.2:
#include <salvo.h>
#include <pic.h>
//#define TASK1_P OSTCBP(1)
//#define TASK2_P OSTCBP(2)
_OSLabel(TaskCount1)
_OSLabel(TaskShow1)
_OSLabel(TaskShow2)
_OSLabel(TaskCount2)
unsigned int counter = 0;
void TaskCount( void )
{
// OSSetPrio(1,TaskShow1);
for (; {
PORTA=PORTA^0x01;
OS_Yield(TaskCount2);
}
}
void TaskShow( void )
{
// OS_SetPrio(1,TaskCount1);
for (; {
PORTB=PORTB^0x01;
OS_Yield(TaskShow2);
}
}
void main( void )
{
ADCON1=0b00000111;
TRISA = 0x00;
TRISB = 0x00;
PORTB = 0x00;
PORTA = 0x00;
//T0CS = 0;//
//T0IE = 1;//
//InitializeMultitasking();
OSInit();
OSCreateTask(TaskCount, OSTCBP(1), 3);
OSCreateTask(TaskShow, OSTCBP(2), 2);
// OSStartTask(1);
// OSStartTask(2);
for (;
OSSched();
}
the LED of PORTA doesnt work why ?
there is no commutation betwen the task
thanks for your answer
#include <salvo.h>
#include <pic.h>
//#define TASK1_P OSTCBP(1)
//#define TASK2_P OSTCBP(2)
_OSLabel(TaskCount1)
_OSLabel(TaskShow1)
_OSLabel(TaskShow2)
_OSLabel(TaskCount2)
unsigned int counter = 0;
void TaskCount( void )
{
// OSSetPrio(1,TaskShow1);
for (; {
PORTA=PORTA^0x01;
OS_Yield(TaskCount2);
}
}
void TaskShow( void )
{
// OS_SetPrio(1,TaskCount1);
for (; {
PORTB=PORTB^0x01;
OS_Yield(TaskShow2);
}
}
void main( void )
{
ADCON1=0b00000111;
TRISA = 0x00;
TRISB = 0x00;
PORTB = 0x00;
PORTA = 0x00;
//T0CS = 0;//
//T0IE = 1;//
//InitializeMultitasking();
OSInit();
OSCreateTask(TaskCount, OSTCBP(1), 3);
OSCreateTask(TaskShow, OSTCBP(2), 2);
// OSStartTask(1);
// OSStartTask(2);
for (;
OSSched();
}
the LED of PORTA doesnt work why ?
there is no commutation betwen the task
thanks for your answer