diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-12-06 20:51:00 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-10 12:04:26 +0100 |
commit | 4956feffdfc8459c5f27e471b50978db29f23c07 (patch) | |
tree | ade7b8dd08f1ad4be5b6e926cb3112630cdb74ba /src/drivers/drv_hrt.h | |
parent | 513d014f03831111a1b9f9af293e253f7d5218a5 (diff) | |
download | px4-firmware-4956feffdfc8459c5f27e471b50978db29f23c07.tar.gz px4-firmware-4956feffdfc8459c5f27e471b50978db29f23c07.tar.bz2 px4-firmware-4956feffdfc8459c5f27e471b50978db29f23c07.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.h | 14 |
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); |