From f383ec7f09299c028cd04966d352a4cb3e92bee0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 28 Feb 2026 09:14:23 -1000 Subject: [PATCH] [ld24xx] Make two_byte_to_uint16 constexpr Enable compile-time evaluation when called with constant arguments. --- esphome/components/ld24xx/ld24xx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ld24xx/ld24xx.h b/esphome/components/ld24xx/ld24xx.h index 70862b6895..f8a5299e3a 100644 --- a/esphome/components/ld24xx/ld24xx.h +++ b/esphome/components/ld24xx/ld24xx.h @@ -40,7 +40,7 @@ namespace esphome::ld24xx { /// Parse a little-endian 16-bit unsigned value from two bytes. -static inline uint16_t two_byte_to_uint16(uint8_t low, uint8_t high) { return ((uint16_t) high << 8) | low; } +static constexpr uint16_t two_byte_to_uint16(uint8_t low, uint8_t high) { return ((uint16_t) high << 8) | low; } // Helper to find index of value in constexpr array template optional find_index(const uint32_t (&arr)[N], uint32_t value) {