From be0953d98f040002eb60458cc91c6a2e951954d6 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 27 Jan 2017 17:20:22 +0000 Subject: [PATCH] firmware: unbreak Io::sleep(). Fixes #663. --- artiq/firmware/runtime/sched.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/firmware/runtime/sched.rs b/artiq/firmware/runtime/sched.rs index 7552a298a..76c60c2a6 100644 --- a/artiq/firmware/runtime/sched.rs +++ b/artiq/firmware/runtime/sched.rs @@ -139,14 +139,12 @@ impl Scheduler { thread.interrupted = false; thread.generator.resume(WaitResult::Interrupted) } - WaitRequest { event: Some(_), timeout: Some(instant) } if now >= instant => - thread.generator.resume(WaitResult::TimedOut), - WaitRequest { event: None, timeout: Some(instant) } if now >= instant => - thread.generator.resume(WaitResult::Completed), - WaitRequest { event: Some(event), timeout: _ } if unsafe { (*event)() } => - thread.generator.resume(WaitResult::Completed), WaitRequest { event: None, timeout: None } => thread.generator.resume(WaitResult::Completed), + WaitRequest { timeout: Some(instant), .. } if now >= instant => + thread.generator.resume(WaitResult::TimedOut), + WaitRequest { event: Some(event), .. } if unsafe { (*event)() } => + thread.generator.resume(WaitResult::Completed), _ => { if self.run_idx == start_idx { // We've checked every thread and none of them are runnable.