summaryrefslogtreecommitdiff
path: root/mec2.h
diff options
context:
space:
mode:
Diffstat (limited to 'mec2.h')
-rwxr-xr-xmec2.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/mec2.h b/mec2.h
index 92cc011..a24b01a 100755
--- a/mec2.h
+++ b/mec2.h
@@ -391,6 +391,18 @@ static inline echo_can_state_t *echo_can_create(int len, 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_d = ec->N_d << 1;
+ if (pos >= ec->N_d)
+ return 1;
+ ec->a_i[pos] = val << 17;
+ ec->a_s[pos] = val << 1;
+ if (++pos >= ec->N_d)
+ return 1;
+ return 0;
+}
#endif