hrt: remove hrt_elapsed_time_atomic

There's no protection on posix
This commit is contained in:
Beat Küng
2021-09-23 09:23:08 +02:00
parent 6f902e54f9
commit e73172b537
9 changed files with 3 additions and 87 deletions
-9
View File
@@ -110,15 +110,6 @@ 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
* and now.
*
* This function is safe to use even if the timestamp is updated
* by an interrupt during execution.
*/
__EXPORT extern hrt_abstime hrt_elapsed_time_atomic(const volatile hrt_abstime *then);
/**
* Store the absolute time in an interrupt-safe fashion.
*
@@ -144,7 +144,6 @@ bool MicroBenchHRT::time_px4_hrt()
{
PERF("hrt_absolute_time()", u_64_out = hrt_absolute_time(), 1000);
PERF("hrt_elapsed_time()", u_64_out = hrt_elapsed_time(&u_64), 1000);
PERF("hrt_elapsed_time_atomic()", u_64_out = hrt_elapsed_time_atomic(&u_64), 1000);
return true;
}
+2 -2
View File
@@ -71,13 +71,13 @@ int HRTTest::main()
hrt_abstime t = hrt_absolute_time();
px4_usleep(1000000);
hrt_abstime elt = hrt_elapsed_time_atomic(&t);
hrt_abstime elt = hrt_elapsed_time(&t);
PX4_INFO("Elapsed time %llu in 1 sec (usleep)\n", (unsigned long long)elt);
PX4_INFO("Start time %llu\n", (unsigned long long)t);
t = hrt_absolute_time();
px4_sleep(1);
elt = hrt_elapsed_time_atomic(&t);
elt = hrt_elapsed_time(&t);
PX4_INFO("Elapsed time %llu in 1 sec (sleep)\n", (unsigned long long)elt);
PX4_INFO("Start time %llu\n", (unsigned long long)t);