Library for Modtronix NZ32 STM32 boards, like the NZ32-SC151, NZ32-SB072, NZ32-SE411 and others
Diff: mx_helpers.h
- Revision:
- 13:328bfac0e686
- Parent:
- 9:5000feb4b46f
- Child:
- 17:86034c970ea0
--- a/mx_helpers.h Thu Sep 17 11:53:01 2015 +1000 +++ b/mx_helpers.h Wed Oct 21 14:53:20 2015 +1100 @@ -21,23 +21,35 @@ #ifndef MX_HELPERS_H_ #define MX_HELPERS_H_ + +// Debugging ////////////////////////////////////////////////////////////////// +// To enable debug output from this file, define MX_DEBUG and DEBUG_ENABLE_MX_HELPERS before +// including this file. +// //Defines for MXH_DEBUG - debugging for include file -#define DEBUG_ENABLE_MX_HELPERS 1 -#define DEBUG_ENABLE_INFO_MX_HELPERS 0 +#if !defined(DEBUG_ENABLE_MX_HELPERS) + #define DEBUG_ENABLE_MX_HELPERS 0 +#endif +#if !defined(DEBUG_ENABLE_INFO_MX_HELPERS) + #define DEBUG_ENABLE_INFO_MX_HELPERS 0 +#endif #if !defined(MXH_DEBUG) -#if (DEBUG_ENABLE_MX_HELPERS == 1) - #define MXH_DEBUG MX_DEBUG - #if (DEBUG_ENABLE_INFO_MX_HELPERS == 1) - #define MXH_DEBUG_INFO MX_DEBUG + #if defined(MX_DEBUG) && (DEBUG_ENABLE_MX_HELPERS==1) + #define MXH_DEBUG MX_DEBUG + #else + #define MXH_DEBUG(format, args...) ((void)0) + #endif +#endif + +#if !defined(MXH_DEBUG_INFO) + #if defined(MX_DEBUG) && (DEBUG_ENABLE_MX_HELPERS==1) && (DEBUG_ENABLE_INFO_MX_HELPERS==1) + #define MXH_DEBUG_INFO MX_DEBUG #else #define MXH_DEBUG_INFO(format, args...) ((void)0) #endif -#else - #define MXH_DEBUG(format, args...) ((void)0) - #define MXH_DEBUG_INFO(format, args...) ((void)0) -#endif // #if (DEBUG_ENABLE_MX_HELPERS == 1) -#endif // #if !defined(MXH_DEBUG) +#endif + typedef union { @@ -443,11 +455,10 @@ }; #if defined(MXH_DEBUG) -#undef MXH_DEBUG + #undef MXH_DEBUG #endif #if defined(MXH_DEBUG_INFO) -#undef MXH_DEBUG_INFO + #undef MXH_DEBUG_INFO #endif - #endif /* MX_HELPERS_H_ */