mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
multi-disp: minor updates
This commit is contained in:
parent
b15ffa3d89
commit
7571bedc46
@ -52,6 +52,18 @@ void lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num)
|
|||||||
else disp->inv_p -= num;
|
else disp->inv_p -= num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr)
|
||||||
|
{
|
||||||
|
lv_disp_t * old_disp = lv_scr_get_disp(scr);
|
||||||
|
|
||||||
|
if(old_disp == disp) {
|
||||||
|
LV_LOG_WARN("lv_disp_assign_screen: tried to assign to the same screen")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_ll_chg_list(&old_disp->scr_ll, &disp->scr_ll, scr);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
@ -14,6 +14,7 @@ extern "C" {
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "../lv_hal/lv_hal.h"
|
#include "../lv_hal/lv_hal.h"
|
||||||
|
#include "lv_obj.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@ -26,6 +27,7 @@ extern "C" {
|
|||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
void lv_disp_assign_screen(lv_disp_t * disp, lv_obj_t * scr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of areas in the buffer
|
* Get the number of areas in the buffer
|
||||||
|
@ -111,7 +111,7 @@ void lv_vdb_flush(void)
|
|||||||
|
|
||||||
/*Flush the rendered content to the display*/
|
/*Flush the rendered content to the display*/
|
||||||
lv_disp_t * disp = lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = lv_refr_get_disp_refreshing();
|
||||||
if(disp->driver.disp_flush) disp->driver.disp_flush(vdb_act->area.x1, vdb_act->area.y1, vdb_act->area.x2, vdb_act->area.y2, vdb_act->buf);
|
if(disp->driver.disp_flush) disp->driver.disp_flush(disp, &vdb_act->area, vdb_act->buf);
|
||||||
|
|
||||||
|
|
||||||
#if LV_VDB_DOUBLE
|
#if LV_VDB_DOUBLE
|
||||||
|
@ -33,6 +33,8 @@ extern "C" {
|
|||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
struct _disp_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display Driver structure to be registered by HAL
|
* Display Driver structure to be registered by HAL
|
||||||
*/
|
*/
|
||||||
@ -42,7 +44,7 @@ typedef struct _disp_drv_t {
|
|||||||
lv_coord_t ver_res;
|
lv_coord_t ver_res;
|
||||||
|
|
||||||
/*Write the internal buffer (VDB) to the display. 'lv_flush_ready()' has to be called when finished*/
|
/*Write the internal buffer (VDB) to the display. 'lv_flush_ready()' has to be called when finished*/
|
||||||
void (*disp_flush)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
void (*disp_flush)(struct _disp_t * disp, const lv_area_t * area, lv_color_t * color_p);
|
||||||
|
|
||||||
/*Fill an area with a color on the display*/
|
/*Fill an area with a color on the display*/
|
||||||
void (*disp_fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
void (*disp_fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
||||||
@ -68,15 +70,16 @@ typedef struct _disp_drv_t {
|
|||||||
struct _lv_obj_t;
|
struct _lv_obj_t;
|
||||||
|
|
||||||
typedef struct _disp_t {
|
typedef struct _disp_t {
|
||||||
|
void * user_data;
|
||||||
lv_disp_drv_t driver;
|
lv_disp_drv_t driver;
|
||||||
lv_area_t inv_areas[LV_INV_BUF_SIZE];
|
|
||||||
uint8_t inv_area_joined[LV_INV_BUF_SIZE];
|
|
||||||
uint16_t inv_p;
|
|
||||||
lv_ll_t scr_ll;
|
lv_ll_t scr_ll;
|
||||||
struct _lv_obj_t * act_scr;
|
struct _lv_obj_t * act_scr;
|
||||||
struct _lv_obj_t * top_layer;
|
struct _lv_obj_t * top_layer;
|
||||||
struct _lv_obj_t * sys_layer;
|
struct _lv_obj_t * sys_layer;
|
||||||
uint8_t orientation:2;
|
lv_area_t inv_areas[LV_INV_BUF_SIZE];
|
||||||
|
uint8_t inv_area_joined[LV_INV_BUF_SIZE];
|
||||||
|
uint16_t inv_p :10;
|
||||||
|
uint16_t orientation :2;
|
||||||
} lv_disp_t;
|
} lv_disp_t;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user