mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
Merge pull request #1252 from littlevgl/embeddedt_fix_7_warnings
Fix some more warnings in dev-7.0
This commit is contained in:
commit
5844319017
@ -46,13 +46,13 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
|||||||
|
|
||||||
#ifndef LV_DEBUG_ASSERT
|
#ifndef LV_DEBUG_ASSERT
|
||||||
#define LV_DEBUG_ASSERT(expr, msg, value) \
|
#define LV_DEBUG_ASSERT(expr, msg, value) \
|
||||||
{ \
|
do { \
|
||||||
if(!(expr)) { \
|
if(!(expr)) { \
|
||||||
LV_LOG_ERROR(__func__); \
|
LV_LOG_ERROR(__func__); \
|
||||||
lv_debug_log_error(msg, (unsigned long int)value); \
|
lv_debug_log_error(msg, (unsigned long int)value); \
|
||||||
while(1); \
|
while(1); \
|
||||||
} \
|
} \
|
||||||
}
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------
|
/*----------------
|
||||||
|
@ -377,7 +377,8 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lv_img_rotate_dsc_t rotate_dsc = {};
|
lv_img_rotate_dsc_t rotate_dsc;
|
||||||
|
memset(&rotate_dsc, 0, sizeof(lv_img_rotate_dsc_t));
|
||||||
if(angle) {
|
if(angle) {
|
||||||
lv_img_cf_t cf = LV_IMG_CF_TRUE_COLOR;
|
lv_img_cf_t cf = LV_IMG_CF_TRUE_COLOR;
|
||||||
if(alpha_byte) cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
|
if(alpha_byte) cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "lv_draw_mask.h"
|
#include "lv_draw_mask.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
#include "../lv_misc/lv_log.h"
|
#include "../lv_misc/lv_log.h"
|
||||||
|
#include "../lv_core/lv_debug.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@ -222,6 +223,17 @@ void lv_draw_mask_angle_init(lv_draw_mask_param_t * param, lv_coord_t origo_x, l
|
|||||||
lv_draw_mask_line_side_t start_side;
|
lv_draw_mask_line_side_t start_side;
|
||||||
lv_draw_mask_line_side_t end_side;
|
lv_draw_mask_line_side_t end_side;
|
||||||
|
|
||||||
|
/* Constrain the input angles */
|
||||||
|
if(start_angle < 0)
|
||||||
|
start_angle = 0;
|
||||||
|
else if(start_angle > 359)
|
||||||
|
start_angle = 359;
|
||||||
|
|
||||||
|
if(end_angle < 0)
|
||||||
|
end_angle = 0;
|
||||||
|
else if(end_angle > 359)
|
||||||
|
end_angle = 359;
|
||||||
|
|
||||||
if(end_angle < start_angle) {
|
if(end_angle < start_angle) {
|
||||||
p->delta_deg = 360 - start_angle + end_angle;
|
p->delta_deg = 360 - start_angle + end_angle;
|
||||||
} else {
|
} else {
|
||||||
@ -239,6 +251,8 @@ void lv_draw_mask_angle_init(lv_draw_mask_param_t * param, lv_coord_t origo_x, l
|
|||||||
}
|
}
|
||||||
else if(start_angle >= 180 && start_angle < 360) {
|
else if(start_angle >= 180 && start_angle < 360) {
|
||||||
start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT;
|
start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT;
|
||||||
|
} else {
|
||||||
|
LV_DEBUG_ASSERT(false, "Unexpected start_angle", start_angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(end_angle >= 0 && end_angle < 180) {
|
if(end_angle >= 0 && end_angle < 180) {
|
||||||
@ -246,6 +260,8 @@ void lv_draw_mask_angle_init(lv_draw_mask_param_t * param, lv_coord_t origo_x, l
|
|||||||
}
|
}
|
||||||
else if(end_angle >= 180 && end_angle < 360) {
|
else if(end_angle >= 180 && end_angle < 360) {
|
||||||
end_side = LV_DRAW_MASK_LINE_SIDE_LEFT;
|
end_side = LV_DRAW_MASK_LINE_SIDE_LEFT;
|
||||||
|
} else {
|
||||||
|
LV_DEBUG_ASSERT(false, "Unexpected end_angle", end_angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_mask_line_angle_init((lv_draw_mask_param_t*)&p->start_line, origo_x, origo_y, start_angle, start_side);
|
lv_draw_mask_line_angle_init((lv_draw_mask_param_t*)&p->start_line, origo_x, origo_y, start_angle, start_side);
|
||||||
|
@ -154,7 +154,14 @@ typedef struct {
|
|||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate an image buffer in RAM
|
||||||
|
* @param w width of image
|
||||||
|
* @param h height of image
|
||||||
|
* @param cf a color format (`LV_IMG_CF_...`)
|
||||||
|
* @return an allocated image, or NULL on failure
|
||||||
|
*/
|
||||||
|
lv_img_dsc_t *lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color of an image's pixel
|
* Get the color of an image's pixel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user