drv_hrt: inline hrt_elapsed_time

GCC did not do that.
This commit is contained in:
Beat Küng
2019-01-23 15:16:18 +01:00
parent 2ffb49b734
commit 74a3c378b2
5 changed files with 4 additions and 47 deletions
-13
View File
@@ -198,19 +198,6 @@ hrt_abstime ts_to_abstime(const struct timespec *ts)
return result;
}
/*
* Compute the delta between a timestamp taken in the past
* and now.
*
* This function is safe to use even if the timestamp is updated
* by an interrupt during execution.
*/
hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/*
* Compute the delta between a timestamp taken in the past
* and now.
+4 -1
View File
@@ -98,7 +98,10 @@ __EXPORT extern void abstime_to_ts(struct timespec *ts, hrt_abstime abstime);
*
* This function is not interrupt save.
*/
__EXPORT extern hrt_abstime hrt_elapsed_time(const hrt_abstime *then);
static inline hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
{
return hrt_absolute_time() - *then;
}
/**
* Compute the delta between a timestamp taken in the past
-11
View File
@@ -594,17 +594,6 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
ts->tv_nsec = abstime * 1000;
}
/**
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/**
* Compare a time value with the current time as atomic operation.
*/
-11
View File
@@ -675,17 +675,6 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
ts->tv_nsec = abstime * 1000;
}
/**
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/**
* Compare a time value with the current time as atomic operation.
*/
-11
View File
@@ -715,17 +715,6 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
ts->tv_nsec = abstime * 1000;
}
/**
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/**
* Compare a time value with the current time as atomic operation
*/