MCPcopy Create free account
hub / github.com/FastLED/FastLED / _write_at_offset

Method _write_at_offset

ci/compiler/esp32_artifacts.py:189–202  ·  view source on GitHub ↗

Write file contents at specified offset.

(
        self, flash_data: bytearray, file_path: Optional[Path], offset: int
    )

Source from the content-addressed store, hash-verified

187 return True
188
189 def _write_at_offset(
190 self, flash_data: bytearray, file_path: Optional[Path], offset: int
191 ) -> None:
192 """Write file contents at specified offset."""
193 if not file_path or not file_path.exists():
194 return
195
196 file_data = file_path.read_bytes()
197 if offset + len(file_data) > len(flash_data):
198 raise ValueError(
199 f"File {file_path.name} at offset 0x{offset:x} exceeds flash size"
200 )
201
202 flash_data[offset : offset + len(file_data)] = file_data
203
204
205class ESP32ArtifactCopier:

Callers 1

create_merged_imageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected