Commit Graph

23952 Commits

Author SHA1 Message Date
J. Nick Koston 6e99bc96a2 Merge remote-tracking branch 'upstream/rp2040-socket-wake' into integration 2026-03-04 22:37:44 -10:00
J. Nick Koston 12616bcc60 Code quality: consistent elif includes, fix callback name, handle alarm error 2026-03-04 22:31:35 -10:00
J. Nick Koston 8050fa6801 Use #elif for mutually exclusive platform guards 2026-03-04 22:30:28 -10:00
J. Nick Koston 6af723e87d [socket] Add socket wake support for RP2040
Enable instant wake on socket activity for RP2040 using ARM WFE/SEV
hardware instructions, matching ESP8266's esp_delay/esp_schedule pattern.

Previously, RP2040 used plain delay() in the main loop which could not
be interrupted by incoming socket data. Now LWIP recv/accept callbacks
call socket_wake() which sets a flag and sends a hardware event (__sev)
to wake the main loop from __wfe() sleep immediately.

The implementation uses a one-shot pico-sdk timer alarm for timeout
(same pattern as ESP8266's os_timer_arm) combined with __wfe() for
true hardware sleep between events.
2026-03-04 22:28:04 -10:00
rwrozelle 0e2a10c5f0 [openthread] Cache is_connected() for cheap inline access (#14484)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-04 17:34:13 -10:00
Clyde Stubbs f5c37bf486 [packet_transport] Minimise heap allocations (#14482) 2026-03-05 14:24:01 +11:00
J. Nick Koston 0ff5270632 [ci] Fix codeowner approval label workflow for fork PRs (#14490)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 16:57:19 -10:00
J. Nick Koston 97f7bd98a9 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-04 16:45:10 -10:00
J. Nick Koston 5df4fd0a27 [tests] Fix flaky uart_mock integration tests (#14476) 2026-03-04 15:51:51 -10:00
Brandon Harvey c0143ac6d6 [ai] Add docs note about keeping component index pages in sync (#14465)
Co-authored-by: Brandon Harvey <bharvey88@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-04 15:46:40 -10:00
J. Nick Koston cfc74ad638 Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:25:09 -10:00
J. Nick Koston f886aa7f9a [rp2040] Fix firmware.bin.signed creation for nobuild upload
Move signed bin creation from post_build script to upload_using_platformio.
The post_build AddPostAction only runs during build, not during nobuild
upload, so the file was missing when PlatformIO tried to upload.
Now create firmware.bin.signed before calling PlatformIO upload.
2026-03-04 14:24:48 -10:00
J. Nick Koston 1d85fa8ed3 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-04 14:18:36 -10:00
J. Nick Koston d30175d84d Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:18:29 -10:00
J. Nick Koston d856046830 [rp2040] Add test coverage for Linux and Windows mass storage detection
Add tests for get_rp2040_mass_storage_volumes() on Linux, Windows,
and unsupported platforms to improve test coverage.
2026-03-04 14:12:39 -10:00
J. Nick Koston c6c0dc62eb [rp2040] Address review feedback for upload improvements
- Fix _wait_for_serial_port to use get_serial_ports() instead of
  os.access() so it works on Windows COM ports
- Snapshot serial ports before upload and wait for new ports to appear,
  preventing false matches on pre-existing serial devices
- Auto-select only newly appeared ports after mass storage upload
- Guard against ZeroDivisionError if UF2 file is empty
2026-03-04 14:03:28 -10:00
J. Nick Koston 5f79e3e0c2 [rp2040] Fix test assertions for Windows path separators
Use str(Path(...)) in test assertions so paths match platform-specific
separators (forward slashes on Unix, backslashes on Windows).
2026-03-04 14:00:35 -10:00
J. Nick Koston 74dd61442a [rp2040] Improve upload experience with mass storage and BOOTSEL support
Add auto-detection of RP2040 BOOTSEL mass storage volumes (RPI-RP2) on
macOS, Linux, and Windows. Show detected volumes as upload targets with
a progress bar for UF2 file copy. Display helpful BOOTSEL instructions
when no RP2040 device is found.

- Add get_rp2040_mass_storage_volumes() to detect mounted RPI-RP2 volumes
- Add PortType.MASS_STORAGE and upload_using_uf2_copy() with progress bar
- Move ProgressBar to helpers.py for shared use
- Wait for USB-CDC serial port after upload for log output
- Auto-select single serial port for logs after mass storage upload
- Create firmware.bin.signed in post_build to fix nobuild upload target
- Show BOOTSEL tip when only OTA options are available
2026-03-04 13:50:52 -10:00
Jonathan Swoboda c8e7f78a25 [zwave_proxy] Fix uint8_t overflow for buffer index and frame end (#14480)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:32:50 -05:00
Jonathan Swoboda b6d7e8e14d [sgp30] Fix serial number truncation from 48-bit to 24-bit (#14478)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:18:28 -05:00
Jonathan Swoboda 55103c0652 [ds2484] Fix read64() using uint8_t accumulator instead of uint64_t (#14479)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:18:14 -05:00
J. Nick Koston 61ea6c3b2f [ci] Add missing issues: write permission to codeowner approval workflow (#14477)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 17:46:26 -05:00
Jonathan Swoboda e11a91411b [esp32_improv][rf_bridge][esp32_ble_server][display][lvgl][pipsolar] Fix unsigned integer underflows (#14466)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2026-03-04 16:36:52 -05:00
J. Nick Koston c725152431 Revert "[core] Remove pre-sleep socket scan from fast select path"
This reverts commit ce6332e6c3.
2026-03-04 11:20:56 -10:00
J. Nick Koston 9e1121dc71 Revert "[core] Update comment wording"
This reverts commit 760dfd7714.
2026-03-04 11:20:55 -10:00
J. Nick Koston 5a16fdf69d Merge remote-tracking branch 'upstream/remove-presleep-socket-scan' into integration 2026-03-04 11:15:45 -10:00
J. Nick Koston 760dfd7714 [core] Update comment wording 2026-03-04 11:15:02 -10:00
J. Nick Koston ce6332e6c3 [core] Remove pre-sleep socket scan from fast select path
The pre-sleep scan of all monitored sockets was added to preserve
select() semantics by checking for pending data before sleeping.
However, this is unnecessary with the FreeRTOS task notification
approach:

- xTaskNotifyGive from the lwip callback persists until consumed
  by ulTaskNotifyTake, so notifications received while the task
  is running (not sleeping) are not lost.

- The only case the scan caught was intentionally undrained sockets
  (e.g., API's MAX_MESSAGES_PER_LOOP=5 throttle). Adding up to
  16ms (loop_interval) latency before re-checking undrained data
  is the desired behavior — waking immediately would defeat the
  purpose of the throttle which exists to let other components run.

This removes N volatile cross-core reads (one per monitored socket)
from every loop iteration.
2026-03-04 11:12:15 -10:00
Jonathan Swoboda 0c883b80c4 [inkplate][ezo_pmp][ezo][packet_transport] Fix use-after-free bugs (#14467)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 16:05:49 -05:00
J. Nick Koston a2d8b19fc1 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-04 10:37:00 -10:00
J. Nick Koston d1af187b76 Merge branch 'integration' of https://github.com/esphome/esphome into integration 2026-03-04 10:36:46 -10:00
J. Nick Koston 4abab7cca3 Merge branch 'inline-network-is-connected' into integration 2026-03-04 10:36:35 -10:00
J. Nick Koston 212634a906 restore missing comment 2026-03-04 10:35:53 -10:00
J. Nick Koston 5e887ea6a2 Merge branch 'devirtualize-ota-backend' into integration 2026-03-04 10:10:53 -10:00
J. Nick Koston 117e23f14c Fix all-include CI check with stub OTA backend
When no platform define is set (static analysis), provide a stub
so decltype(ota::make_ota_backend()) resolves.
2026-03-04 10:10:43 -10:00
J. Nick Koston faba447549 Merge remote-tracking branch 'origin/integration' into integration 2026-03-04 10:09:11 -10:00
J. Nick Koston dde4548eab Merge branch 'devirtualize-ota-backend' into integration 2026-03-04 10:08:51 -10:00
J. Nick Koston 40eb2b5343 Merge branch 'devirtualize-ota-backend' into integration 2026-03-04 10:03:07 -10:00
J. Nick Koston acef15b982 [ota] Devirtualize OTA backend calls
Each platform defines exactly one OTA backend subclass (marked final),
so using concrete types in unique_ptr eliminates virtual dispatch overhead.

- Remove OTABackend base class - no longer needed since all consumers
  use concrete types directly
- Move make_ota_backend() declaration to each concrete backend header
  with concrete return type
- Add ota_backend_factory.h convenience header for consumers
- Use concrete unique_ptr types in ota_esphome, http_request, and
  web_server consumers
2026-03-04 10:01:28 -10:00
J. Nick Koston febb4c47e7 Merge branch 'devirtualize-ota-backend' into integration 2026-03-04 09:51:43 -10:00
J. Nick Koston 9cb5d287a4 [ota] Devirtualize OTA backend calls
Each platform defines exactly one OTA backend subclass (marked final),
so using concrete types in unique_ptr eliminates virtual dispatch overhead.

- Move make_ota_backend() declaration from base header to each concrete
  backend header with concrete return type
- Add ota_backend_factory.h convenience header for consumers
- Use concrete unique_ptr types in ota_esphome, http_request, and
  web_server consumers
2026-03-04 09:49:31 -10:00
Kevin Ahrendt 4928e678d1 [mixer][resampler][speaker] Use core static task manager (#14454) 2026-03-04 14:37:22 -05:00
J. Nick Koston 1c3d5de0ab Merge remote-tracking branch 'upstream/devirtualize-frame-helper' into integration 2026-03-04 09:16:11 -10:00
J. Nick Koston 30d7834fa8 [api] Devirtualize frame helper calls when protocol is fixed at compile time
When only one API protocol is configured (plaintext-only or noise-only),
use the concrete frame helper type in unique_ptr instead of the base
class. Since both APIPlaintextFrameHelper and APINoiseFrameHelper are
marked final, the compiler can devirtualize all virtual calls
(read_packet, write_protobuf_packet, loop, etc.), eliminating vtable
dispatch overhead in the hot APIConnection::loop() path.

When both protocols are enabled (encryption key set with plaintext
fallback), the polymorphic base pointer is used as before.
2026-03-04 09:13:53 -10:00
J. Nick Koston aa1088a6dd Merge branch 'inline-network-is-connected' into integration 2026-03-04 08:57:34 -10:00
J. Nick Koston 9782332108 force it 2026-03-04 08:57:25 -10:00
J. Nick Koston 41fecdf1f7 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-04 08:39:51 -10:00
J. Nick Koston 5bc9604587 Merge branch 'wifi-cache-is-connected' into integration 2026-03-04 08:21:08 -10:00
J. Nick Koston c4b4023a7a Merge remote-tracking branch 'upstream/inline-network-is-connected' into integration 2026-03-04 08:20:49 -10:00
J. Nick Koston fb33fb977d Update esphome/components/network/util.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 08:20:17 -10:00