Any hope of adding the inline keyword to the C51 compiler so that we can declare functions as inline? For example, I have a C source file that wraps manipulations to the 8051 itself. Some functions are nothing more than: void cntrl_MaskAllInterrupts(void) { EA = 0; } I'd like it so that the compiler could inline this function so I don't get the function call and return overhead. Any chance?
Any hope of adding the inline keyword to the C51 compiler so that we can declare functions as inline? That would be nice, wouldn't it. But no, we can't do that (yet?). void cntrl_MaskAllInterrupts(void) { EA = 0; } This one is very easy.
void cntrl_MaskAllInterrupts(void) { EA = 0; }
sbit r_enable_interrupts = 0xAF; // IE.EA, Enable All unmasked interrupts void enableInterrupts(void) { r_enable_interrupts = !0; } void disableInterrupts(void) { r_enable_interrupts = 0; }
Why not just #define cntrl_MaskAllInterrupts() EA=0 and the compiler inlines the instruction? (EA is defined as sbit in ezregs.h)
EA also defined in KEIL reg51.h. No matter which 8051...