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) {