libcoap 4.3.5-develop-4c3f4af
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)
#define FRAC   10
#define SHR_FP(val, 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 )
Value:
((1 << (frac)) * (fval))

Definition at line 81 of file coap_time.c.

◆ SHR_FP

#define SHR_FP ( val,
frac )
Value:
(((coap_tick_t)((val) + (1 << ((frac) - 1)))) >> (frac))
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition coap_time.h:149

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.