From c20e974373e9daeb81278794bc73033b88eb756c Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 30 Jul 2019 09:45:40 -0400 Subject: Update dotstar with interrupts disabled. Output is more solid now, but still flickers badly with heavy serial. --- app/src/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/src/main.rs b/app/src/main.rs index d091a9e..ded4dac 100755 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -123,9 +123,11 @@ fn main() -> ! { let mut last_tick = 0; loop { - dotstar - .write(black.iter().cloned()) - .expect("turning off dotstar"); + cortex_m::interrupt::free(|_cs| { + dotstar + .write(black.iter().cloned()) + .expect("turning off dotstar"); + }); let tick = rtc::millis(); if tick >= last_tick + 1_024 { @@ -135,9 +137,11 @@ fn main() -> ! { usb_host.task(); - dotstar - .write(blue.iter().cloned()) - .expect("turning on dotstar"); + cortex_m::interrupt::free(|_cs| { + dotstar + .write(blue.iter().cloned()) + .expect("turning on dotstar"); + }); wfi(); } }); -- cgit v1.2.3