Merge pull request #5339 from mysterywolf/469

[stm32][f469]update lvgl demo
This commit is contained in:
guo 2021-12-07 09:38:30 +08:00 committed by GitHub
commit be089df128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 13 deletions

View File

@ -10,7 +10,7 @@
#include <rtthread.h> #include <rtthread.h>
#include <lvgl.h> #include <lvgl.h>
#include <lv_port_indev.h> #include <lv_port_indev.h>
#define DBG_TAG "LVGL" #define DBG_TAG "LVGL.demo"
#define DBG_LVL DBG_INFO #define DBG_LVL DBG_INFO
#include <rtdbg.h> #include <rtdbg.h>

View File

@ -11,13 +11,13 @@
#include <lcd_port.h> #include <lcd_port.h>
//#define DRV_DEBUG //#define DRV_DEBUG
#define LOG_TAG "lvgl.disp" #define LOG_TAG "LVGL.port.disp"
#include <drv_log.h> #include <drv_log.h>
/*A static or global variable to store the buffers*/ /*A static or global variable to store the buffers*/
static lv_disp_draw_buf_t disp_buf; 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 struct rt_device_graphic_info info;
static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ 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) if(y_fill_act > y2_fill)
{ {
lv_disp_flush_ready(&disp_drv); lv_disp_flush_ready(&disp_drv);
} }
else 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], (uint32_t)&((uint32_t *)info.framebuffer)[y_fill_act * info.width + x1_flush],
(x2_flush - x1_flush + 1)) != HAL_OK) (x2_flush - x1_flush + 1)) != HAL_OK)
{ {
LOG_E("lvgl dma start error"); LOG_E("HAL_DMA_Start_IT error");
while(1); RT_ASSERT(0);
} }
} }
} }
static void DMA_TransferError(DMA_HandleTypeDef *han) static void DMA_TransferError(DMA_HandleTypeDef *han)
{ {
LOG_E("dma transfer error"); LOG_E("DMA_TransferError");
while(1); RT_ASSERT(0);
} }
void DMA_STREAM_IRQHANDLER(void) void DMA_STREAM_IRQHANDLER(void)
@ -95,7 +95,8 @@ static void lvgl_dma_config(void)
if (HAL_DMA_Init(&DmaHandle) != HAL_OK) 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); 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], (uint32_t)&((uint32_t *)info.framebuffer)[y_fill_act * info.width + x1_flush],
(x2_flush - x1_flush + 1)) != HAL_OK) (x2_flush - x1_flush + 1)) != HAL_OK)
{ {
LOG_E("dma start it error"); LOG_E("HAL_DMA_Start_IT error");
while(1); RT_ASSERT(0);
} }
} }

View File

@ -37,7 +37,7 @@ void lv_port_indev_init(void)
{ {
static lv_indev_drv_t indev_drv; 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.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = input_read; indev_drv.read_cb = input_read;

View File

@ -11,7 +11,7 @@
#include <lvgl.h> #include <lvgl.h>
#include <lv_port_indev.h> #include <lv_port_indev.h>
#include <lv_demo_calendar.h> #include <lv_demo_calendar.h>
#define DBG_TAG "LVGL" #define DBG_TAG "LVGL.demo"
#define DBG_LVL DBG_INFO #define DBG_LVL DBG_INFO
#include <rtdbg.h> #include <rtdbg.h>