Skip to content

Commit

Permalink
firmware: app: libs: libpredict: src: Fixing the name of functions fr…
Browse files Browse the repository at this point in the history
…om time.h #336
  • Loading branch information
mgm8 committed Oct 5, 2023
1 parent 40ab5a2 commit 7e33cea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions firmware/app/libs/libpredict/src/julian_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ time_t mktime_utc(const struct tm* timeinfo_utc)

//get UTC time, interpret resulting tm as a localtime
struct tm timeinfo_gmt;
gmtime_r(&curr_time, &timeinfo_gmt);
timeinfo_gmt = *gmtime(&curr_time);
time_t time_gmt = mktime(&timeinfo_gmt);

//get localtime, interpret resulting tm as localtime
struct tm timeinfo_local;
localtime_r(&curr_time, &timeinfo_local);
timeinfo_local = *localtime(&curr_time);
time_t time_local = mktime(&timeinfo_local);

//find the time difference between the two interpretations
Expand Down Expand Up @@ -73,7 +73,7 @@ time_t predict_from_julian(predict_julian_date_t date)

//add number of seconds since julian start day to the julian start day, get current time_t
struct tm timeinfo;
gmtime_r(&ret_time, &timeinfo);
timeinfo = *gmtime(&ret_time);
timeinfo.tm_sec += seconds_since;
ret_time = mktime_utc(&timeinfo);
return ret_time;
Expand Down

0 comments on commit 7e33cea

Please sign in to comment.