Pumpkin, Inc.

Pumpkin User Forums

New function in SALVO

Have an idea on how to make Salvo better? Post it here!

New function in SALVO

Postby luben » Thu Jun 14, 2001 7:55 am


Because SALVO became more and more perfect I think that some complicated constructions could be implemented too, that will bring big advantages in the future.

One of them is to be able to redirect the events. Something like to redirect the standart printer output of PC to serial port... or console to COM1....

Think about this. You have some output devices like LCD display, RS232 port and thermal printer. Will be great if you can redirect the message or message queue to different tasks.


are 3 messages to different devices.

if you have one MESS_standard_OUTPUT and the function

OSRedirect(MESS_standart_OUTPUT, MESS_serial);

you can send messages to serial.

OSRedirect(MESS_standart_OUTPUT, MESS_display); // messages to LCD

Just ideas.....


Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: New function in SALVO

Postby luben » Sat Jun 16, 2001 7:54 am


I even got vision of how could be implemented OSRedirect(X,Y) in future SALVO.
It's just one array of size equal to number of events, where the cell, addressed like ID contains the new ID. And when you use any of event functions you just take not the ID but the ID from array. In the beginning this array is initialized like


static byte REDIRECTION[number of events];
// number of events includes virtual events too, that are not declared in SALVOCFG.H

for (i=0;i<number_of_events;i++)


after using OSRedirect(0,1) the event 0 ID becomes 1. I mean you can dinamically change the ID's.

Well, I agree that this could be very, very dangerous. SO additional care should be taken for using such redirection. The function should have protection agains redirect BinSem to Mess or one type of events to other.

So if you have 3 messages:


#define MESS_Standard_IO 4 // virtual message


//and then


// calling MESS_Standard_IO will redirect requests
// to MESS_Serial

Well, when SALVO checks the event IDs it should take not the ID, but the DESTINATION[ID] value.

In all cases this will grow the amount of RAM with number of event cells + number of virtual events.


[This message has been edited by luben (edited June 16, 2001).]

Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest