mirror of
https://github.com/esphome/esphome.git
synced 2026-05-28 04:55:48 +08:00
[psram] Require mode for S3 (#11470)
Co-authored-by: clydeps <U5yx99dok9>
This commit is contained in:
@@ -34,6 +34,12 @@ SUPPORTED_PSRAM_VARIANTS = [
|
||||
VARIANT_ESP32S3,
|
||||
VARIANT_ESP32P4,
|
||||
]
|
||||
SUPPORTED_PSRAM_MODES = {
|
||||
VARIANT_ESP32: ["quad"],
|
||||
VARIANT_ESP32S2: ["quad"],
|
||||
VARIANT_ESP32S3: ["quad", "octal"],
|
||||
VARIANT_ESP32P4: ["hex"],
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -86,7 +92,7 @@ def test_psram_configuration_valid_supported_variants(
|
||||
from esphome.components.psram import CONFIG_SCHEMA, FINAL_VALIDATE_SCHEMA
|
||||
|
||||
# This should not raise an exception
|
||||
config = CONFIG_SCHEMA({})
|
||||
config = CONFIG_SCHEMA({"mode": SUPPORTED_PSRAM_MODES[variant][0]})
|
||||
FINAL_VALIDATE_SCHEMA(config)
|
||||
|
||||
|
||||
@@ -122,7 +128,7 @@ def _setup_psram_final_validation_test(
|
||||
("config", "esp32_config", "expect_error", "error_match"),
|
||||
[
|
||||
pytest.param(
|
||||
{"speed": "120MHz"},
|
||||
{"mode": "quad", "speed": "120MHz"},
|
||||
{"cpu_frequency": "160MHz"},
|
||||
True,
|
||||
r"PSRAM 120MHz requires 240MHz CPU frequency",
|
||||
@@ -143,7 +149,7 @@ def _setup_psram_final_validation_test(
|
||||
id="ecc_only_in_octal_mode",
|
||||
),
|
||||
pytest.param(
|
||||
{"speed": "120MHZ"},
|
||||
{"mode": "quad", "speed": "120MHZ"},
|
||||
{"cpu_frequency": "240MHZ"},
|
||||
False,
|
||||
None,
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
packages:
|
||||
i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml
|
||||
|
||||
psram:
|
||||
mode: quad
|
||||
|
||||
<<: !include common.yaml
|
||||
|
||||
@@ -9,3 +9,4 @@ display:
|
||||
lvgl:
|
||||
|
||||
psram:
|
||||
mode: quad
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# I2C bus for camera sensor
|
||||
psram:
|
||||
|
||||
i2c:
|
||||
- id: i2c_camera_bus
|
||||
sda: 25
|
||||
|
||||
Reference in New Issue
Block a user