From 3e32cfa0411dacf053ce41a3708465594390a6a0 Mon Sep 17 00:00:00 2001 From: "C.S.M" Date: Mon, 10 Aug 2026 15:03:18 +0800 Subject: [PATCH] fix(uhci): use UHCI_ALIGN_UP instead of ESP_ALIGN_UP on release branch ESP_ALIGN_UP is not available on release/v6.1; restore the local macro. Co-authored-by: Cursor --- components/esp_driver_uart/src/uhci.c | 3 +-- components/esp_driver_uart/src/uhci_private.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_driver_uart/src/uhci.c b/components/esp_driver_uart/src/uhci.c index c2b1b1d5c16..90d3bf63ff0 100644 --- a/components/esp_driver_uart/src/uhci.c +++ b/components/esp_driver_uart/src/uhci.c @@ -16,7 +16,6 @@ #include "esp_attr.h" #include "esp_log.h" #include "esp_check.h" -#include "esp_macros.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "freertos/queue.h" @@ -135,7 +134,7 @@ static bool uhci_gdma_rx_callback_done(gdma_channel_handle_t dma_chan, gdma_even // Round the invalidate size up to a full cache line. Each node buffer is itself cache-line // aligned and a whole multiple of the cache line, so the extra bytes stay inside this same // node buffer (never a neighbor) and only discard DMA scratch past the frame end. - sync_size = ESP_ALIGN_UP(rx_size, cache_line); + sync_size = UHCI_ALIGN_UP(rx_size, cache_line); } uhci_rx_event_data_t evt_data = { diff --git a/components/esp_driver_uart/src/uhci_private.h b/components/esp_driver_uart/src/uhci_private.h index b61be21ff12..76e706f62fd 100644 --- a/components/esp_driver_uart/src/uhci_private.h +++ b/components/esp_driver_uart/src/uhci_private.h @@ -22,6 +22,7 @@ extern "C" { typedef struct uhci_controller_t uhci_controller_t; +#define UHCI_ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #define UHCI_MAX(a, b) (((a)>(b))?(a):(b)) #define UHCI_PM_LOCK_NAME_LEN_MAX 16