Commit Graph
26617 Commits
Author SHA1 Message Date
J. Nick Koston 586196779b Merge remote-tracking branch 'upstream/gpio-expander-interrupt-pin-2' into integration 2026-04-04 13:43:06 -10:00
J. Nick Koston 18ad20a1bd Add binary sensors on interrupt-enabled hubs to exercise pin_mode path 2026-04-04 10:45:46 -10:00
J. Nick Koston 173195ee1b Add comments explaining why latched interrupts are not cleared at setup 2026-04-04 10:22:50 -10:00
J. Nick Koston af87f21e68 Remove unnecessary latched interrupt clearing during setup
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.
2026-04-04 10:22:19 -10:00
J. Nick Koston aeb8e9413b Clear latched MCP23xxx interrupts during setup, fix uint8_t truncation
- 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
2026-04-04 10:21:28 -10:00
J. Nick Koston 1e9e5ca763 Fix pin_interrupt_mode overriding auto-enabled CHANGE interrupt
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.
2026-04-04 10:05:00 -10:00
J. Nick Koston 85036d64d9 Fix MCP23x17 MIRROR bit, add dump_config logging, and clear PI4IOE5V6408 latched interrupts
- 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
2026-04-04 10:03:40 -10:00
J. Nick Koston 8234512a89 Auto-enable chip-level interrupts for input pins
- 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
2026-04-04 09:44:59 -10:00
J. Nick Koston d1e737280f Fix ESP8266 SPI test pin conflict: use GPIO0 for interrupt_pin 2026-04-04 09:18:04 -10:00
J. Nick Koston 3773ff9a98 Fix clang-tidy: rename setup_interrupt_pin_ to setup_interrupt_pin 2026-04-04 09:17:29 -10:00
J. Nick Koston 41e09c1e6c [mcp23xxx][pi4ioe5v6408] Add optional interrupt pin to eliminate polling
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.
2026-04-04 09:12:09 -10:00
J. Nick Koston ec11c17e74 Merge remote-tracking branch 'upstream/pcf8574-pca9554-interrupt-pin' into integration 2026-04-04 09:08:11 -10:00
J. Nick Koston 9f3fb37d12 Remove duplicate @brief line in cached_gpio.h 2026-04-04 08:59:09 -10:00
J. Nick Koston 0afdc6df26 [pcf8574][pca9554] Add interrupt_pin to compile tests 2026-04-04 08:58:02 -10:00
J. Nick Koston a2120953b9 [gpio_expander] Rename interrupt_driven_ to invalidate_on_read_
The base class doesn't need to know about interrupts — it just controls
whether digital_read() self-invalidates cache entries. Rename the flag
and invert the polarity for clarity.
2026-04-04 08:43:16 -10:00
J. Nick Koston 2c2b6b893e Merge remote-tracking branch 'upstream/pcf8574-pca9554-interrupt-pin' into integration 2026-04-04 08:38:56 -10:00
J. Nick Koston cf7bed8b6c [gpio_expander] Keep cache valid in interrupt-driven mode
When interrupt_driven_ is set, digital_read() no longer self-invalidates
each pin's cache entry. The cache stays valid until reset_pin_cache_()
is called from loop() when an interrupt fires. This eliminates I2C reads
on every binary sensor loop iteration — only reading when pins actually
change.
2026-04-04 08:38:35 -10:00
J. Nick Koston 3a659233be Merge remote-tracking branch 'upstream/pcf8574-pca9554-interrupt-pin' into integration 2026-04-04 08:29:03 -10:00
J. Nick Koston 79fe3de912 [pcf8574][pca9554] Add optional interrupt pin to eliminate polling
Add interrupt_pin config option to PCF8574 and PCA9554 GPIO expander
components. When configured, the component disables its loop and only
wakes on interrupt, eliminating continuous I2C polling when no pins
have changed state.
2026-04-04 08:22:37 -10:00
J. Nick Koston e4e664a9e6 Revert "[gpio_expander] Remove loop() from all GPIO expander components"
This reverts commit 8403728d4a.
2026-04-04 08:10:27 -10:00
J. Nick Koston c579846b2e Merge remote-tracking branch 'upstream/gpio-expander-remove-loop' into integration 2026-04-04 08:05:39 -10:00
J. Nick Koston 8403728d4a [gpio_expander] Remove loop() from all GPIO expander components
Move cache invalidation into CachedGpioExpander::digital_read() itself,
triggered by detecting a new loop iteration via App.get_loop_component_start_time().
This eliminates the need for a dedicated loop() override in every GPIO expander
component that only existed to call reset_pin_cache_().

