This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIDM-02000: About static inline function purpose

Part Number: TIDM-02000

Hi,

1) Why did TI used "static inline void PSFB_pcmcControlCode(void)" instead of using "void PSFB_pcmcControlCode(void)"? Could you please explain basic and main purpose of using static inline?

2) This static inline function is defined and declared at psfbpcmc.h only. Why didn't TI define it psfbpcmc.c? Why did TI prefer this method?

3) Which configurations did I should also configure in order to use any static inline function?

4) Could you please explain drawbacks of using static inline functions?

Thank you in advance.

  • An inline function is similar to a macro. The call to the inline function will be replaced with the actual code in the function. The benefit of inline functions is that there is no overhead to call them like a normal function, so they execute faster. The drawback is the larger object code size. You should use inline functions for anything that is time critical. If you notice PSFB_pcmcControlCode is in an ISR, so you need this to be as fast as possible.