mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 15:33:35 +08:00
Remove CONFIG_ARCH_BOARD #ifdef dependencies from mtd
Since mtd already checks whether CONFIG_MTD_RAMTRON is set in defconfig use this define to check whether to call ramtron_attach() or at24xxx_attach() in the main function, instead of checking CONFIG_ARCH_BOARD_PX4FMU-V1. Also instead of using #ifdef CONFIG_ARCH_BOARD_AEROCORE to determine whether to start mtd on spi 2 or 4, rather use a new board define PX4_SPI_BUS_RAMTRON in the board_config.h file.
This commit is contained in:
committed by
Lorenz Meier
parent
199f6478ee
commit
48c467f602
@@ -82,6 +82,9 @@ __BEGIN_DECLS
|
||||
#define GPIO_SPI_CS_GYRO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3)
|
||||
#define GPIO_SPI_CS_BARO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4)
|
||||
|
||||
/* SPI4--Ramtron */
|
||||
#define PX4_SPI_BUS_RAMTRON 4
|
||||
|
||||
/* Nominal chip selects for devices on SPI bus #3 */
|
||||
#define PX4_SPIDEV_ACCEL_MAG 0
|
||||
#define PX4_SPIDEV_GYRO 1
|
||||
|
||||
@@ -113,6 +113,7 @@ __BEGIN_DECLS
|
||||
#define GPIO_SPI_CS_EXT3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
|
||||
|
||||
#define PX4_SPI_BUS_SENSORS 1
|
||||
#define PX4_SPI_BUS_RAMTRON 2
|
||||
#define PX4_SPI_BUS_EXT 4
|
||||
|
||||
/* Use these in place of the spi_dev_e enumeration to select a specific SPI device on SPI1 */
|
||||
|
||||
Reference in New Issue
Block a user