[package]
name = "plant-ctrl2"
version = "0.1.0"
authors = ["Empire Phoenix"]
edition = "2021"
resolver = "2"
#rust-version = "1.71"

[profile.dev]
# Explicitly disable LTO which the Xtensa codegen backend has issues
lto = false
strip = false
debug = true 
overflow-checks = true
panic = "abort"
incremental = true
opt-level = "s"

[profile.dev.build-override]
opt-level = 1
incremental = true

[package.metadata.cargo_runner]
# The string `$TARGET_FILE` will be replaced with the path from cargo.
command = [
    "cargo",
    "espflash",
    "save-image",
    "--chip",
    "esp32c6",
    "image.bin",
    "--partition-table",
    "partitions.csv"
]


[package.metadata.espflash]
partition_table = "partitions.csv"

[features]
default = ["std", "embassy", "esp-idf-svc/native"]
pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]

[dependencies]
#ESP stuff
embedded-svc = { version = "0.28.1", features = ["experimental"] }
esp-idf-hal = "0.45.2"
esp-idf-sys = { version = "0.36.1", features = ["binstart", "native"] }
esp-idf-svc = { version = "0.51.0", default-features = false }
embedded-hal = "1.0.0"
heapless = { version = "0.8", features = ["serde"] }
embedded-hal-bus = { version = "0.2.0", features = ["std"] }

#Hardware additional driver
ds18b20 = "0.1.1"
bq34z100 = { version = "0.3.0", features = ["flashstream"] }
one-wire-bus = "0.1.1"
ds323x = "0.6.0"

#pure code dependencies
log = { version = "0.4", default-features = false }
once_cell = "1.19.0"
anyhow = { version = "1.0.75", features = ["std", "backtrace"] }
average = { version = "0.14.1" , features = ["std"] }
bit_field = "0.10.2"
strum = { version = "0.27.0", features = ["derive"] }
measurements = "0.11.0"
schemars = "0.8.16"

#json
serde = { version = "1.0.192",  features = ["derive"] }
serde_json = "1.0.108"

#timezone
chrono = { version = "0.4.23", default-features = false , features = ["iana-time-zone" , "alloc", "serde"] }
chrono-tz = {version="0.8.0", default-features = false , features = [ "filter-by-regex" ]}
eeprom24x = "0.7.2"
url = "2.5.3"
crc = "3.2.1"
bincode = "1.3.3"
ringbuffer = "0.15.0"
text-template = "0.1.0"
strum_macros = "0.27.0"
esp-ota = { version = "0.2.2", features = ["log"] }
unit-enum = "1.4.1"


[patch.crates-io]
#esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal.git" }
#esp-idf-hal = { git = "https://github.com/empirephoenix/esp-idf-hal.git" }
#esp-idf-sys = { git = "https://github.com/empirephoenix/esp-idf-sys.git" }
#esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys.git" }
#esp-idf-svc = { git = "https://github.com/esp-rs/esp-idf-svc.git" }
#bq34z100 = { path = "../../bq34z100_rust" }

[build-dependencies]
cc = "=1.1.30"
embuild =  { version= "0.32.0", features = ["espidf"]}
vergen = { version = "8.2.6", features = ["build", "git", "gitcl"] }
