Hi,
The xQueueReceive function in FreeRTOS seems to be broken, when a non-zero timeout is specified.
Example, I'm trying to create and ordered output mechanism for the UART using a task and a FIFO queue:
static void uart_output_task(void * arg)
{
for (;;)
{
struct SerialPortOutput spo;
printf("uart_output_task: Waiting for data to send, come on.\n");
// Block waiting on data in the queue.
if (xQueueReceive(m_uart_output_queue, &spo, 100))
{
printf("Sending data to UART.\n");
// Send data to UART.
nrf_drv_uart_tx(spo.output, spo.length);
}
else
{
printf("uart_output_task: xQueueReceive had nothing to send.\n");
}
// char test[8] = "test\r\n";
// nrf_drv_uart_tx(test, 6);
}
}
If I specify a timeout to the xQueueReceive method (in this case 100 ticks), the task prints the first printf() and stops forever while waiting. I should be seeing that printf() every 100 ticks. If I set the queue receive timeout to 0, it loops appropriately, but this is of course not the behavior I want. This also happens if I set it to portDELAY_MAX
.
Thanks, Max