This commit is contained in:
刘可亮
2024-10-30 16:50:31 +08:00
parent 0ef85b55da
commit 661e71562d
458 changed files with 46555 additions and 12133 deletions

View File

@@ -35,6 +35,7 @@
extern void lv_port_disp_init(void);
extern void lv_port_indev_init(void);
extern void lv_user_gui_init(void);
extern void lv_wait_sdcard_mounted(void);
static struct rt_thread lvgl_thread;
@@ -45,7 +46,7 @@ static struct rt_thread lvgl_thread;
#endif
#ifndef LV_MAIN_THREAD_STACK_SIZE
#define LV_MAIN_THREAD_STACK_SIZE (4096 * 2)
#define LV_MAIN_THREAD_STACK_SIZE LPKG_LVGL_THREAD_STACK_SIZE
#endif /* LV_MAIN_THREAD_STACK_SIZE */
static rt_uint8_t lvgl_thread_stack[LV_MAIN_THREAD_STACK_SIZE];
@@ -60,6 +61,7 @@ static void lv_rt_log(lv_log_level_t level, const char *buf)
static void lvgl_thread_entry(void *parameter)
{
lv_wait_sdcard_mounted();
#if LV_USE_LOG
lv_log_register_print_cb(lv_rt_log);
#endif /* LV_USE_LOG */

View File

@@ -49,7 +49,11 @@ typedef enum {
LV_THREAD_PRIO_LOWEST,
LV_THREAD_PRIO_LOW,
LV_THREAD_PRIO_MID,
#ifdef LPKG_LVGL_THREAD_PRIO
LV_THREAD_PRIO_HIGH = LPKG_LVGL_THREAD_PRIO,
#else
LV_THREAD_PRIO_HIGH,
#endif
LV_THREAD_PRIO_HIGHEST,
} lv_thread_prio_t;

View File

@@ -188,6 +188,12 @@ static void perf_update_timer_cb(lv_timer_t * t)
1000 / disp_refr_period); /*Limit due to possible off-by-one error*/
info->calculated.cpu = 100 - LV_SYSMON_GET_IDLE();
#ifdef LPKG_USING_CPU_USAGE
#include "cpu_usage.h"
info->calculated.cpu = (uint32_t)cpu_load_average();
#endif
info->calculated.refr_avg_time = info->measured.refr_cnt ? (info->measured.refr_elaps_sum / info->measured.refr_cnt) :
0;

View File

@@ -226,10 +226,12 @@ void lv_image_set_src(lv_obj_t * obj, const void * src)
update_align(obj);
#if !defined(AIC_LVGL_METER_DEMO) || defined(LV_METER_SIMPLE_POINT)
/*Provide enough room for the rotated corners*/
if(img->rotation || img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE) {
lv_obj_refresh_ext_draw_size(obj);
}
#endif
lv_obj_invalidate(obj);
}
@@ -284,12 +286,14 @@ void lv_image_set_rotation(lv_obj_t * obj, int32_t angle)
img->rotation = angle;
#if !defined(AIC_LVGL_METER_DEMO) || defined(LV_METER_SIMPLE_POINT)
/* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate
* the whole ext draw area */
lv_display_t * disp = lv_obj_get_display(obj);
lv_display_enable_invalidation(disp, false);
lv_obj_refresh_ext_draw_size(obj);
lv_display_enable_invalidation(disp, true);
#endif
_lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px);
a.x1 += obj->coords.x1;
@@ -325,14 +329,14 @@ void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y)
lv_obj_invalidate_area(obj, &a);
lv_point_set(&img->pivot, x, y);
#if !defined(AIC_LVGL_METER_DEMO) || defined(LV_METER_SIMPLE_POINT)
/* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate
* the whole ext draw area */
lv_display_t * disp = lv_obj_get_display(obj);
lv_display_enable_invalidation(disp, false);
lv_obj_refresh_ext_draw_size(obj);
lv_display_enable_invalidation(disp, true);
#endif
lv_image_get_pivot(obj, &pivot_px);
_lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px);
a.x1 += obj->coords.x1;