Skip to content

Commit

Permalink
Fix "datetime" display on web interface. (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjko authored Dec 27, 2024
1 parent 23435f5 commit 0ab7dcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ u16_t fanpico_ssi_handler(const char *tag, char *insert, int insertlen,
time_t t;
if (rtc_get_time(&t)) {
time_t_to_str(insert, insertlen, t);
printed = strnlen(insert, insertlen);
}
}
if (!strncmp(tag, "uptime", 6)) {
else if (!strncmp(tag, "uptime", 6)) {
uint32_t secs = to_us_since_boot(get_absolute_time()) / 1000000;
uint32_t mins = secs / 60;
uint32_t hours = mins / 60;
Expand All @@ -269,7 +270,7 @@ u16_t fanpico_ssi_handler(const char *tag, char *insert, int insertlen,
mins % 60,
secs % 60);
}
if (!strncmp(tag, "watchdog", 8)) {
else if (!strncmp(tag, "watchdog", 8)) {
printed = snprintf(insert, insertlen, "%s",
(rebooted_by_watchdog ? "☹" : "☺"));
}
Expand Down

0 comments on commit 0ab7dcf

Please sign in to comment.