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
1a1840ae
Commit
1a1840ae
authored
Nov 29, 2017
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_hal_indev and tick updates
parent
cc7128ce
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
99 deletions
+21
-99
lv_hal_indev.h
lv_hal/lv_hal_indev.h
+13
-13
lv_hal_tick.c
lv_hal/lv_hal_tick.c
+4
-68
lv_hal_tick.h
lv_hal/lv_hal_tick.h
+2
-16
lv_indev.c
lv_obj/lv_indev.c
+0
-0
lv_obj.c
lv_obj/lv_obj.c
+2
-2
No files found.
lv_hal/lv_hal_indev.h
View file @
1a1840ae
...
...
@@ -31,25 +31,23 @@ extern "C" {
/*Possible input device types*/
typedef
enum
{
LV_INDEV_TYPE_NONE
,
/*Show uninitialized state*/
LV_INDEV_TYPE_TOUCHPAD
,
/*Touch pad*/
LV_INDEV_TYPE_MOUSE
,
/*Mouse or similar pointer device*/
LV_INDEV_TYPE_POINTER
,
/*Touch pad, mouse, external button*/
LV_INDEV_TYPE_KEYPAD
,
/*Keypad or keyboard*/
LV_INDEV_TYPE_BUTTON
,
/*External (hardware) button assigned to a point on the screen*/
}
lv_hal_indev_type_t
;
/*States for input devices*/
typedef
enum
{
LV_INDEV_
EVENT
_REL
,
LV_INDEV_
EVENT
_PR
}
lv_indev_
event
_t
;
LV_INDEV_
STATE
_REL
,
LV_INDEV_
STATE
_PR
}
lv_indev_
state
_t
;
/*Data type when an input device is read */
typedef
struct
{
union
{
lv_point_t
point
;
/*For INDEV_TYPE_
TOUCHPAD, INDEV_TYPE_POINTER, LV_INDEV_TYPE_BUTTON
*/
lv_point_t
point
;
/*For INDEV_TYPE_
POINTER
*/
uint32_t
key
;
/*For INDEV_TYPE_KEYPAD*/
};
lv_indev_
event
_t
state
;
/*LV_INDEV_EVENT_REL or LV_INDEV_EVENT_PR*/
lv_indev_
state
_t
state
;
/*LV_INDEV_EVENT_REL or LV_INDEV_EVENT_PR*/
}
lv_indev_data_t
;
/*Initialized by the user and registered by 'lv_indev_add()'*/
...
...
@@ -61,9 +59,9 @@ typedef struct {
struct
_lv_obj_t
;
typedef
struct
_lv_indev_state_t
{
lv_indev_
event
_t
event
;
lv_indev_
state
_t
event
;
union
{
struct
{
struct
{
/*Pointer data*/
lv_point_t
act_point
;
lv_point_t
last_point
;
lv_point_t
vect
;
...
...
@@ -76,7 +74,9 @@ typedef struct _lv_indev_state_t {
uint8_t
drag_in_prog
:
1
;
uint8_t
wait_unil_release
:
1
;
};
uint32_t
last_key
;
struct
{
/*Keypad data*/
lv_indev_state_t
last_state
;
};
};
uint32_t
pr_timestamp
;
/*Pressed time stamp*/
...
...
@@ -86,7 +86,7 @@ typedef struct _lv_indev_state_t {
uint8_t
long_pr_sent
:
1
;
uint8_t
reset_query
:
1
;
uint8_t
disabled
:
1
;
}
lv_indev_
state
_t
;
}
lv_indev_
proc
_t
;
struct
_lv_obj_t
;
...
...
@@ -94,7 +94,7 @@ struct _lv_group_t;
typedef
struct
_lv_indev_t
{
lv_indev_drv_t
driver
;
lv_indev_
state_t
state
;
lv_indev_
proc_t
proc
;
union
{
struct
_lv_obj_t
*
cursor
;
struct
_lv_group_t
*
group
;
/*Keypad destination group*/
...
...
lv_hal/lv_hal_tick.c
View file @
1a1840ae
...
...
@@ -39,20 +39,12 @@ static void (*tick_callbacks[LV_HAL_TICK_CALLBACK_NUM])(void);
**********************/
/**
* You have to call this function in every milliseconds
in a timer interrupt
* You have to call this function in every milliseconds
*/
void
lv_tick_
handler
(
void
)
void
lv_tick_
inc
(
void
)
{
tick_irq_flag
=
0
;
sys_time
++
;
/*Run the callback functions*/
uint8_t
i
;
for
(
i
=
0
;
i
<
LV_HAL_TICK_CALLBACK_NUM
;
i
++
)
{
if
(
tick_callbacks
[
i
]
!=
NULL
)
{
tick_callbacks
[
i
]();
}
}
tick_irq_flag
=
0
;
/*lv_hal_systick_get set it to know there was an IRQ*/
}
/**
...
...
@@ -65,7 +57,7 @@ uint32_t lv_tick_get(void)
do
{
tick_irq_flag
=
1
;
result
=
sys_time
;
}
while
(
!
tick_irq_flag
);
/*
Systick IRQ clears this flag
. Continue until make a non interrupted cycle */
}
while
(
!
tick_irq_flag
);
/*
'lv_tick_inc()' clears this flag which can be in an interrupt
. Continue until make a non interrupted cycle */
return
result
;
}
...
...
@@ -90,62 +82,6 @@ uint32_t lv_tick_elaps(uint32_t prev_tick)
return
prev_tick
;
}
/**
* Add a callback function to the systick interrupt
* @param cb a function pointer
* @return true: 'cb' added to the systick callbacks, false: 'cb' not added
*/
bool
lv_tick_add_callback
(
void
(
*
cb
)
(
void
))
{
bool
suc
=
false
;
/*Take the semaphore. Be sure it is set*/
do
{
tick_cb_sem
=
1
;
}
while
(
!
tick_cb_sem
);
uint8_t
i
;
for
(
i
=
0
;
i
<
LV_HAL_TICK_CALLBACK_NUM
;
i
++
)
{
if
(
tick_callbacks
[
i
]
==
NULL
)
{
tick_callbacks
[
i
]
=
cb
;
suc
=
true
;
break
;
}
}
/*Release the semaphore. Be sure it is cleared*/
do
{
tick_cb_sem
=
0
;
}
while
(
tick_cb_sem
);
return
suc
;
}
/**
* Remove a callback function from the tick callbacks
* @param cb a function pointer (added with 'lv_hal_tick_add_callback')
*/
void
lv_tick_rem_callback
(
void
(
*
cb
)
(
void
))
{
/*Take the semaphore. Be sure it is set*/
do
{
tick_cb_sem
=
1
;
}
while
(
!
tick_cb_sem
);
uint8_t
i
;
for
(
i
=
0
;
i
<
LV_HAL_TICK_CALLBACK_NUM
;
i
++
)
{
if
(
tick_callbacks
[
i
]
==
cb
)
{
tick_callbacks
[
i
]
=
NULL
;
break
;
}
}
/*Release the semaphore. Be sure it is cleared*/
do
{
tick_cb_sem
=
0
;
}
while
(
tick_cb_sem
);
}
/**********************
* STATIC FUNCTIONS
**********************/
...
...
lv_hal/lv_hal_tick.h
View file @
1a1840ae
...
...
@@ -28,11 +28,10 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
/**
* You have to call this function in every milliseconds
in a timer interrupt
* You have to call this function in every milliseconds
*/
void
lv_tick_
handler
(
void
);
void
lv_tick_
inc
(
void
);
/**
* Get the elapsed milliseconds since start up
...
...
@@ -47,19 +46,6 @@ uint32_t lv_tick_get(void);
*/
uint32_t
lv_tick_elaps
(
uint32_t
prev_tick
);
/**
* Add a callback function to the systick interrupt
* @param cb a function pointer
* @return true: 'cb' added to the systick callbacks, false: 'cb' not added
*/
bool
lv_tick_add_callback
(
void
(
*
cb
)
(
void
));
/**
* Remove a callback function from the tick callbacks
* @param cb a function pointer (added with 'lv_hal_tick_add_callback')
*/
void
lv_tick_rem_callback
(
void
(
*
cb
)
(
void
));
/**********************
* MACROS
**********************/
...
...
lv_obj/lv_indev.c
View file @
1a1840ae
This diff is collapsed.
Click to expand it.
lv_obj/lv_obj.c
View file @
1a1840ae
...
...
@@ -307,8 +307,8 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
while
(
indev
)
{
dpar
=
obj
;
while
(
dpar
!=
NULL
)
{
if
(
indev
->
state
.
act_obj
==
dpar
||
indev
->
state
.
last_obj
==
dpar
)
{
if
(
indev
->
proc
.
act_obj
==
dpar
||
indev
->
proc
.
last_obj
==
dpar
)
{
lv_indev_reset
(
indev
);
break
;
}
else
{
...
...
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