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
gblqueuehandler = xQueueCreate(6,sizeof(uint8t));
void sendstr1(void const * argument)
void Sduart(void const * argument)
and part of the output where i m receving queued data is "....UART TaskSUART...."
creates a queue that holds 6 characters max. Each character is 8bits.
sends ojne character to the queue. Only the 'S' is ever sent to the queue (the queue holds 8bit types).
If you want to send a string then the string needs to be null terminated in the normal C way, and then you need to create the queue to hold char pointers.
/* Create a string that holds pointers, each pointer is 4 bytes. /
const char *myString="SKNAB";
/* Queue a pointer. */
Thanks it works.
can you please give me some links for queue tutorial. I read basic queue creation, send and receive.
but i want to know how to protect it with semaphore.
because more than task may be send data to uart.
Queues (or any other FreeRTOS object) do not need to be protected by the
application - that is all taken care of by the RTOS itself. Any number
of tasks and interrupts can write to or read from the same queue. Note
that when accessing a queue from an interrupt only the API functions
appended with "FromISR" can be used.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.