/* 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)
/* 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 *dummyptr;
	if ( msg == NULL )
	{
		msg = &dummyptr;
	}
   if ( pdTRUE == xQueueReceive( mbox, &(*msg), 0 ) )
   {
      return ERR_OK;
   }
   else
   {
      return SYS_MBOX_EMPTY;
   }
}