- diff --git a/ptxdist/local_src/ecu01-codesys/io_driver/ecu01compcap.cpp b/ptxdist/local_src/ecu01-codesys/io_driver/ecu01compcap.cpp
- index 552e8c0..6391612 100644
- --- a/ptxdist/local_src/ecu01-codesys/io_driver/ecu01compcap.cpp
- +++ b/ptxdist/local_src/ecu01-codesys/io_driver/ecu01compcap.cpp
- @@ -133,10 +133,15 @@ void Ecu01CompCap::cycle()
- _refError = ioc.RefError;
- _isrTolerCnt = ioc.IsrTolerCnt;
- +#if 1
- + _isrMaxDelay = (ioc.IsrMaxDelay*100L)/665;
- + _isrAvgDelay = (ioc.IsrAvgDelay*100L)/665;
- + _isrDelayCov = (ioc.IsrDelayCov*100L)/665;
- +#else
- _isrMaxDelay = ioc.IsrMaxDelay;
- _isrAvgDelay = ioc.IsrAvgDelay;
- _isrDelayCov = ioc.IsrDelayCov;
- -
- +#endif
- }
- diff --git a/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c b/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c
- index 5edb6d2..34297a5 100644
- --- a/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c
- +++ b/ptxdist/local_src/ecu01-comp-cap/mmc_imp.c
- @@ -90,35 +90,30 @@ int GetPhaseShift(const unsigned int * restrict ref, const unsigned int * restri
- halfperiod = periode / 2;
- - /* loop i over a maximum of 32 ref values. */
- + /* loop i over a maximum of 32 shift values. */
- for (i=0, j=0 ; i<size ; i++) {
- - /*
- - * loop j over 32 shift values. This loop resumes for the next
- - * ref were the previous pair of values was found
- - */
- -
- -/*
- - * In *theory* we should count from the last value of |j|, but somehow
- - * this does not work. We need to re-investigate this later.
- - */
- -#ifdef DOES_NOT_WORK_YET
- + /* loop j over a maximum of 32 ref values... */
- for ( ; j<size ; j++) {
- -#else
- - for (j=0 ; j<size ; j++) {
- -#endif
- - diff = shift[j] - ref[i]; /* calculate difference between shift and ref */
- +
- + diff = shift[i] - ref[j]; /* calculate difference between shift and ref */
- /*
- * shift must be greater than ref to be a valid pair
- * and the difference must be less than the mean value of the ref period
- */
- - if ((diff >= 0) && (diff < halfperiod)) {
- - /* valid pair found */
- - sum += diff;
- - cnt++;
- + if (diff >= 0) {
- + if (diff < halfperiod) {
- + /* valid pair found */
- + sum += diff;
- + cnt++;
- + // ?? j++;
- + } else {
- + /* valid pair cannot be found for this i */
- + }
- +
- break; /* exit loop -> next i */
- }
- } /* end for j */
Quantron non-working filter optimisation, needs more work
Posted by Anonymous on Tue 29th Oct 2019 13:20
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.