[En-Nut-Discussion] IH Macro for CM3
Harald Kipp
harald.kipp at egnite.de
Tue Nov 26 14:54:47 CET 2013
Hi Uwe,
On 26.11.2013 13:31, bon at elektron.ikp.physik.tu-darmstadt.de wrote:
>>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:
>
> Harald> Hi Uwe, On 25.11.2013 17:56,
> Harald> bon at elektron.ikp.physik.tu-darmstadt.de wrote:
> Harald> Minor issue: To be able to distinguish separate words, Nut/OS
> Harald> function names are typically CamelCase, while variable names use
> Harald> underlines. Do you think we should change this to Camel_Case?
> Harald> Nut/OS macros are all upper-case with underlines between
> Harald> words. Any reason to change this?
>
> Is CreateHandler() a function or CREATE_HANDLER() a macro? Please advise
> what I should use.
The current definition uses #define to declare it, so it's undoubtedly a
macro. The background is, that I'm able to use
#undef Create_Handler
#define Create_Handler ...
on macros. I can't do this with functions, right?
> >> Maybe it is usefull for the other CM3 architectures too. Feedback
> >> welcome.
>
> Harald> I'm using at least 2 compilers, which do not support string
> Harald> concatenation in macros. I never found any reasonable way to
> Harald> emulate ##, if the compiler doesn't offer this feature.
>
> Are these non-GNU based compilers also targeting ARM/Cortex?
No, not yet.
It just doesn't make sense to me to introduce macros with ## to other
platforms. So I think it is not useful for our existing and well tested
architectures, at least not in its current implementation with the ##.
> The problem are the 80+ different Interrupts on Cortex. It's tedious and
> errorprone to instantiate the handlers by hand. With the former way, the
> interrupt controll function was also different for all handlers and so
> resultet in more flash usage. Flash usage is now traded off against more
> irq controll function arguments.
I fully understood this and your patch is definitely helpful for that
case. I was simply responding to your suggestion to reuse it for other
architectures.
Regards,
Harald
More information about the En-Nut-Discussion
mailing list