Page 1 of 1

OSMsgQCount does'nt work

PostPosted: Tue Dec 18, 2007 1:04 am
by Bummibaer

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


Re: OSMsgQCount does'nt work

PostPosted: Tue Dec 18, 2007 8:24 am
by aek
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?

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


Re: OSMsgQCount does'nt work

PostPosted: Tue Dec 18, 2007 8:30 am
by aek
Maybe I spoke too soon ... I will look at this AGAIN and see if this needs a change ...

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