aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-08-15 11:26:17 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-08-15 11:26:17 +0200
commit0dc240688dcae83e34f9001072ac151f4a3df140 (patch)
tree1b2d2e61dadfd890b7304c81db6df143d71ffb5c /src
parent29d78367846ebf7834ecd87b2cf528573c3fcdd8 (diff)
parent50cf1c01b701fced6437dfe574fd09cd312b9f15 (diff)
downloadpx4-firmware-0dc240688dcae83e34f9001072ac151f4a3df140.tar.gz
px4-firmware-0dc240688dcae83e34f9001072ac151f4a3df140.tar.bz2
px4-firmware-0dc240688dcae83e34f9001072ac151f4a3df140.zip
Merge branch 'fmuv2_bringup' of github.com:cvg/Firmware_Private into fmuv2_bringup
Diffstat (limited to 'src')
-rw-r--r--src/drivers/stm32/drv_hrt.c17
-rw-r--r--src/systemcmds/tests/test_hrt.c2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/drivers/stm32/drv_hrt.c b/src/drivers/stm32/drv_hrt.c
index 58529fb03..e79d7e10a 100644
--- a/src/drivers/stm32/drv_hrt.c
+++ b/src/drivers/stm32/drv_hrt.c
@@ -70,6 +70,8 @@
#include "stm32_gpio.h"
#include "stm32_tim.h"
+#ifdef HRT_TIMER
+
/* HRT configuration */
#if HRT_TIMER == 1
# define HRT_TIMER_BASE STM32_TIM1_BASE
@@ -153,7 +155,7 @@
# error must not set CONFIG_STM32_TIM11=y and HRT_TIMER=11
# endif
#else
-# error HRT_TIMER must be set in board.h if CONFIG_HRT_TIMER=y
+# error HRT_TIMER must be a value between 1 and 11
#endif
/*
@@ -324,7 +326,7 @@ static void hrt_call_invoke(void);
# define CCER_PPM (GTIM_CCER_CC4E | GTIM_CCER_CC4P | GTIM_CCER_CC4NP) /* CC4, both edges */
# define CCER_PPM_FLIP GTIM_CCER_CC4P
# else
-# error HRT_PPM_CHANNEL must be a value between 1 and 4 if CONFIG_HRT_PPM is set
+# error HRT_PPM_CHANNEL must be a value between 1 and 4
# endif
/*
@@ -422,7 +424,7 @@ hrt_tim_init(void)
up_enable_irq(HRT_TIMER_VECTOR);
}
-#ifdef CONFIG_HRT_PPM
+#ifdef HRT_PPM_CHANNEL
/*
* Handle the PPM decoder state machine.
*/
@@ -524,7 +526,7 @@ error:
ppm_decoded_channels = 0;
}
-#endif /* CONFIG_HRT_PPM */
+#endif /* HRT_PPM_CHANNEL */
/*
* Handle the compare interupt by calling the callout dispatcher
@@ -544,7 +546,7 @@ hrt_tim_isr(int irq, void *context)
/* ack the interrupts we just read */
rSR = ~status;
-#ifdef CONFIG_HRT_PPM
+#ifdef HRT_PPM_CHANNEL
/* was this a PPM edge? */
if (status & (SR_INT_PPM | SR_OVF_PPM)) {
@@ -684,7 +686,7 @@ hrt_init(void)
sq_init(&callout_queue);
hrt_tim_init();
-#ifdef CONFIG_HRT_PPM
+#ifdef HRT_PPM_CHANNEL
/* configure the PPM input pin */
stm32_configgpio(GPIO_PPM_IN);
#endif
@@ -903,3 +905,6 @@ hrt_latency_update(void)
/* catch-all at the end */
latency_counters[index]++;
}
+
+
+#endif /* HRT_TIMER */
diff --git a/src/systemcmds/tests/test_hrt.c b/src/systemcmds/tests/test_hrt.c
index f21dd115b..f6e540401 100644
--- a/src/systemcmds/tests/test_hrt.c
+++ b/src/systemcmds/tests/test_hrt.c
@@ -94,7 +94,7 @@ extern uint16_t ppm_pulse_history[];
int test_ppm(int argc, char *argv[])
{
-#ifdef CONFIG_HRT_PPM
+#ifdef HRT_PPM_CHANNEL
unsigned i;
printf("channels: %u\n", ppm_decoded_channels);