Merge pull request #7557 from BASM/7556_i2csetdevice

i2c: I2cSetDevice wrong behavior
This commit is contained in:
Theo Arends 2020-01-19 15:31:56 +01:00 committed by GitHub
commit 588f3ca0b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 5 deletions

View File

@ -1521,11 +1521,7 @@ bool I2cSetDevice(uint32_t addr)
return false; // If already active report as not present;
}
Wire.beginTransmission((uint8_t)addr);
bool result = (0 == Wire.endTransmission());
if (result) {
I2cSetActive(addr, 1);
}
return result;
return (0 == Wire.endTransmission());
}
#endif // USE_I2C

View File

@ -4775,6 +4775,7 @@ bool Xdrv10(uint8_t function)
glob_script_mem.script_pram_size=MAX_SCRIPT_SIZE;
glob_script_mem.flags=1;
I2cSetActiveFound(EEPROM_ADDRESS, "EEPROM");
}
}
#endif

View File

@ -116,6 +116,7 @@ void ILI9488_InitDriver()
if (I2cEnabled(XI2C_38) && I2cSetDevice(FT6236_address)) {
FT6236begin(FT6236_address);
FT6236_found=1;
I2cSetActiveFound(FT6236_address, "FT6236");
} else {
FT6236_found=0;
}

View File

@ -101,6 +101,7 @@ void RA8876_InitDriver()
if (I2cEnabled(XI2C_39) && I2cSetDevice(FT5316_address)) {
FT6236begin(FT5316_address);
FT5316_found=1;
I2cSetActiveFound(FT5316_address, "FT5316");
} else {
FT5316_found=0;
}