Persistent audio mute support (#1161)

* Persistent speaker mute support #1100
* Moving persistent mute support from WM8731/AK4951 codec files to audio.cpp module for simplification
This commit is contained in:
Mark Thompson 2023-06-17 16:15:21 -05:00 committed by GitHub
parent 5743d3a3b9
commit ba2407d691
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 159 additions and 80 deletions

View file

@ -96,13 +96,18 @@ bool get_antenna_bias() {
return antenna_bias;
}
bool speaker_mode{false};
void set_speaker_mode(const bool v) {
speaker_mode = v;
if (speaker_mode)
audio::output::speaker_unmute();
else
void set_audio_mute(const bool v) {
if (v)
audio::output::speaker_mute();
else
audio::output::speaker_unmute();
}
void set_speaker_disable(const bool v) {
if (v)
audio::output::speaker_disable();
else
audio::output::speaker_enable();
}
static constexpr uint32_t systick_count(const uint32_t clock_source_f) {