[En-Nut-Discussion] Scheduling out of Interrupt sometimes take a timertick NAP

Harald Kipp harald.kipp at egnite.de
Mon Mar 9 17:21:55 CET 2015


Uwe,

On 09.03.2015 16:49, Uwe Bonnes wrote:
> Is there any reason not to rewrite NutEventPostFromIrq() as an static inline
> function? That way, type checking is done by the compiler. And hopefully
> your argument about the none-need for volatile for function arguments would
> still hold.

What makes you believe, that type checking is not done within a macro?

Try

char qp;
NutEventPostFromIrq(qp);

Yeah, but I know, what you mean. ;-) I agree, that inline functions
should be preferred, if parameter types are fixed.

Unfortunately C89 didn't specify static inline functions. Typically I
try to avoid C99, if it doesn't add anything to the final code. However,
static inline functions can be easily replaced with macros, if the
compiler doesn't support them in a right way. So I have no objections in
declaring static inline functions.

Btw. do you know, whether the latest GCC is now finally following the
ISO standard for static inline functions?

Regards,

Harald





More information about the En-Nut-Discussion mailing list