Skip to content

Commit

Permalink
Switch to using rtc_get_time() wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjko committed Dec 5, 2024
1 parent d57ff10 commit 752d738
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <string.h>
#include <time.h>
#include <assert.h>
#include "pico/aon_timer.h"
#include "pico/stdlib.h"
#include "cJSON.h"

Expand Down Expand Up @@ -253,10 +252,9 @@ u16_t fanpico_ssi_handler(const char *tag, char *insert, int insertlen,
/* printf("ssi_handler(\"%s\",%lx,%d,%u,%u)\n", tag, (uint32_t)insert, insertlen, current_tag_part, *next_tag_part); */

if (!strncmp(tag, "datetime", 8)) {
struct timespec ts;
if (aon_timer_is_running()) {
aon_timer_get_time(&ts);
time_t_to_str(insert, insertlen, timespec_to_time_t(&ts));
time_t t;
if (rtc_get_time(&t)) {
time_t_to_str(insert, insertlen, t);
}
}
if (!strncmp(tag, "uptime", 6)) {
Expand Down

0 comments on commit 752d738

Please sign in to comment.