From 3d471bff0ae16bc38a9c25786de147aeacc00d65 Mon Sep 17 00:00:00 2001 From: Harry Ho Date: Thu, 28 Jan 2021 17:56:13 +0800 Subject: [PATCH] cargo: cleanup features --- Cargo.toml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee97bc8..30fe7f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,11 @@ license = "BSD-2-Clause" volatile-register = "0.2" aligned = "0.3" embedded-hal = "0.2" -smoltcp = { version = "0.7.0", default-features = false, features = ["proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp", "log", "verbose", "ethernet"], optional = true } +smoltcp = { version = "0.7.0", default-features = false, features = [ "socket-raw", "proto-ipv4", "proto-ipv6" ], optional = true } +# Dependencies for NAL +embedded-time = { version = "0.10.1", optional = true } +embedded-nal = { version = "0.1.0", optional = true } +heapless = { version = "0.5.6", optional = true } # Optional dependencies for building examples stm32f4xx-hal = { version = "0.8", optional = true } cortex-m = { version = "0.5", optional = true } @@ -21,20 +25,24 @@ cortex-m-rt = { version = "0.6", optional = true } cortex-m-rtic = { version = "0.5.3", optional = true } panic-itm = { version = "0.4", optional = true } log = { version = "0.4", optional = true } -embedded-time = { version = "0.10.1", optional = true } -embedded-nal = { version = "0.1.0", optional = true } -heapless = { version = "0.5.6", optional = true } [features] smoltcp-phy = ["smoltcp"] -smoltcp-phy-all = [ - "smoltcp/socket-raw", "smoltcp/socket-udp", "smoltcp/socket-tcp", - "smoltcp/proto-ipv4", "smoltcp/proto-ipv6" +nal = [ + "embedded-time", "embedded-nal", "heapless", + "smoltcp-phy", "smoltcp/socket-tcp", "smoltcp/ethernet" ] # Example-based features -tx_stm32f407 = ["stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rtic", "panic-itm", "log"] -tcp_stm32f407 = ["stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rt", "cortex-m-rtic", "smoltcp-phy-all", "smoltcp/log", "panic-itm", "log"] -nal = [ "embedded-time", "embedded-nal", "smoltcp-phy", "heapless" ] +smoltcp-examples = [ + "smoltcp-phy", "smoltcp/socket-tcp", "smoltcp/ethernet" +] +tx_stm32f407 = [ + "stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rtic", + "panic-itm", "log" +] +tcp_stm32f407 = [ + "stm32f4xx-hal/stm32f407", "cortex-m", "cortex-m-rt", "cortex-m-rtic", + "smoltcp-examples", "panic-itm", "log"] default = [] [[example]]