Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Uptime in 00h:00m:00s
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jul 14, 2023
1 parent 881ab4a commit c7ec0d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions applications/settings/power_settings_app/views/battery_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
if(model->alt) {
elements_button_left(canvas, "Back");
elements_button_right(canvas, "Next");
char uptime[17];
char uptime[15];
uint32_t sec = furi_get_tick() / furi_kernel_get_tick_frequency();
snprintf(
uptime, sizeof(uptime), "Up %02lu:%02lu:%02lu", sec / 3600, sec / 60 % 60, sec % 60);
uptime, sizeof(uptime), "%02luh%02lum%02lus", sec / 3600, sec / 60 % 60, sec % 60);
canvas_draw_str_aligned(canvas, 64, 61, AlignCenter, AlignBottom, uptime);
}
}
Expand Down

0 comments on commit c7ec0d7

Please sign in to comment.