Morse Micro IoT SDK  2.9.7

Detailed Description

Provides support for reading the system time.

Functions

uint32_t mmosal_get_time_ms (void)
 Get the system time in milliseconds. More...
 
uint32_t mmosal_get_time_ticks (void)
 Get the system time in ticks. More...
 
uint32_t mmosal_ticks_per_second (void)
 Get the number of ticks in a second. More...
 
static bool mmosal_time_lt (uint32_t a, uint32_t b)
 Check if time a is less than time b, taking into account wrapping. More...
 
static bool mmosal_time_le (uint32_t a, uint32_t b)
 Check if time a is less than or equal to time b, taking into account wrapping. More...
 
static uint32_t mmosal_time_max (uint32_t a, uint32_t b)
 Given two times, return the one that is greatest (taking into account wrapping). More...
 
static bool mmosal_time_has_passed (uint32_t t)
 Check if the given time has already passed. More...
 

Function Documentation

◆ mmosal_get_time_ms()

uint32_t mmosal_get_time_ms ( void  )

Get the system time in milliseconds.

Returns
the system time in milliseconds.

Definition at line 121 of file mmosal_shim_bootloader.c.

◆ mmosal_get_time_ticks()

uint32_t mmosal_get_time_ticks ( void  )

Get the system time in ticks.

Returns
the system time in ticks.

Definition at line 126 of file mmosal_shim_bootloader.c.

◆ mmosal_ticks_per_second()

uint32_t mmosal_ticks_per_second ( void  )

Get the number of ticks in a second.

Returns
the number of ticks in a second.

◆ mmosal_time_has_passed()

static bool mmosal_time_has_passed ( uint32_t  t)
inlinestatic

Check if the given time has already passed.

i.e the system time is greater than the given time.

Parameters
tThe time to check.
Returns
true if the given time has passed, else false.

Definition at line 725 of file mmosal.h.

◆ mmosal_time_le()

static bool mmosal_time_le ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Check if time a is less than or equal to time b, taking into account wrapping.

a b return
0 0 true
0 1 true
1 0 false
0xffffffff 0 true
0 0xffffffff false
Parameters
atime a
btime b
Returns
true if time a <= time b.

Definition at line 685 of file mmosal.h.

◆ mmosal_time_lt()

static bool mmosal_time_lt ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Check if time a is less than time b, taking into account wrapping.

a b return
0 0 false
0 1 true
1 0 false
0xffffffff 0 true
0 0xffffffff false
Parameters
atime a
btime b
Returns
true if time a < time b.

Definition at line 662 of file mmosal.h.

◆ mmosal_time_max()

static uint32_t mmosal_time_max ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Given two times, return the one that is greatest (taking into account wrapping).

a b return
0 0 0
0 1 1
1 0 1
0xffffffff 0 0
0 0xffffffff 0
Parameters
atime a
btime b
Returns
a if time a >= time b else b.

Definition at line 706 of file mmosal.h.