Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

salvo programmation problem

Status
Not open for further replies.

brutus

Junior Member level 1
Junior Member level 1
Joined
May 20, 2003
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
116
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
 

Version 2.2 has problems with setting priorities (as I discovered myself).
Define tasks with equal priorities and it should work.
trace
 

I have experienced some problems to with priorities in 2.2.

I use same priority for all task except for one very important task that I set a higher priority, with this everythin works well.

NeuralC
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top