The simplest way to use Salvo in a banked application is to keep all of the Salvo code AND the Salvo tasks in the common area. This will probably also yield the best performance.
This way, the only effect of bank selection on Salvo code is when a banked user function is called from within a Salvo task, e.g.
code:where Cx51/BL51 handles the call to myBankedFn() as a banked call. So, you could put all of your user functions in banked ROM, with just Salvo and the Salvo tasks in common ROM.void Task (void)
{
for ( ; ; )
{
myFnA();
myBankedFnB();
OS_Delay(n);
}
}
This is the simplest way, but you may not want to keep all of Salvo and your Salvo tasks in the common area.
The only place I can think of where the Salvo code may have problems with banking is in OSSched(), because tasks are dispatched via an indirect function call, and the stack is affected. Either of these may cause problems with L51_bank.a51. I think (though I have not tested it) that you could do a source-code build with banking where Salvo's sched.c and all of your Salvo tasks are in the common area, but the rest of the Salvo code (e.g. qins.c, delay.c, etc.) is located in a ROM bank. By placing sched.c and the tasks in the common area, there's no banking involved in the critical and complex issue of task dispatching.
I don't think that sched.c and the Salvo tasks van be placed in banked ROM, because l51_bank.a51 affects the stack, and it will probably break the Salvo context switcher. But I'm not sure of this ...
So,
Configuration 1 ***
Common ROM: Salvo source + Salvo tasks
Banked ROM: User functions
will work.
Configuration 2 ***
Common ROM: salvosrcsched.c + Salvo tasks
Banked ROM: rest of Salvo + User functions
should work. 2 will be much slower than 1 because of all the banking that will occur when Salvo's banked internal functions are called.
Configuration 3 ***
Common ROM: user
Banked ROM: Salvo source + Salvo tasks
or
Common ROM: user + Salvo tasks
Banked ROM: Salvo source
probably won't work because the call-by-pointer in OSSched (sched.c) will probably be broken by l51_bank.a51.
Please let us know what you end up with ...
------------------
[This message has been edited by aek (edited April 23, 2004).]
------------------
I.K.
Users browsing this forum: No registered users and 1 guest