Finalised all Mic Boost(WM) and Mic ALC(AK)

This commit is contained in:
Brumi-2021
2022-10-02 00:51:12 +02:00
parent 745574d3c4
commit 6b75249b0a
4 changed files with 49 additions and 37 deletions

View File

@@ -345,19 +345,28 @@ public:
void speaker_disable() {};
void microphone_enable(int8_t alc_mode) override {
(void)alc_mode; // to avoid "unused warning" when compiling. (@WM8731 we do not use that parameter)
// TODO: Implement,
}
void microphone_enable(int8_t wm8731_boost_GUI) override {
microphone_mute(true); // c/m to reduce "plop noise" when changing wm8731_boost_GUI.
// chThdSleepMilliseconds(20); // does not help to reduce the "plop noise"
microphone_boost((wm8731_boost_GUI<2) ? 1 : 0 ); // 1 = Enable Boost (+20 dBs) . 0 = Disable Boost (0dBs).
chThdSleepMilliseconds(120); // >50 msegs, very effective , >100 msegs minor improvement ,120 msegs trade off speed .
microphone_mute(false);
// (void)alc_mode; In prev. fw version , when we did not use at all param., to avoid "unused warning" when compiling.)
}
void microphone_disable() override {
// TODO: Implement
}
// void microphone_mute(const bool mute) {
// map.r.analog_audio_path_control.mutemic = (mute ? 0 : 1);
// write(Register::AnalogAudioPathControl);
// }
void microphone_boost(const bool boost) {
map.r.analog_audio_path_control.micboost = (boost ? 1 : 0);
write(Register::AnalogAudioPathControl);
}
void microphone_mute(const bool mute) {
map.r.analog_audio_path_control.mutemic = (mute ? 1 : 0); //1 = Enable Mute , 0 = Disable Mute
write(Register::AnalogAudioPathControl);
}
// void set_adc_source(const ADCSource adc_source) {
// map.r.analog_audio_path_control.insel = toUType(adc_source);