From cffdb1c8e216e779050465e516960cd370b30bdf Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 15 Oct 2015 17:20:09 +0200 Subject: [PATCH] timex: introduce USEC_IN_NS constant --- sys/include/timex.h | 5 +++++ sys/posix/semaphore/posix_semaphore.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/include/timex.h b/sys/include/timex.h index 935f702cd..9a9432143 100644 --- a/sys/include/timex.h +++ b/sys/include/timex.h @@ -43,6 +43,11 @@ extern "C" { */ #define MS_IN_USEC (1000U) +/** + * @brief The number of nanoseconds per microsecond + */ +#define USEC_IN_NS (1000) + /** * @brief The maximum length of the string representation of a timex timestamp */ diff --git a/sys/posix/semaphore/posix_semaphore.c b/sys/posix/semaphore/posix_semaphore.c index 4f9756296..4e8d67893 100644 --- a/sys/posix/semaphore/posix_semaphore.c +++ b/sys/posix/semaphore/posix_semaphore.c @@ -32,8 +32,6 @@ #include "semaphore.h" -#define USEC_IN_NS (1000) - int sem_timedwait(sem_t *sem, const struct timespec *abstime) { timex_t now, timeout = { abstime->tv_sec, abstime->tv_nsec / USEC_IN_NS };