USE_SOCKET_SELECT_SUPPORT now exclusively means 'host select() fallback'.
ESP32/LibreTiny use USE_LWIP_FAST_SELECT instead. This eliminates
all 'USE_SOCKET_SELECT_SUPPORT && !USE_LWIP_FAST_SELECT' guards.
Wake primitives (esp_schedule, __sev, FreeRTOS task notifications)
are platform SDK functions that don't depend on the socket/network
stack. Move them to esphome/core/wake.h/.cpp so they work
unconditionally on all platforms.
This eliminates the require_wake_loop_threadsafe() boilerplate,
the USE_WAKE_LOOP_THREADSAFE define, and the socket AUTO_LOAD
entries that 12 components needed just to use wake.
wake_loop_threadsafe() and wake_loop_any_context() now just work
on every platform without opt-in.
A latched interrupt at boot is harmless - the ISR fires immediately,
loop runs, cache invalidates, and a normal read cycle clears it.
The extra register reads added unnecessary complexity.
- MCP23008/MCP23S08: Read GPIO register before attaching ISR to clear
any latched interrupt from a previous MCU run (chip may stay powered)
- MCP23017/MCP23S17: Read both GPIOA and GPIOB to clear latched state
- PI4IOE5V6408: Add explicit static_cast<uint8_t> for ~mode_mask_ to
avoid implicit int-to-uint8_t truncation
MCP23XXXGPIOPin::setup() calls pin_interrupt_mode(pin, NO_INTERRUPT)
after pin_mode() already auto-enabled CHANGE, undoing the auto-enable.
Skip the explicit pin_interrupt_mode call when interrupt_pin is
configured and the user didn't override the default.
- MCP23017/MCP23S17: Enable MIRROR bit in IOCON when interrupt_pin is
configured so INTA and INTB are ORed together, allowing a single
interrupt wire to catch changes on all 16 pins
- All MCP23xxx variants: Log interrupt_pin in dump_config for debugging
- PI4IOE5V6408: Read interrupt status register during setup to clear
any latched state that could hold INT line low
- MCP23XXXBase: Move setup_interrupt_pin_() to protected visibility
- MCP23x08/x17: auto-enable CHANGE interrupt mode in pin_mode() when
interrupt_pin is configured, so users don't need to manually set
interrupt: CHANGE on every pin
- PI4IOE5V6408: write interrupt enable mask for input pins in
write_gpio_modes_() when interrupt_pin is configured
Extend interrupt_pin support to MCP23008, MCP23017, MCP23S08, MCP23S17,
and PI4IOE5V6408 GPIO expander components. Same approach as PCF8574/PCA9554:
when configured, the component disables its loop and only wakes on interrupt,
and the cache stays valid between interrupts so binary sensors return from
cache instead of doing I2C/SPI reads every loop iteration.
For MCP23xxx, the interrupt_pin config and C++ logic lives in the shared
MCP23XXXBase template class, so all four variants (I2C 8/16-pin, SPI
8/16-pin) inherit it automatically.
Inspired by jesserockz's work in #11959 which proposed a more comprehensive
interrupt-driven approach with per-pin interrupt status register reading.
This implementation takes a simpler path by leveraging the existing
CachedGpioExpander cache invalidation mechanism.