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
d239b319
Commit
d239b319
authored
Dec 20, 2017
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_task: add idle measurement
parent
8164e8ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
lv_mem.h
lv_misc/lv_mem.h
+3
-3
lv_task.c
lv_misc/lv_task.c
+20
-0
lv_task.h
lv_misc/lv_task.h
+6
-0
No files found.
lv_misc/lv_mem.h
View file @
d239b319
...
@@ -27,13 +27,13 @@ extern "C" {
...
@@ -27,13 +27,13 @@ extern "C" {
typedef
struct
typedef
struct
{
{
uint32_t
total_size
;
uint32_t
free_cnt
;
uint32_t
free_cnt
;
uint32_t
used_cnt
;
uint32_t
free_size
;
uint32_t
free_size
;
uint32_t
total_size
;
uint32_t
free_biggest_size
;
uint32_t
free_biggest_size
;
uint
8_t
frag_pc
t
;
uint
32_t
used_cn
t
;
uint8_t
used_pct
;
uint8_t
used_pct
;
uint8_t
frag_pct
;
}
lv_mem_monitor_t
;
}
lv_mem_monitor_t
;
/**********************
/**********************
...
...
lv_misc/lv_task.c
View file @
d239b319
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
/*********************
/*********************
* DEFINES
* DEFINES
*********************/
*********************/
#define IDLE_MEAS_PERIOD 500
/*[ms]*/
/**********************
/**********************
* TYPEDEFS
* TYPEDEFS
...
@@ -55,8 +56,14 @@ void lv_task_init(void)
...
@@ -55,8 +56,14 @@ void lv_task_init(void)
*/
*/
void
lv_task_handler
(
void
)
void
lv_task_handler
(
void
)
{
{
static
uint32_t
idle_period_start
=
0
;
static
uint32_t
handler_start
=
0
;
static
uint32_t
busy_time
=
0
;
if
(
lv_task_run
==
false
)
return
;
if
(
lv_task_run
==
false
)
return
;
handler_start
=
lv_tick_get
();
lv_task_t
*
lv_task_prio_a
[
LV_TASK_PRIO_NUM
];
/*Lists for all prio.*/
lv_task_t
*
lv_task_prio_a
[
LV_TASK_PRIO_NUM
];
/*Lists for all prio.*/
lv_task_prio_t
prio_act
;
lv_task_prio_t
prio_act
;
bool
prio_reset
=
false
;
/*Used to go back to the highest priority*/
bool
prio_reset
=
false
;
/*Used to go back to the highest priority*/
...
@@ -100,6 +107,19 @@ void lv_task_handler(void)
...
@@ -100,6 +107,19 @@ void lv_task_handler(void)
}
}
}
}
}
}
busy_time
+=
lv_tick_elaps
(
handler_start
);
uint32_t
idle_period_time
=
lv_tick_elaps
(
idle_period_start
);
if
(
idle_period_time
>=
IDLE_MEAS_PERIOD
)
{
idle_last
=
(
uint32_t
)((
uint32_t
)
busy_time
*
100
)
/
IDLE_MEAS_PERIOD
;
/*Calculate the busy percentage*/
idle_last
=
idle_last
>
100
?
0
:
100
-
idle_last
;
/*But we need idle time*/
busy_time
=
0
;
idle_period_start
=
lv_tick_get
();
}
}
}
/**
/**
...
...
lv_misc/lv_task.h
View file @
d239b319
...
@@ -123,6 +123,12 @@ void lv_task_reset(lv_task_t* lv_task_p);
...
@@ -123,6 +123,12 @@ void lv_task_reset(lv_task_t* lv_task_p);
*/
*/
void
lv_task_enable
(
bool
en
);
void
lv_task_enable
(
bool
en
);
/**
* Get idle percentage
* @return the lv_task idle in percentage
*/
uint8_t
lv_task_get_idle
(
void
);
/**********************
/**********************
* MACROS
* MACROS
**********************/
**********************/
...
...
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