mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
sleep while waiting for pwm export
Co-authored-by: J M <2364004+Blu-J@users.noreply.github.com>
This commit is contained in:
committed by
Keagan McClelland
parent
3ab078a878
commit
f01d9e9519
@@ -40,7 +40,9 @@ impl SoundInterface {
|
|||||||
let instant = Instant::now();
|
let instant = Instant::now();
|
||||||
while tokio::fs::metadata(&*PERIOD_FILE).await.is_err()
|
while tokio::fs::metadata(&*PERIOD_FILE).await.is_err()
|
||||||
&& instant.elapsed() < Duration::from_secs(1)
|
&& instant.elapsed() < Duration::from_secs(1)
|
||||||
{}
|
{
|
||||||
|
tokio::time::sleep(Duration::from_millis(1));
|
||||||
|
}
|
||||||
Ok(SoundInterface(Some(guard)))
|
Ok(SoundInterface(Some(guard)))
|
||||||
}
|
}
|
||||||
#[instrument(skip(self))]
|
#[instrument(skip(self))]
|
||||||
|
|||||||
Reference in New Issue
Block a user