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.

TMS320F280039: Encapsulating inline functions into library files (.lib)

Part Number: TMS320F280039

Hi Team,

There's an issue from the customer need your help:

I currently use the inline function to define inline in a .h file with static inline void, but then I don't know how to encapsulate it in a .lib file.

I've also tried using #pragma FUNC_ALWAYS_INLINE() in a .c file to force inline, calling this inline function from the same file does it inline, but I can't call it from another file.

Is there any documentation or routine that I can refer to?

I know how to generate libs, but I call the library function inside the lib, and it's called via LCR. I want the GridVoltFilter function in the graph to be expanded inline, is this possible?

Best Regards.

Ben

  • Hello,

    I have brought this thread to the attention of the compiler experts. Please note that many people are away for the holidays so responses may be delayed.

    Thanks

    ki

  • For inlining to occur at some particular call site, the compiler must be able to see, at the same time, the complete implementation of the function.  Use the method described in this article.  To summarize the method … In a header file that is included by every source file which calls the function, write something similar to …

    inline int name_of_function_to_inline(int args)
    {
        /* full implementation here */
    }

    In exactly one source file that eventually becomes a member of the library, also include the header file and this line …

    extern inline int name_of_function_to_inline(int args);

    The method relies on the C99 language standard. Thus everything has to be compiled with the option --c99.

    Thanks and regards,

    -George