fixes
This commit is contained in:
parent
712140fc8d
commit
10e71b6ccc
1 changed files with 3 additions and 3 deletions
|
@ -14,7 +14,7 @@ pub const LOOP_WAIT: u64 = 250;
|
||||||
fn main() {
|
fn main() {
|
||||||
let p: RawColor = [0, 0, 0, 0];
|
let p: RawColor = [0, 0, 0, 0];
|
||||||
let lock = Arc::new(RwLock::new([p; LED_SIZE]));
|
let lock = Arc::new(RwLock::new([p; LED_SIZE]));
|
||||||
let mut pattern: Arc<Mutex<Vec<Box<dyn Pattern>>>> = Arc::new(Mutex::new(Vec::new()));
|
let pattern: Arc<Mutex<Vec<Box<dyn Pattern>>>> = Arc::new(Mutex::new(Vec::new()));
|
||||||
let read = Arc::clone(&lock);
|
let read = Arc::clone(&lock);
|
||||||
//light management
|
//light management
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
|
@ -45,8 +45,8 @@ fn main() {
|
||||||
thread::sleep(time::Duration::from_millis(LOOP_WAIT));
|
thread::sleep(time::Duration::from_millis(LOOP_WAIT));
|
||||||
let c_lock = Arc::clone(&lock);
|
let c_lock = Arc::clone(&lock);
|
||||||
let mut lights = c_lock.write().unwrap();
|
let mut lights = c_lock.write().unwrap();
|
||||||
let mut data = pattern.lock().unwrap();
|
let data = pattern.lock().unwrap();
|
||||||
for p in *data {
|
for p in &*data {
|
||||||
//let c_lock = Arc::clone(&lock);
|
//let c_lock = Arc::clone(&lock);
|
||||||
//let mut lights = c_lock.write().unwrap();
|
//let mut lights = c_lock.write().unwrap();
|
||||||
p.execute(&mut lights, ticks);
|
p.execute(&mut lights, ticks);
|
||||||
|
|
Loading…
Reference in a new issue