Merge pull request #7687 from ako-sxt/development

PCF8574 - skip detection if i2c address is defined in USE_MCP230xx_ADDR
This commit is contained in:
Theo Arends 2020-02-07 11:53:52 +01:00 committed by GitHub
commit 945a9e0100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,12 @@ void Pcf8574Init(void)
} }
pcf8574_address++; pcf8574_address++;
#ifdef USE_MCP230xx_ADDR
if (USE_MCP230xx_ADDR == pcf8574_address) {
AddLog_P2(LOG_LEVEL_INFO, PSTR("PCF: Addr: 0x%x reserved for MCP320xx, skipping PCF8574 probe"), pcf8574_address);
pcf8574_address++;
}
#endif
if ((PCF8574_ADDR1 +7) == pcf8574_address) { // Support I2C addresses 0x20 to 0x26 and 0x39 to 0x3F if ((PCF8574_ADDR1 +7) == pcf8574_address) { // Support I2C addresses 0x20 to 0x26 and 0x39 to 0x3F
pcf8574_address = PCF8574_ADDR2 +1; pcf8574_address = PCF8574_ADDR2 +1;
} }