From f01d9e95190ca3cb6222958f1d2738352d7337d4 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:26:51 -0700 Subject: [PATCH] sleep while waiting for pwm export Co-authored-by: J M <2364004+Blu-J@users.noreply.github.com> --- backend/src/sound.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/sound.rs b/backend/src/sound.rs index b10612001..e55950bd1 100644 --- a/backend/src/sound.rs +++ b/backend/src/sound.rs @@ -40,7 +40,9 @@ impl SoundInterface { let instant = Instant::now(); while tokio::fs::metadata(&*PERIOD_FILE).await.is_err() && instant.elapsed() < Duration::from_secs(1) - {} + { + tokio::time::sleep(Duration::from_millis(1)); + } Ok(SoundInterface(Some(guard))) } #[instrument(skip(self))]