Cargo.toml: Fix excessive dependency requirements

pull/3/head
Harry Ho 2020-12-29 11:50:35 +08:00
parent 50c3003210
commit eeea973f1f
2 changed files with 8 additions and 6 deletions

View File

@ -14,8 +14,8 @@ aligned = "0.3"
embedded-hal = "0.2" embedded-hal = "0.2"
stm32f4xx-hal = { version = "0.8" , optional = true } stm32f4xx-hal = { version = "0.8" , optional = true }
smoltcp = { version = "0.6.0", default-features = false, features = ["proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp", "log", "verbose", "ethernet"], optional = true } smoltcp = { version = "0.6.0", default-features = false, features = ["proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp", "log", "verbose", "ethernet"], optional = true }
log = "0.4" log = { version = "0.4", optional = true }
cortex-m-rtic = "0.5.3" cortex-m-rtic = { version = "0.5.3", optional = true }
[features] [features]
smoltcp-phy = ["smoltcp"] smoltcp-phy = ["smoltcp"]
@ -25,6 +25,8 @@ smoltcp-phy-all = [
] ]
stm32f4 = ["stm32f4xx-hal"] stm32f4 = ["stm32f4xx-hal"]
stm32f407 = ["stm32f4xx-hal/stm32f407"] stm32f407 = ["stm32f4xx-hal/stm32f407"]
tx_stm32f407 = ["stm32f407", "log", "cortex-m-rtic"]
tcp_stm32f407 = ["stm32f407", "smoltcp-phy-all", "smoltcp/log", "log", "cortex-m-rtic"]
default = [] default = []
[dev-dependencies] [dev-dependencies]
@ -34,11 +36,11 @@ panic-itm = "0.4"
[[example]] [[example]]
name = "tx_stm32f407" name = "tx_stm32f407"
required-features = ["stm32f407"] required-features = ["tx_stm32f407"]
[[example]] [[example]]
name = "tcp_stm32f407" name = "tcp_stm32f407"
required-features = ["stm32f407", "smoltcp-phy-all", "smoltcp/log"] required-features = ["tcp_stm32f407"]
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1

View File

@ -94,10 +94,10 @@ let
# Examples # Examples
exTxStm32f407 = writeShellScriptBin "tx_stm32f407" '' exTxStm32f407 = writeShellScriptBin "tx_stm32f407" ''
cargo run --release --example=tx_stm32f407 --features=stm32f407 cargo run --release --example=tx_stm32f407 --features=tx_stm32f407
''; '';
exTcpStm32f407 = writeShellScriptBin "tcp_stm32f407" '' exTcpStm32f407 = writeShellScriptBin "tcp_stm32f407" ''
cargo run --release --example=tcp_stm32f407 --features=stm32f407,smoltcp-phy-all cargo run --release --example=tcp_stm32f407 --features=tcp_stm32f407
''; '';
in in
stdenv.mkDerivation { stdenv.mkDerivation {