ephobb wrote on Sunday, December 27, 2015:
Hi,
This is my first FreeRTOS based project.
I am trying to send string through one task to uart task. but i could see, only 1st letter is being sent.
here is my code
[code]
gbl_queue_handler = xQueueCreate(6,sizeof(uint8_t));
xTaskCreate((TaskFunction_t)Sd_uart,“Suart”,256,NULL,1,NULL);
xTaskCreate((TaskFunction_t)send_str1,“string1”,256,NULL,0,NULL);
void send_str1(void const * argument)
{
uint8_t dat[5]={‘S’,‘K’,‘N’,‘A’,‘B’};
for(;
{
xQueueSend(gbl_queue_handler,&dat[0],0);
vTaskDelay(1000);
}
}
void Sd_uart(void const * argument)
{
uint8_t data[6]={0};
uint8_t da;
for(;
{
HAL_UART_Transmit(&huart1,“UART Task”,9,1000);
if(xQueueReceive(gbl_queue_handler,data,100))
{
HAL_UART_Transmit(&huart1,&data[0],1,1000);
}
else
{
HAL_UART_Transmit(&huart1,“No Data”,7,1000);
}
}
}
[\code]
and part of the output where i m receving queued data is “…UART TaskSUART…”