diff --git a/components/esp_driver_uart/src/uhci.c b/components/esp_driver_uart/src/uhci.c index 3366fb1519c..41108fcb26e 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" @@ -136,7 +135,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 b6526867119..521d18c52ff 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