From 421f1b2c0122c7354e9b47708984b3ee23ac77d0 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Sun, 28 Jun 2020 09:16:25 -0400 Subject: [PATCH] lv_gpu: fix #1617 by renaming internal macros This avoids conflicts with STM32Cube. --- src/lv_gpu/lv_gpu_stm32_dma2d.c | 12 ++++++------ src/lv_gpu/lv_gpu_stm32_dma2d.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.c b/src/lv_gpu/lv_gpu_stm32_dma2d.c index 086f27753..9810587dd 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.c +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.c @@ -27,9 +27,9 @@ #endif #if LV_COLOR_DEPTH == 16 - #define DMA2D_COLOR_FORMAT DMA2D_RGB565 + #define LV_DMA2D_COLOR_FORMAT LV_DMA2D_RGB565 #elif LV_COLOR_DEPTH == 32 - #define DMA2D_COLOR_FORMAT DMA2D_ARGB8888 + #define LV_DMA2D_COLOR_FORMAT LV_DMA2D_ARGB8888 #else /*Can't use GPU with other formats*/ #endif @@ -68,7 +68,7 @@ void lv_gpu_stm32_dma2d_init(void) volatile uint32_t temp = RCC->AHB1ENR; /* set output colour mode */ - DMA2D->OPFCCR = DMA2D_COLOR_FORMAT; + DMA2D->OPFCCR = LV_DMA2D_COLOR_FORMAT; } /** @@ -160,7 +160,7 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_ DMA2D->CR = 0; /* copy output colour mode, this register controls both input and output colour format */ - DMA2D->FGPFCCR = DMA2D_COLOR_FORMAT; + DMA2D->FGPFCCR = LV_DMA2D_COLOR_FORMAT; DMA2D->FGMAR = (uint32_t)map; DMA2D->FGOR = map_w - copy_w; DMA2D->OMAR = (uint32_t)buf; @@ -189,11 +189,11 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color invalidate_cache(); DMA2D->CR = 0x20000; - DMA2D->BGPFCCR = DMA2D_COLOR_FORMAT; + DMA2D->BGPFCCR = LV_DMA2D_COLOR_FORMAT; DMA2D->BGMAR = (uint32_t)buf; DMA2D->BGOR = buf_w - copy_w; - DMA2D->FGPFCCR = (uint32_t)DMA2D_COLOR_FORMAT + DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT /* alpha mode 2, replace with foreground * alpha value */ | (2 << DMA2D_FGPFCCR_AM_Pos) /* alpha value */ diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.h b/src/lv_gpu/lv_gpu_stm32_dma2d.h index d3da2a846..9f244a603 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.h +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.h @@ -20,11 +20,11 @@ extern "C" { * DEFINES *********************/ -#define DMA2D_ARGB8888 0 -#define DMA2D_RGB888 1 -#define DMA2D_RGB565 2 -#define DMA2D_ARGB1555 3 -#define DMA2D_ARGB4444 4 +#define LV_DMA2D_ARGB8888 0 +#define LV_DMA2D_RGB888 1 +#define LV_DMA2D_RGB565 2 +#define LV_DMA2D_ARGB1555 3 +#define LV_DMA2D_ARGB4444 4 /********************** * TYPEDEFS