I am working on a PSU consistiong of 2 Phase PFC followed by a quasi resonant full bridge
My main interupt handler is below
#pragma CODE_SECTION(OnlyInterrupt, "ramfuncs")
interrupt void OnlyInterrupt(void){
static int instance = 0;
GPIO_set(GPIO_18);
HandleADC();
PCMCPSB_PeakCurrentModeControl();
switch (instance){
case 0:
case 2:
PCMCPSB_VoltageLoop();
break;
case 1:
case 3:
PFC_CurrentLoop();
if (instance == 1){
PFC_VoltageLoop();
}else{
PFC_InputConditioning();
};
}
if (++instance > 3) instance = 0;
GPIO_clr(GPIO_18);
}
Each of the functions called by this handler are declared inline for example
inline void PFC_InputConditioning(void){
...
}
yet when I trace the compiled code these the function is not being expanded inline. The function contains a mix of C and inline assembly. When I check the optimization level for the compiler its set to 3. Also as a result of the functions not being inline they are in slow FLASH not the faster RAM
What am I doing wrong?
Since each of these functions are only called once I could just get rid of the separate functions and just put it all in one big function but I would prefer not to do that because I usually try to keep my functions small so they are easier to understand and tell the compiler to inline any functions that are only called once or are small enough not to worry about.
Any help would be appreciated