Pumpkin, Inc.

Pumpkin User Forums

message queues, insert a struct ?

If you can't make Salvo do what you want it to do, post it here.

message queues, insert a struct ?

Postby weeb0 » Fri Jun 06, 2014 7:02 am

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
weeb0
 
Posts: 6
Joined: Mon Mar 19, 2007 11:00 pm

Re: message queues, insert a struct ?

Postby Andrew » Fri Jun 06, 2014 8:36 am

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.
Andrew
Site Admin
 
Posts: 68
Joined: Mon Nov 30, 2009 6:43 pm

Re: message queues, insert a struct ?

Postby weeb0 » Fri Jun 06, 2014 11:23 am

Andrew,

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

K
weeb0
 
Posts: 6
Joined: Mon Mar 19, 2007 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 4 guests

cron