summaryrefslogtreecommitdiff
path: root/mec3.h
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-05 06:24:13 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-11-05 06:24:13 +0000
commite2fb6ee2a17f307a8822d7087430df241e81ae45 (patch)
tree91b04cd46f70d728b9ff797cacd9d2c43eaa7958 /mec3.h
parent9fc7e50f64426eef1bd0f77fa6906bf590c293bc (diff)
Implement training for mec3
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@265 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'mec3.h')
-rwxr-xr-xmec3.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/mec3.h b/mec3.h
index 9f0256b..3df3f50 100755
--- a/mec3.h
+++ b/mec3.h
@@ -225,4 +225,19 @@ static inline echo_can_state_t *echo_can_create(int taps, int adaption_mode)
return ec;
}
+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->hcntr = ec->taps << 1;
+ if (pos >= ec->taps)
+ return 1;
+ ec->a_i[pos] = val << 17;
+ ec->a_s[pos] = val << 1;
+ if (++pos >= ec->taps)
+ return 1;
+ return 0;
+}
+
+
#endif