Fix some sound issues

This commit is contained in:
RogueMaster
2022-12-19 20:19:03 -05:00
parent 37a0e5463f
commit 929aea6a91
5 changed files with 39 additions and 14 deletions

View File

@@ -102,11 +102,16 @@ static void tama_p1_hal_set_lcd_icon(u8_t icon, bool_t val) {
}
static void tama_p1_hal_play_frequency(bool_t en) {
if(en)
furi_hal_speaker_start(g_ctx->frequency, 0.5f);
else
furi_hal_speaker_stop();
if(en) {
if(furi_hal_speaker_acquire(30)) {
furi_hal_speaker_start(g_ctx->frequency, 0.5f);
}
} else {
if(furi_hal_speaker_is_mine()) {
furi_hal_speaker_stop();
furi_hal_speaker_release();
}
}
g_ctx->buzzer_on = en;
}