producer::producer() : scheduler_task("producer", 3 * 512, PRIORITY_LOW) { /* Create the queue, and share the handle using an ID (enum) or index */ QueueHandle_t qh = xQueueCreate(1, sizeof(int)); addSharedObject(shared_SensorQueue, qh); }
bool queue_tx::init(void) { // call our run() every second : setRunDuration(1000); /** * Create a queue, and add to mShared object by the name of "my_queue" * One small error is not to check for NULL from xQueueCreate() */ QueueHandle_t my_queue = xQueueCreate(1, sizeof(int)); return addSharedObject("my_queue", my_queue); }
orient_compute(uint8_t priority) : scheduler_task("compute", 2048, priority) { /* We save the queue handle by using addSharedObject() */ qid = xQueueCreate(1, sizeof(orientation_t)); addSharedObject(shared_SensorQueueId, qid); }