mirror of
https://github.com/esphome/esphome.git
synced 2026-09-24 13:34:07 +00:00
Also use constexpr for size variables
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
ad3b3387df
commit
051cba20a3
@@ -281,9 +281,7 @@ def add_resource_as_progmem(
|
||||
content_encoded_size = len(content_encoded)
|
||||
bytes_as_int = ", ".join(str(x) for x in content_encoded)
|
||||
uint8_t = f"constexpr uint8_t ESPHOME_WEBSERVER_{resource_name}[{content_encoded_size}] PROGMEM = {{{bytes_as_int}}}"
|
||||
size_t = (
|
||||
f"const size_t ESPHOME_WEBSERVER_{resource_name}_SIZE = {content_encoded_size}"
|
||||
)
|
||||
size_t = f"constexpr size_t ESPHOME_WEBSERVER_{resource_name}_SIZE = {content_encoded_size}"
|
||||
cg.add_global(cg.RawExpression(uint8_t))
|
||||
cg.add_global(cg.RawExpression(size_t))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user