Round up the charge % when drawing battery icon (#912)

Causes anxious urge to recharge otherwise
This commit is contained in:
Vlad Roskov 2021-12-18 14:11:18 +03:00 committed by GitHub
parent 93871f9425
commit 26b2d07dd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ void power_draw_battery_callback(Canvas* canvas, void* context) {
furi_assert(context); furi_assert(context);
Power* power = context; Power* power = context;
canvas_draw_icon(canvas, 0, 0, &I_Battery_26x8); canvas_draw_icon(canvas, 0, 0, &I_Battery_26x8);
canvas_draw_box(canvas, 2, 2, power->info.charge / 5, 4); canvas_draw_box(canvas, 2, 2, (power->info.charge + 4) / 5, 4);
} }
static ViewPort* power_battery_view_port_alloc(Power* power) { static ViewPort* power_battery_view_port_alloc(Power* power) {