diff --git a/Cargo.toml b/Cargo.toml index 0f00b43..6315b94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,11 +15,12 @@ reqwest = { version = "0.12", default-features = false, features = ["http2","ru serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.143" bincode = "2.0.1" -embedded-graphics-simulator = "0.7.0" +embedded-graphics-simulator = { version = "0.7.0", optional = true } + [features] -default = ["simulator"] # use simulator by default -simulator = [] +default = ["simulator"] +simulator = ["embedded-graphics-simulator"] # enable only for simulator builds epaper = [] paper-png = [] \ No newline at end of file diff --git a/build_aarch_epaper.sh b/build_aarch_epaper.sh new file mode 100644 index 0000000..58e033f --- /dev/null +++ b/build_aarch_epaper.sh @@ -0,0 +1 @@ +cargo build --release --no-default-features --features=epaper --target=aarch64-unknown-linux-gnu \ No newline at end of file diff --git a/src/display/mod.rs b/src/display/mod.rs index 9610447..4066845 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -47,8 +47,13 @@ mod epaper; #[cfg(feature = "epaper")] pub use epaper::EPaper; -mod image_sim; -mod simulator; -pub use image_sim::ImageSimulator; +#[cfg(feature = "simulator")] +mod simulator; +#[cfg(feature = "simulator")] pub use simulator::Simulator; + +#[cfg(feature = "paper-png")] +mod image_sim; +#[cfg(feature = "paper-png")] +pub use image_sim::ImageSimulator; diff --git a/src/main.rs b/src/main.rs index b4231d4..d1dc766 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,7 +38,7 @@ fn main() { let display = display::Simulator::new(); #[cfg(feature = "epaper")] - let display = display::EPaper::new(); + let display = display::EPaper::new().unwrap(); let mut app = app::App::new(98685373, display); app.init();