All this talk on Proper Queue usage got me thinking that i could do something in a better way.
I am looking to have a Task that will be in control of writing to my LCD. All other tasks that want to use the screen will post a message. The LCD task will be in a pending state when there is no data available. When another task makes a post with data, the LCD routine will resume running and update the LCD.
The OSFifo example, looks like what i want do do. except, i dont see that i can add a string of text to the "OSFifoPost( &MyFIFO, ( OS_FIFO_EL * ) &StructArray ); "
Using the OSFifo example to pass a string ?
Re: Using the OSFifo example to pass a string ?
using that example, you can put whatever you want in the MyStructue struct -
just don't touch that first member, pUsedByFifo.
e.g.,
typedef struct // Pointers to this structure will be passed in the FIFO
{
void * pUsedByFifo; // Don't modify this value, and keep it first
int x; // Any other members come after the pointer
char sYours[32]; // or whatever else you want to add
BOOL free; // free = TRUE if structure is free to be used.
} MyStructure;
just don't touch that first member, pUsedByFifo.
e.g.,
typedef struct // Pointers to this structure will be passed in the FIFO
{
void * pUsedByFifo; // Don't modify this value, and keep it first
int x; // Any other members come after the pointer
char sYours[32]; // or whatever else you want to add
BOOL free; // free = TRUE if structure is free to be used.
} MyStructure;
Re: Using the OSFifo example to pass a string ?
was able to finally try this with your suggestion, worked like a charm, Thanks!