aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-07-30 09:45:40 -0400
committerBrian Cully <bjc@kublai.com>2019-07-30 09:45:43 -0400
commitc20e974373e9daeb81278794bc73033b88eb756c (patch)
treebb91ec1aa22272aca2cab8660b2ae41af3d72e33 /app
parent7851fa4ed3ff4b0c494d89ed6501e5998b1cc932 (diff)
downloadsamd21-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')
-rwxr-xr-xapp/src/main.rs16
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();
}
});