From a56b36043d84af3094b8ddcd07cfd35cb8983549 Mon Sep 17 00:00:00 2001 From: martinp Date: Sat, 8 Nov 2003 00:55:26 +0000 Subject: Add training routine to other EC git-svn-id: http://svn.digium.com/svn/zaptel/trunk@269 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- mec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mec.h') diff --git a/mec.h b/mec.h index 2307c37..f399e1b 100755 --- a/mec.h +++ b/mec.h @@ -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 -- cgit v1.2.3