content: [package]
  name = "firmware"
  version = "0.3.4"
  edition = "2021"
  license = "GPL-3.0-or-later"
  
  [dependencies]
  rtic = { version = "2.1", features = ["thumbv7-backend"] }
  rtic-sync = "1.3"
  rtic-monotonics = { version = "1.5", features = ["cortex-m-systick"] }
  critical-section = "1.1"
  cortex-m = { version = "^0.7.7", features = ["critical-section-single-core"] }
  # set-vtor: set vector table to the flash address rather than relying
  #   on the default value of 0x0 which is fine when booting from bank 1
  #   (because memory is aliased) but would break with bank 2
  cortex-m-rt = { version = "0.7.3", features = ["set-vtor"] }
  embedded-alloc = "0.5"
  display-interface = "^0.4.1"
  ssd1306 = "0.8"
  minicbor = { version = "0.24.1", default-features = false, features = ["alloc", "derive"] }
  rand = { version = "0.8", default-features = false }
  rand_chacha = { version = "0.3", default-features = false }
  log = "0.4"
  futures = { version = "0.3", default-features = false, features = ["async-await"] }
  bitcoin = { version = "0.32", default-features = false, features = ["secp-recovery"] }
  bdk_wallet = { git = "https://github.com/afilini/bdk.git", rev = "369ff991f4e6624dd4705cada786259888407c8f", default-features = false, features = ["keys-bip39"] }
  bitcoin_hashes = { version = "0.14.0", default-features = false, features = ["small-hash"] }
  secp256k1 = { version = "0.29", default-features = false, features = ["alloc", "lowmemory"] }
  fetch-git-hash = { path = "../fetch-git-hash" }
  
  model = { package="portal-model", path = "../portal-model", features = ["stm32"] }
  gui = { path = "../gui", features = ["stm32"] }
  
  embedded-hal = { package = "embedded-hal", version = "0.2.6", optional = true }
  
  rtt-target = { version = "0.5", optional = true }
  rtt-log = { version = "0.3", optional = true }
  # stm32l4xx-hal = { version = "0.7.1", features = ["stm32l476", "rt"], optional = true }
  stm32l4xx-hal = { git = "http://github.com/TwentyTwoHW/stm32l4xx-hal.git", rev = "120f868c9325b7a72ea6958d18c935c19e878db4", features = ["stm32l476", "rt"], optional = true }
  
  # panic-probe = { version = "0.2", features = ["print-rtt"], optional = true }
  cortex-m-semihosting = { version = "0.5", optional = true }
  cortex-m-log = { version = "0.8", features = ["log-integration", "semihosting"], optional = true}
  # panic-semihosting = { version = "0.6", optional = true }
  
  [features]
  default = ["device"]
  production = []
  emulator-fast-ticks = []
  device = ["stm32l4xx-hal", "embedded-hal"] # "panic-probe"
  device-log = ["rtt-target", "rtt-log"]
  device-qemu = ["cortex-m-semihosting", "cortex-m-log"]
  trace_memory = []
  panic-log = []
  
  [profile.dev]
  opt-level = "z"
  panic = "abort"
  lto = true
  codegen-units = 1
  
  # Don't optimize the `cortex-m-rt` crate
  # [profile.dev.package.cortex-m-rt]
  # opt-level = 0
  # Optimize all the other dependencies
  [profile.dev.package."*"]
  debug = true
  
  [profile.release]
  opt-level = "z"
  panic = "abort"
  lto = true
  codegen-units = 1
  debug = true
  
  [profile.emulator-fast-ticks]
  inherits = "release"
  
  [patch.crates-io]
  miniscript = { git = "https://github.com/afilini/rust-miniscript.git", rev = "fbc027206d66da448ebe548cf556b526019d0456" }
  # Use bitcoin-hashes 0.14 to save space
  bip39 = { git = "https://github.com/afilini/rust-bip39.git", rev = "e8e4aea8238a5527a64eafa2b1073e22b822188f" }
  