Browse Source

Hotfix: Be more aggressive about SPI2 init on v1 boards

sbg
Lorenz Meier 11 years ago
parent
commit
c63995e91c
  1. 17
      src/drivers/boards/px4fmu-v1/px4fmu_init.c

17
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. * 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 * Keep the SPI2 init optional and conditionally initialize the ADC pins
*/ */
spi2 = up_spiinitialize(2);
if (!spi2) { #ifdef CONFIG_STM32_SPI2
message("[boot] Enabling IN12/13 instead of SPI2\n"); spi2 = up_spiinitialize(2);
/* no SPI2, use pins for ADC */
stm32_configgpio(GPIO_ADC1_IN12);
stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards
} else {
/* Default SPI2 to 1MHz and de-assert the known chip selects. */ /* Default SPI2 to 1MHz and de-assert the known chip selects. */
SPI_SETFREQUENCY(spi2, 10000000); SPI_SETFREQUENCY(spi2, 10000000);
SPI_SETBITS(spi2, 8); SPI_SETBITS(spi2, 8);
@ -238,7 +233,13 @@ __EXPORT int nsh_archinitialize(void)
SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false); SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false);
message("[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n"); 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 */ /* Get the SPI port for the microSD slot */

Loading…
Cancel
Save