From a33ae3cc40a34c093b35038ae3f5c138522c7849 Mon Sep 17 00:00:00 2001 From: ako Date: Thu, 6 Feb 2020 22:45:39 +0100 Subject: [PATCH] PCF8574 - skip detection if i2c address is defined in USE_MCP230xx_ADDR Currently the PCF8574 address selection detects the MCP230xx which is using an address in the range 0x20 - 0x26. This fix skips the address defined in #define USE_MCP230xx_ADDR --- tasmota/xdrv_28_pcf8574.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasmota/xdrv_28_pcf8574.ino b/tasmota/xdrv_28_pcf8574.ino index ecbde786c..26ae9f65a 100644 --- a/tasmota/xdrv_28_pcf8574.ino +++ b/tasmota/xdrv_28_pcf8574.ino @@ -93,6 +93,12 @@ void Pcf8574Init(void) } 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 pcf8574_address = PCF8574_ADDR2 +1; }