Page 1 of 1

message queues, insert a struct ?

PostPosted: Fri Jun 06, 2014 7:02 am
by weeb0
Hello,

I will begin explaining what I want to do :

I have an RS232 TX task that wait for the data to send. The data is modbus, so I need to send a char burst then wait few moment before sending a new frame.

In my main task, I would build the frame in a fixed size structure and insert it in a message queue. Then wake up the TX task to do his work.

From what I have seen, Salvo's message queue works by keeping a pointer to an array and send the pointer to the waiting task. Did I understood well ? If the message queue store a pointer, how does the main task manage usage of his own buffer (which in final contain the data of the message queue)?

I guess, I would be better to create my own fifo ?

Thank you

Re: message queues, insert a struct ?

PostPosted: Fri Jun 06, 2014 8:36 am
by Andrew
Yes, for your application you'll have to create your own fifo.

Salvo is designed for minimal memory footprints -- it even works on parts with 46 bytes of RAM (!). Therefore, Salvo does not e.g. dyamically allocate memory for (object) queues, etc. This is covered in the Salvo User Manual FAQ.

Re: message queues, insert a struct ?

PostPosted: Fri Jun 06, 2014 11:23 am
by weeb0
Andrew,

Thank you for your reply. I appreciate your answer and I am glad to know that I understood :-)

K