mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 12:53:34 +08:00
Support v5X build variants
This adds support for the different implementation variants of the v5X standard.
This commit is contained in:
@@ -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