aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/controls.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-02-24 11:42:34 -0800
committerpx4dev <px4@purgatory.org>2013-02-24 11:42:34 -0800
commitf245d6b1a7edaa3b403007b704b4d54ecb7f3737 (patch)
tree57bf7266fa83e7327099763e402c2cd0d9f458e7 /apps/px4io/controls.c
parent923a7cc505971ab6d04115d18108152f62d46283 (diff)
downloadpx4-firmware-f245d6b1a7edaa3b403007b704b4d54ecb7f3737.tar.gz
px4-firmware-f245d6b1a7edaa3b403007b704b4d54ecb7f3737.tar.bz2
px4-firmware-f245d6b1a7edaa3b403007b704b4d54ecb7f3737.zip
Use hrt_elapsed_time() in cases where we can't be sure the timestamp won't change under us.
Diffstat (limited to 'apps/px4io/controls.c')
-rw-r--r--apps/px4io/controls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/px4io/controls.c b/apps/px4io/controls.c
index cad368ae4..6b5164756 100644
--- a/apps/px4io/controls.c
+++ b/apps/px4io/controls.c
@@ -218,7 +218,7 @@ controls_tick() {
* If we haven't seen any new control data in 200ms, assume we
* have lost input.
*/
- if ((hrt_absolute_time() - system_state.rc_channels_timestamp) > 200000) {
+ if (hrt_elapsed_time(&system_state.rc_channels_timestamp) > 200000) {
rc_input_lost = true;
/* clear the input-kind flags here */
@@ -294,7 +294,7 @@ ppm_input(uint16_t *values, uint16_t *num_values)
* If we have received a new PPM frame within the last 200ms, accept it
* and then invalidate it.
*/
- if ((hrt_absolute_time() - ppm_last_valid_decode) < 200000) {
+ if (hrt_elapsed_time(&ppm_last_valid_decode) < 200000) {
/* PPM data exists, copy it */
*num_values = ppm_decoded_channels;