From 3816869fce15509fd43eb5a6d14de76478f86cf1 Mon Sep 17 00:00:00 2001 From: pete-pjb Date: Fri, 2 Dec 2022 10:00:19 +0000 Subject: [PATCH] Some reverts and changes after discussion. --- src/host/usbh.c | 6 +++--- src/osal/osal_freertos.h | 5 ++++- src/portable/ehci/ehci.c | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/host/usbh.c b/src/host/usbh.c index f28554b81..d97b160c9 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -246,8 +246,8 @@ static uint8_t _usbh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE]; // Control transfer: since most controller does not support multiple control transfer // on multiple devices concurrently. And control transfer is not used much except enumeration -// We will only execute control transfer one at a time.CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4096) -CFG_TUSB_MEM_SECTION struct +// We will only execute control transfer one at a time. +struct { tusb_control_request_t request TU_ATTR_ALIGNED(4); uint8_t* buffer; @@ -509,7 +509,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr) default: break; } -#if CFG_TUSB_OS != OPT_OS_NONE && CFG_TUSB_OS != OPT_OS_PICO && CFG_TUSB_OS != OPT_OS_FREERTOS +#if CFG_TUSB_OS != OPT_OS_NONE && CFG_TUSB_OS != OPT_OS_PICO // return if there is no more events, for application to run other background if (osal_queue_empty(_usbh_q)) return; #endif diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h index fed70400e..ccb98cc99 100644 --- a/src/osal/osal_freertos.h +++ b/src/osal/osal_freertos.h @@ -74,6 +74,7 @@ TU_ATTR_ALWAYS_INLINE static inline osal_semaphore_t osal_semaphore_create(osal_ #if configSUPPORT_STATIC_ALLOCATION == 1 return xSemaphoreCreateBinaryStatic(semdef); #else + (void)(semdef); return xSemaphoreCreateBinary(); #endif } @@ -125,6 +126,7 @@ TU_ATTR_ALWAYS_INLINE static inline osal_mutex_t osal_mutex_create(osal_mutex_de #if configSUPPORT_STATIC_ALLOCATION == 1 return xSemaphoreCreateMutexStatic(mdef); #else + (void)(mdef); return xSemaphoreCreateMutex(); #endif @@ -154,8 +156,9 @@ typedef struct uint16_t depth; uint16_t item_sz; void* buf; - +#if configSUPPORT_STATIC_ALLOCATION == 1 StaticQueue_t sq; +#endif }osal_queue_def_t; typedef QueueHandle_t osal_queue_t; diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c index 76ba2a921..0af8c3b2d 100644 --- a/src/portable/ehci/ehci.c +++ b/src/portable/ehci/ehci.c @@ -193,7 +193,8 @@ static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr) { // TODO check type for ISO iTD and siTD // TODO Suppress cast-align warning - #pragma GCC diagnostic push + if( prev == NULL ) break; + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" ehci_qhd_t* qhd = (ehci_qhd_t*) list_next(prev); #pragma GCC diagnostic pop