[package]
edition = "2021"
name = "stm32f042c4-blinky"
version = "0.1.0"
default-run = "main"

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

[[bin]]
name = "mapper"
path = "src/mapper.rs"

[dependencies]
cortex-m = { version = "0.7", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rt = "0.7"
critical-section = "1"
embedded-hal = "0.2"
embedded-midi = "0.1.2"
midi-types = "0.1.7"
nb = "1"
panic-halt = "0.2"
stm32f0xx-hal = { path = "stm32f0xx-hal", features = ["stm32f042", "rt"] }

# For debugging and logging
defmt = "1"
defmt-rtt = "1"

# Add defmt feature to make sure metadata is included
[package.metadata.defmt]
linker_args = ["-C", "link-arg=-Tdefmt.x"]

[profile.release]
debug = true        # Keep debug info for better debugging
opt-level = "s"     # Optimize for size
lto = true          # Link-time optimization
codegen-units = 1   # Better optimization
panic = 'abort'     # Reduce binary size
strip = false       # Keep symbols for debugging

[profile.dev]
debug = true        # Keep debug info for better debugging
opt-level = "s"     # Optimize for size
lto = true          # Link-time optimization
codegen-units = 1   # Better optimization
panic = 'abort'     # Reduce binary size
strip = false       # Keep symbols for debugging