Skip to content

Commit

Permalink
RemoteIDModule: Format update time as h:mm:ss
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura authored and tridge committed Sep 22, 2022
1 parent 22ced5a commit 35bcb31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion RemoteIDModule/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ String status_json(void)
const uint32_t sec = now_s % 60;
const uint32_t min = (now_s / 60) % 60;
const uint32_t hr = (now_s / 3600) % 24;
char minsec_str[6] {}; // HOUR does not include. Because wired powered drones allow for longer flight times.
snprintf(minsec_str, sizeof(minsec_str), "%02d:%02d", min, sec);
char githash[20];
snprintf(githash, sizeof(githash), "(%08x)", GIT_VERSION);
const json_table_t table[] = {
{ "STATUS:VERSION", String(FW_VERSION_MAJOR) + "." + String(FW_VERSION_MINOR) + " " + githash},
{ "STATUS:UPTIME", String(hr) + ":" + String(min) + ":" + String(sec) },
{ "STATUS:UPTIME", String(hr) + ":" + String(minsec_str) },
{ "STATUS:FREEMEM", String(ESP.getFreeHeap()) },
{ "BASICID:UAType", ENUM_MAP(uatype, UAS_data.BasicID[0].UAType) },
{ "BASICID:IDType", ENUM_MAP(idtype, UAS_data.BasicID[0].IDType) },
Expand Down

0 comments on commit 35bcb31

Please sign in to comment.