Compare commits
1 commit
51345aee4a
...
7ccfc3091e
Author | SHA1 | Date | |
---|---|---|---|
7ccfc3091e |
2 changed files with 5 additions and 8 deletions
|
@ -4,11 +4,10 @@ in
|
||||||
with pkgs;
|
with pkgs;
|
||||||
mkShell {
|
mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
cargo
|
pkgs.cargo
|
||||||
rustc
|
pkgs.rustc
|
||||||
rustfmt
|
pkgs.rustfmt
|
||||||
rls
|
pkgs.rls
|
||||||
protobuf
|
|
||||||
];
|
];
|
||||||
|
|
||||||
RUST_SRC_PATH= "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH= "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||||
|
|
|
@ -3,14 +3,12 @@ pub mod util;
|
||||||
use util::lights::*;
|
use util::lights::*;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use candela::Pixel;
|
|
||||||
|
|
||||||
|
|
||||||
pub const LED_SIZE: usize = 450;
|
pub const LED_SIZE: usize = 450;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut p: Pixel = [0, 0, 0, 0];
|
let lock = RwLock::new([Color {r: 0, g: 0, b: 0}; LED_SIZE]);
|
||||||
let lock = RwLock::new([p; LED_SIZE]);
|
|
||||||
thread::spawn(move || loop {
|
thread::spawn(move || loop {
|
||||||
let lights = lock.read().unwrap();
|
let lights = lock.read().unwrap();
|
||||||
run_lights(&lights);
|
run_lights(&lights);
|
||||||
|
|
Loading…
Reference in a new issue