Commit f70381df authored by David Sidrane's avatar David Sidrane Committed by Daniel Agar
Browse files

i2c_spi_buses:Support devices that may change address

parent 84066f57
......@@ -642,7 +642,7 @@ void I2CSPIDriverBase::print_status()
bool is_i2c_bus = _bus_option == I2CSPIBusOption::I2CExternal || _bus_option == I2CSPIBusOption::I2CInternal;
if (is_i2c_bus) {
PX4_INFO("Running on I2C Bus %i, Address 0x%02X", _bus, _i2c_address);
PX4_INFO("Running on I2C Bus %i, Address 0x%02X", _bus, get_i2c_address());
} else {
PX4_INFO("Running on SPI Bus %i", _bus);
......
......@@ -62,11 +62,13 @@ class I2CSPIInstance : public ListNode<I2CSPIInstance *>
{
public:
virtual ~I2CSPIInstance() = default;
virtual int8_t get_i2c_address() {return _i2c_address;}
private:
I2CSPIInstance(const char *module_name, I2CSPIBusOption bus_option, int bus, uint8_t i2c_address, uint16_t type)
: _module_name(module_name), _bus_option(bus_option), _bus(bus), _type(type), _i2c_address(i2c_address) {}
friend class BusInstanceIterator;
friend class I2CSPIDriverBase;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment