Turn ftdi and piston into features
This commit is contained in:
parent
4f959d217d
commit
6d1f45c92a
5 changed files with 12 additions and 5 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -10,7 +10,6 @@ dependencies = [
|
|||
"ftdi-embedded-hal",
|
||||
"image",
|
||||
"piston_window",
|
||||
"rgb",
|
||||
"unreal_asset",
|
||||
"url",
|
||||
]
|
||||
|
|
|
|||
10
Cargo.toml
10
Cargo.toml
|
|
@ -9,13 +9,17 @@ readme = "README.md"
|
|||
|
||||
[dependencies]
|
||||
clap = { version = "4.5.17", features = ["derive"] }
|
||||
ftdi-embedded-hal = { version = "0.22.0", features = ["libftd2xx"] }
|
||||
ftdi-embedded-hal = { version = "0.22.0", features = ["libftd2xx"], optional = true }
|
||||
image = "0.25.2"
|
||||
piston_window = "0.132.0"
|
||||
rgb = "0.8.52"
|
||||
piston_window = { version = "0.132.0", optional = true }
|
||||
unreal_asset = "0.1.16"
|
||||
url = "2.5.2"
|
||||
|
||||
[features]
|
||||
default = ["ftdi","piston"]
|
||||
ftdi = ["dep:ftdi-embedded-hal"]
|
||||
piston = ["dep:piston_window"]
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 3
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ fn main() {
|
|||
}
|
||||
}
|
||||
match args.output.as_str() {
|
||||
#[cfg(feature = "piston")]
|
||||
"piston" => Output::piston(rx),
|
||||
#[cfg(feature = "ftdi")]
|
||||
"ftd2xx" => Output::ft2dxx(rx),
|
||||
_ => {
|
||||
match Url::parse(&args.output) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
mod ft2dxx;
|
||||
#[cfg(feature = "ftdi")]
|
||||
mod ftd2xx;
|
||||
#[cfg(feature = "piston")]
|
||||
mod piston;
|
||||
mod realtimeudp;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue