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
c5c435e9
Commit
c5c435e9
authored
Oct 07, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui: Battery indicator shows the proper status at the beginning.
parent
75f2a8f8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
menu.c
sw/freertos/src/apps/menu.c
+2
-0
battery_task.c
sw/freertos/src/battery_task.c
+6
-1
battery_task.h
sw/freertos/src/battery_task.h
+5
-0
No files found.
sw/freertos/src/apps/menu.c
View file @
c5c435e9
...
...
@@ -29,6 +29,7 @@
#include "menu_struct.h"
#include "widgets/status_bar.h"
#include "settings/settings.h"
#include "battery_task.h"
#include <stdio.h>
...
...
@@ -187,6 +188,7 @@ void menu_main(void* params) {
(
void
)(
params
);
// suppress unused parameter warning
struct
event
evt
;
battery_update
();
menu_size
=
get_menu_size
(
*
current_menu
);
// run clock as the the initial application
...
...
sw/freertos/src/battery_task.c
View file @
c5c435e9
...
...
@@ -53,7 +53,7 @@ static void battery_monitor_task(void *params)
unsigned
percentage
=
max17047_get_charge
();
// Send an event if measurements are different
if
(
charging
!=
cur_charging
||
percentage
!=
cur_percentage
)
{
if
(
!
params
||
charging
!=
cur_charging
||
percentage
!=
cur_percentage
)
{
evt
.
type
=
BATTERY_STATUS
;
evt
.
data
.
battery
.
percentage
=
percentage
;
evt
.
data
.
battery
.
charging
=
charging
;
...
...
@@ -63,6 +63,11 @@ static void battery_monitor_task(void *params)
}
}
void
battery_update
(
void
)
{
battery_monitor_task
(
NULL
);
}
void
battery_monitor_init
(
void
)
{
// Set invalid values to force an update
...
...
sw/freertos/src/battery_task.h
View file @
c5c435e9
...
...
@@ -32,4 +32,9 @@
*/
void
battery_monitor_init
(
void
);
/**
* Forces a battery status update event.
*/
void
battery_update
(
void
);
#endif
/* BATTERY_TASK_H */
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