diff --git a/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c b/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c index 42d913d..187afe4 100644 --- a/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c +++ b/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c @@ -258,6 +258,8 @@ int qa_mmc_calc( struct qa_mmc_dev *dev ) // if duration is longer than 100 ms the frequencey of pulses is less than 10 Hz. This is an error if(l_periode_duartion > MAX_MMC_PERIODE_DELAY) i_mmc_error |= 0x8; + filtered_duration = 0; + // Filter to eliminate values much longer than average or much shorter than everage. // To prevent side effects activate filter only if L and R signal are not present // Interrupt from these signals should be preventet by disabling them if the bridge from Pin C3 to C4 @@ -298,7 +300,6 @@ int qa_mmc_calc( struct qa_mmc_dev *dev ) ++filter_cnt; - filtered_duration = 0; for(i=0; i< 12; i++) { if((t_periode_duartion[i] > l_periode_duartion_min) && (t_periode_duartion[i] < l_periode_duartion_max)) {