mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 05:23:34 +08:00
boards/platform: remove confusing override
This removes the odd px4_i2c_bus_external override which was confusing me and lead to odd and inconsistent results. The function is now only available with an int as the argument.
This commit is contained in:
@@ -50,21 +50,7 @@ __EXPORT extern const px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS]; ///< b
|
||||
* runtime-check if a board has a specific bus as external.
|
||||
* This can be overridden by a board to add run-time checks.
|
||||
*/
|
||||
__EXPORT bool px4_i2c_bus_external(const px4_i2c_bus_t &bus);
|
||||
|
||||
/**
|
||||
* runtime-check if a board has a specific bus as external.
|
||||
*/
|
||||
static inline bool px4_i2c_bus_external(int bus)
|
||||
{
|
||||
for (int i = 0; i < I2C_BUS_MAX_BUS_ITEMS; ++i) {
|
||||
if (px4_i2c_buses[i].bus == bus) {
|
||||
return px4_i2c_bus_external(px4_i2c_buses[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
__EXPORT bool px4_i2c_bus_external(int bus);
|
||||
|
||||
/**
|
||||
* runtime-check if a board has a specific device as external.
|
||||
@@ -98,7 +84,7 @@ public:
|
||||
|
||||
int externalBusIndex() const { return _external_bus_counter; }
|
||||
|
||||
bool external() const { return px4_i2c_bus_external(bus()); }
|
||||
bool external() const { return px4_i2c_bus_external(_bus); }
|
||||
|
||||
private:
|
||||
const FilterType _filter;
|
||||
|
||||
Reference in New Issue
Block a user