I have four different tasks. Two tasks are sending different data into the corresponding two queues and the other two task is to receive the data from the queue and process it. I am using queue sets for two queues and task notification when the queue is full.
The problem I face is that… out of four tasks any one pair of the sending and receiving task is working fine. But when I try to run all the four tasks none of them are running.
the overall structure is
xTaskCreate(SenderTask1, “” , 100, 1, NULL)
xTaskCreate(SenderTask2, “”, 100, 1, NULL)
xTaskCreate(ReceiverTask1, “”, 100, 1, &RTask1)
xTaskCreate(ReceiverTask2, “”, 100, 1, &RTask2)
SenderTask1(void pvParam)
{
while(1)
vTaskDelay(pdMS_TO_TICKS(100);
…
…
qStatus=xQueueSend(Q1,value,0);
if(qStatus==errQUEUE_FULL)
xTaskNotifyGive(RTask1);
}
SenderTask2(void pvParam)
{
while(1)
vTaskDelay(pdMS_TO_TICKS(200);
…
…
qStatus=xQueueSend(Q2,value,0);
if(qStatus==errQUEUE_FULL)
xTaskNotifyGive(RTask2);
}
ReceiverTask1(void pvParam)
{
while(1)
if(notification received, xticksToWiat(200))
{
QReceived=(QueueHandle_t)xQueueSelectFromSet(xQueueSet,pdMS_TO_TICKS(200));
if(QReceived==Q1)
{
…
…
…
}
}
ReceiverTask2(void pvParam)
{
while(1)
if(notification received,xticksToWiat(200))
{
QReceived=(QueueHandle_t)xQueueSelectFromSet(xQueueSet,pdMS_TO_TICKS(200));
if(QReceived==Q2)
{
…
…
…
}
}
void loop()
{
}
Please Help me in scheduling. I want Sender1 and Receiver1 tasks to be synced and similarly Sender2 and Receiver2 to be synced and both sender1 and sender2 must run parallely.