Environment - KEIL ARMcc v5.05 compiler, ARMlink v5.05 linker for LPC1769 Hello experts, I asked this question on NXP forum too, if this looks familiar. I want to create a base project which can be reused for same or similar processors.
I am trying to create interrupt handlers which can be defined/declared by a macro and can over-ride the default weak definition.
For. e.g I want to write DBG port handler but I want the next person to chose what UART he wants by just changing a macro in a header file.
#define DBG_UART UART0 /* The following macro will create text void UART0_IRQhandler */ #define MAKE_IRQH(x) void x##_IRQHandler(void) #define IRQH(x) MAKE_IRQH(x)
So in my dbg.c file I write
IRQH(DBG_UART) { /*....... UART handling stuff ....*/ }
My intention is that next person can take this project and just change say UART0 to UART1 and won't need to change dbg.c file.
The above thing doesn't work, and my code still hits default handler as though void UART0_IRQhandler has not been defined.
Do you guys see any other way of accomplishing this?
Thanks.
--------------------------------------- Posted through