Exclude SMBus addresses from detection matching upstream i2c-tools code

This commit is contained in:
Adam Honse 2019-12-20 13:07:21 -06:00
parent e0018b23aa
commit 02273a3601

View file

@ -16,6 +16,7 @@
std::string i2c_detect(i2c_smbus_interface * bus, int mode)
{
int i, j;
int first = 0x03, last = 0x77;
int res;
int slave_addr;
char line[128];
@ -31,6 +32,14 @@ std::string i2c_detect(i2c_smbus_interface * bus, int mode)
for (j = 0; j < 16; j++)
{
/* Skip unwanted addresses */
if (i+j < first || i+j > last)
{
sprintf(line, " ");
text.append(line);
continue;
}
/* Set slave address */
slave_addr = i + j;