From 89044a86491842189321f1823d7953cfdc1ea66b Mon Sep 17 00:00:00 2001 From: Zaltora Date: Sun, 14 Jan 2018 10:23:16 +0100 Subject: [PATCH] Add specific otion for tick function + inline it --- lv_conf_templ.h | 9 +++++++++ lv_hal/lv_hal_tick.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lv_conf_templ.h b/lv_conf_templ.h index e978b35db..7da177ca6 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -8,6 +8,15 @@ #ifndef LV_CONF_H #define LV_CONF_H +/*---------------- + * Compiler attribute + *----------------*/ +/* + * Some Architecture can be customized, like put function or variable + * to a specific memory segment. + */ +#define LV_TICK_ATTRIBUTE /* Define a custom attribute to Tick function */ + /*---------------- * Dynamic memory *----------------*/ diff --git a/lv_hal/lv_hal_tick.c b/lv_hal/lv_hal_tick.c index 44576f31d..ee4a2a4b4 100644 --- a/lv_hal/lv_hal_tick.c +++ b/lv_hal/lv_hal_tick.c @@ -8,6 +8,7 @@ *********************/ #include "lv_hal_tick.h" #include +#include "../../lv_conf.h" /********************* * DEFINES @@ -39,7 +40,7 @@ static volatile uint8_t tick_irq_flag; * You have to call this function periodically * @param tick_period the call period of this function in milliseconds */ -void lv_tick_inc(uint32_t tick_period) +inline void LV_TICK_ATTRIBUTE lv_tick_inc(uint32_t tick_period) { tick_irq_flag = 0; sys_time += tick_period;