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; }
/** 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); }
/** 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); }