diff options
author | Brian Cully <bjc@kublai.com> | 2019-07-30 09:45:40 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-07-30 09:45:43 -0400 |
commit | c20e974373e9daeb81278794bc73033b88eb756c (patch) | |
tree | bb91ec1aa22272aca2cab8660b2ae41af3d72e33 /app/src | |
parent | 7851fa4ed3ff4b0c494d89ed6501e5998b1cc932 (diff) | |
download | samd21-demo-c20e974373e9daeb81278794bc73033b88eb756c.tar.gz samd21-demo-c20e974373e9daeb81278794bc73033b88eb756c.zip |
Update dotstar with interrupts disabled.
Output is more solid now, but still flickers badly with heavy serial.
Diffstat (limited to 'app/src')
-rwxr-xr-x | app/src/main.rs | 16 |
1 files changed, 10 insertions, 6 deletions
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(); } }); |