[api] Add encode_progmem_string for progmem string fields

Generated code passes the ProgmemStringRef instead of spelling out the cast.
This commit is contained in:
J. Nick Koston
2026-10-08 20:17:55 -10:00
parent 7b5a1f9de9
commit 1fa844a5d2
4 changed files with 20 additions and 17 deletions
+2 -3
View File
@@ -1285,10 +1285,9 @@ class PointerToStringBufferType(PointerToBufferTypeBase):
return _encode_call(encode_fn, str(tag), f"this->{self.field_name}")
if self.progmem:
return _encode_call(
"encode_progmem_bytes",
"encode_progmem_string",
str(self.number),
f"reinterpret_cast<const uint8_t *>(this->{self.field_name}.progmem_ptr())",
f"this->{self.field_name}.size()",
f"this->{self.field_name}",
force=self.force,
)
if result := self._encode_bytes_with_precomputed_tag(