mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
IO firmware: Run critical timing operations as atomic
This is required as we might be in interrupt context on this bare-metal target.
This commit is contained in:
@@ -205,7 +205,7 @@ hrt_abstime ts_to_abstime(const struct timespec *ts)
|
||||
* This function is safe to use even if the timestamp is updated
|
||||
* by an interrupt during execution.
|
||||
*/
|
||||
hrt_abstime hrt_elapsed_time(const volatile hrt_abstime *then)
|
||||
hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
|
||||
{
|
||||
hrt_abstime delta = hrt_absolute_time() - *then;
|
||||
return delta;
|
||||
|
||||
Reference in New Issue
Block a user