sys: time_units: Add SYS_FOREVER_US macro
Add macro for representing forever timeout in microseconds. Macro is similar to already existing SYS_FOREVER_MS. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
0f53679859
commit
cc69ca1a9b
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,12 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define SYS_FOREVER_MS (-1)
|
#define SYS_FOREVER_MS (-1)
|
||||||
|
|
||||||
|
/** @brief System-wide macro to denote "forever" in microseconds
|
||||||
|
*
|
||||||
|
* See @ref SYS_FOREVER_MS.
|
||||||
|
*/
|
||||||
|
#define SYS_FOREVER_US (-1)
|
||||||
|
|
||||||
/** @brief System-wide macro to convert milliseconds to kernel timeouts
|
/** @brief System-wide macro to convert milliseconds to kernel timeouts
|
||||||
*/
|
*/
|
||||||
#define SYS_TIMEOUT_MS(ms) ((ms) == SYS_FOREVER_MS ? K_FOREVER : K_MSEC(ms))
|
#define SYS_TIMEOUT_MS(ms) ((ms) == SYS_FOREVER_MS ? K_FOREVER : K_MSEC(ms))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue