I'm having trouble sending multiple queues to a task in FreeRTOS.
I tried to create a structure to hold them as follows:
typedef struct { xQueueHandle buttonQueue; xQueueHandle OLEDQueue; } xQueues;
and then send it to the task as follows:
void vStartADCtasks( xQueueHandle xButtonQueuex, QueueHandle xOLEDQueue ) { xQueues xADCQueues = { xOLEDQueue, xButtonQueue }; xTaskCreate( vGetAltitude, "Get Altitude", 240, (void *) &xADCQueues, 2, NULL ); }
and access to it, as in the task:
static void vGetAltitude(void *pvParameters) { xQueues *xADCQueues = ( xQueues * ) pvParameters; xQueueHandle xOLEDQueue = xADCQueues->OLEDQueue; xQueueHandle xButtonQueue = xADCQueues->buttonQueue;
but that will not work. Any tips? I suggest that my more general question is how to get around the queue between multiple .c files. i.e. create it and one file, but be able to use it in a task in another file?
source share