Versions Compared

Key

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

Set Clock timestamp.

Files

clk.h/clk.c

Prototype

Code Block
languagecpp
CPU_BOOLEAN  Clk_SetTS (CLK_TS_SEC  ts_sec);


Arguments

ts_sec

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

Returned Values

DEF_OK, if timestamp is successfully set.

DEF_FAIL, otherwise.

Required Configuration

None

Notes / Warnings

Clock timestamp should be set for UTC+00 (i.e., no local time zone offset included).

Example Usage

Anchor
Listing - Clk_SetTS() Example Usage
Listing - Clk_SetTS() Example Usage

Code Block
languagecpp
titleListing - Clk_SetTS() Example Usage
linenumberstrue
CLK_TS_SEC   ts_sec;
CPU_BOOLEAN  valid;
 
ts_sec = 15052;
valid  = Clk_SetTS(ts_sec);
if (valid == DEF_OK) {
    printf("Clock Set TS successful\n\r");
} else {
    printf("Clock Set TS error\n\r");
}