aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/drv_hrt.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2013-12-06 20:51:00 +1100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-10 11:03:31 +0100
commit53f2dc8296d550df8933663465cf163ae523084a (patch)
treeeb23b8d7f616fde0ad47a97bba5c0c7092a1abab /src/drivers/drv_hrt.h
parent86ec1c37fa29ba4ffc1d54a0c438de1cd536f51c (diff)
downloadpx4-firmware-53f2dc8296d550df8933663465cf163ae523084a.tar.gz
px4-firmware-53f2dc8296d550df8933663465cf163ae523084a.tar.bz2
px4-firmware-53f2dc8296d550df8933663465cf163ae523084a.zip
drv_hrt: added hrt_call_init() and hrt_call_delay() APIs
hrt_call_init() can be used to initialise (zero) a hrt_call structure to ensure safe usage. The hrt_call_every() interface calls this automatically. hrt_call_delay() can be used to delay a current callout by the given number of microseconds
Diffstat (limited to 'src/drivers/drv_hrt.h')
-rw-r--r--src/drivers/drv_hrt.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/drv_hrt.h b/src/drivers/drv_hrt.h
index 8a99eeca7..d130d68b3 100644
--- a/src/drivers/drv_hrt.h
+++ b/src/drivers/drv_hrt.h
@@ -142,6 +142,20 @@ __EXPORT extern bool hrt_called(struct hrt_call *entry);
__EXPORT extern void hrt_cancel(struct hrt_call *entry);
/*
+ * initialise a hrt_call structure
+ */
+__EXPORT extern void hrt_call_init(struct hrt_call *entry);
+
+/*
+ * delay a hrt_call_every() periodic call by the given number of
+ * microseconds. This should be called from within the callout to
+ * cause the callout to be re-scheduled for a later time. The periodic
+ * callouts will then continue from that new base time at the
+ * previously specified period.
+ */
+__EXPORT extern void hrt_call_delay(struct hrt_call *entry, hrt_abstime delay);
+
+/*
* Initialise the HRT.
*/
__EXPORT extern void hrt_init(void);