Page 1 of 1


PostPosted: Wed May 15, 2002 8:02 am
by dfleck
I am using the HI-TECH PICC18 compiler. I am using a library and I want to in-line OSTimer() in my ISR. Can I define OSUSE_INLINE_OSTIMER to non-0 in my salvocfg.h to do so? It seems to work (the compiler generates code that treats OStimerTicks as 32-bit unsigned), but since OSUSE_INLINE_TIMER is listed as an option for source code distributions and I'm using a library, I want to make sure I can use it.

Donald A. Fleck


PostPosted: Wed May 15, 2002 8:26 am
by aek
Hi Donald.

The short answer is yes, you can, but we "officially" would rather you do so only in a source-code build.

It will work (and so will OSUSE_INLINE_OSSCHED) as long as you don't use any of the source-code-only configuration options. That's because those other options begin to alter OSTimer()'s functionality, and you can end up with a "mismatch" between what's in OSTimer() and what the library thinks should be in OSTimer(). Ditto for OSSched().

Also, keep in mind that the PIC18 has a much deeper hardware stack depth than the PIC16 (32 vs. 8 levels). So inlining OSTimer() is a lot less necessary on the PIC18 than it is on the PIC16. PIC17 has 16 levels.

So, I would say that inlining OSTimer() and/or OSSched() in a library build is definitely for "advanced users" only, i.e. for people who understand the relationship between the preprocessor, the libraries, the modules and how they're all linked together. You appear to be such a user, so go for it!