Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: clk/clktm.c
- Revision:
- 54:a3c018ceca77
- Parent:
- 46:d3d56cb47940
- Child:
- 57:4daf2e423b27
--- a/clk/clktm.c Wed Feb 13 10:50:04 2019 +0000 +++ b/clk/clktm.c Thu Feb 21 12:47:15 2019 +0000 @@ -3,7 +3,8 @@ #include "tm.h" #include "clktime.h" +#include "clkutc.h" -void ClkTimeToTmLocal(int64_t time, struct tm* ptm) { TmLocalFromTimeT(time >> CLK_TIME_ONE_SECOND_SHIFT, ptm); } -void ClkTimeToTmUtc (int64_t time, struct tm* ptm) { TmUtcFromTimeT(time >> CLK_TIME_ONE_SECOND_SHIFT, ptm); } -int64_t ClkTimeFromTmUtc( struct tm* ptm) { return ((int64_t)TmUtcToTimeT(ptm)) << CLK_TIME_ONE_SECOND_SHIFT ; } \ No newline at end of file +void ClkTimeToTmLocal(int64_t time, struct tm* ptm) { TmLocalFromTimeT(ClkUtcFromTai(time) >> CLK_TIME_ONE_SECOND_SHIFT, ptm); } +void ClkTimeToTmUtc (int64_t time, struct tm* ptm) { TmUtcFromTimeT(ClkUtcFromTai(time) >> CLK_TIME_ONE_SECOND_SHIFT, ptm); } +int64_t ClkTimeFromTmUtc( struct tm* ptm) { return ClkUtcToTai(((int64_t)TmUtcToTimeT(ptm)) << CLK_TIME_ONE_SECOND_SHIFT) ; } \ No newline at end of file