From 77dc58534aa4d3603b84c979a780167d342e9c0b Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 6 Dec 2021 09:33:04 -0500 Subject: [PATCH] [stm32][f469]update lvgl demo --- .../board/ports/lvgl/lv_demo.c | 2 +- .../board/ports/lvgl/lv_port_disp.c | 21 ++++++++++--------- .../board/ports/lvgl/lv_port_indev.c | 2 +- .../board/ports/lvgl/lv_demo.c | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_demo.c b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_demo.c index c4818399f3..17d01e09cc 100644 --- a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_demo.c +++ b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_demo.c @@ -10,7 +10,7 @@ #include #include #include -#define DBG_TAG "LVGL" +#define DBG_TAG "LVGL.demo" #define DBG_LVL DBG_INFO #include diff --git a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_disp.c b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_disp.c index 4a3ea2601b..1d0c35e158 100644 --- a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_disp.c +++ b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_disp.c @@ -11,13 +11,13 @@ #include //#define DRV_DEBUG -#define LOG_TAG "lvgl.disp" +#define LOG_TAG "LVGL.port.disp" #include /*A static or global variable to store the buffers*/ static lv_disp_draw_buf_t disp_buf; -rt_device_t lcd_device = 0; +static rt_device_t lcd_device = RT_NULL; static struct rt_device_graphic_info info; static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ @@ -41,7 +41,7 @@ static void DMA_TransferComplete(DMA_HandleTypeDef *han) if(y_fill_act > y2_fill) { - lv_disp_flush_ready(&disp_drv); + lv_disp_flush_ready(&disp_drv); } else { @@ -51,16 +51,16 @@ static void DMA_TransferComplete(DMA_HandleTypeDef *han) (uint32_t)&((uint32_t *)info.framebuffer)[y_fill_act * info.width + x1_flush], (x2_flush - x1_flush + 1)) != HAL_OK) { - LOG_E("lvgl dma start error"); - while(1); + LOG_E("HAL_DMA_Start_IT error"); + RT_ASSERT(0); } } } static void DMA_TransferError(DMA_HandleTypeDef *han) { - LOG_E("dma transfer error"); - while(1); + LOG_E("DMA_TransferError"); + RT_ASSERT(0); } void DMA_STREAM_IRQHANDLER(void) @@ -95,7 +95,8 @@ static void lvgl_dma_config(void) if (HAL_DMA_Init(&DmaHandle) != HAL_OK) { - while(1); + LOG_E("HAL_DMA_Init error"); + RT_ASSERT(0); } HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_CPLT_CB_ID, DMA_TransferComplete); @@ -130,8 +131,8 @@ static void lcd_fb_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_colo (uint32_t)&((uint32_t *)info.framebuffer)[y_fill_act * info.width + x1_flush], (x2_flush - x1_flush + 1)) != HAL_OK) { - LOG_E("dma start it error"); - while(1); + LOG_E("HAL_DMA_Start_IT error"); + RT_ASSERT(0); } } diff --git a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_indev.c b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_indev.c index b190a32a91..50022c4edb 100644 --- a/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_indev.c +++ b/bsp/stm32/stm32f469-st-disco/board/ports/lvgl/lv_port_indev.c @@ -37,7 +37,7 @@ void lv_port_indev_init(void) { static lv_indev_drv_t indev_drv; - lv_indev_drv_init(&indev_drv); /*Basic initialization*/ + lv_indev_drv_init(&indev_drv); /*Basic initialization*/ indev_drv.type = LV_INDEV_TYPE_POINTER; indev_drv.read_cb = input_read; diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c index c8d09a8e94..d72e6ae7ba 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c @@ -11,7 +11,7 @@ #include #include #include -#define DBG_TAG "LVGL" +#define DBG_TAG "LVGL.demo" #define DBG_LVL DBG_INFO #include