This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Queue Question

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?