打开log 防止初始化完成之前进入usb中断
This commit is contained in:
@@ -75,6 +75,7 @@ extern "C" {
|
||||
//--------------------------------------------------------------------
|
||||
// DEBUG CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
#define CFG_TUSB_DEBUG 3
|
||||
#ifdef CFG_TUSB_DEBUG
|
||||
#define CFG_TUSB_DEBUG_PRINTF rt_kprintf
|
||||
#endif /* CFG_TUSB_DEBUG */
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <rtthread.h>
|
||||
#include "bsp_init.h"
|
||||
#include "stm32f4xx.h"
|
||||
#include "dcd.h"
|
||||
|
||||
#define DBG_TAG "TinyUSB"
|
||||
#define DBG_LVL DBG_INFO
|
||||
@@ -79,6 +80,8 @@ static int init_tinyusb(void)
|
||||
|
||||
//call tusb_rhport_init()
|
||||
tusb_init();
|
||||
dcd_int_enable(TUD_OPT_RHPORT);
|
||||
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
tid = rt_thread_create("tusb", tusb_thread_entry, RT_NULL,
|
||||
|
@@ -52,7 +52,7 @@ extern char const* const tu_str_xfer_result[];
|
||||
void tu_print_mem(void const *buf, uint32_t count, uint8_t indent);
|
||||
|
||||
#ifdef CFG_TUSB_DEBUG_PRINTF
|
||||
extern int CFG_TUSB_DEBUG_PRINTF(const char *format, ...);
|
||||
extern void CFG_TUSB_DEBUG_PRINTF(const char *format, ...);
|
||||
#define tu_printf CFG_TUSB_DEBUG_PRINTF
|
||||
#else
|
||||
#define tu_printf printf
|
||||
|
@@ -533,7 +533,7 @@ bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
|
||||
|
||||
// Init device controller driver
|
||||
TU_ASSERT(dcd_init(rhport, rh_init));
|
||||
dcd_int_enable(rhport);
|
||||
// dcd_int_enable(rhport);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user