I'm having trouble sending multiple queues to a task in FreeRTOS.
I've tried creating a struct to hold them like this:
typedef struct
{
xQueueHandle buttonQueue;
xQueueHandle OLEDQueue;
} xQueues;
and then sending it to the task like this:
void vStartADCtasks( xQueueHandle xButtonQueuex, QueueHandle xOLEDQueue )
{
xQueues xADCQueues = { xOLEDQueue, xButtonQueue };
xTaskCreate( vGetAltitude, "Get Altitude", 240, (void *) &xADCQueues, 2, NULL );
}
and accessing it like this in the task:
static void vGetAltitude(void *pvParameters) {
xQueues *xADCQueues = ( xQueues * ) pvParameters;
xQueueHandle xOLEDQueue = xADCQueues->OLEDQueue;
xQueueHandle xButtonQueue = xADCQueues->buttonQueue;
but that doesn't work. Any tips? I guess my more general question is how to pass around a queue between multiple .c files. ie. create it and one file, but be able to use it in a task in another file?