void adc_request_start(adc_request_t *request) { if (request->state == ADC_REQUEST_STATE_IDLE) { request->sequence++; request->state = ADC_REQUEST_STATE_QUEUED; msg_queue_put ( (void *)request ); } }
void* put_thread(void* prm) { msg_queue_t* q = prm; const char* name; msg_t* m; while(!terminate) { sleep(1); /* getting random name */ name = names[rand() % ARRAY_COUNT(names)]; if(!(m = msg_create(name, strlen(name) + 1))) continue; if(msg_queue_put(q, m)) { printf("msg_queue_errno() = %s\n", msg_queue_errno2str(msg_queue_errno())); msg_free(m); sleep(10); } } return(NULL); }