POSIX SIM: Reset the HRT on system boot

This commit is contained in:
Lorenz Meier
2015-07-04 08:35:11 -07:00
parent 46a6082a26
commit f0f28d5420
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -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.
*/