Pumpkin, Inc.

Pumpkin User Forums

More than 3 tasks?

If you're having difficulty with Salvo's configuration options, post it here.

More than 3 tasks?

Postby goliath_thye » Mon Aug 14, 2006 2:22 am

hi,
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).]

goliath_thye
 
Posts: 2
Joined: Sun Aug 13, 2006 11:00 pm
Location: Belfast, Northern Ireland, UK

Re: More than 3 tasks?

Postby goliath_thye » Tue Aug 15, 2006 5:11 am

Hi,
I kinda solve the problem already. My program is now working fine. I think my previous assumption is wrong. Is not limitation. It looks like task's pointer OSTCBP(4) - OSTCBP(5) and binsem's pointer OSECBP(2) - OSECBP(5) can't work probably. Is it because they already been used for something else somewhere? Help?

Thanks.

goliath_thye
 
Posts: 2
Joined: Sun Aug 13, 2006 11:00 pm
Location: Belfast, Northern Ireland, UK

Re: More than 3 tasks?

Postby aek » Tue Aug 15, 2006 6:08 am

Not only do you need to specify
code:
#define OSLIBRARY_TYPE  OSL

(which you did) but you also need to make sure that the library in your project is actually a Salvo LE/Pro library and not a Salvo Lite library. See the Salvo compiler reference manual for the library name nomenclature -- Lite libraries have an 'f' in them whereas LE/Pro libraries have an 'l' in the same spot.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: More than 3 tasks?

Postby aek » Tue Aug 15, 2006 10:49 am

Also note that OSCreateTask() returns an error code -- if it's non-zero, then ther task was not created. Asking to create a task with a tcb ID of higher than 3 when linked to a Salvo Lite application will result in this error ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron