mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 00:33:33 +08:00
VOXL2: HRT updates for synchronization with Qurt time (#22881)
- Added offset to Posix hrt time to account for synchronization with Qurt hrt time - Added new Kconfig to configure synchronization of HRT timestamps on VOXL2 - Moved voxl2 libfc sensor library submodule from muorb module to boards directory - Added check to make sure hrt_elapsed_time can never be negative
This commit is contained in:
+10
-1
@@ -162,7 +162,16 @@ static inline void abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
|
||||
*/
|
||||
static inline hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
|
||||
{
|
||||
return hrt_absolute_time() - *then;
|
||||
hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
// Cannot allow a negative elapsed time as this would appear
|
||||
// to be a huge positive elapsed time when represented as an
|
||||
// unsigned value!
|
||||
if (*then > now) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return now - *then;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user