Update lvgl to v8.4.0
This commit is contained in:
@@ -21,7 +21,11 @@
|
||||
#include "../draw/sw/lv_draw_sw.h"
|
||||
#include "../draw/sdl/lv_draw_sdl.h"
|
||||
#include "../draw/stm32_dma2d/lv_gpu_stm32_dma2d.h"
|
||||
#include "../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h"
|
||||
#include "../draw/arm2d/lv_gpu_arm2d.h"
|
||||
#include "../draw/nxp/vglite/lv_draw_vglite.h"
|
||||
#include "../draw/nxp/pxp/lv_draw_pxp.h"
|
||||
#include "../draw/renesas/lv_gpu_d2_ra6m3.h"
|
||||
|
||||
#if LV_USE_THEME_DEFAULT
|
||||
#include "../extra/themes/default/lv_theme_default.h"
|
||||
@@ -88,23 +92,30 @@ void lv_disp_drv_init(lv_disp_drv_t * driver)
|
||||
driver->offset_x = 0;
|
||||
driver->offset_y = 0;
|
||||
driver->antialiasing = LV_COLOR_DEPTH > 8 ? 1 : 0;
|
||||
driver->screen_transp = LV_COLOR_SCREEN_TRANSP;
|
||||
driver->screen_transp = 0;
|
||||
driver->dpi = LV_DPI_DEF;
|
||||
driver->color_chroma_key = LV_COLOR_CHROMA_KEY;
|
||||
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
#if LV_USE_GPU_RA6M3_G2D
|
||||
driver->draw_ctx_init = lv_draw_ra6m3_2d_ctx_init;
|
||||
driver->draw_ctx_deinit = lv_draw_ra6m3_2d_ctx_init;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_ra6m3_dma2d_ctx_t);
|
||||
#elif LV_USE_GPU_STM32_DMA2D
|
||||
driver->draw_ctx_init = lv_draw_stm32_dma2d_ctx_init;
|
||||
driver->draw_ctx_deinit = lv_draw_stm32_dma2d_ctx_init;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_stm32_dma2d_ctx_t);
|
||||
#elif LV_USE_GPU_NXP_PXP
|
||||
driver->draw_ctx_init = lv_draw_nxp_pxp_init;
|
||||
driver->draw_ctx_deinit = lv_draw_nxp_pxp_init;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_nxp_pxp_t);
|
||||
#elif LV_USE_GPU_SWM341_DMA2D
|
||||
driver->draw_ctx_init = lv_draw_swm341_dma2d_ctx_init;
|
||||
driver->draw_ctx_deinit = lv_draw_swm341_dma2d_ctx_init;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_swm341_dma2d_ctx_t);
|
||||
#elif LV_USE_GPU_NXP_VG_LITE
|
||||
driver->draw_ctx_init = lv_draw_nxp_vglite_init;
|
||||
driver->draw_ctx_deinit = lv_draw_nxp_vglite_init;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_nxp_vglite_t);
|
||||
driver->draw_ctx_init = lv_draw_vglite_ctx_init;
|
||||
driver->draw_ctx_deinit = lv_draw_vglite_ctx_deinit;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_vglite_ctx_t);
|
||||
#elif LV_USE_GPU_NXP_PXP
|
||||
driver->draw_ctx_init = lv_draw_pxp_ctx_init;
|
||||
driver->draw_ctx_deinit = lv_draw_pxp_ctx_deinit;
|
||||
driver->draw_ctx_size = sizeof(lv_draw_pxp_ctx_t);
|
||||
#elif LV_USE_GPU_SDL
|
||||
driver->draw_ctx_init = lv_draw_sdl_init_ctx;
|
||||
driver->draw_ctx_deinit = lv_draw_sdl_deinit_ctx;
|
||||
@@ -173,6 +184,10 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
|
||||
|
||||
disp->driver = driver;
|
||||
|
||||
disp->inv_en_cnt = 1;
|
||||
|
||||
_lv_ll_init(&disp->sync_areas, sizeof(lv_area_t));
|
||||
|
||||
lv_disp_t * disp_def_tmp = disp_def;
|
||||
disp_def = disp; /*Temporarily change the default screen to create the default screens on the
|
||||
new display*/
|
||||
@@ -303,6 +318,7 @@ void lv_disp_remove(lv_disp_t * disp)
|
||||
}
|
||||
|
||||
_lv_ll_remove(&LV_GC_ROOT(_lv_disp_ll), disp);
|
||||
_lv_ll_clear(&disp->sync_areas);
|
||||
if(disp->refr_timer) lv_timer_del(disp->refr_timer);
|
||||
lv_mem_free(disp);
|
||||
|
||||
@@ -500,20 +516,8 @@ lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp)
|
||||
* Call in the display driver's `flush_cb` function when the flushing is finished
|
||||
* @param disp_drv pointer to display driver in `flush_cb` where this function is called
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
void LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
{
|
||||
/*If the screen is transparent initialize it when the flushing is ready*/
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
if(disp_drv->screen_transp) {
|
||||
if(disp_drv->clear_cb) {
|
||||
disp_drv->clear_cb(disp_drv, disp_drv->draw_buf->buf_act, disp_drv->draw_buf->size);
|
||||
}
|
||||
else {
|
||||
lv_memset_00(disp_drv->draw_buf->buf_act, disp_drv->draw_buf->size * sizeof(lv_color32_t));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
disp_drv->draw_buf->flushing = 0;
|
||||
disp_drv->draw_buf->flushing_last = 0;
|
||||
}
|
||||
@@ -524,7 +528,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
* @param disp_drv pointer to display driver
|
||||
* @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_drv_t * disp_drv)
|
||||
bool LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_is_last(lv_disp_drv_t * disp_drv)
|
||||
{
|
||||
return disp_drv->draw_buf->flushing_last;
|
||||
}
|
||||
@@ -682,28 +686,35 @@ static void set_px_alpha_generic(lv_img_dsc_t * d, lv_coord_t x, lv_coord_t y, l
|
||||
lv_img_buf_set_px_alpha(d, x, y, br);
|
||||
}
|
||||
|
||||
static void set_px_true_color_alpha(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x,
|
||||
lv_coord_t y,
|
||||
static void set_px_true_color_alpha(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w,
|
||||
lv_coord_t x, lv_coord_t y,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
(void) disp_drv; /*Unused*/
|
||||
|
||||
if(opa <= LV_OPA_MIN) return;
|
||||
lv_img_dsc_t d;
|
||||
d.data = buf;
|
||||
d.header.always_zero = 0;
|
||||
d.header.h = 1; /*Doesn't matter*/;
|
||||
d.header.w = buf_w;
|
||||
d.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
|
||||
uint8_t * buf_px = buf + (buf_w * y * LV_IMG_PX_SIZE_ALPHA_BYTE + x * LV_IMG_PX_SIZE_ALPHA_BYTE);
|
||||
|
||||
lv_color_t bg_color = lv_img_buf_get_px_color(&d, x, y, lv_color_black());
|
||||
lv_opa_t bg_opa = lv_img_buf_get_px_alpha(&d, x, y);
|
||||
|
||||
lv_opa_t res_opa;
|
||||
lv_color_t bg_color;
|
||||
lv_color_t res_color;
|
||||
lv_opa_t bg_opa = buf_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
|
||||
#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
|
||||
bg_color.full = buf_px[0];
|
||||
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[2]);
|
||||
if(buf_px[1] <= LV_OPA_MIN) return;
|
||||
buf_px[0] = res_color.full;
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
bg_color.full = buf_px[0] + (buf_px[1] << 8);
|
||||
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[2]);
|
||||
if(buf_px[2] <= LV_OPA_MIN) return;
|
||||
buf_px[0] = res_color.full & 0xff;
|
||||
buf_px[1] = res_color.full >> 8;
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
bg_color = *((lv_color_t *)buf_px);
|
||||
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[3]);
|
||||
if(buf_px[3] <= LV_OPA_MIN) return;
|
||||
buf_px[0] = res_color.ch.blue;
|
||||
buf_px[1] = res_color.ch.green;
|
||||
buf_px[2] = res_color.ch.red;
|
||||
#endif
|
||||
|
||||
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &res_opa);
|
||||
|
||||
lv_img_buf_set_px_alpha(&d, x, y, res_opa);
|
||||
lv_img_buf_set_px_color(&d, x, y, res_color);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ extern "C" {
|
||||
#include "../misc/lv_area.h"
|
||||
#include "../misc/lv_ll.h"
|
||||
#include "../misc/lv_timer.h"
|
||||
#include "../misc/lv_ll.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -117,7 +118,6 @@ typedef struct _lv_disp_drv_t {
|
||||
|
||||
void (*clear_cb)(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, uint32_t size);
|
||||
|
||||
|
||||
/** OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the
|
||||
* number of flushed pixels*/
|
||||
void (*monitor_cb)(struct _lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px);
|
||||
@@ -173,10 +173,8 @@ typedef struct _lv_disp_t {
|
||||
struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/
|
||||
struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/
|
||||
uint32_t screen_cnt;
|
||||
uint8_t draw_prev_over_act :
|
||||
1; /**< 1: Draw previous screen over active screen*/
|
||||
uint8_t del_prev :
|
||||
1; /**< 1: Automatically delete the previous screen when the screen load animation is ready*/
|
||||
uint8_t draw_prev_over_act : 1; /**< 1: Draw previous screen over active screen*/
|
||||
uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load anim. is ready*/
|
||||
uint8_t rendering_in_progress : 1; /**< 1: The current screen rendering is in progress*/
|
||||
|
||||
lv_opa_t bg_opa; /**<Opacity of the background color or wallpaper*/
|
||||
@@ -187,6 +185,10 @@ uint8_t del_prev :
|
||||
lv_area_t inv_areas[LV_INV_BUF_SIZE];
|
||||
uint8_t inv_area_joined[LV_INV_BUF_SIZE];
|
||||
uint16_t inv_p;
|
||||
int32_t inv_en_cnt;
|
||||
|
||||
/** Double buffer sync areas */
|
||||
lv_ll_t sync_areas;
|
||||
|
||||
/*Miscellaneous data*/
|
||||
uint32_t last_activity_time; /**< Last time when there was activity on this display*/
|
||||
@@ -310,7 +312,6 @@ bool lv_disp_get_antialiasing(lv_disp_t * disp);
|
||||
*/
|
||||
lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp);
|
||||
|
||||
|
||||
/**
|
||||
* Set the rotation of this display.
|
||||
* @param disp pointer to a display (NULL to use the default display)
|
||||
@@ -331,7 +332,7 @@ lv_disp_rot_t lv_disp_get_rotation(lv_disp_t * disp);
|
||||
* Call in the display driver's `flush_cb` function when the flushing is finished
|
||||
* @param disp_drv pointer to display driver in `flush_cb` where this function is called
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
void /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
|
||||
/**
|
||||
* Tell if it's the last area of the refreshing process.
|
||||
@@ -339,7 +340,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
* @param disp_drv pointer to display driver
|
||||
* @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_drv_t * disp_drv);
|
||||
bool /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_is_last(lv_disp_drv_t * disp_drv);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
||||
@@ -40,14 +40,12 @@ extern "C" {
|
||||
*Time between `LV_EVENT_LONG_PRESSED_REPEAT*/
|
||||
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
|
||||
|
||||
|
||||
/*Gesture threshold in pixels*/
|
||||
#define LV_INDEV_DEF_GESTURE_LIMIT 50
|
||||
|
||||
/*Gesture min velocity at release before swipe (pixels)*/
|
||||
#define LV_INDEV_DEF_GESTURE_MIN_VELOCITY 3
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -141,6 +139,7 @@ typedef struct _lv_indev_proc_t {
|
||||
struct {
|
||||
/*Pointer and button data*/
|
||||
lv_point_t act_point; /**< Current point of input device.*/
|
||||
lv_point_t indev_point;
|
||||
lv_point_t last_point; /**< Last point of input device.*/
|
||||
lv_point_t last_raw_point; /**< Last point read from read_cb. */
|
||||
lv_point_t vect; /**< Difference between `act_point` and `last_point`.*/
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period)
|
||||
void LV_ATTRIBUTE_TICK_INC lv_tick_inc(uint32_t tick_period)
|
||||
{
|
||||
tick_irq_flag = 0;
|
||||
sys_time += tick_period;
|
||||
|
||||
@@ -40,7 +40,7 @@ extern "C" {
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
|
||||
void /* LV_ATTRIBUTE_TICK_INC */ lv_tick_inc(uint32_t tick_period);
|
||||
#endif
|
||||
|
||||
//! @endcond
|
||||
|
||||
Reference in New Issue
Block a user