Page 1 of 1

ISR problem

PostPosted: Tue Dec 19, 2000 10:25 am
by luben
Hello,

After I tried to add in my interrupt routine OSSignalBinSem() (before that I set in salfocfg.h
- the values of OSCALL_OSSIGNALBINSEM to OSFROM_ANYWHERE
- and #define OSEVENTS 2
- and #define OSENABLE_BINARY_SEMAPHORES TRUE
- before interrupt I put #pragma interrupt_level 0)

I get the message
function _OSRtnEventPtr appears in multiple call graphs: rooted at intlevel0 and _main

that means that Salvo doesn't understand that OSSignalBinSem is correctly called (from level 0 or 1 of calls depth).

Regards
Luben


Re: ISR problem

PostPosted: Tue Dec 19, 2000 11:24 am
by Salvo Tech Support
Hi Luben.

1) Recall that you cannot change anything in the salvocfg.h that's supplied with the freeware libraries, except OSEVENTS and OSTASKS. That's because the libraries contain sections of code that are dependent on the configuration settings.

By setting OSCALL_SIGNALBINSEM to OSFROMANYWHERE, you're changing it from its default value -- the value that the libraries expect. OSENABLE_BINARY_SEMAPHORES's default value is TRUE, so that's OK. The default values are all listed in the User Manual.

2) Apart from changing the values of these configuration parameters, you did everything right :-). What you're seeing is a limitation of the freeware libraries -- they were not compiled to allow for OSCALL_OSSIGNALXYZ other than OSFROM_BACKGROUND. Therefore no matter what you do with your main.c and salvocfg.h, you will always get this error.

We are trying to design a way for freeware library users to be able to signal events from interrupts and/or from mainline code. We will incorporate this into the next release (v2.2) of the freeware libraries.

Note that this is not an issue with the full version of Salvo, only with the precompiled freeware libraries. And this has nothing to do with Salvo per se, it is simply an artifact of the "stackless" design of the PIC C compiler. It's not good or bad, it's simply something that must be managed by PIC C programmers wishing to call the same function from both mainline and interrupt code.

As mentioned above, this restriction will be removed from the v2.2 freeware libraries. For now, it means that you can only signal and create events from mainline code with the v2.1 freeware libraries.


Re: ISR problem

PostPosted: Tue Dec 19, 2000 11:28 am
by aek