2020-05-23 12:09:28 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Friedt Professional Engineering Services, Inc
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2022-05-06 11:23:05 +02:00
|
|
|
#include <zephyr/kernel.h>
|
2020-05-23 12:09:28 +02:00
|
|
|
#include <limits.h>
|
|
|
|
#include <errno.h>
|
|
|
|
/* required for struct timespec */
|
2022-05-06 11:23:05 +02:00
|
|
|
#include <zephyr/posix/time.h>
|
|
|
|
#include <zephyr/sys/util.h>
|
|
|
|
#include <zephyr/sys_clock.h>
|
2020-05-23 12:09:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Suspend execution for nanosecond intervals.
|
|
|
|
*
|
|
|
|
* See IEEE 1003.1
|
|
|
|
*/
|
|
|
|
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
|
|
|
|
{
|
2023-08-19 19:34:12 +02:00
|
|
|
return clock_nanosleep(CLOCK_MONOTONIC, 0, rqtp, rmtp);
|
2020-05-23 12:09:28 +02:00
|
|
|
}
|