Commit Graph
23442 Commits
Author SHA1 Message Date
J. Nick Koston 8c70472f60 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 11:50:44 -10:00
b9d70dcda2 [sen6x] Add SEN6x sensor support (#12553)
Co-authored-by: Martin Ebner <martinebner@me.com>
Co-authored-by: Tobias Stanzel <tobi.stanzel@gmail.com>
Co-authored-by: Big Mike <mike@bigmike.land>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:41:28 -05:00
J. Nick Koston 32794b9fc0 Merge remote-tracking branch 'upstream/move-millis64-impl' into integration 2026-02-27 11:41:19 -10:00
J. Nick KostonandClaude Opus 4.6 9b3800c867 Guard TAG, log.h, and cinttypes behind ESPHOME_DEBUG_SCHEDULER
These are only used in debug rollover logging. Guarding them avoids
unused variable warnings and unnecessary includes in normal builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:39:34 -10:00
dependabot[bot] 5e3857abf7 Bump click from 8.1.7 to 8.3.1 (#11955)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 16:25:36 -05:00
Laura WrattenandJonathan Swoboda bb567827a1 [sht3xd] Allow sensors that don't support serial number read (#14224)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:23:32 -05:00
J. Nick Koston f9d6df5403 Merge remote-tracking branch 'upstream/dev' into move-millis64-impl
# Conflicts:
#	esphome/core/scheduler.cpp
#	esphome/core/scheduler.h
2026-02-27 11:20:56 -10:00
J. Nick KostonandClaude Opus 4.6 280f874edc [rp2040] Use native time_us_64() for millis_64() (#14356)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:18:02 -10:00
J. Nick KostonandClaude Opus 4.6 c9a2fe5b80 Move HALF_MAX_UINT32 inside compute() function
Only used within the function, matches the pattern of ROLLOVER_WINDOW.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:04:46 -10:00
J. Nick KostonandClaude Opus 4.6 3d674ae1d2 Restructure preprocessor guards to single if/elif/else chain
Pure code reorganization — no functional change. Combines the separate
#ifndef ESPHOME_THREAD_SINGLE and #ifdef ESPHOME_THREAD_MULTI_ATOMICS
guards into one if/elif/else chain so each threading model's static
variables are grouped together.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:02:37 -10:00
J. Nick KostonandClaude Opus 4.6 ec2259733e Revert spinlock back to Mutex for atomics path
A std::atomic_flag spinlock is unsafe on preemptive single-core RTOS
platforms (like LN882H) due to priority inversion: a high-priority task
spinning would prevent the lock holder from running to release it.
FreeRTOS Mutex has priority inheritance to handle this correctly.

Added a comment explaining why spinlock can't be used here.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:01:06 -10:00
J. Nick KostonandClaude Opus 4.6 c121d8dc2a Move millis_64() call inside non-defer path
defer() items go straight into defer_queue_ and never use a timestamp.
Now that millis_64() has its own lock separate from the scheduler,
the call no longer needs to happen before taking the scheduler lock.
Move it inside the non-defer branch so defer() avoids the cost entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:56:29 -10:00
J. Nick KostonandClaude Opus 4.6 6c8542026f Replace Mutex with atomic_flag spinlock for MULTI_ATOMICS path
The atomics path only takes the lock during rollover (every ~49.7 days)
for a ~5 instruction critical section. A std::atomic_flag spinlock
(1 byte) replaces the full FreeRTOS Mutex (~80-100 bytes RAM) since
contention is near-zero. The full Mutex is kept only for the
MULTI_NO_ATOMICS path (BK72xx) which needs it for broader locking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:51:40 -10:00
J. Nick KostonandClaude Opus 4.6 c3252e861f Don't allocate Mutex on single-threaded platforms
On ESPHOME_THREAD_SINGLE (ESP8266), the lock is never used.
Guarding it avoids the static local guard variable overhead
(8 bytes RAM + init check on every call).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:39:53 -10:00
J. Nick KostonandClaude Opus 4.6 ea47af1fe3 Use cg.add_define for USE_NATIVE_64BIT_TIME
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:36:04 -10:00
J. Nick KostonandClaude Opus 4.6 fedf9d0ad5 [core] Move millis_64 rollover tracking out of Scheduler into time_64.cpp
millis_64_impl_() handles 32-bit millis() rollover tracking for
platforms without native 64-bit time (ESP8266, LibreTiny). It was a
Scheduler method using Scheduler fields (last_millis_, millis_major_,
lock_), but has nothing to do with scheduling.

Move it to esphome/core/time_64.cpp as Millis64Impl::compute() with
static local state. Access is restricted via friend to millis_64()
(HAL) and Scheduler only.

Also introduces USE_NATIVE_64BIT_TIME define emitted by ESP32, Host,
Zephyr, and RP2040 platforms, replacing the verbose multi-platform
#if guards throughout scheduler.h/cpp.

time_64.cpp is only compiled on platforms that need it (ESP8266,
LibreTiny) via the build filter in config.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:32:06 -10:00
Jonathan SwobodaandCopilot f6755aabae [ci] Add PR title format check (#14345)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 15:18:07 -05:00
J. Nick Koston 8588063f65 fix stale comment 2026-02-27 10:12:09 -10:00
J. Nick Koston d1de36840c Merge remote-tracking branch 'upstream/dev' into millis64-rp2040-native
# Conflicts:
#	esphome/core/scheduler.cpp
#	esphome/core/scheduler.h
2026-02-27 10:03:53 -10:00
J. Nick Koston 52af4bced0 [component] Devirtualize call_dump_config (#14355) 2026-02-27 10:01:23 -10:00
J. Nick KostonandClaude Opus 4.6 63e757807e [zephyr] Use native k_uptime_get() for millis_64() (#14350)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:01:09 -10:00
dependabot[bot] edd63e3d2d Bump actions/download-artifact from 7.0.0 to 8.0.0 (#14327)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 14:43:10 -05:00
dependabot[bot] 32133e2f46 Bump ruff from 0.15.3 to 0.15.4 (#14357)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 14:42:20 -05:00
Clyde Stubbs 2255c68377 [esp32] Enable execute_from_psram for P4 (#14329) 2026-02-28 06:40:55 +11:00
J. Nick Koston 9c1d1a0d9f [color] Use integer math in Color::gradient to reduce code size (#14354) 2026-02-27 19:25:13 +00:00
J. Nick Koston 1fb0f48427 Merge branch 'color-gradient-integer-math' into integration 2026-02-27 09:10:12 -10:00
J. Nick Koston 96d38a9d16 Merge remote-tracking branch 'upstream/devirtualize-call-dump-config' into integration 2026-02-27 09:08:50 -10:00
J. Nick Koston 4cb1d4d454 Merge remote-tracking branch 'upstream/millis64-rp2040-native' into integration 2026-02-27 09:05:16 -10:00
J. Nick Koston 54f5df83a2 Merge remote-tracking branch 'upstream/millis64-zephyr-native' into integration 2026-02-27 09:04:49 -10:00
J. Nick Koston e110ac24d5 [rp2040] Use native time_us_64() for millis_64()
RP2040's Pico SDK provides time_us_64() which reads the hardware
timer registers directly, returning native uint64_t microseconds.
This eliminates the need for 32-bit rollover tracking on this
platform.

millis() is now derived from millis_64() (like Zephyr) instead of
the other way around, unifying the time source.

Also removes IRAM_ATTR from all RP2040 HAL functions. On RP2040,
IRAM_ATTR is a no-op: the functions it decorated (millis, micros,
delayMicroseconds, arch_get_cpu_cycle_count) all call into Pico SDK
functions that reside in flash (XIP), so the attribute had no effect.
2026-02-27 09:03:20 -10:00
J. Nick Koston fad0d9ec30 Merge remote-tracking branch 'upstream/dev' into millis64-zephyr-native
# Conflicts:
#	esphome/core/scheduler.cpp
#	esphome/core/scheduler.h
2026-02-27 08:55:47 -10:00
J. Nick KostonandClaude Opus 4.6 8698b01bc7 [host] Use native clock_gettime for millis_64() (#14340)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:54:13 +00:00
J. Nick Koston 26f8e878c8 Merge branch 'dev' into devirtualize-call-dump-config 2026-02-27 11:53:54 -07:00
J. Nick Koston 58dfed237a Merge remote-tracking branch 'upstream/devirtualize-call-dump-config' into integration 2026-02-27 08:50:19 -10:00
J. Nick KostonandCopilot 3411ce2150 [core] Fix Application asm label for Mach-O using __USER_LABEL_PREFIX__ (#14334)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-27 08:49:57 -10:00
J. Nick Koston 814b265d40 [component] Devirtualize call_dump_config
Remove virtual from Component::call_dump_config() since only
MQTTComponent overrode it. The MQTT override skipped dump_config
for internal entities, which unnecessarily hid useful debug info
from startup logs. The is_internal flag means "don't expose to
Home Assistant", not "don't log config".

This also removes one vtable entry from every Component subclass
and eliminates the indirect call overhead.
2026-02-27 08:49:27 -10:00
J. Nick Koston 29e1e8bdfd [wifi] Add LibreTiny component test configs (#14351) 2026-02-27 18:45:20 +00:00
J. Nick Koston 317dd5b2da [ci] Skip memory impact target branch build when tests don't exist (#14316) 2026-02-27 08:42:08 -10:00
J. Nick Koston 7e6b3922cd Merge remote-tracking branch 'upstream/dev' into color-gradient-integer-math 2026-02-27 08:33:17 -10:00
J. Nick Koston ecf36d60ae [color] Use integer math in Color::gradient to reduce code size
Replace floating-point arithmetic with integer weighted average.
This eliminates soft-float library calls on platforms without FPU
(e.g., ESP8266), reducing the function from 352 bytes.

The integer version uses uint16_t weighted average which matches
the float version's output in 99.96% of cases (off-by-one in
the remaining 0.04% due to float precision differences).
2026-02-27 08:30:28 -10:00
J. Nick Koston 67003efcb5 [zephyr] Derive millis() from millis_64() to unify time source 2026-02-27 08:29:15 -10:00
Michael CassanitiandJonathan Swoboda 4ae7633418 [safe_mode] Add feature to explicitly mark a boot as successful (#14306)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 13:23:02 -05:00
J. Nick Koston 7019bb1e5a Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 08:22:24 -10:00
J. Nick Koston 1ba667df97 Merge branch 'wifi-libretiny-test-configs' into integration 2026-02-27 08:18:56 -10:00
J. Nick Koston c3a0eeceec [wifi] Use direct SDK APIs for LibreTiny SSID retrieval (#14349) 2026-02-27 18:17:17 +00:00
J. Nick Koston 86ef324309 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 08:15:22 -10:00
J. Nick Koston c7f99bd61a [wifi] Add LibreTiny test configs for BK72XX, RTL87XX, and LN882X
Add component test configurations for LibreTiny platforms so CI can
run compilation tests and memory impact analysis for LibreTiny WiFi
changes.
2026-02-27 08:12:02 -10:00
J. Nick KostonandClaude Opus 4.6 8d932ed855 [zephyr] Use native k_uptime_get() for millis_64()
Zephyr's k_uptime_get() returns int64_t milliseconds directly,
eliminating the need for 32-bit rollover tracking on this platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:03:46 -10:00
J. Nick Koston 40632cb941 Revert "[zephyr] Use native k_uptime_get() for millis_64()"
This reverts commit 77baa0a187.
2026-02-27 08:03:34 -10:00
J. Nick KostonandClaude Opus 4.6 77baa0a187 [zephyr] Use native k_uptime_get() for millis_64()
Zephyr's k_uptime_get() returns int64_t milliseconds directly,
eliminating the need for 32-bit rollover tracking on this platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:01:43 -10:00