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
8578c2f1
Commit
8578c2f1
authored
Jun 07, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WiFi app added
parent
6b2ff575
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
101 additions
and
8 deletions
+101
-8
lv_app.c
lv_app/lv_app.c
+5
-0
lv_app.h
lv_app/lv_app.h
+1
-0
lv_app_kb.c
lv_app/lv_app_util/lv_app_kb.c
+8
-5
lv_app_kb.h
lv_app/lv_app_util/lv_app_kb.h
+1
-0
lv_app_terminal.c
lv_appx/lv_app_terminal.c
+4
-1
lv_app_wifi.c
lv_appx/lv_app_wifi.c
+0
-0
lv_app_wifi.h
lv_appx/lv_app_wifi.h
+39
-0
lv_style.c
lv_obj/lv_style.c
+1
-0
lv_ddlist.c
lv_objx/lv_ddlist.c
+39
-2
lv_ddlist.h
lv_objx/lv_ddlist.h
+2
-0
lv_ta.c
lv_objx/lv_ta.c
+1
-0
No files found.
lv_app/lv_app.c
View file @
8578c2f1
...
...
@@ -133,6 +133,11 @@ void lv_app_init(void)
dsc
=
ll_ins_head
(
&
app_dsc_ll
);
*
dsc
=
lv_app_files_init
();
#endif
#if USE_LV_APP_WIFI != 0
dsc
=
ll_ins_head
(
&
app_dsc_ll
);
*
dsc
=
lv_app_wifi_init
();
#endif
}
/**
...
...
lv_app/lv_app.h
View file @
8578c2f1
...
...
@@ -240,6 +240,7 @@ lv_app_style_t * lv_app_style_get(void);
#include "lvgl/lv_appx/lv_app_sysmon.h"
#include "lvgl/lv_appx/lv_app_terminal.h"
#include "lvgl/lv_appx/lv_app_files.h"
#include "lvgl/lv_appx/lv_app_wifi.h"
#endif
/*LV_APP_ENABLE != 0*/
...
...
lv_app/lv_app_util/lv_app_kb.c
View file @
8578c2f1
...
...
@@ -149,14 +149,13 @@ lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv
if
(
lv_obj_get_height
(
kb_ta
)
>
cont_h
-
LV_DPI
/
10
)
{
lv_obj_set_height
(
kb_ta
,
cont_h
-
LV_DPI
/
10
);
}
#if LV_APP_ANIM_LEVEL != 0
lv_page_focus
(
lv_win_get_content
(
kb_win
),
kb_ta
,
true
);
#else
lv_page_focus
(
lv_win_get_page
(
kb_win
),
kb_ta
,
0
);
#endif
}
lv_ta_set_cursor_pos
(
kb_ta
,
LV_TA_CUR_LAST
);
if
(
kb_mode
&
LV_APP_KB_MODE_CURSOR_MANAGE
)
{
lv_ta_set_cursor_show
(
kb_ta
,
true
);
}
return
kb_btnm
;
...
...
@@ -182,7 +181,11 @@ void lv_app_kb_close(bool ok)
lv_obj_set_size
(
kb_win
,
LV_HOR_RES
,
LV_VER_RES
);
kb_win
=
NULL
;
}
if
(
kb_mode
&
LV_APP_KB_MODE_CURSOR_MANAGE
)
{
lv_ta_set_cursor_show
(
kb_ta
,
false
);
}
lv_obj_del
(
kb_btnm
);
kb_btnm
=
NULL
;
...
...
lv_app/lv_app_util/lv_app_kb.h
View file @
8578c2f1
...
...
@@ -24,6 +24,7 @@ typedef enum
LV_APP_KB_MODE_TXT
=
0x01
,
LV_APP_KB_MODE_NUM
=
0x02
,
LV_APP_KB_MODE_WIN_RESIZE
=
0x04
,
LV_APP_KB_MODE_CURSOR_MANAGE
=
0x08
,
}
lv_app_kb_mode_t
;
/**********************
...
...
lv_appx/lv_app_terminal.c
View file @
8578c2f1
...
...
@@ -32,6 +32,7 @@
* DEFINES
*********************/
#define OBJ_PAD (LV_DPI / 12)
#define AUTO_CONNECT_TCP_DELAY 5000
/*Wait before TCS server connect when the WiFi connect is ready*/
/**********************
* TYPEDEFS
...
...
@@ -187,7 +188,7 @@ static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
/*Insert the name of the sender application if it is not the last*/
if
(
app_data
->
last_sender
!=
app_send
)
{
add_data
(
app_rec
,
"
@"
,
1
);
add_data
(
app_rec
,
"
\n
@"
,
2
);
add_data
(
app_rec
,
app_send
->
name
,
strlen
(
app_send
->
name
));
add_data
(
app_rec
,
"
\n
"
,
1
);
}
...
...
@@ -424,6 +425,8 @@ static void win_ta_kb_ok_action(lv_obj_t * ta)
lv_app_com_send
(
app
,
app_data
->
com_type
,
ta_txt
,
ta_txt_len
);
lv_ta_set_text
(
ta
,
""
);
app_data
->
last_sender
=
NULL
;
/*Now the least data in the terminal is from this app*/
}
/**
...
...
lv_appx/lv_app_wifi.c
0 → 100644
View file @
8578c2f1
This diff is collapsed.
Click to expand it.
lv_appx/lv_app_wifi.h
0 → 100644
View file @
8578c2f1
/**
* @file lv_app_example.h
*
*/
#ifndef LV_APP_WIFI_H
#define LV_APP_WIFI_H
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_WIFI != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef
struct
{
}
lv_app_wifi_conf_t
;
/**********************
* GLOBAL PROTOTYPES
**********************/
const
lv_app_dsc_t
*
lv_app_wifi_init
(
void
);
/**********************
* MACROS
**********************/
#endif
/*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#endif
/* LV_APP_EXAMPLE_H */
lv_obj/lv_style.c
View file @
8578c2f1
...
...
@@ -134,6 +134,7 @@ void lv_style_init (void)
lv_style_btn_rel
.
hpad
=
LV_DPI
/
4
;
lv_style_btn_rel
.
vpad
=
LV_DPI
/
6
;
lv_style_btn_rel
.
opad
=
LV_DPI
/
10
;
lv_style_btn_rel
.
txt_align
=
LV_TXT_ALIGN_MID
;
/*Button pressed style*/
memcpy
(
&
lv_style_btn_pr
,
&
lv_style_btn_rel
,
sizeof
(
lv_style_t
));
...
...
lv_objx/lv_ddlist.c
View file @
8578c2f1
...
...
@@ -140,9 +140,9 @@ bool lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param)
*====================*/
/**
* Set the options in a drop down list
* Set the options in a drop down list
from an array
* @param ddlist pointer to drop down list object
* @param options an array of strings wit the text of the options.
* @param options an array of strings wit
h
the text of the options.
* The lest element has to be "" (empty string)
* E.g. const char * opts[] = {"apple", "banana", "orange", ""};
*/
...
...
@@ -162,6 +162,18 @@ void lv_ddlist_set_options(lv_obj_t * ddlist, const char ** options)
}
/**
* Set the options in a drop down list from a string
* @param ddlist pointer to drop down list object
* @param options a string with '\n' separated options. E.g. "One\nTwo\nThree"
*/
void
lv_ddlist_set_options_str
(
lv_obj_t
*
ddlist
,
const
char
*
options
)
{
lv_ddlist_ext_t
*
ext
=
lv_obj_get_ext
(
ddlist
);
lv_label_set_text
(
ext
->
opt_label
,
options
);
lv_ddlist_refr_size
(
ddlist
,
0
);
}
/**
* Set the selected option
* @param ddlist pointer to drop down list object
* @param sel_opt id of the selected option (0 ... number of option - 1);
...
...
@@ -251,6 +263,31 @@ uint16_t lv_ddlist_get_selected(lv_obj_t * ddlist)
}
/**
* Get the current selected option as a string
* @param ddlist pointer to ddlist object
* @param buf pointer to an array to store the string
*/
void
lv_ddlist_get_selected_str
(
lv_obj_t
*
ddlist
,
char
*
buf
)
{
lv_ddlist_ext_t
*
ext
=
lv_obj_get_ext
(
ddlist
);
uint16_t
i
;
uint16_t
line
=
0
;
const
char
*
opt_txt
=
lv_label_get_text
(
ext
->
opt_label
);
uint16_t
txt_len
=
strlen
(
opt_txt
);
for
(
i
=
0
;
i
<
txt_len
&&
line
!=
ext
->
sel_opt
;
i
++
)
{
if
(
opt_txt
[
i
]
==
'\n'
)
line
++
;
}
uint16_t
c
;
for
(
c
=
0
;
opt_txt
[
i
]
!=
'\n'
&&
i
<
txt_len
;
c
++
,
i
++
)
buf
[
c
]
=
opt_txt
[
i
];
buf
[
c
]
=
'\0'
;
}
/**
* Get the auto size attribute.
* @param ddlist pointer to a drop down list object
* @return true: the auto_size is enabled, false: disabled
...
...
lv_objx/lv_ddlist.h
View file @
8578c2f1
...
...
@@ -77,6 +77,7 @@ bool lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param);
*/
void
lv_ddlist_set_options
(
lv_obj_t
*
ddlist
,
const
char
**
options
);
void
lv_ddlist_set_options_str
(
lv_obj_t
*
ddlist
,
const
char
*
options
);
/**
* Set the selected option
* @param ddlist pointer to drop down list object
...
...
@@ -121,6 +122,7 @@ const char * lv_ddlist_get_options(lv_obj_t * ddlist);
*/
uint16_t
lv_ddlist_get_selected
(
lv_obj_t
*
ddlist
);
void
lv_ddlist_get_selected_str
(
lv_obj_t
*
ddlist
,
char
*
buf
);
/**
* Get the auto size attribute.
* @param ddlist pointer to a drop down list object
...
...
lv_objx/lv_ta.c
View file @
8578c2f1
...
...
@@ -105,6 +105,7 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_set_design_f
(
ext
->
page
.
scrl
,
lv_ta_scrling_design
);
lv_ta_ext_t
*
copy_ext
=
lv_obj_get_ext
(
copy
);
ext
->
label
=
lv_label_create
(
new_ta
,
copy_ext
->
label
);
ext
->
cursor_show
=
copy_ext
->
cursor_show
;
lv_page_glue_obj
(
ext
->
label
,
true
);
/*Refresh the style with new signal function*/
...
...
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