am 3e3d0780: am 6fb3df8d: Merge "charger: make the almost-full frame only show when it\'s current level" into ics-mr0
* commit '3e3d0780fcc8da7f9917b3f9d05e16ffc08d4b6f':
charger: make the almost-full frame only show when it's current level
diff --git a/charger/charger.c b/charger/charger.c
index 03280bf..abf5517 100644
--- a/charger/charger.c
+++ b/charger/charger.c
@@ -87,6 +87,7 @@
const char *name;
int disp_time;
int min_capacity;
+ bool level_only;
gr_surface surface;
};
@@ -157,6 +158,7 @@
.name = "charger/battery_4",
.disp_time = 750,
.min_capacity = 80,
+ .level_only = true,
},
{
.name = "charger/battery_5",
@@ -735,7 +737,14 @@
* if necessary, advance cycle cntr, and reset frame cntr
*/
batt_anim->cur_frame++;
- if (batt_anim->cur_frame == batt_anim->num_frames) {
+
+ /* if the frame is used for level-only, that is only show it when it's
+ * the current level, skip it during the animation.
+ */
+ while (batt_anim->cur_frame < batt_anim->num_frames &&
+ batt_anim->frames[batt_anim->cur_frame].level_only)
+ batt_anim->cur_frame++;
+ if (batt_anim->cur_frame >= batt_anim->num_frames) {
batt_anim->cur_cycle++;
batt_anim->cur_frame = 0;