- Convert ProtoEncode::write_short_string to static method with pos param
- Fix codegen to emit ProtoEncode::write_short_string(pos, ...)
- Add PROTO_ENCODE_DEBUG_INIT to encode_fn call in encode_to_buffer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix double static_cast in enum encode precomputed tag path by
passing raw field ref instead of pre-cast value_expr.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix comment: NAME_MAX_LENGTH is in config_validation.py, not core/config.py
- Add missing max_data_length=63 to unit_of_measurement in ListEntitiesNumberResponse
Replace two separate write_raw_byte calls with a single
encode_small_varint(tag, value) call that writes both bytes
with one bounds check. Used for enum fields with max < 128.
When an enum field has max_value < 128 and a single-byte tag, emit
inline write_raw_byte calls instead of calling encode_uint32, which
avoids encode_field_raw and encode_varint_raw function call overhead.
When a repeated enum field has a constant size per element (max < 128),
emit size * constant instead of iterating. This fixes unused variable
warnings from clang-tidy and generates more efficient code.
The protobuf code generator already parses all enum definitions and
knows every enum's maximum value. Use this to automatically apply the
max_value < 128 optimization to all enum fields, eliminating the need
for manual annotation.
Since every enum in api.proto has max < 128, all 58 enum field size
calculations now use constant arithmetic instead of calling varint
size functions.
Builds on #15424 which introduced the max_value optimization.
Reduce preferences normal region from 96 to 78 words (words 32-109)
to formally reserve words 110-127 for the crash handler backtrace.
Preferences that don't fit in RTC fall back to flash storage, so
this has no functional impact for typical configurations.
- Add IRAM_ATTR to is_code_addr/recover_code_addr as safety net
in case the compiler doesn't inline them
- Restore EXCVADDR logging for exception resets (faulting address
is the key diagnostic for LoadProhibit/StoreProhibit)
- Add comment noting Xtensa stack pointer alignment assumption
- Match Arduino core's declaration of _irom0_text_start/_end as
void functions (mmu_iram.h declares them this way)
- Use C-style casts with NOLINT for int-to-ptr conversions in
custom_crash_callback (clang-tidy performance-no-int-to-ptr)
The ESPHome CLI already decodes addresses inline (shown as
WARNING Decoded lines). The hint was redundant and cost ~100
bytes of flash plus 220 bytes of stack for the format buffer.
The LX106 (ESP8266) has no MMU, TLB, PIF, or privilege levels, so
exception causes 1, 5, 7, 8, 12-18, and 24-26 can never occur.
Remove them and shorten remaining cause names. Also drop Syscall,
Alloca, PCValue, Privileged which are unreachable on this core.