Skip to content

Commit

Permalink
Make OpenPDMFilter gain customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepmistry committed May 13, 2021
1 parent fc6ac02 commit 238f56a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/OpenPDM2PCM/OpenPDMFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@

#define SINCN 3
#define DECIMATION_MAX 128
#ifdef PICO_BUILD
#define FILTER_GAIN Param->Gain
#else
#define FILTER_GAIN 16
#endif

#define HTONS(A) ((((uint16_t)(A) & 0xff00) >> 8) | \
(((uint16_t)(A) & 0x00ff) << 8))
Expand All @@ -72,6 +76,9 @@ typedef struct {
uint8_t Out_MicChannels;
uint8_t Decimation;
uint8_t MaxVolume;
#ifdef PICO_BUILD
uint8_t Gain;
#endif
/* Private */
uint32_t Coef[SINCN];
uint16_t FilterLen;
Expand Down

0 comments on commit 238f56a

Please sign in to comment.