Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Files

clk.h/clk.c

Prototype

Code Block
languagecpp
CPU_BOOLEAN  Clk_SetTS_NTP (CLK_TS_SEC  ts_ntp_sec);


Arguments

ts_ntp_sec

Current NTP timestamp to set (in seconds, UTC+00).

...

Only years supported by Clock and NTP can be set, thus the timestamp date must be between greater than or equal to CLK_EPOCH_YR_START and less than CLK_NTP_EPOCH_YR_END.

Example Usage

Anchor
Listing - Clk_SetTS_NTP() Example Usage
Listing - Clk_SetTS_NTP() Example Usage

Code Block
languagecpp
titleListing - Clk_SetTS_NTP() Example Usage
linenumberstrue
CLK_TS_SEC   ts_ntp_sec;
CPU_BOOLEAN  valid;
 
ts_ntp_sec = 3158880000;
valid      = Clk_SetTS_NTP(ts_ntp_sec);
if (valid == DEF_OK) {
    printf("Timestamp successfully set");
} else {
    printf("Set timestamp error\n\r");
}