lv_hal: use less general structur elements

This commit is contained in:
Gabor Kiss-Vamosi
2017-11-27 00:48:16 +01:00
parent c890dc8d43
commit c9b28c7692
4 changed files with 10 additions and 10 deletions

View File

@@ -112,7 +112,7 @@ lv_disp_t * lv_disp_next(lv_disp_t * disp)
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
{
if(active == NULL) return;
if(active->driver.fill != NULL) active->driver.fill(x1, y1, x2, y2, color);
if(active->driver.fill_fp != NULL) active->driver.fill_fp(x1, y1, x2, y2, color);
}
/**
@@ -126,7 +126,7 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t col
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map)
{
if(active == NULL) return;
if(active->driver.map != NULL) active->driver.map(x1, y1, x2, y2, color_map);
if(active->driver.map_fp != NULL) active->driver.map_fp(x1, y1, x2, y2, color_map);
}
@@ -141,7 +141,7 @@ void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_
void lv_disp_copy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
{
if(active == NULL) return;
if(active->driver.copy != NULL) active->driver.copy(dest, src, length, opa);
if(active->driver.blend_fp != NULL) active->driver.blend_fp(dest, src, length, opa);
}
/**
@@ -150,7 +150,7 @@ void lv_disp_copy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv
*/
bool lv_disp_is_copy_supported(void)
{
if(active->driver.copy) return true;
if(active->driver.blend_fp) return true;
else return false;
}

View File

@@ -32,9 +32,9 @@ extern "C" {
* Display Driver structure to be registered by HAL
*/
typedef struct _disp_drv_t {
void (*fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
void (*map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
void (*copy)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
void (*fill_fp)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
void (*map_fp)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
void (*blend_fp)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
} lv_disp_drv_t;
typedef struct _disp_t {

View File

@@ -91,8 +91,8 @@ bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t *data)
{
bool cont = false;
if(indev->driver.get_data) {
cont = indev->driver.get_data(data);
if(indev->driver.read_fp) {
cont = indev->driver.read_fp(data);
} else {
memset(data, 0, sizeof(lv_indev_data_t));
}

View File

@@ -54,7 +54,7 @@ typedef struct {
/*Initialized by the user and registered by 'lv_indev_add()'*/
typedef struct {
lv_hal_indev_type_t type; /*Input device type*/
bool (*get_data)(lv_indev_data_t *data); /*Function pointer to read data. Return 'true' if there is still data to be read (buffered)*/
bool (*read_fp)(lv_indev_data_t *data); /*Function pointer to read data. Return 'true' if there is still data to be read (buffered)*/
}lv_indev_drv_t;
struct _lv_obj_t;