diff --git a/pkg/lvgl/include/lv_conf.h b/pkg/lvgl/include/lv_conf.h index 54141430f6..b96c59f814 100644 --- a/pkg/lvgl/include/lv_conf.h +++ b/pkg/lvgl/include/lv_conf.h @@ -22,6 +22,7 @@ extern "C" { #endif #include +#include "lvgl_riot_conf.h" /*==================== Graphical settings @@ -83,9 +84,6 @@ extern "C" { #define LV_DISP_MEDIUM_LIMIT 50 #define LV_DISP_LARGE_LIMIT 70 -/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */ -typedef int16_t lv_coord_t; - /*========================= Memory manager settings *=========================*/ @@ -298,14 +296,6 @@ typedef void * lv_img_decoder_user_data_t; * HAL settings *==================*/ -/* 1: use a custom tick source. - * It removes the need to manually update the tick with `lv_tick_inc`) */ -#define LV_TICK_CUSTOM 1 -#if LV_TICK_CUSTOM == 1 -#define LV_TICK_CUSTOM_INCLUDE "xtimer.h" /*Header for the sys time function*/ -#define LV_TICK_CUSTOM_SYS_TIME_EXPR (xtimer_now_usec() / US_PER_MS) /*Expression evaluating to current systime in ms*/ -#endif /*LV_TICK_CUSTOM*/ - typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/ diff --git a/pkg/lvgl/include/lvgl_riot_conf.h b/pkg/lvgl/include/lvgl_riot_conf.h new file mode 100644 index 0000000000..5b9b4aefc3 --- /dev/null +++ b/pkg/lvgl/include/lvgl_riot_conf.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 Inria + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup pkg_lvgl + * @{ + * + * @file + * @brief Definitions specific to RIOT for the LittlevGL engine + * + * @author Alexandre Abadie + */ + +#ifndef LVGL_RIOT_CONF_H +#define LVGL_RIOT_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */ +typedef int16_t lv_coord_t; + +#define LV_TICK_CUSTOM 1 +#if LV_TICK_CUSTOM == 1 +#define LV_TICK_CUSTOM_INCLUDE "xtimer.h" /*Header for the sys time function*/ +#define LV_TICK_CUSTOM_SYS_TIME_EXPR (xtimer_now_usec() / US_PER_MS) /*Expression evaluating to current systime in ms*/ +#endif /*LV_TICK_CUSTOM*/ + +#ifdef __cplusplus +} +#endif + +#endif /* LVGL_RIOT_CONF_H */