kernel: Add helpers for converting durations into milliseconds

These should help to make it easier to understand code passing
specific durations to the kernel APIs.

Change-Id: I8682fafc291e8af56fd0289d0cab8c736b88da59
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-11-13 10:52:15 +02:00
commit 1447169c4b

View file

@ -496,6 +496,12 @@ extern void *k_thread_custom_data_get(void);
#include <sys_clock.h>
/* Convenience helpers to convert durations into milliseconds */
#define K_MSEC(ms) (ms)
#define K_SECONDS(s) K_MSEC((s) * MSEC_PER_SEC)
#define K_MINUTES(m) K_SECONDS((m) * 60)
#define K_HOURS(h) K_MINUTES((h) * 60)
/* private internal time manipulation (users should never play with ticks) */
/* added tick needed to account for tick in progress */