mirror of
https://github.com/apache/nuttx.git
synced 2026-10-12 16:50:21 +00:00
sched/clock: fix CLOCK_BOOTTIME and CLOCK_MONOTONIC handling
The current implementation retrieves time from the same source for both CLOCK_BOOTTIME and CLOCK_MONOTONIC, which is incorrect. CLOCK_BOOTTIME includes time spent in system suspend, whereas CLOCK_MONOTONIC does not. This patch fixes the incorrect clock source handling and ensures the two clocks are distinguished properly. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
parent
303760b937
commit
ae1731210d
1 changed files with 1 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ int nxclock_gettime(clockid_t clock_id, FAR struct timespec *tp)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (clock_id == CLOCK_MONOTONIC || clock_id == CLOCK_BOOTTIME)
|
||||
if (clock_id == CLOCK_MONOTONIC)
|
||||
{
|
||||
/* The the time elapsed since the timer was initialized at power on
|
||||
* reset, excluding the time that the system is suspended.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue