Add define to allow platform override of debug printf function

This commit is contained in:
Björn Mellström 2021-06-03 13:56:11 +02:00
parent 4b8c4990dc
commit d987a8dd8c
1 changed files with 5 additions and 2 deletions

View File

@ -59,9 +59,12 @@ enum BMP_DEBUG {
* BMP PC-Hosted is the preferred way. Printing DEBUG_WARN
* and DEBUG_INFO is kept for comptibiluty.
*/
# if !defined(PLATFORM_PRINTF)
# define PLATFORM_PRINTF printf
# endif
# if defined(ENABLE_DEBUG)
# define DEBUG_WARN printf
# define DEBUG_INFO printf
# define DEBUG_WARN PLATFORM_PRINTF
# define DEBUG_INFO PLATFORM_PRINTF
# else
# define DEBUG_WARN(...) do {} while(0)
# define DEBUG_INFO(...) do {} while(0)