|
|
# Application development guide
|
|
|
|
|
|
There is a single commit (commit:64805071) that contains an example
|
|
|
application that might be a good starting point to start development. I
|
|
|
did my best to make it as simple as possible, but here you may find some
|
|
|
additional comments.
|
|
|
|
|
|
### Menu entry
|
|
|
|
|
|
To make your application visible in the main menu, choose the right
|
|
|
submenu (or create a new one) and an entry in
|
|
|
sw/freertos/apps/src/menu\_struct.c:
|
|
|
|
|
|
{ APP, &example_icon, { .app = &example } },
|
|
|
|
|
|
The three fields indicate:
|
|
|
|
|
|
1. APP stands for application type entry
|
|
|
2. \&example\_icon is pointer to a structure containing icon data (or
|
|
|
NULL if there is no icon); more details below
|
|
|
3. structure dependent on entry type; for applications it stores a
|
|
|
pointer to your *application* structure
|
|
|
|
|
|
Example submenu entry:
|
|
|
|
|
|
{ SUBMENU, NULL, { .submenu = &sub_menu } },
|
|
|
|
|
|
explained:
|
|
|
|
|
|
1. SUBMENU is the entry type
|
|
|
2. NULL means that there is no icon (but you can have one for submenus
|
|
|
too)
|
|
|
3. the last field is a structure with a pointer to the submenu
|
|
|
(*menu\_list* type) that should be activated
|
|
|
|
|
|
There is also a special entry that servers as the sentinel:
|
|
|
|
|
|
{ END, NULL, { NULL } }
|
|
|
|
|
|
You should have one at the end of each submenu, otherwise baaaad things
|
|
|
will happen - I promise.
|
|
|
|
|
|
### Icon (and other graphics)
|
|
|
|
|
|
To decorate an entry in menu with an icon, you need to create a 16x16
|
|
|
pixels bitmap (.bmp format) and put it to sw/bitmaps/ folder. Afterwards
|
|
|
run the bmp2rle.py script. It will convert the new bitmap to a C
|
|
|
structure that may be used as icon. You can add any graphics you would
|
|
|
like use in your app in the same way.
|
|
|
If your file is named *graphic.bmp*, then the created structure will be
|
|
|
called *graphic* (*struct rle\_bitmap* type) - this is what you type in
|
|
|
menu entry in the icon field (prefixed by &, as in the example above).
|
|
|
|
|
|
### Template (src/example\_app.{c,h}
|
|
|
|
|
|
### Widgets
|
|
|
|
|
|
### Events
|
|
|
|