diff --git a/src/drivers/device/i2c_nuttx.cpp b/src/drivers/device/i2c_nuttx.cpp index 88c40e5c48..7fbc4fc612 100644 --- a/src/drivers/device/i2c_nuttx.cpp +++ b/src/drivers/device/i2c_nuttx.cpp @@ -49,7 +49,7 @@ namespace device * All calls to init() will NOT set the buss frequency */ -unsigned int I2C::_bus_clocks[3] = { 100000, 100000, 100000 }; +unsigned int I2C::_bus_clocks[BOARD_NUMBER_I2C_BUSES] = BOARD_I2C_BUS_CLOCK_INIT; I2C::I2C(const char *name, const char *devname, diff --git a/src/drivers/device/i2c_nuttx.h b/src/drivers/device/i2c_nuttx.h index f4aa608857..00e4848500 100644 --- a/src/drivers/device/i2c_nuttx.h +++ b/src/drivers/device/i2c_nuttx.h @@ -62,7 +62,7 @@ public: static int set_bus_clock(unsigned bus, unsigned clock_hz); - static unsigned int _bus_clocks[3]; + static unsigned int _bus_clocks[BOARD_NUMBER_I2C_BUSES]; protected: /**