fix(config): remove LV_DISP_DEF_REFR_PERIOD related stuff (#3512)
* fix(config): remove LV_DISP_DEF_REFR_PERIOD related stuff Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> * fix(config): remove LV_INDEV_DEF_READ_PERIOD related stuff Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
10
Kconfig
10
Kconfig
@@ -89,16 +89,6 @@ menu "LVGL configuration"
|
|||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "HAL Settings"
|
menu "HAL Settings"
|
||||||
config LV_DISP_DEF_REFR_PERIOD
|
|
||||||
int "Default display refresh period (ms)."
|
|
||||||
default 30
|
|
||||||
help
|
|
||||||
Can be changed in the display driver (`lv_disp_drv_t`).
|
|
||||||
|
|
||||||
config LV_INDEV_DEF_READ_PERIOD
|
|
||||||
int "Input device read period [ms]."
|
|
||||||
default 30
|
|
||||||
|
|
||||||
config LV_TICK_CUSTOM
|
config LV_TICK_CUSTOM
|
||||||
bool "Use a custom tick source"
|
bool "Use a custom tick source"
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ LVGL refreshes the screen in the following steps:
|
|||||||
- Objects completely out of their parent are not added.
|
- Objects completely out of their parent are not added.
|
||||||
- Areas partially out of the parent are cropped to the parent's area.
|
- Areas partially out of the parent are cropped to the parent's area.
|
||||||
- Objects on other screens are not added.
|
- Objects on other screens are not added.
|
||||||
3. In every `LV_DISP_DEF_REFR_PERIOD` (set in `lv_conf.h`) the following happens:
|
3. In every `LV_DEF_REFR_PERIOD` (set in `lv_hal_disp.h`) the following happens:
|
||||||
- LVGL checks the invalid areas and joins those that are adjacent or intersecting.
|
- LVGL checks the invalid areas and joins those that are adjacent or intersecting.
|
||||||
- Takes the first joined area, if it's smaller than the *draw buffer*, then simply renders the area's content into the *draw buffer*.
|
- Takes the first joined area, if it's smaller than the *draw buffer*, then simply renders the area's content into the *draw buffer*.
|
||||||
If the area doesn't fit into the buffer, draw as many lines as possible to the *draw buffer*.
|
If the area doesn't fit into the buffer, draw as many lines as possible to the *draw buffer*.
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ Display rotation can also be changed at runtime using the `lv_disp_set_rotation(
|
|||||||
Support for software rotation is a new feature, so there may be some glitches/bugs depending on your configuration. If you encounter a problem please open an issue on [GitHub](https://github.com/lvgl/lvgl/issues).
|
Support for software rotation is a new feature, so there may be some glitches/bugs depending on your configuration. If you encounter a problem please open an issue on [GitHub](https://github.com/lvgl/lvgl/issues).
|
||||||
|
|
||||||
### Decoupling the display refresh timer
|
### Decoupling the display refresh timer
|
||||||
Normally the dirty (a.k.a invalid) areas are checked and redrawn in every `LV_DISP_DEF_REFR_PERIOD` milliseconds (set in `lv_conf.h`).
|
Normally the dirty (a.k.a invalid) areas are checked and redrawn in every `LV_DEF_REFR_PERIOD` milliseconds (set in `lv_hal_disp.h`).
|
||||||
However, in some cases you might need more control on when the display refreshing happen, for example to synchronize rendering with VSYNC or the TE signal.
|
However, in some cases you might need more control on when the display refreshing happen, for example to synchronize rendering with VSYNC or the TE signal.
|
||||||
|
|
||||||
You can do this in the following way:
|
You can do this in the following way:
|
||||||
@@ -225,7 +225,7 @@ If you have multiple displays call `lv_disp_set_deafult(disp1);` to select the d
|
|||||||
|
|
||||||
Note that `lv_timer_handler()` and `_lv_disp_refr_timer()` can not run at the same time.
|
Note that `lv_timer_handler()` and `_lv_disp_refr_timer()` can not run at the same time.
|
||||||
|
|
||||||
If the performance monitor is enabled, the value of `LV_DISP_DEF_REFR_PERIOD` needs to be set to be consistent with the refresh period of the display to ensure that the statistical results are correct.
|
If the performance monitor is enabled, the value of `LV_DEF_REFR_PERIOD` needs to be set to be consistent with the refresh period of the display to ensure that the statistical results are correct.
|
||||||
|
|
||||||
## Further reading
|
## Further reading
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ The default value of the following parameters can be changed in `lv_indev_drv_t`
|
|||||||
- `scroll_throw` Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down.
|
- `scroll_throw` Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down.
|
||||||
- `long_press_time` Press time to send `LV_EVENT_LONG_PRESSED` (in milliseconds)
|
- `long_press_time` Press time to send `LV_EVENT_LONG_PRESSED` (in milliseconds)
|
||||||
- `long_press_rep_time` Interval of sending `LV_EVENT_LONG_PRESSED_REPEAT` (in milliseconds)
|
- `long_press_rep_time` Interval of sending `LV_EVENT_LONG_PRESSED_REPEAT` (in milliseconds)
|
||||||
- `read_timer` pointer to the `lv_timer` which reads the input device. Its parameters can be changed by `lv_timer_...()` functions. `LV_INDEV_DEF_READ_PERIOD` in `lv_conf.h` sets the default read period.
|
- `read_timer` pointer to the `lv_timer` which reads the input device. Its parameters can be changed by `lv_timer_...()` functions. `LV_DEF_REFR_PERIOD` in `lv_hal_disp.h` sets the default read period.
|
||||||
|
|
||||||
### Feedback
|
### Feedback
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ while(1) {
|
|||||||
|
|
||||||
You should also add the following lines to your input device read function to signal a wake-up (press, touch or click etc.) has happened:
|
You should also add the following lines to your input device read function to signal a wake-up (press, touch or click etc.) has happened:
|
||||||
```c
|
```c
|
||||||
lv_tick_inc(LV_DISP_DEF_REFR_PERIOD); /*Force task execution on wake-up*/
|
lv_tick_inc(LV_DEF_REFR_PERIOD); /*Force task execution on wake-up*/
|
||||||
timer_start(); /*Restart the timer where lv_tick_inc() is called*/
|
timer_start(); /*Restart the timer where lv_tick_inc() is called*/
|
||||||
lv_task_handler(); /*Call `lv_task_handler()` manually to process the wake-up event*/
|
lv_task_handler(); /*Call `lv_task_handler()` manually to process the wake-up event*/
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -62,12 +62,6 @@
|
|||||||
HAL SETTINGS
|
HAL SETTINGS
|
||||||
*====================*/
|
*====================*/
|
||||||
|
|
||||||
/*Default display refresh period. LVG will redraw changed areas with this period time*/
|
|
||||||
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
|
|
||||||
|
|
||||||
/*Input device read period in milliseconds*/
|
|
||||||
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
|
|
||||||
|
|
||||||
/*Use a custom tick source that tells the elapsed time in milliseconds.
|
/*Use a custom tick source that tells the elapsed time in milliseconds.
|
||||||
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
|
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
|
||||||
#ifdef __PERF_COUNTER__
|
#ifdef __PERF_COUNTER__
|
||||||
|
|||||||
@@ -36,10 +36,6 @@
|
|||||||
#define LV_TICK_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE
|
#define LV_TICK_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE
|
||||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (rt_tick_get_millisecond()) /*Expression evaluating to current system time in ms*/
|
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (rt_tick_get_millisecond()) /*Expression evaluating to current system time in ms*/
|
||||||
|
|
||||||
#ifdef PKG_LVGL_DISP_REFR_PERIOD
|
|
||||||
#define LV_DISP_DEF_REFR_PERIOD PKG_LVGL_DISP_REFR_PERIOD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*=======================
|
/*=======================
|
||||||
* FEATURE CONFIGURATION
|
* FEATURE CONFIGURATION
|
||||||
*=======================*/
|
*=======================*/
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ static void lvgl_thread_entry(void *parameter)
|
|||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
lv_task_handler();
|
lv_task_handler();
|
||||||
rt_thread_mdelay(LV_DISP_DEF_REFR_PERIOD);
|
rt_thread_mdelay(PKG_LVGL_DISP_REFR_PERIOD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user