![]() |
Wirepas SDK for Mesh 2.4 GHz latest
|
Comparison functions include comparison for 8, 16, and 32-bit integers (Util_cmpUint8, Util_cmpUint16, Util_cmpUint32). The functions compare two values, and return the comparison result in UTIL_CMP_XXX value. For convenience, the following macros have been defined:
For example:
Low-resolution timers have a granularity of one second. Timers can be added with Util_addTimer(). When a timer is created, the user defines whether the timer is an application timer or not. The application timers generate App_timer() event, other timers must be checked with Util_checkTimer(). A timer can be modified and/or removed with Util_setTimer() function.
Definition in file util.h.
Go to the source code of this file.
Functions | |
bool | Util_isLtUint32 (uint32_t a, uint32_t b) |
bool | Util_isSmallest (const uint32_t a, const uint32_t b, const uint32_t c) |
bool | Util_inBetween (const uint32_t a, const uint32_t b, const uint32_t c) |
uint8_t | Util_bitCountU8 (uint8_t value) |
Calculate the '1' bits in 8-bit value. More... | |
Macros | |
#define | Util_isLtUint8(a, b) ((int8_t)((a) - (b)) < 0) |
#define | Util_isGtOrEqUint8(a, b) ((int8_t)((a) - (b)) >= 0) |
#define | Util_isLtUint16(a, b) ((int16_t)((a) - (b)) < 0) |
#define | Util_isGtOrEqUint16(a, b) ((int16_t)((a) - (b)) >= 0) |
#define | Util_isGtOrEqUint32(a, b) !Util_isLtUint32(a, b) |
#define | Util_isGtUint8(a, b) (!Util_isGtOrEqUint8(b, a)) |
#define | Util_isGtUint16(a, b) (!Util_isGtOrEqUint16(b, a)) |
#define | Util_isGtUint32(a, b) (!Util_isGtOrEqUint32(b, a)) |
#define | SA_MEMBERNAME(line) align ## line |
#define | SA_BASE(prev_type, size, line) |
#define | STRUCT_ALIGN_4(prev_type) SA_BASE(prev_type, 4, __LINE__) |
#define | STRUCT_ALIGN_2(prev_type) SA_BASE(prev_type, 2, __LINE__) |
uint8_t Util_bitCountU8 | ( | uint8_t | value | ) |
Calculate the '1' bits in 8-bit value.
value | Input value from where the amount of '1' bits is calculated |
bool Util_inBetween | ( | const uint32_t | a, |
const uint32_t | b, | ||
const uint32_t | c | ||
) |
Compares a, b, and c.
bool Util_isLtUint32 | ( | uint32_t | a, |
uint32_t | b | ||
) |
bool Util_isSmallest | ( | const uint32_t | a, |
const uint32_t | b, | ||
const uint32_t | c | ||
) |
Compares a, b, and c.
#define SA_BASE | ( | prev_type, | |
size, | |||
line | |||
) |
#define STRUCT_ALIGN_2 | ( | prev_type | ) | SA_BASE(prev_type, 2, __LINE__) |
#define STRUCT_ALIGN_4 | ( | prev_type | ) | SA_BASE(prev_type, 4, __LINE__) |
#define Util_isGtOrEqUint16 | ( | a, | |
b | |||
) | ((int16_t)((a) - (b)) >= 0) |
#define Util_isGtOrEqUint32 | ( | a, | |
b | |||
) | !Util_isLtUint32(a, b) |
#define Util_isGtOrEqUint8 | ( | a, | |
b | |||
) | ((int8_t)((a) - (b)) >= 0) |
#define Util_isGtUint16 | ( | a, | |
b | |||
) | (!Util_isGtOrEqUint16(b, a)) |
#define Util_isGtUint32 | ( | a, | |
b | |||
) | (!Util_isGtOrEqUint32(b, a)) |
#define Util_isGtUint8 | ( | a, | |
b | |||
) | (!Util_isGtOrEqUint8(b, a)) |