Sometimes it’s often unclear which version of the graphics library the configuration file matches.
It’s not a big problem, but it can be improved.
Like:
/**
* @file lv_conf.h
* @version 6.1.1
*
*/
Sometimes it’s often unclear which version of the graphics library the configuration file matches.
It’s not a big problem, but it can be improved.
Like:
/**
* @file lv_conf.h
* @version 6.1.1
*
*/
It would be a great improvement!
I think we could do even better: instead of just adding a @version
tag for Doxygen/a human, we could (also) add LV_CONF_REQUIRED_API_LEVEL
and LV_CONF_FILE_API_LEVEL
defines (the names could be changed).
LV_CONF_REQUIRED_API_LEVEL
would be part of LittlevGL itself, and would be incremented whenever someone needed to resync their lv_conf.h
file with the template.LV_CONF_FILE_API_LEVEL
would be inside lv_conf.h
and lv_conf_template.h
and would denote the lv_conf
API level that file supported.@kisvegabor Do you think this would be a worthwhile change?
Very good. Your proposal is better.
I found a similar defines in the example.It should also apply to configuration files
/*********************
* DEFINES
*********************/
/*Test lvgl version*/
#define LV_EXAMPLES_LVGL_REQ_MAJOR 6
#define LV_EXAMPLES_LVGL_REQ_MINOR 0
#define LV_EXAMPLES_LVGL_REQ_PATCH 0
#if LV_EXAMPLES_LVGL_REQ_MAJOR != LVGL_VERSION_MAJOR
#error "lv_examples: Wrong lvgl major version"
#endif
#if LV_EXAMPLES_LVGL_REQ_MINOR > LVGL_VERSION_MINOR
#error "lv_examples: Wrong lvgl minor version"
#endif
#if LV_EXAMPLES_LVGL_REQ_PATCH > LVGL_VERSION_PATCH
#error "lv_examples: Wrong lvgl bug fix version"
#endif
Sounds good!
In the rework-7
branch of lv_examples
is changed it like this.
The only problem I see is from lv_conf.h
you don’t see the defines in lvgl.h
or other places (e.g. LVGL_VERSIONS_MAJOR
) because always lv_conf.h
is the first include.