Skip to content
Snippets Groups Projects
Commit 27cae912 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Kinetis: Add atomic and non-atomic HRT calls

This reduces interrupt load significantly.
parent c6718a5b
No related branches found
No related tags found
No related merge requests found
......@@ -599,6 +599,17 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
*/
hrt_abstime
hrt_elapsed_time(const volatile hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;
return delta;
}
/**
* Compare a time value with the current time as atomic operation.
*/
hrt_abstime
hrt_elapsed_time_atomic(const volatile hrt_abstime *then)
{
irqstate_t flags = px4_enter_critical_section();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment