RubenKelevra
fde80bc530
core/scheduler: split millis_64_ into different platform functions
2025-07-19 21:44:35 +02:00
RubenKelevra
211739bba0
core/scheduler: Make millis_64_ rollover monotonic on SMP
...
The current implementation uses only memory_order_relaxed on all atomic
accesses. That protects each variable individually but not the semantic
link between the low word (last_millis_) and the high-word epoch counter
(millis_major_). On a multi-core target a reader could observe a freshly
stored low word before seeing the matching increment of the epoch,
causing a ~49-day negative jump.
Key fixes
- Release/acquire pairing
- writer: compare_exchange_weak(..., memory_order_release, …)
- reader: first load of last_millis_ now uses memory_order_acquire
- ensures any core that sees the new low word also sees the updated
high word
- Epoch-coherency retry loop
- re-loads millis_major_ after the update and retries if it changed,
guaranteeing monotonicity even when another core rolls over
concurrently
- millis_major_ promoted to std::atomic<uint16_t> on SMP platforms
- removes the formal data race at negligible cost
- new macros for better readability
- ESPHOME_SINGLE_CORE – currently ESP8266/RP2040 only
- ESPHOME_ATOMIC_SCHEDULER – all others except LibreTiny
- Logging and comments
- loads atomics safely in debug output
- updated inline docs to match the memory ordering
Behavior on single-core or non-atomic platforms is unchanged; multi-core
targets now get a provably monotonic 64-bit millisecond clock with
minimal overhead.
2025-07-19 19:09:10 +02:00
J. Nick Koston
89b9bddf1b
[CI] Fix clang-tidy not running when platformio.ini changes ( #9678 )
2025-07-19 20:55:21 +12:00
J. Nick Koston
65cbb0d741
[gpio] Auto-disable interrupts for shared GPIO pins in binary sensors ( #9701 )
2025-07-19 05:31:53 +00:00
Jesse Hills
9533d52d86
Merge branch 'release' into dev
2025-07-19 12:05:32 +12:00
Jesse Hills
6fe4ffa0cf
Merge pull request #9691 from esphome/bump-2025.7.2
...
2025.7.2
2025.7.2
2025-07-19 12:04:51 +12:00
Jesse Hills
19a68dc650
Add core team as codeowner of .github folder ( #9663 )
2025-07-19 10:55:22 +12:00
Jesse Hills
576ce7ee35
Bump version to 2025.7.2
2025-07-19 09:56:08 +12:00
J. Nick Koston
8a45e877bb
[gpio] Disable interrupt mode by default for LibreTiny platforms ( #9687 )
...
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-07-19 09:56:08 +12:00
Kevin Ahrendt
84607c1255
[voice_assistant] Use media player callbacks to track TTS response status ( #9670 )
2025-07-19 09:56:01 +12:00
Kevin Ahrendt
8664ec0a3b
[speaker] Media player's pipeline properly returns playing state near end of file ( #9668 )
2025-07-19 09:54:15 +12:00
J. Nick Koston
32d8c60a0b
Fix AsyncTCP version mismatch between platformio.ini and async_tcp component ( #9676 )
2025-07-19 09:54:00 +12:00
Jesse Hills
976a1e27b4
[lvgl] Prevent keyerror on min/max value widgets with no default ( #9660 )
2025-07-19 09:53:47 +12:00
J. Nick Koston
cc2c1b1d89
[libretiny] Remove unsupported lock-free queue and event pool implementations ( #9653 )
2025-07-19 09:53:47 +12:00
Clyde Stubbs
85495d38b7
[lvgl] Fix meter rotation ( #9605 )
...
Co-authored-by: clydeps <U5yx99dok9>
2025-07-19 09:53:47 +12:00
J. Nick Koston
84a77ee427
[scheduler] Fix DelayAction cancellation in restart mode scripts ( #9646 )
2025-07-19 09:53:47 +12:00
@RubenKelevra
11a4115e30
esp32_camera: deprecate i2c_pins; throw error if combined with i2c: block ( #9615 )
2025-07-19 09:53:47 +12:00
Samuel Sieb
121ed687f3
[logger] fix on_message ( #9642 )
...
Co-authored-by: Samuel Sieb <samuel@sieb.net >
Co-authored-by: J. Nick Koston <nick@koston.org >
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com >
2025-07-19 09:53:47 +12:00
J. Nick Koston
c602f3082e
[scheduler] Fix cancellation of timers with empty string names ( #9641 )
2025-07-19 09:53:39 +12:00
J. Nick Koston
4a43f922c6
[wireguard] Fix boot loop when CONFIG_LWIP_TCPIP_CORE_LOCKING is enabled ( #9637 )
2025-07-19 09:50:36 +12:00
J. Nick Koston
21e66b76e4
[api] Fix compilation error with char* lambdas in HomeAssistant services ( #9638 )
...
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-07-19 09:50:36 +12:00
Flo
cdeed7afa7
Fix template event web_server crash ( #9618 )
2025-07-19 09:50:36 +12:00
J. Nick Koston
6cefe943e9
[gpio] Disable interrupt mode by default for LibreTiny platforms ( #9687 )
...
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-07-19 09:32:20 +12:00
Kevin Ahrendt
6f74decd79
[i2s_audio] Bugfix: cast adc_channel_t to adc1_channel_t ( #9688 )
2025-07-18 16:52:46 -04:00
dependabot[bot]
60350e8abd
Bump aioesphomeapi from 37.0.0 to 37.0.1 ( #9685 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-18 20:08:29 +00:00
@RubenKelevra
08407706aa
esp32cam: add fb location config option ( #9630 )
2025-07-19 07:28:13 +12:00
Kevin Ahrendt
cb8d9dca2a
[voice_assistant] Use media player callbacks to track TTS response status ( #9670 )
2025-07-19 07:24:55 +12:00
Kevin Ahrendt
3f8494bf8f
[speaker] Media player's pipeline properly returns playing state near end of file ( #9668 )
2025-07-19 07:21:36 +12:00
J. Nick Koston
95a08579f6
Fix AsyncTCP version mismatch between platformio.ini and async_tcp component ( #9676 )
2025-07-19 07:20:08 +12:00
dependabot[bot]
a11c39bdc9
Bump aioesphomeapi from 36.0.1 to 37.0.0 ( #9677 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-18 17:57:40 +00:00
J. Nick Koston
71cc298363
Use message_source_map consistently in proto generation ( #9542 )
2025-07-19 00:28:08 +12:00
J. Nick Koston
0d422bd74f
[scheduler] Add integration tests for set_retry functionality ( #9644 )
2025-07-19 00:26:54 +12:00
Jesse Hills
ce3a16f03c
[lvgl] Prevent keyerror on min/max value widgets with no default ( #9660 )
2025-07-18 21:49:34 +10:00
J. Nick Koston
72905f5f42
[libretiny] Remove unsupported lock-free queue and event pool implementations ( #9653 )
2025-07-18 23:40:14 +12:00
Jesse Hills
b5b301f935
[CI] Fix by-code-owner labelling ( #9661 )
2025-07-18 23:24:06 +12:00
Jesse Hills
afc48812fa
[CI] Add codeowners mention workflow ( #9651 )
2025-07-18 23:21:38 +12:00
Jesse Hills
e189add8a3
[CI] New workflow to mention codeowners on issues ( #9658 )
2025-07-18 22:57:25 +12:00
@RubenKelevra
f8146bd340
core/schedule: fixup out of sync code comment ( #9649 )
2025-07-17 18:54:01 -10:00
J. Nick Koston
ec5a517a76
Fix bluetooth_proxy heap allocations during BLE scanning ( #9633 )
2025-07-18 16:24:29 +12:00
Clyde Stubbs
f7314adff4
[lvgl] Fix meter rotation ( #9605 )
...
Co-authored-by: clydeps <U5yx99dok9>
2025-07-18 16:14:21 +12:00
J. Nick Koston
f0f76066f3
[scheduler] Fix DelayAction cancellation in restart mode scripts ( #9646 )
2025-07-18 04:07:59 +00:00
@RubenKelevra
1ebf157768
esp32_camera: deprecate i2c_pins; throw error if combined with i2c: block ( #9615 )
2025-07-17 17:09:24 -10:00
Samuel Sieb
4bd0561ba3
[logger] fix on_message ( #9642 )
...
Co-authored-by: Samuel Sieb <samuel@sieb.net >
Co-authored-by: J. Nick Koston <nick@koston.org >
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com >
2025-07-17 17:08:18 -10:00
J. Nick Koston
a18ddd1169
[scheduler] Fix LibreTiny compilation error due to missing atomic operations ( #9643 )
2025-07-18 14:21:46 +12:00
J. Nick Koston
158a3b2835
[scheduler] Fix cancellation of timers with empty string names ( #9641 )
2025-07-18 14:20:35 +12:00
Clyde Stubbs
eb8a241a01
[esp32] Allow variant in place of board ( #9427 )
...
Co-authored-by: J. Nick Koston <nick@koston.org >
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com >
2025-07-18 13:48:48 +12:00
tomaszduda23
7cdb48b820
[code quality] move const to esphome/const.py ( #9632 )
...
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com >
2025-07-17 23:39:35 +00:00
tomaszduda23
558e175c6b
adds nRF52840 to PR templates ( #9631 )
2025-07-18 11:23:42 +12:00
J. Nick Koston
dfa8c8c77f
Fix scheduler rollover detection with concurrent task calls ( #9624 )
2025-07-17 13:07:36 -10:00
J. Nick Koston
7f807e08b1
[wireguard] Fix boot loop when CONFIG_LWIP_TCPIP_CORE_LOCKING is enabled ( #9637 )
2025-07-18 11:00:56 +12:00