mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 05:43:35 +08:00
POSIX SIM: Reset the HRT on system boot
This commit is contained in:
@@ -66,6 +66,8 @@ static hrt_abstime px4_timestart = 0;
|
||||
static void
|
||||
hrt_call_invoke(void);
|
||||
|
||||
__EXPORT hrt_abstime hrt_reset(void);
|
||||
|
||||
static void hrt_lock(void)
|
||||
{
|
||||
//printf("hrt_lock\n");
|
||||
@@ -128,6 +130,12 @@ hrt_abstime hrt_absolute_time(void)
|
||||
return ts_to_abstime(&ts) - px4_timestart;
|
||||
}
|
||||
|
||||
__EXPORT hrt_abstime hrt_reset(void)
|
||||
{
|
||||
px4_timestart = 0;
|
||||
return hrt_absolute_time();
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a timespec to absolute time.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user