From 64aaec441917e4e10e687d655a43d137c298a6f3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 7 Aug 2017 16:08:19 -1000 Subject: [PATCH] i2c_nuttx:Use BOARD_NUMBER_I2C_BUSES and BOARD_I2C_BUS_CLOCK_INIT Used the board overrideable vlaues to define the _bus_clocks array and initalize it. --- src/drivers/device/i2c_nuttx.cpp | 2 +- src/drivers/device/i2c_nuttx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: /**