Commit b217e608 authored by Ryan McClelland's avatar Ryan McClelland Committed by Erwan Gouriou
Browse files

fix open_pdfm_filter_init double promotion



floating point constants were defined as doubles. change them to
single-percision point to prevent double promotion of the whole
thing.

Signed-off-by: default avatarRyan McClelland <ryanmcclelland@meta.com>
parent 5948f7b3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6,3 +6,8 @@ Available libs:
      allows to drive the vl53l0x sensor
      full information can be found here : http://www.st.com/en/embedded-software/stsw-img005.html
  *...

Patch List:

   *Fix double-promotion warnings
    -audio/microphone/OpenPDMFilter.c modified
+2 −2
Original line number Diff line number Diff line
@@ -177,8 +177,8 @@ void Open_PDM_Filter_Init(TPDMFilter_InitStruct *Param)
  }

  Param->OldOut = Param->OldIn = Param->OldZ = 0;
  Param->LP_ALFA = (Param->LP_HZ != 0 ? (uint16_t) (Param->LP_HZ * 256 / (Param->LP_HZ + Param->Fs / (2 * 3.14159))) : 0);
  Param->HP_ALFA = (Param->HP_HZ != 0 ? (uint16_t) (Param->Fs * 256 / (2 * 3.14159 * Param->HP_HZ + Param->Fs)) : 0);
  Param->LP_ALFA = (Param->LP_HZ != 0 ? (uint16_t) (Param->LP_HZ * 256 / (Param->LP_HZ + Param->Fs / (2 * 3.14159f))) : 0);
  Param->HP_ALFA = (Param->HP_HZ != 0 ? (uint16_t) (Param->Fs * 256 / (2 * 3.14159f * Param->HP_HZ + Param->Fs)) : 0);

  Param->FilterLen = decimation * SINCN;       
  sinc[0] = 0;