[package]
name          = "esp-backtrace"
version       = "0.16.0"
edition       = "2024"
rust-version  = "1.86.0"
description   = "Bare-metal backtrace support for Espressif devices"
documentation = "https://docs.espressif.com/projects/rust/esp-backtrace/latest/"
keywords      = ["backtrace", "embedded", "esp32", "espressif"]
categories    = ["embedded", "hardware-support", "no-std"]
repository    = "https://github.com/esp-rs/esp-hal"
license       = "MIT OR Apache-2.0"

[package.metadata.docs.rs]
default-target = "riscv32imc-unknown-none-elf"
features       = ["esp32c3", "panic-handler", "exception-handler", "println", "esp-println/uart"]

[lib]
bench = false
test  = false

[dependencies]
cfg-if      = "1.0.0"
defmt       = { version = "1.0.1", optional = true }
esp-config  = { version = "0.4.0", path = "../esp-config" }
esp-println = { version = "0.14.0", optional = true, default-features = false, path = "../esp-println" }
heapless    = "0.8"
semihosting = { version = "0.1.20", optional = true }

[build-dependencies]
esp-build = { version = "0.3.0", path = "../esp-build" }
esp-config   = { version = "0.4.0", path = "../esp-config", features = ["build"] }
esp-metadata = { version = "0.7.0", path = "../esp-metadata" }

[features]
default = ["colors"]

esp32   = ["esp-println?/esp32", "semihosting?/openocd-semihosting", "print-float-registers"]
esp32c2 = ["esp-println?/esp32c2"]
esp32c3 = ["esp-println?/esp32c3"]
esp32c6 = ["esp-println?/esp32c6"]
esp32h2 = ["esp-println?/esp32h2"]
esp32p4 = ["esp-println?/esp32p4"]
esp32s2 = ["esp-println?/esp32s2", "semihosting?/openocd-semihosting"]
esp32s3 = ["esp-println?/esp32s3", "semihosting?/openocd-semihosting", "print-float-registers"]

# Use esp-println
println = ["dep:esp-println"]

# Use defmt
defmt = ["dep:defmt"]

print-float-registers = [] # TODO support esp32p4

# You may optionally enable one or more of the below features to provide
# additional functionality:
colors               = []
custom-halt          = []
custom-pre-backtrace = []
exception-handler    = []
halt-cores           = []
panic-handler        = []

[lints.rust]
unexpected_cfgs = "allow"
