Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
5cdbe574
Commit
5cdbe574
authored
Aug 21, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menu: Just a few comments.
parent
971e4ea8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
menu.c
sw/freertos/src/apps/menu.c
+7
-1
No files found.
sw/freertos/src/apps/menu.c
View file @
5cdbe574
...
...
@@ -32,7 +32,7 @@
static
int
selected_item
=
0
;
static
int
menu_size
=
0
;
//
Store
states to navigate between menus
//
store menu
states to navigate between menus
static
menu_list
*
menu_stack
[
8
]
=
{
&
main_menu
,
NULL
,
};
static
menu_list
**
current_menu
=
&
menu_stack
[
0
];
...
...
@@ -45,11 +45,15 @@ static void menu_screen_redraw(struct ui_widget *w)
gfx_clear
(
&
w
->
dc
,
0
);
for
(
i
=
0
;
i
<
menu_size
;
++
i
)
{
// draw a white background for the selected entry
if
(
i
==
selected_item
)
{
gfx_box
(
&
w
->
dc
,
LEFT_MARGIN
,
i
*
LINE_HEIGHT
,
127
,
(
i
+
1
)
*
LINE_HEIGHT
,
1
);
}
// TODO draw icon
// display label (either app or submenu)
menu_entry
*
ent
=
&
(
*
current_menu
)
->
entries
[
i
];
if
(
ent
->
type
==
APP
)
{
application
*
a
=
ent
->
data
.
app
;
...
...
@@ -67,6 +71,7 @@ static void menu_screen_redraw(struct ui_widget *w)
static
void
menu_screen_event
(
struct
ui_widget
*
w
,
const
struct
event
*
evt
)
{
// scroll through the menu if a button was pressed
if
(
evt
->
type
==
BUTTON_PRESSED
)
{
if
(
evt
->
data
.
button
==
BUT_BR
)
{
if
(
selected_item
<
menu_size
-
1
)
{
...
...
@@ -137,6 +142,7 @@ void menu_main(void* params) {
menu_size
=
get_menu_size
(
*
current_menu
);
// run clock as the the initial application
clock
.
main
(
NULL
);
menu_ui_init
();
...
...
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