mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 17:23:33 +08:00
Build for ESC bus conditionally
This commit is contained in:
@@ -669,6 +669,8 @@ start()
|
||||
}
|
||||
|
||||
if (OK != g_dev->init()) {
|
||||
|
||||
#ifdef PX4_I2C_BUS_ESC
|
||||
delete g_dev;
|
||||
/* try 2nd bus */
|
||||
g_dev = new PX4FLOW(PX4_I2C_BUS_ESC);
|
||||
@@ -678,6 +680,8 @@ start()
|
||||
}
|
||||
|
||||
if (OK != g_dev->init()) {
|
||||
#endif
|
||||
|
||||
delete g_dev;
|
||||
/* try 3rd bus */
|
||||
g_dev = new PX4FLOW(PX4_I2C_BUS_ONBOARD);
|
||||
@@ -689,7 +693,10 @@ start()
|
||||
if (OK != g_dev->init()) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef PX4_I2C_BUS_ESC
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* set the poll rate to default, starts automatic data collection */
|
||||
|
||||
Reference in New Issue
Block a user