summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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