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
2353ca06
Commit
2353ca06
authored
Apr 17, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix overflow in lv_anim_speed_to_time
parent
8bc5770c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
lv_anim.c
lv_misc/lv_anim.c
+3
-1
lv_anim.h
lv_misc/lv_anim.h
+1
-1
No files found.
lv_misc/lv_anim.c
View file @
2353ca06
...
@@ -115,7 +115,9 @@ bool lv_anim_del(void * var, lv_anim_fp_t fp)
...
@@ -115,7 +115,9 @@ bool lv_anim_del(void * var, lv_anim_fp_t fp)
uint16_t
lv_anim_speed_to_time
(
uint16_t
speed
,
int32_t
start
,
int32_t
end
)
uint16_t
lv_anim_speed_to_time
(
uint16_t
speed
,
int32_t
start
,
int32_t
end
)
{
{
int32_t
d
=
LV_MATH_ABS
((
int32_t
)
start
-
end
);
int32_t
d
=
LV_MATH_ABS
((
int32_t
)
start
-
end
);
uint16_t
time
=
(
int32_t
)((
int32_t
)(
d
*
1000
)
/
speed
);
uint32_t
time
=
(
int32_t
)((
int32_t
)(
d
*
1000
)
/
speed
);
if
(
time
>
UINT16_MAX
)
time
=
UINT16_MAX
;
if
(
time
==
0
)
{
if
(
time
==
0
)
{
time
++
;
time
++
;
...
...
lv_misc/lv_anim.h
View file @
2353ca06
...
@@ -43,7 +43,7 @@ typedef struct _lv_anim_t
...
@@ -43,7 +43,7 @@ typedef struct _lv_anim_t
lv_anim_path_t
path
;
/*An array with the steps of animations*/
lv_anim_path_t
path
;
/*An array with the steps of animations*/
int32_t
start
;
/*Start value*/
int32_t
start
;
/*Start value*/
int32_t
end
;
/*End value*/
int32_t
end
;
/*End value*/
int16_t
time
;
/*Animation time in ms*/
u
int16_t
time
;
/*Animation time in ms*/
int16_t
act_time
;
/*Current time in animation. Set to negative to make delay.*/
int16_t
act_time
;
/*Current time in animation. Set to negative to make delay.*/
uint16_t
playback_pause
;
/*Wait before play back*/
uint16_t
playback_pause
;
/*Wait before play back*/
uint16_t
repeat_pause
;
/*Wait before repeat*/
uint16_t
repeat_pause
;
/*Wait before repeat*/
...
...
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