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

Method read_flash_config

ci/compiler/esp32_artifacts.py:115–143  ·  view source on GitHub ↗

Read flash configuration from build artifacts.

(self)

Source from the content-addressed store, hash-verified

113 return path if path.exists() else None
114
115 def read_flash_config(self) -> FlashConfig:
116 """Read flash configuration from build artifacts."""
117 flash_args_file = self.artifact_dir / "flash_args"
118 if not flash_args_file.exists():
119 return FlashConfig(FlashMode.UNKNOWN, 4)
120
121 content = flash_args_file.read_text()
122
123 # Parse flash mode
124 mode = FlashMode.UNKNOWN
125 if "--flash_mode dio" in content:
126 mode = FlashMode.DIO
127 elif "--flash_mode qio" in content:
128 mode = FlashMode.QIO
129 elif "--flash_mode dout" in content:
130 mode = FlashMode.DOUT
131 elif "--flash_mode qout" in content:
132 mode = FlashMode.QOUT
133
134 # Parse flash size (default 4MB)
135 size_mb = 4
136 if "--flash_size 2MB" in content:
137 size_mb = 2
138 elif "--flash_size 8MB" in content:
139 size_mb = 8
140 elif "--flash_size 16MB" in content:
141 size_mb = 16
142
143 return FlashConfig(mode, size_mb)
144
145
146class ESP32FlashImageBuilder:

Callers 1

copy_qemu_artifactsMethod · 0.80

Calls 1

FlashConfigClass · 0.85

Tested by

no test coverage detected