Page 1 of 1

_OSLabel() and PIC18 / C18

PostPosted: Mon Jun 04, 2012 6:16 am
by dfnr2

I've been integrating Salvo v3.2.3 into my current application, and I think it's a great system.

Looking at the definition of OSCtxSw() in portpic18.c, no parameter is passed, and OS_Yield(label) discards the dummy parameter. I gather that the label is required for compilers that use compiled-in jumps to simulate the stack flow. Is that correct? If so, then for C18 v3.40, couldn't I just create a single _OSLabel(OSHere) definition (for example), and then just use OSHere for the label in all the declarations?

If that's the case, I could see it would actually be nice to just alter the definitions throughout the code to eliminate the label, but I think that would not be a great return on time invested with respect to my current project.

Thanks for creating such a great tool!


Re: _OSLabel() and PIC18 / C18

PostPosted: Tue Jun 05, 2012 7:41 am
by Andrew
Salvo 4 eliminated labels -- but Salvo 3 requires them.

The simples thing is to do e.g. "OS_Delay(5, label);"

I.e. use the literal "label" in each context-switching macro.