summaryrefslogtreecommitdiff
path: root/sec-2.h
diff options
context:
space:
mode:
authormartinp <martinp@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-08 00:55:26 +0000
committermartinp <martinp@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-08 00:55:26 +0000
commita56b36043d84af3094b8ddcd07cfd35cb8983549 (patch)
tree3635c20cb1a1b4e5b914ebc65c568763ea85b7c8 /sec-2.h
parent9baf60b469593263664ccbc00d8264ad35e7d258 (diff)
Add training routine to other EC
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@269 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'sec-2.h')
-rwxr-xr-xsec-2.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sec-2.h b/sec-2.h
index d139e86..dd7dcf7 100755
--- a/sec-2.h
+++ b/sec-2.h
@@ -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