Skip to content

Commit 6bb9255

Browse files
authored
Merge pull request #2347 from IngHK/HostLogsFixes
fixed compile errors due to untreated CFG_TUH_LOG_LEVEL
2 parents b6ad70b + efde252 commit 6bb9255

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/common/tusb_debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#if CFG_TUSB_DEBUG
4444

4545
// Enum to String for debugging purposes
46-
#if CFG_TUSB_DEBUG >= 2
46+
#if CFG_TUSB_DEBUG >= CFG_TUH_LOG_LEVEL || CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
4747
extern char const* const tu_str_speed[];
4848
extern char const* const tu_str_std_request[];
4949
extern char const* const tu_str_xfer_result[];

src/host/usbh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ typedef struct {
113113
// MACRO CONSTANT TYPEDEF
114114
//--------------------------------------------------------------------+
115115

116-
#if CFG_TUSB_DEBUG >= 2
116+
#if CFG_TUSB_DEBUG >= CFG_TUH_LOG_LEVEL
117117
#define DRIVER_NAME(_name) .name = _name,
118118
#else
119119
#define DRIVER_NAME(_name)
@@ -1237,7 +1237,7 @@ static void process_removing_device(uint8_t rhport, uint8_t hub_addr, uint8_t hu
12371237
TU_LOG_USBH("Device unplugged address = %u\r\n", daddr);
12381238

12391239
if (is_hub_addr(daddr)) {
1240-
TU_LOG(CFG_TUH_LOG_LEVEL, " is a HUB device %u\r\n", daddr);
1240+
TU_LOG_USBH(" is a HUB device %u\r\n", daddr);
12411241

12421242
// Submit removed event If the device itself is a hub (un-rolled recursive)
12431243
// TODO a better to unroll recursrive is using array of removing_hubs and mark it here
@@ -1712,7 +1712,7 @@ static bool _parse_configuration_descriptor(uint8_t dev_addr, tusb_desc_configur
17121712

17131713
if ( drv_id == TOTAL_DRIVER_COUNT - 1 )
17141714
{
1715-
TU_LOG(CFG_TUH_LOG_LEVEL, "[%u:%u] Interface %u: class = %u subclass = %u protocol = %u is not supported\r\n",
1715+
TU_LOG_USBH("[%u:%u] Interface %u: class = %u subclass = %u protocol = %u is not supported\r\n",
17161716
dev->rhport, dev_addr, desc_itf->bInterfaceNumber, desc_itf->bInterfaceClass, desc_itf->bInterfaceSubClass, desc_itf->bInterfaceProtocol);
17171717
}
17181718
}
@@ -1745,7 +1745,7 @@ void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num) {
17451745
enum_full_complete();
17461746

17471747
if (is_hub_addr(dev_addr)) {
1748-
TU_LOG(CFG_TUH_LOG_LEVEL, "HUB address = %u is mounted\r\n", dev_addr);
1748+
TU_LOG_USBH("HUB address = %u is mounted\r\n", dev_addr);
17491749
}else {
17501750
// Invoke callback if available
17511751
if (tuh_mount_cb) tuh_mount_cb(dev_addr);

src/host/usbh_pvt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum {
5151
//--------------------------------------------------------------------+
5252

5353
typedef struct {
54-
#if CFG_TUSB_DEBUG >= 2
54+
#if CFG_TUSB_DEBUG >= CFG_TUH_LOG_LEVEL
5555
char const* name;
5656
#endif
5757

src/tusb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ uint32_t tu_edpt_stream_read(tu_edpt_stream_t* s, void* buffer, uint32_t bufsize
419419
#if CFG_TUSB_DEBUG
420420
#include <ctype.h>
421421

422-
#if CFG_TUSB_DEBUG >= 2
422+
#if CFG_TUSB_DEBUG >= CFG_TUH_LOG_LEVEL || CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
423423

424424
char const* const tu_str_speed[] = { "Full", "Low", "High" };
425425
char const* const tu_str_std_request[] =

0 commit comments

Comments
 (0)