mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Support v5X build variants
This adds support for the different implementation variants of the v5X standard.
This commit is contained in:
@@ -8,22 +8,52 @@ board_adc start
|
||||
ina226 -X -b 1 -t 1 -k start
|
||||
ina226 -X -b 2 -t 2 -k start
|
||||
|
||||
# Internal SPI BMI088
|
||||
bmi088 -A -R 4 -s start
|
||||
bmi088 -G -R 4 -s start
|
||||
if ver hwtypecmp V5X90 V5X91 V5Xa0 V5Xa1
|
||||
then
|
||||
#SKYNODE base fmu board orientation
|
||||
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 6 -s start
|
||||
# Internal SPI BMI088
|
||||
bmi088 -A -R 2 -s start
|
||||
bmi088 -G -R 2 -s start
|
||||
|
||||
# Internal SPI bus ICM-20602 (hard-mounted)
|
||||
icm20602 -R 10 -s start
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 4 -s start
|
||||
|
||||
# Internal magnetometer on I2c
|
||||
bmm150 -I start
|
||||
# Internal SPI bus ICM-20602 (hard-mounted)
|
||||
icm20602 -R 8 -s start
|
||||
|
||||
# Internal magnetometer on I2c
|
||||
bmm150 -I -R 6 start
|
||||
|
||||
else
|
||||
#FMUv5Xbase board orientation
|
||||
|
||||
# Internal SPI BMI088
|
||||
bmi088 -A -R 4 -s start
|
||||
bmi088 -G -R 4 -s start
|
||||
|
||||
# Internal SPI bus ICM42688p
|
||||
icm42688p -R 6 -s start
|
||||
|
||||
# Internal SPI bus ICM-20602 (hard-mounted)
|
||||
icm20602 -R 10 -s start
|
||||
|
||||
# Internal magnetometer on I2c
|
||||
bmm150 -I start
|
||||
|
||||
fi
|
||||
|
||||
# Possible internal Baro
|
||||
bmp388 -I -a 0x77 start
|
||||
bmp388 -I start
|
||||
|
||||
# Baro on I2C3
|
||||
ms5611 -X start
|
||||
# Disable startup of internal baros if param is set to false
|
||||
if param compare SENS_INT_BARO_EN 1
|
||||
then
|
||||
bmp388 -I -a 0x77 start
|
||||
if ver hwtypecmp V5X91 V5Xa1
|
||||
then
|
||||
bmp388 -X -b 2 start
|
||||
else
|
||||
bmp388 -I start
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
@@ -127,6 +127,14 @@ SECTIONS
|
||||
_einit = ABSOLUTE(.);
|
||||
} > FLASH_AXIM
|
||||
|
||||
/*
|
||||
* Construction data for parameters.
|
||||
*/
|
||||
__param ALIGN(4): {
|
||||
__param_start = ABSOLUTE(.);
|
||||
KEEP(*(__param*))
|
||||
__param_end = ABSOLUTE(.);
|
||||
} > FLASH_AXIM
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
|
||||
@@ -434,6 +434,7 @@
|
||||
|
||||
#define BOARD_NUM_IO_TIMERS 5
|
||||
|
||||
|
||||
#define PX4_I2C_BUS_MTD 4,5
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -286,5 +286,31 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
px4_platform_configure();
|
||||
|
||||
int hw_version = board_get_hw_version();
|
||||
|
||||
if (hw_version == 0x9 || hw_version == 0xa) {
|
||||
static MCP23009 mcp23009{3, 0x25};
|
||||
|
||||
// No USB
|
||||
if (hw_version == 0x9) {
|
||||
// < P8
|
||||
ret = mcp23009.init(0xf0, 0xf0, 0x0f);
|
||||
// >= P8
|
||||
//ret = mcp23009.init(0xf1, 0xf0, 0x0f);
|
||||
}
|
||||
|
||||
if (hw_version == 0xa) {
|
||||
// < P6
|
||||
//ret = mcp23009.init(0xf0, 0xf0, 0x0f);
|
||||
// >= P6
|
||||
ret = mcp23009.init(0xf1, 0xf0, 0x0f);
|
||||
}
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user