Removes loop() from: pcf8574, pca9554, tca9555, pi4ioe5v6408, pca6416a,
mcp23016, mcp23xxx_base. For sx1509, only the reset_pin_cache_() call is
removed (loop() is kept for keypad scanning).
2026-04-04 07:55:38 -10:00
Clyde Stubbs 1a1725f958 [esp32] Clean build when sdkconfig options change (#15439) 2026-04-04 09:11:29 -04:00
J. Nick Koston 297f9c134f [time] Use set_interval for CronTrigger instead of loop() (#15433) 2026-04-04 01:07:16 -10:00
J. Nick Koston f51871fa6b [total_daily_energy] Replace loop() with timeout-based midnight reset (#15432) 2026-04-04 00:37:50 -10:00
J. Nick Koston 9ee5089891 [time] Support */N syntax in cron expressions (#15434) 2026-04-04 00:30:41 -10:00
J. Nick Koston b0d39aedd3 [hlw8012] Change periodic sensor reading logs to LOGV (#15431) 2026-04-04 00:30:29 -10:00
J. Nick Koston 80296ae6f2 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-04-04 00:04:36 -10:00
J. Nick Koston 915f1899ed bot comments 2026-04-04 00:03:50 -10:00
J. Nick Koston b7e666aa9b Merge remote-tracking branch 'origin/api/peel-first-write-iteration' into integration 2026-04-04 00:01:33 -10:00
J. Nick Koston f0c22fc1cd dupe 2026-04-04 00:00:25 -10:00
J. Nick Koston 269c234ac2 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-04-03 23:48:58 -10:00
J. Nick Koston 99d080b2a7 preen 2026-04-03 23:35:41 -10:00
J. Nick Koston 8b0e6a3324 preen 2026-04-03 23:34:57 -10:00
J. Nick Koston 392aa0fcbc preen 2026-04-03 23:27:19 -10:00
J. Nick Koston a3febe4a9e fix bloat 2026-04-03 23:20:05 -10:00
J. Nick Koston 5553962eae fix bloat 2026-04-03 23:16:56 -10:00
J. Nick Koston 72df34a507 fix bloat 2026-04-03 23:07:06 -10:00
J. Nick Koston 599f784a90 fix bloat 2026-04-03 22:46:36 -10:00
J. Nick Koston dee78b8a8e fix slowdown 2026-04-03 22:39:19 -10:00
J. Nick Koston 3a564633b7 clean 2026-04-03 22:20:11 -10:00
J. Nick Koston b5989e7a7b clean 2026-04-03 22:15:16 -10:00
J. Nick Koston 7911b9f029 clean 2026-04-03 22:14:07 -10:00
J. Nick Koston d795dc2f1c fix bench 2026-04-03 22:09:46 -10:00
J. Nick Koston 2ec10f2ba7 Merge branch 'dev' into api/peel-first-write-iteration 2026-04-03 22:07:42 -10:00
J. Nick Koston 555804db14 no gap 2026-04-03 22:03:26 -10:00
J. Nick Koston fb4d488864 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-03 21:09:25 -10:00
Clyde Stubbs 89de00e7ce [online_image] Clear LVGL dsc when image size changes. (#15360) 2026-04-04 17:04:01 +11:00
alorenteandclydebarrow 53b6528cc5 [epaper_spi] Allow runtime rotation change (#15419)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2026-04-04 16:02:15 +10:00
Boris Krivonog 16ae753317 [mitsubishi_cn105] Add climate component for Mitsubishi A/C units with CN105 connector (Part 2) (#15358) 2026-04-03 19:44:04 -10:00