Skip to content

Commit

Permalink
Merge pull request #948 from facchinm/pdm_dsfdm_gain_fix
Browse files Browse the repository at this point in the history
PDM: fix setGain() for dfsdm
  • Loading branch information
facchinm authored Sep 2, 2024
2 parents a77715f + 2bb5b88 commit 92eaf0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/PDM/src/STM32H747_dfsdm/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ int py_audio_init(size_t channels, uint32_t frequency)

void py_audio_gain_set(int gain_db)
{
attenuation = 8 - gain_db;
attenuation = 8 - (gain_db / 3);
if (attenuation < 0) {
attenuation = 0;
}
}

void py_audio_deinit()
Expand Down

0 comments on commit 92eaf0e

Please sign in to comment.