Hi,
I'm using a mailbox with 1 message:
Mailbox_Params mbox_params; Mailbox_Params_init(&mbox_params); Error_init(&eb); Mailbox_Handle h = Mailbox_create(4, 1, &mbox_params, &eb); if (Error_check(&eb)) System_abort("hMailbox create failed");
I call the mailbox pend from a task with BIOS_WAIT_FOREVER:
while (Mailbox_pend(h, &val, BIOS_WAIT_FOREVER)) {}
I call the mailbox post from a clock swi with BIOS_NO_WAIT:
Bool r = Mailbox_post(h, &q, BIOS_NO_WAIT); if (r == FALSE) { // here both Mailbox_getNumFreeMsgs()=0 and Mailbox_getNumPendingMsgs()=0 }
When my Mailbox_post() fails, I assume it's because of a timeout if the mailbox is full. However, if I print out the number of messages ready to be read in the mailbox, I get 0. Shouldn't this be 1? Why does the Mailbox_post() fail if there are no messages in the mailbox ?
Any insight on this matter would be helpful. Thanks !