btstack_debug: allow to provide custom BTSTACK_PRINTF

This commit is contained in:
Matthias Ringwald 2016-10-18 15:58:28 +02:00
parent a3dc965a0a
commit cd4b342469

View File

@ -57,13 +57,20 @@
// Avoid complaints of unused arguments when log levels are disabled.
static inline void __log_unused(const char *format, ...) {}
// allow to provide port specific printf
#ifndef BTSTACK_PRINTF
#ifdef __AVR__
#define HCI_DUMP_LOG(log_level, format, ...) hci_dump_log_P(log_level, PSTR(format), ## __VA_ARGS__)
#define BTSTACK_PRINTF(format, ...) printf_P(PSTR(format), ## __VA_ARGS__)
#else
#define HCI_DUMP_LOG(log_level, format, ...) hci_dump_log(log_level, format, ## __VA_ARGS__)
#define BTSTACK_PRINTF(format, ...) printf(format, ## __VA_ARGS__)
#endif
#endif
#ifdef __AVR__
#define HCI_DUMP_LOG(log_level, format, ...) hci_dump_log_P(log_level, PSTR(format), ## __VA_ARGS__)
#else
#define HCI_DUMP_LOG(log_level, format, ...) hci_dump_log(log_level, format, ## __VA_ARGS__)
#endif
#ifdef ENABLE_LOG_DEBUG
#ifdef ENABLE_LOG_INTO_HCI_DUMP