Fix as per @jflyper's comments

This commit is contained in:
Martin Budden 2017-06-28 14:40:42 +01:00
parent c00ffe0427
commit 3d7145b088
2 changed files with 3 additions and 2 deletions

View File

@ -45,8 +45,9 @@ typedef enum I2CDevice {
#define I2CDEV_COUNT 4 #define I2CDEV_COUNT 4
#endif #endif
// Macro to convert CLI bus number to I2CDevice. // Macros to convert between CLI bus number and I2CDevice.
#define I2C_CFG_TO_DEV(x) ((x) - 1) #define I2C_CFG_TO_DEV(x) ((x) - 1)
#define I2C_DEV_TO_CFG(x) ((x) + 1)
// I2C device address range in 8-bit address mode // I2C device address range in 8-bit address mode
#define I2C_ADDR8_MIN 8 #define I2C_ADDR8_MIN 8

View File

@ -75,7 +75,7 @@
PG_REGISTER_WITH_RESET_TEMPLATE(dashboardConfig_t, dashboardConfig, PG_DASHBOARD_CONFIG, 0); PG_REGISTER_WITH_RESET_TEMPLATE(dashboardConfig_t, dashboardConfig, PG_DASHBOARD_CONFIG, 0);
PG_RESET_TEMPLATE(dashboardConfig_t, dashboardConfig, PG_RESET_TEMPLATE(dashboardConfig_t, dashboardConfig,
.device = DASHBOARD_I2C_INSTANCE, .device = I2C_DEV_TO_CFG(DASHBOARD_I2C_INSTANCE),
.address = DASHBOARD_I2C_ADDRESS, .address = DASHBOARD_I2C_ADDRESS,
); );