mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
sched/clock: independent the CLOCK_BOOTTIME
The previous commit will cause build break if the definition of clock id is used in the switch case. Change-Id: Iecd078818d28879883dd582b236372ba43171b13 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@
|
||||
/* Monotonic system-wide clock that includes time spent in suspension. */
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
# define CLOCK_BOOTTIME CLOCK_MONOTONIC
|
||||
# define CLOCK_BOOTTIME 2
|
||||
#endif
|
||||
|
||||
/* This is a flag that may be passed to the timer_settime() and
|
||||
|
||||
@@ -74,6 +74,7 @@ int clock_getres(clockid_t clock_id, struct timespec *res)
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
case CLOCK_MONOTONIC:
|
||||
case CLOCK_BOOTTIME:
|
||||
#endif
|
||||
case CLOCK_REALTIME:
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
|
||||
* is invoked with a clock_id argument of CLOCK_MONOTONIC."
|
||||
*/
|
||||
|
||||
if (clock_id == CLOCK_MONOTONIC)
|
||||
if (clock_id == CLOCK_MONOTONIC || clock_id == CLOCK_BOOTTIME)
|
||||
{
|
||||
/* The the time elapsed since the timer was initialized at power on
|
||||
* reset.
|
||||
|
||||
@@ -161,6 +161,7 @@ int timer_create(clockid_t clockid, FAR struct sigevent *evp,
|
||||
if (timerid == NULL || (clockid != CLOCK_REALTIME
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
&& clockid != CLOCK_MONOTONIC
|
||||
&& clockid != CLOCK_BOOTTIME
|
||||
#endif /* CONFIG_CLOCK_MONOTONIC */
|
||||
))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user