aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2013-11-09 11:06:53 +0100
committerThomas Gubler <thomasgubler@gmail.com>2013-11-09 11:06:53 +0100
commit993bf06eafbe508e0e3beed817de8a79ebda098d (patch)
tree0fe917bdf8f424f6e7e24dc9e0ffab684ab06d62 /src
parentb172bcd9122e186d152b7bacf6495f7f27efc80c (diff)
parentc63995e91c188b476aa2608b42a366f68dced423 (diff)
downloadpx4-firmware-993bf06eafbe508e0e3beed817de8a79ebda098d.tar.gz
px4-firmware-993bf06eafbe508e0e3beed817de8a79ebda098d.tar.bz2
px4-firmware-993bf06eafbe508e0e3beed817de8a79ebda098d.zip
Merge remote-tracking branch 'upstream/master' into fw_autoland_att_tecs
Diffstat (limited to 'src')
-rw-r--r--src/drivers/boards/px4fmu-v1/px4fmu_init.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c
index 964f5069c..4b12b75f9 100644
--- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c
+++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c
@@ -222,14 +222,9 @@ __EXPORT int nsh_archinitialize(void)
* If SPI2 is enabled in the defconfig, we loose some ADC pins as chip selects.
* Keep the SPI2 init optional and conditionally initialize the ADC pins
*/
- spi2 = up_spiinitialize(2);
- if (!spi2) {
- message("[boot] Enabling IN12/13 instead of SPI2\n");
- /* no SPI2, use pins for ADC */
- stm32_configgpio(GPIO_ADC1_IN12);
- stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards
- } else {
+ #ifdef CONFIG_STM32_SPI2
+ spi2 = up_spiinitialize(2);
/* Default SPI2 to 1MHz and de-assert the known chip selects. */
SPI_SETFREQUENCY(spi2, 10000000);
SPI_SETBITS(spi2, 8);
@@ -238,7 +233,13 @@ __EXPORT int nsh_archinitialize(void)
SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false);
message("[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n");
- }
+ #else
+ spi2 = NULL;
+ message("[boot] Enabling IN12/13 instead of SPI2\n");
+ /* no SPI2, use pins for ADC */
+ stm32_configgpio(GPIO_ADC1_IN12);
+ stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards
+ #endif
/* Get the SPI port for the microSD slot */