I'm using OS_GetMailCond1 as such
if (OS_GetMailCond1(&mb,&key))
process(key);
But it seems that this is no good since the data is left in the mail box buffer.
I experimented by using OS_PutMailCond1(&mb,&c) only once, but the process key would run forever.
Does OS_GetMailCond1 not clear the buffer automatically? Am I over simplifying this?
I went to
if(OS_GetMessageCnt(&mb))
{
OS_GetMailCond1(&mb,&key))
process(key);
}
And that seems to work. But, I don't understand the operation of OS_GetMailCond1(&mb,&key) returning success if the result of OS_GetMessageCnt(&mb) is zero.
Am I making a bad assumption or is something wrong?
if (OS_GetMailCond1(&mb,&key))
process(key);
But it seems that this is no good since the data is left in the mail box buffer.
I experimented by using OS_PutMailCond1(&mb,&c) only once, but the process key would run forever.
Does OS_GetMailCond1 not clear the buffer automatically? Am I over simplifying this?
I went to
if(OS_GetMessageCnt(&mb))
{
OS_GetMailCond1(&mb,&key))
process(key);
}
And that seems to work. But, I don't understand the operation of OS_GetMailCond1(&mb,&key) returning success if the result of OS_GetMessageCnt(&mb) is zero.
Am I making a bad assumption or is something wrong?