lpcware

Incorrect use of preprocessor definitions in debug_frmwrk.h causes debug_frmwrk.c not to build (CMSIS distribution)

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by rgledhill on Mon Apr 08 06:54:29 MST 2013

Hello, I have noticed the following code in debug_frmwrk.h (lpcware distribution of CMSIS drivers for LPC43xx): #define PLATFORM HITEX_BOARD #if (PLATFORM == HITEX_BOARD) #define USED_UART_DEBUG_PORT 0 #endif #if (PLATFORM == KEIL_BOARD) #define USED_UART_DEBUG_PORT 3 #endif This is giving a compiler error that USED_UART_DEBUG_PORT is redefined, i.e. it is processing both of the #if clauses as positive. I can fix the code by doing this: #define HITEX_BOARD 1 #define KEIL_BOARD 2 #define PLATFORM HITEX_BOARD #if (PLATFORM == HITEX_BOARD) #define USED_UART_DEBUG_PORT 0 #endif #if (PLATFORM == KEIL_BOARD) #define USED_UART_DEBUG_PORT 3 #endif This is because the C compiler (Keil in my case) is defining KEIL_BOARD and HITEX_BOARD as the same constant (0), which means the #if clauses are both "true".
Can you change the LPCWare distribution to include this fix please?

Thanks, Richard

Outcomes