Skip to content

Commit

Permalink
lv_gpu: fix lvgl#1617 by renaming internal macros
Browse files Browse the repository at this point in the history
This avoids conflicts with STM32Cube.
  • Loading branch information
embeddedt committed Jun 28, 2020
1 parent 92027cc commit 421f1b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/lv_gpu/lv_gpu_stm32_dma2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
10 changes: 5 additions & 5 deletions src/lv_gpu/lv_gpu_stm32_dma2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 421f1b2

Please sign in to comment.