Thought I'd post here rather than start a new thread - I'm having trouble making CW use inline functions, using CW7.2 for MCF52259.
In the Freescale includes we have mcf5xxx.c/.h which define the following functions:
// Modified to return the previous IPL
uint8 mcf5xxx_irq_enable (void)
{
return(asm_set_ipl(0));
}
uint8 mcf5xxx_irq_disable (void)
{
return(asm_set_ipl(7));
}
Which are used in our interrupt routines etc. to prevent spurious interrupts when twiddling the IMRx registers. As such, we're trying to make the code a bit faster by inlining some functions, but cannot make CW inline these.
In the global optimisations I have it set to "faster code". I have tried setting IPA to "File" and "Program", I have tried turning auto-inline on/off, and tried redeclaring functions as "inline uint8 mcf5xxx_irq_disable (void)" or "__inline uint8 mcf5xxx_irq_disable (void)" but the compiler then throws link errors saying "Undefined: mcf5xxx_irq_disable".
Is this because the function is using asm_set_ipl() and this must also somehow be inlined?