Support v5X build variants

This adds support for the different implementation variants of the v5X standard.
This commit is contained in:
Lorenz Meier
2021-02-14 11:17:28 +01:00
parent 2be482c5ae
commit 4c9b2c65b5
4 changed files with 78 additions and 13 deletions
+26
View File
@@ -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;
}