diff --git a/module_usb_audio/pcm_pdm_mic.xc b/module_usb_audio/pcm_pdm_mic.xc index c95a760b..a56fdb8a 100644 --- a/module_usb_audio/pcm_pdm_mic.xc +++ b/module_usb_audio/pcm_pdm_mic.xc @@ -211,11 +211,13 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s default:break; } +#define GAIN 0 + if((-a) > max) max = (-a); if(a > max) max = a; int output; if(only_one_mic){ - output = a<<(clz(max)-1); + output = a< max) max = (-a); if(a > max) max = a; @@ -231,7 +233,7 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s if(f > max) max = f; output = a+b+c+d+e+f+g+g; output >>=3; - output = output<<(clz(max)-1); + output = output<>17);