Skip to content

Commit 901ce2a

Browse files
committed
hcd/ehci: hcd_edpt_open() return false if ep is already opened. implement hcd_edpt_close()
1 parent 1615120 commit 901ce2a

File tree

6 files changed

+301
-290
lines changed

6 files changed

+301
-290
lines changed

hw/bsp/imxrt/family.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
- Define CFG_TUSB_MEM_SECTION=__attribute__((section("NonCacheable")))
6262
*/
6363

64-
static void BOARD_ConfigMPU(void);
64+
// static void BOARD_ConfigMPU(void);
6565

6666
// needed by fsl_flexspi_nor_boot
6767
TU_ATTR_USED const uint8_t dcd_data[] = {0x00};
@@ -456,7 +456,7 @@ static void BOARD_ConfigMPU(void) {
456456

457457
#elif __CORTEX_M == 4
458458

459-
void BOARD_ConfigMPU(void) {
459+
static void BOARD_ConfigMPU(void) {
460460
#if defined(__CC_ARM) || defined(__ARMCC_VERSION)
461461
extern uint32_t Image$$RW_m_ncache$$Base[];
462462
/* RW_m_ncache_unused is a auxiliary region which is used to get the whole size of noncache section */

src/device/usbd.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ static void usbd_reset(uint8_t rhport) {
561561
}
562562

563563
bool tud_task_event_ready(void) {
564-
// Skip if stack is not initialized
565-
if (!tud_inited()) return false;
564+
TU_VERIFY(tud_inited()); // Skip if stack is not initialized
566565
return !osal_queue_empty(_usbd_q);
567566
}
568567

@@ -684,7 +683,9 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) {
684683

685684
case USBD_EVENT_FUNC_CALL:
686685
TU_LOG_USBD("\r\n");
687-
if (event.func_call.func) event.func_call.func(event.func_call.param);
686+
if (event.func_call.func) {
687+
event.func_call.func(event.func_call.param);
688+
}
688689
break;
689690

690691
case DCD_EVENT_SOF:
@@ -701,7 +702,7 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) {
701702

702703
#if CFG_TUSB_OS != OPT_OS_NONE && CFG_TUSB_OS != OPT_OS_PICO
703704
// return if there is no more events, for application to run other background
704-
if (osal_queue_empty(_usbd_q)) return;
705+
if (osal_queue_empty(_usbd_q)) { return; }
705706
#endif
706707
}
707708
}

src/host/usbh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr) {
520520
// Loop until there is no more events in the queue
521521
while (1) {
522522
hcd_event_t event;
523-
if (!osal_queue_receive(_usbh_q, &event, timeout_ms)) return;
523+
if (!osal_queue_receive(_usbh_q, &event, timeout_ms)) { return; }
524524

525525
switch (event.event_id) {
526526
case HCD_EVENT_DEVICE_ATTACH:

0 commit comments

Comments
 (0)