From c19a4ad568fa016ae5f6312795f15c9c56a1d1a7 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 26 Oct 2020 12:40:05 +0100 Subject: [PATCH] lv_conf_checker.py: add auto incude of lv_conf.h if available --- scripts/lv_conf_checker.py | 8 ++++++++ src/lv_conf_internal.h | 15 +++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index 46d227cc2..a29951aae 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -32,6 +32,14 @@ fout.write( #include +#if defined __has_include +# if __has_include("lv_conf.h") +# ifndef LV_CONF_INCLUDE_SIMPLE +# define LV_CONF_INCLUDE_SIMPLE +# endif +# endif +#endif + /*If lv_conf.h is not skipped include it*/ #if !defined(LV_CONF_SKIP) && !defined(CONFIG_LV_CONF_SKIP) # if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index c7263ca8f..df82b5f59 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -8,8 +8,19 @@ #define LV_CONF_INTERNAL_H /* clang-format off */ +/*Handle special Kconfig options*/ +#include "lv_conf_kconfig.h" + #include +#if defined __has_include +# if __has_include("lv_conf.h") +# ifndef LV_CONF_INCLUDE_SIMPLE +# define LV_CONF_INCLUDE_SIMPLE +# endif +# endif +#endif + /*If lv_conf.h is not skipped include it*/ #if !defined(LV_CONF_SKIP) && !defined(CONFIG_LV_CONF_SKIP) # if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/ @@ -25,12 +36,8 @@ # endif #endif - /* clang-format off */ -/*Handle special Kconfig options*/ -#include "lv_conf_kconfig.h" - #include /*====================