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
662c22b5
Commit
662c22b5
authored
Jun 21, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_obj_del: reset the dispi-s only if it is really required
parent
166fa39d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
lv_dispi.c
lv_obj/lv_dispi.c
+12
-4
lv_dispi.h
lv_obj/lv_dispi.h
+6
-0
lv_obj.c
lv_obj/lv_obj.c
+19
-4
No files found.
lv_obj/lv_dispi.c
View file @
662c22b5
...
...
@@ -41,6 +41,7 @@ static void dispi_drag_throw(lv_dispi_t * dispi_p);
static
ptask_t
*
dispi_task_p
;
static
bool
lv_dispi_reset_qry
;
static
bool
lv_dispi_reset_now
;
static
lv_dispi_t
dispi_array
[
INDEV_NUM
];
/**********************
* MACROS
...
...
@@ -66,6 +67,15 @@ void lv_dispi_init(void)
}
/**
* Get an array with all the display inputs. Contains (INDEV_NUM elements)
* @return pointer to a an lv_dispi_t array.
*/
lv_dispi_t
*
lv_dispi_get_array
(
void
)
{
return
dispi_array
;
}
/**
* Reset all display inputs
*/
void
lv_dispi_reset
(
void
)
...
...
@@ -135,15 +145,13 @@ void lv_dispi_wait_release(lv_dispi_t * dispi)
*/
static
void
dispi_task
(
void
*
param
)
{
static
lv_dispi_t
dispi
[
INDEV_NUM
];
cord_t
x
;
cord_t
y
;
uint8_t
i
;
for
(
i
=
0
;
i
<
INDEV_NUM
;
i
++
)
{
dispi
[
i
].
pressed
=
indev_get
(
i
,
&
x
,
&
y
);
dispi_proc_point
(
&
dispi
[
i
],
x
,
y
);
dispi
_array
[
i
].
pressed
=
indev_get
(
i
,
&
x
,
&
y
);
dispi_proc_point
(
&
dispi
_array
[
i
],
x
,
y
);
}
/*If reset query occurred in this round then set a flag to
...
...
lv_obj/lv_dispi.h
View file @
662c22b5
...
...
@@ -56,6 +56,12 @@ typedef lv_action_res_t ( * lv_action_t) (struct __LV_OBJ_T * obj, lv_dispi_t *
void
lv_dispi_init
(
void
);
/**
* Get an array with all the display inputs. Contains (INDEV_NUM elements)
* @return pointer to a an lv_dispi_t array.
*/
lv_dispi_t
*
lv_dispi_get_array
(
void
);
/**
* Reset all display inputs
*/
void
lv_dispi_reset
(
void
);
...
...
lv_obj/lv_obj.c
View file @
662c22b5
...
...
@@ -15,6 +15,7 @@
#include "lvgl/lv_app/lv_app.h"
#include "lvgl/lv_draw/lv_draw_rbasic.h"
#include "misc/gfx/anim.h"
#include "hal/indev/indev.h"
#include <stdint.h>
#include <string.h>
...
...
@@ -280,10 +281,24 @@ void lv_obj_del(lv_obj_t * obj)
if
(
obj
->
ext
!=
NULL
)
dm_free
(
obj
->
ext
);
dm_free
(
obj
);
/*Free the object itself*/
/* Reset all display input (dispi) because
* the deleted object can be being pressed*/
lv_dispi_reset
();
/* Reset all display input (dispi) if
* the currently pressed object is deleted too*/
lv_dispi_t
*
dispi_array
=
lv_dispi_get_array
();
lv_obj_t
*
dpar
;
uint8_t
d
;
for
(
d
=
0
;
d
<
INDEV_NUM
;
d
++
)
{
dpar
=
obj
;
while
(
dpar
!=
NULL
)
{
if
(
dispi_array
[
d
].
act_obj
==
dpar
||
dispi_array
[
d
].
last_obj
==
dpar
)
{
lv_dispi_reset
();
break
;
}
else
{
dpar
=
lv_obj_get_parent
(
dpar
);
}
}
}
/*Send a signal to the parent to notify it about the child delete*/
if
(
par
!=
NULL
)
{
par
->
signal_f
(
par
,
LV_SIGNAL_CHILD_CHG
,
NULL
);
...
...
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