libcoap 4.3.5-develop-490e4e0
Loading...
Searching...
No Matches
coap_time.c File Reference

Clock handling functions. More...

+ Include dependency graph for coap_time.c:

Go to the source code of this file.

Macros

#define Q(frac, fval)   ((1 << (frac)) * (fval))
 
#define FRAC   10
 
#define SHR_FP(val, frac)   (((coap_tick_t)((val) + (1 << ((frac) - 1)))) >> (frac))
 

Functions

void coap_clock_init (void)
 Initializes the internal clock.
 
void coap_ticks (coap_tick_t *t)
 Returns the current value of an internal tick counter.
 
coap_time_t coap_ticks_to_rt (coap_tick_t t)
 Helper function that converts coap ticks to wallclock time.
 
uint64_t coap_ticks_to_rt_us (coap_tick_t t)
 Helper function that converts coap ticks to POSIX wallclock time in us.
 
coap_tick_t coap_ticks_from_rt_us (uint64_t t)
 Helper function that converts POSIX wallclock time in us to coap ticks.
 

Variables

static coap_tick_t coap_clock_offset = 0
 

Detailed Description

Clock handling functions.

Definition in file coap_time.c.

Macro Definition Documentation

◆ FRAC

#define FRAC   10

Definition at line 84 of file coap_time.c.

◆ Q

#define Q (   frac,
  fval 
)    ((1 << (frac)) * (fval))

Definition at line 81 of file coap_time.c.

◆ SHR_FP

#define SHR_FP (   val,
  frac 
)    (((coap_tick_t)((val) + (1 << ((frac) - 1)))) >> (frac))

Definition at line 87 of file coap_time.c.

Variable Documentation

◆ coap_clock_offset

coap_tick_t coap_clock_offset = 0
static

Definition at line 37 of file coap_time.c.