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
7aee3932
Commit
7aee3932
authored
Aug 26, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menu: Entries have icons.
parent
3dfde748
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
27 deletions
+31
-27
application.h
sw/freertos/src/apps/application.h
+1
-3
menu.c
sw/freertos/src/apps/menu.c
+5
-2
menu_struct.c
sw/freertos/src/apps/menu_struct.c
+22
-22
menu_struct.h
sw/freertos/src/apps/menu_struct.h
+3
-0
No files found.
sw/freertos/src/apps/application.h
View file @
7aee3932
...
...
@@ -44,13 +44,11 @@ typedef struct {
///> Application name
const
char
*
name
;
// TODO const char* icon;
/**
* @brief Main application routine.
* @params Optional parameters, dependendent on application.
*/
void
(
*
main
)(
void
*
params
);
void
(
*
main
)(
void
*
params
);
}
application
;
/**
...
...
sw/freertos/src/apps/menu.c
View file @
7aee3932
...
...
@@ -58,10 +58,13 @@ static void menu_screen_redraw(struct ui_widget *w)
127
,
(
i
+
1
)
*
LINE_HEIGHT
,
1
);
}
// TODO draw icon
menu_entry
*
ent
=
&
(
*
current_menu
)
->
entries
[
pos
];
// draw icon
if
(
ent
->
icon
)
gfx_draw_bitmap
(
&
w
->
dc
,
0
,
i
*
LINE_HEIGHT
,
ent
->
icon
);
// display label (either app or submenu)
menu_entry
*
ent
=
&
(
*
current_menu
)
->
entries
[
pos
];
if
(
ent
->
type
==
APP
)
{
application
*
a
=
ent
->
data
.
app
;
...
...
sw/freertos/src/apps/menu_struct.c
View file @
7aee3932
...
...
@@ -40,34 +40,34 @@ int get_menu_size(const menu_list *menu) {
menu_list
sub_menu
=
{
"Submenu"
,
{
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
END
,
{
NULL
}
}
{
APP
,
&
gps_receiving
,
{
.
app
=
&
clock
}
},
{
APP
,
&
battery
,
{
.
app
=
&
clock
}
},
{
APP
,
&
gps_disconnected
,
{
.
app
=
&
clock
}
},
{
END
,
&
gps_searching
,
{
NULL
}
}
}
};
menu_list
main_menu
=
{
"Main menu"
,
{
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
{
.
submenu
=
&
sub_menu
}
},
{
SUBMENU
,
{
.
submenu
=
&
sub_menu
}
},
{
SUBMENU
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
APP
,
{
.
app
=
&
clock
}
},
{
END
,
{
NULL
}
}
{
APP
,
&
gps_receiving
,
{
.
app
=
&
clock
}
},
{
APP
,
&
battery_charging
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
NULL
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
&
battery
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
&
gps_disconnected
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
&
battery_charging
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
NULL
,
{
.
submenu
=
&
sub_menu
}
},
{
SUBMENU
,
NULL
,
{
.
submenu
=
&
sub_menu
}
},
{
SUBMENU
,
NULL
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
END
,
NULL
,
{
NULL
}
}
}
};
sw/freertos/src/apps/menu_struct.h
View file @
7aee3932
...
...
@@ -28,6 +28,7 @@
#define MENU_STRUCT_H
#include "application.h"
#include "bitmaps.h"
/**
* @brief Type of menu entry.
...
...
@@ -45,6 +46,8 @@ enum entry_type {
typedef
struct
menu_entry_t
{
enum
entry_type
type
;
const
struct
rle_bitmap
*
icon
;
union
{
application
*
app
;
struct
menu_list_t
*
submenu
;
...
...
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