mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[wifi] Allow config to use PSRAM (#9866)
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| from esphome import automation | ||||
| from esphome.automation import Condition | ||||
| import esphome.codegen as cg | ||||
| from esphome.components.const import CONF_USE_PSRAM | ||||
| from esphome.components.esp32 import add_idf_sdkconfig_option, const, get_esp32_variant | ||||
| from esphome.components.network import IPAddress | ||||
| from esphome.config_helpers import filter_source_files_from_platform | ||||
| @@ -334,6 +335,9 @@ CONFIG_SCHEMA = cv.All( | ||||
|             cv.Optional(CONF_ON_DISCONNECT): automation.validate_automation( | ||||
|                 single=True | ||||
|             ), | ||||
|             cv.Optional(CONF_USE_PSRAM): cv.All( | ||||
|                 cv.requires_component("psram"), cv.boolean | ||||
|             ), | ||||
|         } | ||||
|     ), | ||||
|     _validate, | ||||
| @@ -454,6 +458,8 @@ async def to_code(config): | ||||
|         if config[CONF_ENABLE_RRM]: | ||||
|             cg.add(var.set_rrm(config[CONF_ENABLE_RRM])) | ||||
|  | ||||
|     if config.get(CONF_USE_PSRAM): | ||||
|         add_idf_sdkconfig_option("CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP", True) | ||||
|     cg.add_define("USE_WIFI") | ||||
|  | ||||
|     # must register before OTA safe mode check | ||||
|   | ||||
| @@ -1 +1,7 @@ | ||||
| <<: !include common.yaml | ||||
| psram: | ||||
|  | ||||
| wifi: | ||||
|   use_psram: true | ||||
|  | ||||
| packages: | ||||
|   - !include common.yaml | ||||
|   | ||||
		Reference in New Issue
	
	Block a user