Cargo.toml: Tidy & simplify

This commit is contained in:
Harry Ho 2020-12-29 16:53:43 +08:00
parent 4ba5052623
commit f68d5a8c93
2 changed files with 13 additions and 13 deletions

View File

@ -12,9 +12,13 @@ edition = "2018"
volatile-register = "0.2" volatile-register = "0.2"
aligned = "0.3" aligned = "0.3"
embedded-hal = "0.2" embedded-hal = "0.2"
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" # Optional dependencies for building examples
stm32f4xx-hal = { version = "0.8", optional = true }
cortex-m = { version = "0.5", optional = true }
cortex-m-rt = { version = "0.6", optional = true }
panic-itm = { version = "0.4", optional = true }
log = { version = "0.4", optional = true }
[features] [features]
smoltcp-phy = ["smoltcp"] smoltcp-phy = ["smoltcp"]
@ -22,22 +26,18 @@ smoltcp-phy-all = [
"smoltcp/socket-raw", "smoltcp/socket-udp", "smoltcp/socket-tcp", "smoltcp/socket-raw", "smoltcp/socket-udp", "smoltcp/socket-tcp",
"smoltcp/proto-ipv4", "smoltcp/proto-ipv6" "smoltcp/proto-ipv4", "smoltcp/proto-ipv6"
] ]
stm32f4 = ["stm32f4xx-hal"] # Example-based features
stm32f407 = ["stm32f4xx-hal/stm32f407"] tx_stm32f407 = ["stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rt", "panic-itm", "log"]
tcp_stm32f407 = ["stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rt", "smoltcp-phy-all", "smoltcp/log", "panic-itm", "log"]
default = [] default = []
[dev-dependencies]
cortex-m = "0.5"
cortex-m-rt = "0.6"
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

@ -95,7 +95,7 @@ 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" ''
if [[ $1 = "" ]] || [[ $2 = "" ]] if [[ $1 = "" ]] || [[ $2 = "" ]]
@ -106,7 +106,7 @@ let
touch ./examples/tcp_stm32f407.rs touch ./examples/tcp_stm32f407.rs
export ENC424J600_TCP_IP=$1 export ENC424J600_TCP_IP=$1
export ENC424J600_TCP_PREF=$2 export ENC424J600_TCP_PREF=$2
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 {