[package]
edition      = "2021"
name         = "renderbug-embassy"
rust-version = "1.86"
version      = "0.1.0"
default-run = "renderbug-embassy"

[[bin]]
name = "renderbug-embassy"
path = "./src/bin/main.rs"

[features]
default = ["real-output"]
real-output = []
dual-core = []
simulation = ["dep:rmp"]
radio = [
  "dep:esp-radio",
  "dep:reqwless",
  "dep:trouble-host",
  "esp-rtos/esp-radio"
]
motion = ["mpu", "gps"]
max-usb-power = []
wokwi = ["max-usb-power"]
mpu = ["dep:mpu6050-dmp"]
gps = ["dep:nmea"]
oled = ["dep:ssd1306"]
rtt = ["dep:rtt-target"]
demo = []

[dependencies]
# The basic requirements for all features
figments = { path = "../figments/figments/", features = ["alloc", "embedded-graphics"] }
figments-render = { path = "../figments/figments-render/", features = ["smart-leds", "micromath"], default-features = false }
esp-bootloader-esp-idf = { version = "0.4.0", features = ["esp32s3"] }
esp-hal = { version = "1.0.0", features = [
  "esp32s3",
  "log-04",
  "unstable",
] }
esp-alloc = "0.9.0"
esp-backtrace = { version = "0.18", features = [
  "esp32s3",
  "panic-handler",
  "println",
] }
esp-println = { version = "0.16", features = ["esp32s3", "log-04"] }
# for more networking protocol support see https://crates.io/crates/edge-net
critical-section = "1.2.0"
embassy-executor = { version = "0.9.0", features = [
  "log",
 # "task-arena-size-98304",
] }
embassy-time = { version = "0.5.0", features = ["log"] }
esp-rtos = { version = "0.2.0", features = [
  "embassy",
  "esp-alloc",
  "esp32s3",
  "log-04"
] }
log = "0.4"
static_cell = "2.1.1"
rgb = "0.8.52"
esp-hal-smartled = { version = "0.17.0", features = ["esp32s3"] }
smart-leds = "0.4.0"
embassy-sync = "0.7.2"
embassy-embedded-hal = "0.5.0"
embedded-hal-async = "1.0.0"
nalgebra = { version = "0.33.2", default-features = false, features = ["alloc", "libm"] }
xtensa-lx-rt = { version = "*", features = ["float-save-restore"] }
micromath = "2.1.0"
enumset = "1.1.10"
enum-map = "2.7.3"
portable-atomic = { version = "1.11", features = ["critical-section"] }
embassy-futures = { version = "0.1.2", features = ["log"] }

# Telemetry outputs
esp-radio = { version = "*", optional = true, features = [
  "esp-alloc",
  "esp32s3",
  "log-04",
  "wifi",
  "ble",
  "coex",
  "unstable"
] }
embassy-net = { version = "0.7.1", features = ["alloc", "dns", "medium-ethernet", "proto-ipv4", "tcp", "udp", "dhcpv4"] }
reqwless = { version = "0.13.0", optional = true, features = ["log", "alloc"] }
trouble-host = { version = "0.5.1", optional = true, features = ["log"] }

# Sensors
nmea = { version = "0.7.0", optional = true, default-features = false, features = [
  "GGA",
  "GSA",
  "GSV",
  "RMC",
  "VTG",

  "GLL",
  "GST",
] }
mpu6050-dmp = { version = "0.6.1", features = ["async"], optional = true }

# RTT debugging
rtt-target = { version = "0.6.2", optional = true }

# Simulation
esp-storage = { version = "0.7.0", features = ["esp32s3", "critical-section"] }
embedded-storage = "0.3.1"
rmp = { path = "../msgpack-rust/rmp/", optional = true, default-features = false }
display-interface = "0.5.0"
embassy-net = { version = "0.7.1", features = ["alloc", "dns", "medium-ethernet", "proto-ipv4", "tcp", "udp", "dhcpv4"] }
reqwless = { version = "0.13.0", optional = true }

[profile.dev]
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"

[profile.release]
codegen-units    = 1     # LLVM can perform better optimizations using a single thread
debug            = 2
debug-assertions = false
incremental      = false
lto              = 'fat'
opt-level        = 's'
overflow-checks  = false

[profile.dev.package.esp-radio]
opt-level = 3

[build-dependencies]
image = "0.25"
rmp = { path = "../msgpack-rust/rmp/" }
csv = "1.3"
