summaryrefslogtreecommitdiff
path: root/tinyusb/common
diff options
context:
space:
mode:
Diffstat (limited to 'tinyusb/common')
-rw-r--r--tinyusb/common/common.h2
-rw-r--r--tinyusb/common/errors.c6
-rw-r--r--tinyusb/common/errors.h6
3 files changed, 12 insertions, 2 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h
index 91b18ee22..e63747d68 100644
--- a/tinyusb/common/common.h
+++ b/tinyusb/common/common.h
@@ -109,7 +109,7 @@
//#if ( defined CFG_PRINTF_UART || defined CFG_PRINTF_USBCDC || defined CFG_PRINTF_DEBUG )
-#if CFG_TUSB_DEBUG_LEVEL
+#if TUSB_CFG_DEBUG
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...)
diff --git a/tinyusb/common/errors.c b/tinyusb/common/errors.c
index db93d5d84..4c60e5e47 100644
--- a/tinyusb/common/errors.c
+++ b/tinyusb/common/errors.c
@@ -35,9 +35,15 @@
* This file is part of the tinyUSB stack.
*/
+#include "errors.h"
+
+#if TUSB_CFG_DEBUG == 3
+
char const* const TUSB_ErrorStr[] = {
# define ERROR_ENUM(x) #x,
# include "errors_def"
# undef ERROR_ENUM
0
};
+
+#endif
diff --git a/tinyusb/common/errors.h b/tinyusb/common/errors.h
index 22db0721a..53c9379c3 100644
--- a/tinyusb/common/errors.h
+++ b/tinyusb/common/errors.h
@@ -49,6 +49,8 @@
#ifndef _TUSB_ERRORS_H_
#define _TUSB_ERRORS_H_
+#include "../tusb_cfg.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -64,8 +66,10 @@ typedef enum {
ERROR_COUNT
}TUSB_Error_t;
-/// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG_LEVEL > 0
+#if TUSB_CFG_DEBUG == 3
+/// Enum to String for debugging purposes. Only available if \ref TUSB_CFG_DEBUG > 0
extern char const* const TUSB_ErrorStr[];
+#endif
#ifdef __cplusplus
}