[package]
edition = "2021"
name = "nrf-bootloader-example"
version = "0.1.0"
description = "Bootloader for nRF chips"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
defmt = { version = "1.0.1", optional = true }
defmt-rtt = { version = "1.0.0", optional = true }

embassy-nrf = { path = "../../../../embassy-nrf", features = [] }
embassy-boot-nrf = { path = "../../../../embassy-boot-nrf" }
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
embassy-sync = { version = "0.7.2", path = "../../../../embassy-sync" }
cortex-m-rt = { version = "0.7" }
cfg-if = "1.0.0"

[features]
defmt = [
    "dep:defmt",
    "dep:defmt-rtt",
    "embassy-boot-nrf/defmt",
    "embassy-nrf/defmt",
]
softdevice = [
    "embassy-boot-nrf/softdevice",
]

[profile.dev]
debug = 2
debug-assertions = true
incremental = false
opt-level = 'z'
overflow-checks = true

[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 'z'
overflow-checks = false

# do not optimize proc-macro crates = faster builds from scratch
[profile.dev.build-override]
codegen-units = 8
debug = false
debug-assertions = false
opt-level = 0
overflow-checks = false

[profile.release.build-override]
codegen-units = 8
debug = false
debug-assertions = false
opt-level = 0
overflow-checks = false

[package.metadata.embassy]
build = [
  { target = "thumbv7em-none-eabi", features = ["embassy-nrf/nrf52840"] },
  { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9160-ns"] },
  { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9120-ns"] },
  { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9151-ns"] },
  { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9161-ns"] }
]
