|
|
|
@ -222,14 +222,9 @@ __EXPORT int nsh_archinitialize(void)
@@ -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)
@@ -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 */ |
|
|
|
|
|
|
|
|
|