diff options
author | px4dev <px4@purgatory.org> | 2013-03-19 21:03:27 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-03-19 21:03:27 -0700 |
commit | b7d65bf8fc65b2fd7c98d46d60fb24fb937baa94 (patch) | |
tree | df111ecf287a2852f32d3c58783496e479c4adc7 | |
parent | ccdb2da4f4e4b811f3f6d47a13fcdb66f9256cbd (diff) | |
download | px4-firmware-b7d65bf8fc65b2fd7c98d46d60fb24fb937baa94.tar.gz px4-firmware-b7d65bf8fc65b2fd7c98d46d60fb24fb937baa94.tar.bz2 px4-firmware-b7d65bf8fc65b2fd7c98d46d60fb24fb937baa94.zip |
HOTFIX: correct some logic errors with SPI chipselect generation.
Tested by Tridge.
-rw-r--r-- | apps/drivers/boards/px4fmu/px4fmu_spi.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/drivers/boards/px4fmu/px4fmu_spi.c b/apps/drivers/boards/px4fmu/px4fmu_spi.c index 70245a3ec..7a02eaeb7 100644 --- a/apps/drivers/boards/px4fmu/px4fmu_spi.c +++ b/apps/drivers/boards/px4fmu/px4fmu_spi.c @@ -92,21 +92,21 @@ __EXPORT void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, case PX4_SPIDEV_GYRO: /* Making sure the other peripherals are not selected */ stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected); - stm32_gpiowrite(GPIO_SPI_CS_MPU, selected); - stm32_gpiowrite(GPIO_SPI_CS_ACCEL, selected); + stm32_gpiowrite(GPIO_SPI_CS_MPU, 1); + stm32_gpiowrite(GPIO_SPI_CS_ACCEL, 1); break; case PX4_SPIDEV_ACCEL: /* Making sure the other peripherals are not selected */ stm32_gpiowrite(GPIO_SPI_CS_ACCEL, !selected); - stm32_gpiowrite(GPIO_SPI_CS_MPU, selected); - stm32_gpiowrite(GPIO_SPI_CS_GYRO, selected); + stm32_gpiowrite(GPIO_SPI_CS_MPU, 1); + stm32_gpiowrite(GPIO_SPI_CS_GYRO, 1); break; case PX4_SPIDEV_MPU: /* Making sure the other peripherals are not selected */ - stm32_gpiowrite(GPIO_SPI_CS_ACCEL, selected); - stm32_gpiowrite(GPIO_SPI_CS_GYRO, selected); + stm32_gpiowrite(GPIO_SPI_CS_ACCEL, 1); + stm32_gpiowrite(GPIO_SPI_CS_GYRO, 1); stm32_gpiowrite(GPIO_SPI_CS_MPU, !selected); break; @@ -125,7 +125,7 @@ __EXPORT uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devi __EXPORT void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { /* there can only be one device on this bus, so always select it */ - stm32_gpiowrite(GPIO_SPI_CS_SDCARD, 0); + stm32_gpiowrite(GPIO_SPI_CS_SDCARD, !selected); } __EXPORT uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) |