lvgl.h: Add lv_version functions (#1973)

These static inline functions return the values of the VERSION macros, making them available for Micropython

See also https://github.com/lvgl/lv_examples/pull/85#issuecomment-749506978
This commit is contained in:
Amir Gonnen
2020-12-23 16:25:06 +02:00
committed by GitHub
parent 53fd7ec37b
commit f532be9051

23
lvgl.h
View File

@@ -121,6 +121,29 @@ extern "C" {
* */
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
/**
* Wrapper functions for VERSION macros
*/
static inline int lv_version_major()
{
return LVGL_VERSION_MAJOR;
}
static inline int lv_version_minor()
{
return LVGL_VERSION_MINOR;
}
static inline int lv_version_patch()
{
return LVGL_VERSION_PATCH;
}
static inline const char *lv_version_info()
{
return LVGL_VERSION_INFO;
}
#ifdef __cplusplus
}