Pumpkin, Inc.

Pumpkin User Forums

INTERRUPTs and OS_WaitBinSem()

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

INTERRUPTs and OS_WaitBinSem()

Postby aek » Mon Dec 25, 2000 5:13 am

Can you give a specific example?

#prama interrupt_level is specific to the HI-TECH C compiler. It's needed because parameters and local vars are not passed on the stack. A conventional compiler (e.g. Visual C++ or Metrowerks CodeWarrior) passes parameters and local vars on the stack, and therefore doesn't need to worry about functions called from both mainline code and interrupts.

Basically, the rule of thumb with HI-TECH PIC C and multiple call graph errors is that you must have a

code:
#pragma interrupt_level 0


in front of every function listed in the call graph / error messages.

The Salvo source code automatically places these directives based on OSCALL_OSCREATE/SIGNALXYZ values.

As a Salvo full-version user, you shouldn't need to ever use this #pragma with the Salvo code, because the only allowed multiple call graphs relate to OSSignalXyz and OSCreateXyz, and we've already taken those into account with OSCALL_OSCREATE/SIGNALXYZ configuration parameters.

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: INTERRUPTs and OS_WaitBinSem()

Postby luben » Mon Dec 25, 2000 8:40 am

Hello,

If you care in the source files to put #pragma before every function called from interrupt - then it's OK, it will work. And you should check if the compiler is HiTech, or you'll get errors with other compilers.

Because I was with impression that it was not implemented into the current version 2.1.
If you make a note in the WEB page to add manually this #pragma into project (and this is not menshened in the manual) that means - 80% possible is that this not exists in the sources. Just pure logic :-)

Regards
Luben

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

Re: INTERRUPTs and OS_WaitBinSem()

Postby luben » Mon Dec 25, 2000 11:21 am

Hello,

I read your notes and I think that everything is clear, except one small thing:

#pragma interrupt_level 0
is directive to the HiTech C compiler. It it's appliable only to the operator immediately next to this row. And it blocks the appearing of error message like "appear in multiple graphs... etc." In your notes you wrote to put such directive before our interrupt routine, right?

But it's only the one side of the whole thing. Making only this I'm afraid that the error will appear again (I don't have the full version, so it's only my suggestion). To solve the problem you should add the same directive before the called from interrupt fuctions.

So, that means - in your notes should be added - "to modify some of the source code and add #pragma interrupt_level 0 before some routines".

Usually the style of such include files contents many if/endif directives. I'm afraid that that #pragma could not be interpreted correctly.

Or I wrong somewhere?

For more information - read the HiTech Manual page 84 /PDF file page 90. If you don't have the PDF version of the manual - just let me know - will send it via email.

And what about other compilers, they have different #pragma directives, or even they don't have #pragma at all. Does that mean that this is applyable only to HiTech?

Regards
Luben

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

Re: INTERRUPTs and OS_WaitBinSem()

Postby aek » Tue Dec 26, 2000 3:00 am

Service Bulletins like the one you read are meant to alert users of the current Salvo release (right now that's v2.1) to potential problems they may encounter, and how to fix them.

Such problems are normally fixed in the succeeding version.

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron