(output_file, device_properties: ConfigParser)
| 171 | output_file.write(f"CONFIG_ESPTOOLPY_FLASHFREQ_{esptool_flash_freq}=y\n") |
| 172 | |
| 173 | def write_spiram_variables(output_file, device_properties: ConfigParser): |
| 174 | idf_target = get_property_or_exit(device_properties, "hardware", "target").lower() |
| 175 | has_spiram = get_property_or_exit(device_properties, "hardware", "spiRam") |
| 176 | if has_spiram != "true": |
| 177 | return |
| 178 | output_file.write("# SPIRAM\n") |
| 179 | # Boot speed optimization |
| 180 | output_file.write("CONFIG_SPIRAM_MEMTEST=n\n") |
| 181 | # Enable |
| 182 | output_file.write("CONFIG_SPIRAM=y\n") |
| 183 | output_file.write(f"CONFIG_{idf_target.upper()}_SPIRAM_SUPPORT=y\n") |
| 184 | mode = get_property_or_exit(device_properties, "hardware", "spiRamMode") |
| 185 | if mode == "OPI": |
| 186 | mode = "OCT" |
| 187 | # Mode |
| 188 | if mode != "AUTO": |
| 189 | output_file.write(f"CONFIG_SPIRAM_MODE_{mode}=y\n") |
| 190 | else: |
| 191 | output_file.write("CONFIG_SPIRAM_TYPE_AUTO=y\n") |
| 192 | speed = get_property_or_exit(device_properties, "hardware", "spiRamSpeed") |
| 193 | # Speed |
| 194 | output_file.write(f"CONFIG_SPIRAM_SPEED_{speed}=y\n") |
| 195 | output_file.write(f"CONFIG_SPIRAM_SPEED={speed}\n") |
| 196 | # Reduce IRAM usage |
| 197 | output_file.write("CONFIG_SPIRAM_USE_MALLOC=y\n") |
| 198 | output_file.write("CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y\n") |
| 199 | # Performance improvements |
| 200 | if idf_target == "esp32s3": |
| 201 | output_file.write("CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y\n") |
| 202 | output_file.write("CONFIG_SPIRAM_RODATA=y\n") |
| 203 | output_file.write("CONFIG_SPIRAM_XIP_FROM_PSRAM=y\n") |
| 204 | |
| 205 | def write_performance_improvements(output_file, device_properties: ConfigParser): |
| 206 | idf_target = get_property_or_exit(device_properties, "hardware", "target").lower() |
no test coverage detected