diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-13 01:10:05 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-13 01:10:05 -0700 |
commit | 178a3e8567b3e721771fffcb8f32df140ad1038b (patch) | |
tree | d0489f2cca40fd101db853596315443654f1ca72 /src/drivers/stm32 | |
parent | 634157210c6181f02bebfa3f43c64cf40694ab2a (diff) | |
parent | f10395e05a9fc11b36f70f6a9d864e83b6eadc01 (diff) | |
download | px4-firmware-178a3e8567b3e721771fffcb8f32df140ad1038b.tar.gz px4-firmware-178a3e8567b3e721771fffcb8f32df140ad1038b.tar.bz2 px4-firmware-178a3e8567b3e721771fffcb8f32df140ad1038b.zip |
Merge pull request #927 from PX4/ram_cleanup
Ram cleanup
Diffstat (limited to 'src/drivers/stm32')
-rw-r--r-- | src/drivers/stm32/drv_hrt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/stm32/drv_hrt.c b/src/drivers/stm32/drv_hrt.c index f324b341e..5bb550279 100644 --- a/src/drivers/stm32/drv_hrt.c +++ b/src/drivers/stm32/drv_hrt.c @@ -354,6 +354,9 @@ __EXPORT uint16_t ppm_frame_length = 0; __EXPORT unsigned ppm_decoded_channels = 0; __EXPORT uint64_t ppm_last_valid_decode = 0; +#define PPM_DEBUG 0 + +#if PPM_DEBUG /* PPM edge history */ __EXPORT uint16_t ppm_edge_history[32]; unsigned ppm_edge_next; @@ -361,6 +364,7 @@ unsigned ppm_edge_next; /* PPM pulse history */ __EXPORT uint16_t ppm_pulse_history[32]; unsigned ppm_pulse_next; +#endif static uint16_t ppm_temp_buffer[PPM_MAX_CHANNELS]; @@ -455,10 +459,12 @@ hrt_ppm_decode(uint32_t status) /* how long since the last edge? - this handles counter wrapping implicitely. */ width = count - ppm.last_edge; +#if PPM_DEBUG ppm_edge_history[ppm_edge_next++] = width; if (ppm_edge_next >= 32) ppm_edge_next = 0; +#endif /* * if this looks like a start pulse, then push the last set of values @@ -546,10 +552,12 @@ hrt_ppm_decode(uint32_t status) interval = count - ppm.last_mark; ppm.last_mark = count; +#if PPM_DEBUG ppm_pulse_history[ppm_pulse_next++] = interval; if (ppm_pulse_next >= 32) ppm_pulse_next = 0; +#endif /* if the mark-mark timing is out of bounds, abandon the frame */ if ((interval < PPM_MIN_CHANNEL_VALUE) || (interval > PPM_MAX_CHANNEL_VALUE)) |