[package]
name    = "hil-test"
version = "0.0.0"
edition = "2024"
publish = false

[lib]
name = "hil_test"

[[bin]]
name              = "aes"
harness           = false

[[bin]]
name              = "alloc_psram"
harness           = false
required-features = ["psram"]

[[bin]]
name              = "ecc_rsa_sha"
harness           = false

[[bin]]
name              = "embassy_timers_executors"
harness           = false
required-features = ["embassy"]

[[bin]]
name              = "esp_radio"
harness           = false
required-features = ["esp-radio", "esp-alloc"]

[[bin]]
name              = "gpio"
harness           = false

[[bin]]
name              = "gpio_custom_handler"
harness           = false

[[bin]]
name              = "i2c"
harness           = false

[[bin]]
name              = "i2s"
harness           = false

[[bin]]
name              = "interrupt"
harness           = false

[[bin]]
name              = "lcd_cam"
harness           = false

[[bin]]
name              = "misc_drivers"
harness           = false

[[bin]]
name              = "misc_non_drivers"
harness           = false

[[bin]]
name              = "parl_io"
harness           = false

[[bin]]
name              = "rmt"
harness           = false
required-features = ["embassy"]

[[bin]]
name              = "spi_full_duplex"
harness           = false

[[bin]]
name              = "spi_half_duplex_slave_qspi"
harness           = false

[[bin]]
name              = "spi_half_duplex_write_psram"
harness           = false

[[bin]]
name              = "storage_read_app_desc"
harness           = false

[[bin]]
name              = "uart"
harness           = false

[dependencies]
allocator-api2    = { version = "0.3.0", default-features = false, features = ["alloc"] }
cfg-if             = "1"
critical-section   = "1"
defmt              = "1.0.1"
defmt-rtt          = { version = "1.0.0", optional = true }
embassy-executor   = { version = "0.9.0", default-features = false }
embassy-futures    = "0.1"
embedded-storage   = "0.3.1"
embassy-sync       = "0.7.2"
embassy-time       = "0.5.0"
embedded-hal       = "1.0.0"
embedded-io        = "0.7.1"
embedded-io-async  = "0.7.0"
embedded-can       = "0.4.1"
embedded-hal-async = "1.0.0"
esp-alloc          = { path = "../esp-alloc", optional = true }
esp-bootloader-esp-idf = { path = "../esp-bootloader-esp-idf" }
esp-hal            = { path = "../esp-hal", features = ["defmt"] }
esp-rtos           = { path = "../esp-rtos", features = ["defmt"], optional = true }
esp-storage        = { path = "../esp-storage", optional = true }
esp-sync           = { path = "../esp-sync" }
esp-radio          = { path = "../esp-radio", features = ["defmt"], optional = true }
esp-radio-rtos-driver = { path = "../esp-radio-rtos-driver", optional = true }
portable-atomic    = "1.11"
static_cell        = { version = "2.1.0" }
semihosting        = { version = "0.1", features= ["stdio", "panic-handler"] }

crypto-bigint       = { version = "0.5.5", default-features = false }
digest              = { version = "0.10.7", default-features = false }
elliptic-curve      = { version = "0.13.8", default-features = false, features = ["sec1"] }
# Add the `embedded-test/defmt` feature for more verbose testing
embedded-test       = { version = "0.7", default-features = false, features = ["embassy", "external-executor", "semihosting", "defmt"] }
hex-literal         = "1.0.0"
nb                  = "1.1.0"
p192                = { version = "0.13.0", default-features = false, features = ["arithmetic"] }
p256                = { version = "0.13.2", default-features = false, features = ["arithmetic"] }
sha1                = { version = "0.10.6", default-features = false }
sha2                = { version = "0.10.8", default-features = false }

[build-dependencies]
esp-metadata-generated = { path = "../esp-metadata-generated", features = ["build-script"] }

[features]
default = []
unstable = ["esp-hal/unstable"]

defmt = ["dep:defmt-rtt"]
esp-radio = ["dep:esp-radio", "dep:esp-rtos", "dep:esp-radio-rtos-driver", "esp-rtos/esp-radio"]
embassy = ["dep:esp-rtos", "esp-rtos/embassy"]

# Device support (required!):
esp32 = [
    "embedded-test/xtensa-semihosting",
    "esp-hal/esp32",
    "esp-alloc/esp32",
    "esp-radio?/esp32",
    "esp-storage?/esp32",
    "esp-bootloader-esp-idf/esp32",
    "esp-metadata-generated/esp32",
    "esp-rtos?/esp32",
]
esp32c2 = [
    "esp-hal/esp32c2",
    "esp-alloc/esp32c2",
    "esp-radio?/esp32c2",
    "esp-storage?/esp32c2",
    "esp-bootloader-esp-idf/esp32c2",
    "esp-metadata-generated/esp32c2",
    "esp-rtos?/esp32c2"
]
esp32c3 = [
    "esp-hal/esp32c3",
    "esp-alloc/esp32c3",
    "esp-radio?/esp32c3",
    "esp-storage?/esp32c3",
    "esp-bootloader-esp-idf/esp32c3",
    "esp-metadata-generated/esp32c3",
    "esp-rtos?/esp32c3",
]
esp32c6 = [
    "esp-hal/esp32c6",
    "esp-alloc/esp32c6",
    "esp-radio?/esp32c6",
    "esp-storage?/esp32c6",
    "esp-bootloader-esp-idf/esp32c6",
    "esp-metadata-generated/esp32c6",
    "esp-rtos?/esp32c6",
]
esp32h2 = [
    "esp-hal/esp32h2",
    "esp-alloc/esp32h2",
    "esp-radio?/esp32h2",
    "esp-storage?/esp32h2",
    "esp-bootloader-esp-idf/esp32h2",
    "esp-metadata-generated/esp32h2",
    "esp-rtos?/esp32h2",
]
esp32s2 = [
    "embedded-test/xtensa-semihosting",
    "esp-hal/esp32s2",
    "esp-alloc/esp32s2",
    "esp-radio?/esp32s2",
    "esp-storage?/esp32s2",
    "esp-bootloader-esp-idf/esp32s2",
    "esp-metadata-generated/esp32s2",
    "esp-rtos?/esp32s2"
]
esp32s3 = [
    "embedded-test/xtensa-semihosting",
    "esp-hal/esp32s3",
    "esp-alloc/esp32s3",
    "esp-radio?/esp32s3",
    "esp-storage?/esp32s3",
    "esp-bootloader-esp-idf/esp32s3",
    "esp-metadata-generated/esp32s3",
    "esp-rtos?/esp32s3",
]

psram = ["esp-hal/psram", "esp-alloc"]

# https://doc.rust-lang.org/cargo/reference/profiles.html#test
# Test and bench profiles inherit from dev and release respectively.
[profile.dev]
codegen-units    = 1
debug            = 2
debug-assertions = true
incremental      = false
opt-level        = "z"
overflow-checks  = true

[profile.release]
codegen-units    = 1
debug            = 2
debug-assertions = true
incremental      = false
opt-level        = 3
lto              = false # LTO (thin or fat) miscompiles some tests on RISC-V
overflow-checks  = true

# `cargo machete` incorrectly marks it as unused.
[package.metadata.cargo-machete]
ignored = ["semihosting"]
