Sleeping in boolean blocks to prevent race condition in tight loops
This commit is contained in:
Родитель
6c8fff5727
Коммит
9a0c77c914
|
@ -117,6 +117,7 @@ int audioDuration(int sampleRate) {
|
|||
*/
|
||||
//%
|
||||
bool audioIsPlaying() {
|
||||
uBit.sleep(0);
|
||||
return recording->isPlaying();
|
||||
}
|
||||
|
||||
|
@ -125,6 +126,7 @@ bool audioIsPlaying() {
|
|||
*/
|
||||
//%
|
||||
bool audioIsRecording() {
|
||||
uBit.sleep(0);
|
||||
return recording->isRecording();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче