mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-25 18:29:26 +08:00
lv_coord_t: add config option in lv_conf.h
This commit is contained in:
@@ -53,6 +53,9 @@
|
||||
* (Not so important, you can adjust it to modify default sizes and spaces)*/
|
||||
#define LV_DPI 100 /*[px]*/
|
||||
|
||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||
#define LV_COORD_T int32_t
|
||||
|
||||
/*=========================
|
||||
Memory manager settings
|
||||
*=========================*/
|
||||
|
||||
+14
-3
@@ -66,6 +66,11 @@
|
||||
#define LV_DPI 100 /*[px]*/
|
||||
#endif
|
||||
|
||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||
#ifndef LV_COORD_T
|
||||
#define LV_COORD_T int32_t
|
||||
#endif
|
||||
|
||||
/*=========================
|
||||
Memory manager settings
|
||||
*=========================*/
|
||||
@@ -196,19 +201,19 @@
|
||||
|
||||
/* 1: Enable indexed (palette) images */
|
||||
#ifndef LV_IMG_CF_INDEXED
|
||||
#define LV_IMG_CF_INDEXED 1
|
||||
#define LV_IMG_CF_INDEXED 1
|
||||
#endif
|
||||
|
||||
/* 1: Enable alpha indexed images */
|
||||
#ifndef LV_IMG_CF_ALPHA
|
||||
#define LV_IMG_CF_ALPHA 1
|
||||
#define LV_IMG_CF_ALPHA 1
|
||||
#endif
|
||||
|
||||
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
|
||||
|
||||
/*1: Add a `user_data` to drivers and objects*/
|
||||
#ifndef LV_USE_USER_DATA
|
||||
#define LV_USE_USER_DATA 1
|
||||
#define LV_USE_USER_DATA 1
|
||||
#endif
|
||||
|
||||
/*=====================
|
||||
@@ -231,6 +236,12 @@
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
/* Attribute to mark large constant arrays for example
|
||||
* font's bitmaps */
|
||||
#ifndef LV_ATTRIBUTE_LARGE_CONST
|
||||
#define LV_ATTRIBUTE_LARGE_CONST
|
||||
#endif
|
||||
|
||||
/* 1: Variable length array is supported*/
|
||||
#ifndef LV_COMPILER_VLA_SUPPORTED
|
||||
#define LV_COMPILER_VLA_SUPPORTED 1
|
||||
|
||||
@@ -25,13 +25,11 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_COORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
|
||||
#define LV_COORD_MIN (-16384)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef int16_t lv_coord_t;
|
||||
typedef LV_COORD_T lv_coord_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -165,6 +163,10 @@ bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/*To avoid overflow don't let the max ranges (reduce with 1000) */
|
||||
#define LV_COORD_MAX ((lv_coord_t)((uint32_t)((uint32_t)1 << (8 * sizeof(lv_coord_t) - 1)) - 1000))
|
||||
#define LV_COORD_MIN (-LV_COORD_MAX)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -193,8 +193,6 @@ void lv_gauge_set_value(lv_obj_t * gauge, uint8_t needle_id, int16_t value)
|
||||
*/
|
||||
void lv_gauge_set_scale(lv_obj_t * gauge, uint16_t angle, uint8_t line_cnt, uint8_t label_cnt)
|
||||
{
|
||||
/*TODO v6.0: change `line_cnt` to `subdiv_cnt`*/
|
||||
|
||||
lv_lmeter_set_scale(gauge, angle, line_cnt);
|
||||
|
||||
lv_gauge_ext_t * ext = lv_obj_get_ext_attr(gauge);
|
||||
|
||||
+2
-2
@@ -235,7 +235,7 @@ void lv_ta_add_char(lv_obj_t * ta, uint32_t c)
|
||||
return;
|
||||
}
|
||||
|
||||
/*Disable edge flash. If a new line was added it could show edge flash effect*/
|
||||
/*If a new line was added it shouldn't show edge flash effect*/
|
||||
bool edge_flash_en = lv_ta_get_edge_flash(ta);
|
||||
lv_ta_set_edge_flash(ta, false);
|
||||
|
||||
@@ -318,7 +318,7 @@ void lv_ta_add_text(lv_obj_t * ta, const char * txt)
|
||||
return;
|
||||
}
|
||||
|
||||
/*Disable edge flash. If a new line was added it could show edge flash effect*/
|
||||
/*If a new line was added it shouldn't show edge flash effect*/
|
||||
bool edge_flash_en = lv_ta_get_edge_flash(ta);
|
||||
lv_ta_set_edge_flash(ta, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user