1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
This commit is contained in:
Gabor Kiss-Vamosi 2019-07-03 06:54:15 +02:00
commit 3a8a004e8b
13 changed files with 36 additions and 89 deletions

View File

@ -40,9 +40,8 @@ LittlevGL provides everything you need to create a Graphical User Interface (GUI
Basically, every modern controller - which is able to drive a display - is suitable to run LittlevGL. The minimal requirements: Basically, every modern controller - which is able to drive a display - is suitable to run LittlevGL. The minimal requirements:
- **16, 32 or 64-bit** microcontroller or processor - **16, 32 or 64-bit** microcontroller or processor
- **> 16 MHz** clock speed - **> 16 MHz** clock speed
- **> 8 kB RAM for static data** and **> 2 KB RAM for dynamic data** (graphical objects) - **> 16 kB RAM** for static data, dynamic data (heap), stack and display buffer (> 32 kB is recommended)
- **> 64 kB flash** program memory - **> 64 kB flash** program memory (> 180 kB is recommended)
- **Optionally ~1/10 screen sized memory** for buffered drawing (on 240 × 320, 16-bit colors it's 15 kB)
Just to mention some **platforms**: Just to mention some **platforms**:
- STM32F1, STM32F3, [STM32F4](https://blog.littlevgl.com/2017-07-15/stm32f429_disco_port), [STM32F7](https://github.com/littlevgl/stm32f746_disco_no_os_sw4stm32) - STM32F1, STM32F3, [STM32F4](https://blog.littlevgl.com/2017-07-15/stm32f429_disco_port), [STM32F7](https://github.com/littlevgl/stm32f746_disco_no_os_sw4stm32)
@ -200,7 +199,7 @@ Check out the [Documentation](https://docs.littlevgl.com/) for more!
### Contributing ### Contributing
To ask questions please use the [Forum](https://forum.littlevgl.com). To ask questions please use the [Forum](https://forum.littlevgl.com).
FOr development related things (bug reports, feature suggestions) use [GitHub's Issue tracker](https://github.com/littlevgl/lvgl/issues). For development related things (bug reports, feature suggestions) use [GitHub's Issue tracker](https://github.com/littlevgl/lvgl/issues).
You can contribute in several ways: You can contribute in several ways:
- **Answer other's question** in the Forum - **Answer other's question** in the Forum
- **Report and/or fix bugs** using the issue tracker and in Pull-request - **Report and/or fix bugs** using the issue tracker and in Pull-request

View File

@ -152,7 +152,7 @@ typedef void * lv_fs_drv_user_data_t;
#endif #endif
/*1: Add a `user_data` to drivers and objects*/ /*1: Add a `user_data` to drivers and objects*/
#define LV_USE_USER_DATA 1 #define LV_USE_USER_DATA 0
/*======================== /*========================
* Image decoder and cache * Image decoder and cache
@ -213,13 +213,14 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
*===============*/ *===============*/
/*1: Enable the log module*/ /*1: Enable the log module*/
#define LV_USE_LOG 1 #define LV_USE_LOG 0
#if LV_USE_LOG #if LV_USE_LOG
/* How important log should be added: /* How important log should be added:
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
* LV_LOG_LEVEL_INFO Log important events * LV_LOG_LEVEL_INFO Log important events
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
* LV_LOG_LEVEL_NONE Do not log anything
*/ */
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
@ -325,7 +326,7 @@ typedef void * lv_obj_user_data_t;
#define LV_USE_BTN 1 #define LV_USE_BTN 1
#if LV_USE_BTN != 0 #if LV_USE_BTN != 0
/*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/ /*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
# define LV_BTN_INK_EFFECT 1 # define LV_BTN_INK_EFFECT 0
#endif #endif
/*Button matrix (dependencies: -)*/ /*Button matrix (dependencies: -)*/

View File

@ -206,7 +206,7 @@
/*1: Add a `user_data` to drivers and objects*/ /*1: Add a `user_data` to drivers and objects*/
#ifndef LV_USE_USER_DATA #ifndef LV_USE_USER_DATA
#define LV_USE_USER_DATA 1 #define LV_USE_USER_DATA 0
#endif #endif
/*======================== /*========================
@ -286,7 +286,7 @@
/*1: Enable the log module*/ /*1: Enable the log module*/
#ifndef LV_USE_LOG #ifndef LV_USE_LOG
#define LV_USE_LOG 1 #define LV_USE_LOG 0
#endif #endif
#if LV_USE_LOG #if LV_USE_LOG
/* How important log should be added: /* How important log should be added:
@ -294,6 +294,7 @@
* LV_LOG_LEVEL_INFO Log important events * LV_LOG_LEVEL_INFO Log important events
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
* LV_LOG_LEVEL_NONE Do not log anything
*/ */
#ifndef LV_LOG_LEVEL #ifndef LV_LOG_LEVEL
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
@ -448,7 +449,7 @@
#if LV_USE_BTN != 0 #if LV_USE_BTN != 0
/*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/ /*Enable button-state animations - draw a circle on click (dependencies: LV_USE_ANIMATION)*/
#ifndef LV_BTN_INK_EFFECT #ifndef LV_BTN_INK_EFFECT
# define LV_BTN_INK_EFFECT 1 # define LV_BTN_INK_EFFECT 0
#endif #endif
#endif #endif

View File

@ -240,36 +240,6 @@ static inline void lv_style_anim_clear_repeat(lv_anim_t * a)
lv_anim_clear_repeat(a); lv_anim_clear_repeat(a);
} }
/**
* Set a user specific data for the animation
* @param a pointer to an initialized `lv_anim_t` variable
* @param user_data the user data
*/
static inline void lv_style_anim_set_user_data(lv_anim_t * a, lv_anim_user_data_t user_data)
{
lv_anim_set_user_data(a, user_data);
}
/**
* Get the user data
* @param a pointer to an initialized `lv_anim_t` variable
* @return the user data
*/
static inline lv_anim_user_data_t lv_style_anim_get_user_data(lv_anim_t * a)
{
return lv_anim_get_user_data(a);
}
/**
* Get pointer to the user data
* @param a pointer to an initialized `lv_anim_t` variable
* @return pointer to the user data
*/
static inline lv_anim_user_data_t * lv_style_anim_get_user_data_ptr(lv_anim_t * a)
{
return lv_anim_get_user_data_ptr(a);
}
/** /**
* Create an animation * Create an animation
* @param a an initialized 'anim_t' variable. Not required after call. * @param a an initialized 'anim_t' variable. Not required after call.

View File

@ -14,6 +14,11 @@
#include "../lv_misc/lv_log.h" #include "../lv_misc/lv_log.h"
#include "../lv_misc/lv_math.h" #include "../lv_misc/lv_math.h"
#include "../lv_misc/lv_mem.h" #include "../lv_misc/lv_mem.h"
#include "../lv_misc/lv_gc.h"
#if defined(LV_GC_INCLUDE)
#include LV_GC_INCLUDE
#endif /* LV_ENABLE_GC */
/********************* /*********************
* DEFINES * DEFINES
@ -30,7 +35,6 @@
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
**********************/ **********************/
static void * draw_buf = NULL;
static uint32_t draw_buf_size = 0; static uint32_t draw_buf_size = 0;
/********************** /**********************
@ -48,21 +52,21 @@ static uint32_t draw_buf_size = 0;
*/ */
void * lv_draw_get_buf(uint32_t size) void * lv_draw_get_buf(uint32_t size)
{ {
if(size <= draw_buf_size) return draw_buf; if(size <= draw_buf_size) return LV_GC_ROOT(_lv_draw_buf);
LV_LOG_TRACE("lv_draw_get_buf: allocate"); LV_LOG_TRACE("lv_draw_get_buf: allocate");
draw_buf_size = size; draw_buf_size = size;
if(draw_buf == NULL) { if(LV_GC_ROOT(_lv_draw_buf) == NULL) {
draw_buf = lv_mem_alloc(size); LV_GC_ROOT(_lv_draw_buf) = lv_mem_alloc(size);
lv_mem_assert(draw_buf); lv_mem_assert(LV_GC_ROOT(_lv_draw_buf));
return draw_buf; return LV_GC_ROOT(_lv_draw_buf);
} }
draw_buf = lv_mem_realloc(draw_buf, size); LV_GC_ROOT(_lv_draw_buf) = lv_mem_realloc(LV_GC_ROOT(_lv_draw_buf), size);
lv_mem_assert(draw_buf); lv_mem_assert(LV_GC_ROOT(_lv_draw_buf));
return draw_buf; return LV_GC_ROOT(_lv_draw_buf);
} }
/** /**
@ -70,9 +74,9 @@ void * lv_draw_get_buf(uint32_t size)
*/ */
void lv_draw_free_buf(void) void lv_draw_free_buf(void)
{ {
if(draw_buf) { if(LV_GC_ROOT(_lv_draw_buf)) {
lv_mem_free(draw_buf); lv_mem_free(LV_GC_ROOT(_lv_draw_buf));
draw_buf = NULL; LV_GC_ROOT(_lv_draw_buf) = NULL;
draw_buf_size = 0; draw_buf_size = 0;
} }
} }

View File

@ -1,4 +1,4 @@
#include "lvgl/lvgl.h" #include "../../lvgl.h"
/******************************************************************************* /*******************************************************************************
* Size: 12 px * Size: 12 px

View File

@ -1,4 +1,4 @@
#include "lvgl/lvgl.h" #include "../../lvgl.h"
/******************************************************************************* /*******************************************************************************
* Size: 16 px * Size: 16 px

View File

@ -1,4 +1,4 @@
#include "lvgl/lvgl.h" #include "../../lvgl.h"
/******************************************************************************* /*******************************************************************************
* Size: 22 px * Size: 22 px

View File

@ -1,4 +1,4 @@
#include "lvgl/lvgl.h" #include "../../lvgl.h"
/******************************************************************************* /*******************************************************************************
* Size: 28 px * Size: 28 px

View File

@ -1,4 +1,4 @@
#include "lvgl/lvgl.h" #include "../../lvgl.h"
/******************************************************************************* /*******************************************************************************
* Size: 8 px * Size: 8 px

View File

@ -222,36 +222,6 @@ static inline void lv_anim_clear_repeat(lv_anim_t * a)
a->repeat = 0; a->repeat = 0;
} }
/**
* Set a user specific data for the animation
* @param a pointer to an initialized `lv_anim_t` variable
* @param user_data the user data
*/
static inline void lv_anim_set_user_data(lv_anim_t * a, lv_anim_user_data_t user_data)
{
memcpy(&a->user_data, &user_data, sizeof(user_data));
}
/**
* Get the user data
* @param a pointer to an initialized `lv_anim_t` variable
* @return the user data
*/
static inline lv_anim_user_data_t lv_anim_get_user_data(lv_anim_t * a)
{
return a->user_data;
}
/**
* Get pointer to the user data
* @param a pointer to an initialized `lv_anim_t` variable
* @return pointer to the user data
*/
static inline lv_anim_user_data_t * lv_anim_get_user_data_ptr(lv_anim_t * a)
{
return &a->user_data;
}
/** /**
* Create an animation * Create an animation
* @param a an initialized 'anim_t' variable. Not required after call. * @param a an initialized 'anim_t' variable. Not required after call.

View File

@ -40,7 +40,8 @@ extern "C" {
prefix lv_ll_t _lv_group_ll; \ prefix lv_ll_t _lv_group_ll; \
prefix lv_ll_t _lv_img_defoder_ll; \ prefix lv_ll_t _lv_img_defoder_ll; \
prefix lv_img_cache_entry_t * _lv_img_cache_array; \ prefix lv_img_cache_entry_t * _lv_img_cache_array; \
prefix void * _lv_task_act; prefix void * _lv_task_act; \
prefix void * _lv_draw_buf;
#define LV_NO_PREFIX #define LV_NO_PREFIX
#define LV_ROOTS LV_GC_ROOTS(LV_NO_PREFIX) #define LV_ROOTS LV_GC_ROOTS(LV_NO_PREFIX)

View File

@ -30,7 +30,8 @@ extern "C" {
#define LV_LOG_LEVEL_INFO 1 /**< Log important events*/ #define LV_LOG_LEVEL_INFO 1 /**< Log important events*/
#define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem*/ #define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem*/
#define LV_LOG_LEVEL_ERROR 3 /**< Only critical issue, when the system may fail*/ #define LV_LOG_LEVEL_ERROR 3 /**< Only critical issue, when the system may fail*/
#define _LV_LOG_LEVEL_NUM 4 /**< Number of log levels */ #define LV_LOG_LEVEL_NONE 4 /**< Do not log anything*/
#define _LV_LOG_LEVEL_NUM 5 /**< Number of log levels */
typedef int8_t lv_log_level_t; typedef int8_t lv_log_level_t;