Question:
When adding elements to a Q, can I declare one Q entry, put it in the Q, and then rewrite the data of that object, and put it in the Q again?
For example:
void task(void)
{
Queue_record qEntry;
//etc declare vars
while(1)
{
for(i=0;i<8;i++)
{
newData = GIO_read();
qEntry->data = newData;
Queue_Put(myQ, &(qEntry.Elem));
}
Sempahore_post( processingTaskSem);
}
}
or, do I have to declare a new Q object every time I put new data into the Q?