mirror of https://github.com/arendst/Tasmota.git
PCF8574 input pin initialization fix (#17499)
* step1 - quick test patch * mistake, pullup should be disabled * 2nd test version * refactoring * final
This commit is contained in:
parent
9f23151f78
commit
4a47514a25
|
@ -123,7 +123,9 @@ void Pcf8574Init(void)
|
|||
Pcf8574.max_connected_ports = 0; // reset no of devices to avoid duplicate ports on duplicate init.
|
||||
for (uint32_t idx = 0; idx < Pcf8574.max_devices; idx++) { // suport up to 8 boards PCF8574
|
||||
uint8_t gpio = Pcf8574Read(idx);
|
||||
Pcf8574.pin_mask[idx] = gpio;
|
||||
// Insure the input pins are actually writen a 1 for proper input operation
|
||||
Pcf8574.pin_mask[idx] = gpio | ~Settings->pcf8574_config[idx];
|
||||
Pcf8574Write(idx); // Write back to the register
|
||||
#ifdef USE_PCF8574_MQTTINPUT
|
||||
Pcf8574.last_input[idx] = gpio & ~Settings->pcf8574_config[idx];
|
||||
#endif // #ifdef USE_PCF8574_MQTTINPUT
|
||||
|
|
Loading…
Reference in New Issue