diff options
-rwxr-xr-x | mec.h | 13 | ||||
-rwxr-xr-x | sec-2.h | 17 | ||||
-rwxr-xr-x | sec.h | 15 |
3 files changed, 44 insertions, 1 deletions
@@ -292,4 +292,17 @@ static INLINE int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t return suppr; } +static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +{ + /* Reset hang counter to avoid adjustments after + initial forced training */ + ec->hangt = NUM_TAPS << 1; + if (pos >= NUM_TAPS) + return 1; + ec->a[pos] = val << 17; + if (++pos >= NUM_TAPS) + return 1; + return 0; +} + #endif @@ -410,6 +410,21 @@ static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t return clean_rx; } /*- End of function --------------------------------------------------------*/ -/*- End of file ------------------------------------------------------------*/ #endif + +static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +{ + /* Reset hang counter to avoid adjustments after + initial forced training */ + ec->nonupdate_dwell = ec->taps << 1; + if (pos >= ec->taps) + return 1; + ec->fir_taps32[pos] = val << 17; + ec->fir_taps16[pos] = val << 1; + if (++pos >= ec->taps) + return 1; + return 0; +} + +/*- End of file ------------------------------------------------------------*/ #endif @@ -267,5 +267,20 @@ static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t return clean_rx; } /*- End of function --------------------------------------------------------*/ + +static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +{ + /* Reset hang counter to avoid adjustments after + initial forced training */ + ec->nonupdate_dwell = ec->taps << 1; + if (pos >= ec->taps) + return 1; + ec->fir_taps[pos] = val << 17; + ec->fir_taps_short[pos] = val << 1; + if (++pos >= ec->taps) + return 1; + return 0; +} + /*- End of file ------------------------------------------------------------*/ #endif |