I am using SalvoLE v3.2.3. I am doing tut5 now and there's no problem with it, but when I try to add just another one task to the program, it can't run at all. Then I try to use OSDestroyTask() before using OSCreateTask(). I use MPLAB SIM to observe the process, I found that for tasks with pointer OSTCBP(1) to OSTCBP(3) returned a OSTaskUsed(tcbPP) = TRUE which is valid. While pointer OSTCBP(4) to OSTCBP(10) returned a OSTaskUsed(tcbPP) = FALSE which is invalid. Any idea why? I suspect that there is a limitation somewhere but I can't seen to find it. And NO I didn't modify any of the salvo's original files :) Help?
Below is my salvocfg.h file:
/*--------------------------------------*/
#elif defined(MAKE_WITH_STD_LIB)
/* */
/* Salvo LE & Pro library build */
/* */
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSL
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSB
#define OSEVENTS 1
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 10
/*--------------------------------------*/
Below is my main() in main.c file:
/*--------------------------------------*/
void main( void )
{
Init();
OSInit();
ResetPORT();
InitTx();
SpiSetup(Master);
OSEi();
for ( i=1 ; i<=10 ; i++ )
OSDestroyTask(OSTCBP(i));
OSCreateTask(TaskCount, OSTCBP(1), 10);
OSCreateTask(TaskShow, OSTCBP(2), 10);
OSCreateTask(TaskSpi, OSTCBP(3), 2);
OSCreateTask(TaskSerial, OSTCBP(4), 10);
OSCreateBinSem(BINSEM_SIGNAL_1, 0);
counter = 0;
for (; ;){
OSSched();
}
}
/*--------------------------------------*/
[This message has been edited by goliath_thye (edited August 15, 2006).]