diff --git a/shell.nix b/shell.nix index f5fd699..3d1aed4 100644 --- a/shell.nix +++ b/shell.nix @@ -4,10 +4,11 @@ in with pkgs; mkShell { buildInputs = [ - pkgs.cargo - pkgs.rustc - pkgs.rustfmt - pkgs.rls + cargo + rustc + rustfmt + rls + protobuf ]; RUST_SRC_PATH= "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; diff --git a/src/main.rs b/src/main.rs index 6bb4ca6..5e3d6d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,12 +3,14 @@ pub mod util; use util::lights::*; use std::sync::RwLock; use std::thread; +use candela::Pixel; pub const LED_SIZE: usize = 450; fn main() { - let lock = RwLock::new([Color {r: 0, g: 0, b: 0}; LED_SIZE]); + let mut p: Pixel = [0, 0, 0, 0]; + let lock = RwLock::new([p; LED_SIZE]); thread::spawn(move || loop { let lights = lock.read().unwrap(); run_lights(&lights);