mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-07 14:10:34 +08:00
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.
This commit is contained in:
committed by
Lorenz Meier
parent
9644f855e3
commit
64aaec4419
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user