BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
f6c459d2
Commit
f6c459d2
authored
Jul 07, 2017
by
Kiss-Vamosi Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_refr: refresh time monitor added
parent
b4c877c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
15 deletions
+24
-15
lv_refr.c
lv_obj/lv_refr.c
+19
-15
lv_refr.h
lv_obj/lv_refr.h
+5
-0
No files found.
lv_obj/lv_refr.c
View file @
f6c459d2
...
@@ -16,11 +16,7 @@
...
@@ -16,11 +16,7 @@
/*********************
/*********************
* DEFINES
* DEFINES
*********************/
*********************/
#define MONITOR_EXEC_TIME 0
#if MONITOR_EXEC_TIME != 0
#include <time.h>
#include <stdio.h>
#endif
/**********************
/**********************
* TYPEDEFS
* TYPEDEFS
**********************/
**********************/
...
@@ -51,6 +47,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
...
@@ -51,6 +47,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
**********************/
**********************/
static
lv_join_t
inv_buf
[
LV_INV_FIFO_SIZE
];
static
lv_join_t
inv_buf
[
LV_INV_FIFO_SIZE
];
static
uint16_t
inv_buf_p
;
static
uint16_t
inv_buf_p
;
static
void
(
*
monitor_cb
)(
uint32_t
,
uint32_t
);
/**********************
/**********************
* MACROS
* MACROS
...
@@ -126,6 +123,15 @@ void lv_inv_area(const area_t * area_p)
...
@@ -126,6 +123,15 @@ void lv_inv_area(const area_t * area_p)
}
}
}
}
/**
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
*/
void
lv_refr_set_monitor_cb
(
void
(
*
cb
)(
uint32_t
,
uint32_t
))
{
monitor_cb
=
cb
;
}
/**********************
/**********************
* STATIC FUNCTIONS
* STATIC FUNCTIONS
**********************/
**********************/
...
@@ -191,10 +197,8 @@ static void lv_refr_join_area(void)
...
@@ -191,10 +197,8 @@ static void lv_refr_join_area(void)
static
void
lv_refr_areas
(
void
)
static
void
lv_refr_areas
(
void
)
{
{
uint32_t
i
;
uint32_t
i
;
uint32_t
start
=
systick_get
();
#if MONITOR_EXEC_TIME != 0
uint32_t
px_num
=
0
;
clock_t
start
=
clock
();
#endif
for
(
i
=
0
;
i
<
inv_buf_p
;
i
++
)
{
for
(
i
=
0
;
i
<
inv_buf_p
;
i
++
)
{
/*Refresh the unjoined areas*/
/*Refresh the unjoined areas*/
...
@@ -206,16 +210,16 @@ static void lv_refr_areas(void)
...
@@ -206,16 +210,16 @@ static void lv_refr_areas(void)
/*If VDB is used...*/
/*If VDB is used...*/
lv_refr_area_with_vdb
(
&
inv_buf
[
i
].
area
);
lv_refr_area_with_vdb
(
&
inv_buf
[
i
].
area
);
#endif
#endif
if
(
monitor_cb
!=
NULL
)
px_num
+=
area_get_size
(
&
inv_buf
[
i
].
area
);
}
}
}
}
#if MONITOR_EXEC_TIME != 0
if
(
inv_buf_p
!=
0
)
{
if
(
inv_buf_p
!=
0
)
{
clock_t
end
=
clock
();
if
(
monitor_cb
!=
NULL
)
{
float
time_spent
=
(
float
)(
end
-
start
)
/
CLOCKS_PER_SEC
;
monitor_cb
(
systick_elaps
(
start
),
px_num
)
;
printf
(
"Exec time: %08f ms
\n
"
,
(
float
)
time_spent
*
1000
);
}
}
}
#endif
}
}
#if LV_VDB_SIZE == 0
#if LV_VDB_SIZE == 0
...
@@ -343,7 +347,7 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
...
@@ -343,7 +347,7 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
}
}
/**
/**
* Make the refreshing from an object. Draw all its children and the y
ungers too.
* Make the refreshing from an object. Draw all its children and the y
oungers too.
* @param top_p pointer to an objects. Start the drawing from it.
* @param top_p pointer to an objects. Start the drawing from it.
* @param mask_p pointer to an area, the objects will be drawn only here
* @param mask_p pointer to an area, the objects will be drawn only here
*/
*/
...
...
lv_obj/lv_refr.h
View file @
f6c459d2
...
@@ -44,6 +44,11 @@ void lv_refr_init(void);
...
@@ -44,6 +44,11 @@ void lv_refr_init(void);
*/
*/
void
lv_inv_area
(
const
area_t
*
area_p
);
void
lv_inv_area
(
const
area_t
*
area_p
);
/**
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
*/
void
lv_refr_set_monitor_cb
(
void
(
*
cb
)(
uint32_t
,
uint32_t
));
/**********************
/**********************
* STATIC FUNCTIONS
* STATIC FUNCTIONS
**********************/
**********************/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment