diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-08 18:47:46 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-08 18:47:46 +0200 |
commit | 7a912a3fe47bced7c04d948cc3da094fea7542bc (patch) | |
tree | d653955dc344c26eb63550432c75c0589ae82e5f /nuttx/configs/px4fmu/src/up_hrt.c | |
parent | 7a6a4b93525ea62484a5df02f392b72a519ac248 (diff) | |
download | px4-firmware-7a912a3fe47bced7c04d948cc3da094fea7542bc.tar.gz px4-firmware-7a912a3fe47bced7c04d948cc3da094fea7542bc.tar.bz2 px4-firmware-7a912a3fe47bced7c04d948cc3da094fea7542bc.zip |
Minor but important fixes across system
Diffstat (limited to 'nuttx/configs/px4fmu/src/up_hrt.c')
-rw-r--r-- | nuttx/configs/px4fmu/src/up_hrt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nuttx/configs/px4fmu/src/up_hrt.c b/nuttx/configs/px4fmu/src/up_hrt.c index 35aecfe08..507358f8b 100644 --- a/nuttx/configs/px4fmu/src/up_hrt.c +++ b/nuttx/configs/px4fmu/src/up_hrt.c @@ -310,6 +310,7 @@ static void hrt_call_invoke(void); #define PPM_MAX_CHANNELS 12 uint16_t ppm_buffer[PPM_MAX_CHANNELS]; unsigned ppm_decoded_channels; +uint64_t ppm_last_valid_decode = 0; /* PPM edge history */ uint16_t ppm_edge_history[32]; @@ -427,6 +428,8 @@ hrt_ppm_decode(uint32_t status) for (i = 0; i < ppm.next_channel && i < PPM_MAX_CHANNELS; i++) ppm_buffer[i] = ppm_temp_buffer[i]; ppm_decoded_channels = i; + ppm_last_valid_decode = hrt_absolute_time(); + } /* reset for the next frame */ @@ -485,6 +488,8 @@ hrt_ppm_decode(uint32_t status) error: /* we don't like the state of the decoder, reset it and try again */ ppm.phase = UNSYNCH; + ppm_decoded_channels = 0; + } #endif /* CONFIG_HRT_PPM */ |