Пример #1
0
/*-----------------------------------------------------------------------------------
 * Similar to sys_arch_mbox_fetch, but if message is not ready immediately, we'll
 * return with SYS_MBOX_EMPTY.  On success, 0 is returned.
 */
u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg)
{
    void *dummy_ptr;
    void ** tmp_ptr = msg;
    e_mailbox_t* embox = (e_mailbox_t*)(*mbox);
    if ( msg == NULL )
    {
        tmp_ptr = &dummy_ptr;
    }

    if (0 == OS_GetMailCond(&embox->mbox, tmp_ptr))
    {
        return ERR_OK;
    }
    else
    {
        return SYS_MBOX_EMPTY;
    }
}
/*-------------------------------------------
| Name:OS_GetMailCond1
| Description:
| Parameters:
| Return Type:
| Comments:
| See:
---------------------------------------------*/
char OS_GetMailCond1 (OS_MAILBOX* pMB, void* Result){
   return OS_GetMailCond (pMB,Result);
}