示例#1
0
static bool enqueue_test()
{
    bool passed=true;
    for( int n=0; passed && n < QUEUE_DEPTH; n++ )
    {
        char* message_a = (char*)malloc(MESSAGE_SZ);
        passed = ( message_a != NULL );
        if ( passed )
        {
            /** Populate the message, and post the message onto the queue... */
            memset(message_a,'A',MESSAGE_SZ); 
            passed = caribou_queue_post(&test.queue_a,message_a,from_ms(QUEUE_TIMEOUT_MS));
        }
    }
    return passed;
}
示例#2
0
/** Post a message to an mbox - may not fail
 * -> blocks if full, only used from tasks not from ISR
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL) */
void sys_mbox_post(sys_mbox_t *mbox, void *msg)
{
	caribou_queue_post(*mbox,msg,TIMEOUT_INFINITE);
}
示例#3
0
/** Post a message to an mbox - may not fail
 * -> blocks if full, only used from tasks not from ISR
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL) */
void sys_mbox_post(sys_mbox_t *mbox, void *msg)
{
	caribou_queue_post(*mbox,msg);
}