mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 20:57:01 +08:00
lv_coord_t: use typdef in lv_conf.h
This commit is contained in:
+3
-1
@@ -13,6 +13,8 @@
|
|||||||
#define LV_CONF_H
|
#define LV_CONF_H
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
Graphical settings
|
Graphical settings
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -54,7 +56,7 @@
|
|||||||
#define LV_DPI 100 /*[px]*/
|
#define LV_DPI 100 /*[px]*/
|
||||||
|
|
||||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
||||||
#define LV_COORD_T int32_t
|
typedef int16_t lv_coord_t;
|
||||||
|
|
||||||
/*=========================
|
/*=========================
|
||||||
Memory manager settings
|
Memory manager settings
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#define LV_CONF_CHECKER_H
|
#define LV_CONF_CHECKER_H
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
Graphical settings
|
Graphical settings
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -67,9 +69,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
/* 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
|
Memory manager settings
|
||||||
|
|||||||
@@ -25,11 +25,13 @@ extern "C" {
|
|||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
/*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)
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
typedef LV_COORD_T lv_coord_t;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -163,10 +165,6 @@ bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p);
|
|||||||
* MACROS
|
* 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
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user