枚举失败
Some checks failed
Build / set-matrix (push) Has been cancelled
Build / cmake (aarch64-gcc) (push) Has been cancelled
Build / cmake (arm-gcc) (push) Has been cancelled
Build / cmake (esp-idf) (push) Has been cancelled
Build / cmake (msp430-gcc) (push) Has been cancelled
Build / cmake (riscv-gcc) (push) Has been cancelled
Build / make (aarch64-gcc) (push) Has been cancelled
Build / make (arm-gcc) (push) Has been cancelled
Build / make (msp430-gcc) (push) Has been cancelled
Build / make (riscv-gcc) (push) Has been cancelled
Build / make (rx-gcc) (push) Has been cancelled
Build / arm-iar (make) (push) Has been cancelled
Build / make-os (macos-latest) (push) Has been cancelled
Build / make-os (windows-latest) (push) Has been cancelled
Build / zephyr (push) Has been cancelled
Build / hil-build (arm-gcc) (push) Has been cancelled
Build / hil-build (esp-idf) (push) Has been cancelled
Build / hil-tinyusb (push) Has been cancelled
Build / hil-hfp (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled

This commit is contained in:
2025-09-21 19:11:17 +08:00
parent 87406e1391
commit f553c0b100
7 changed files with 63 additions and 12 deletions

View File

@@ -58,6 +58,18 @@ int tusb_board_init(void) {
return 0;
}
void usb_irq_enable(){
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = OTG_HS_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
static void tusb_thread_entry(void *parameter)
{
(void) parameter;
@@ -80,15 +92,16 @@ static int init_tinyusb(void)
//call tusb_rhport_init()
tusb_init();
dcd_int_enable(TUD_OPT_RHPORT);
// dcd_int_enable(TUD_OPT_RHPORT);
usb_irq_enable();
#ifdef RT_USING_HEAP
#ifdef RT_USING_HEAP
tid = rt_thread_create("tusb", tusb_thread_entry, RT_NULL,
2048,
5, 10);
if (tid == RT_NULL)
#else
#else
rt_err_t result;
tid = &tusb_thread;