Pumpkin, Inc.

Pumpkin User Forums

OSMsgQCount does'nt work

If you can't make Salvo do what you want it to do, post it here.

OSMsgQCount does'nt work

Postby Bummibaer » Tue Dec 18, 2007 1:04 am


Hello aek,

The following code works different,
depending on the DEFINE OSENABLE_FAST_SIGNALING :


[CODE] for(i=0;i<3;i++) {
OSSignalMsgQ(MSGQ_ECB_SEND,(OStypeMsgP)p_data++);
printf("Send %c , count = %d
",*p_data,OSMsgQCount(MSGQ_ECB_SEND));
}
[code]

[code]#define OSENABLE_FAST_SIGNALING TRUE
Send 1 , count = 0
Send 2 , count = 1
Send 3 , count = 2
Got 0 , count = 2
Got 1 , count = 1
Send 4 , count = 2[code]


[code]#define OSENABLE_FAST_SIGNALING FALSE
Send 1 , count = 1
Send 2 , count = 2
Send 3 , count = 3
Got 0 , count = 2
Got 1 , count = 1
Send 4 , count = 2
[code]


I think, the error is here:

[code] if (u.tcbP)
{
u.tcbP->status.bits.state = OSTCB_TASK_SIGNALED;
OSInsSigQ(u.tcbP, ecbP);
u.tcbP->msgP = msgP;
//-> here the count++ is missing!?
}
else
{
*(mqcbP->inPP) = msgP;
if (++(mqcbP->inPP) == mqcbP->endPP)
{
mqcbP->inPP = mqcbP->beginPP;
}
mqcbP->count++;
}

[code]

Thanks for your help,

Steffen

#define OSVER_MAJOR 4
#define OSVER_MINOR 0
#define OSVER_SUBMINOR 2
ARM

Bummibaer
 
Posts: 15
Joined: Thu Sep 13, 2007 11:00 pm
Location: Dresden,Germany

Re: OSMsgQCount does'nt work

Postby aek » Tue Dec 18, 2007 8:24 am

As I've said before, the code and behavior is correct.

Fast signaling affects the message count just like fast signaling affects all other event processing.

Since you don't like or understand the way fast signaling works, why don't you leave it disabled?

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

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

Re: OSMsgQCount does'nt work

Postby aek » Tue Dec 18, 2007 8:30 am

Maybe I spoke too soon ... I will look at this AGAIN and see if this needs a change ...

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

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


Return to Coding

Who is online

Users browsing this forum: No registered users and 0 guests

cron