summaryrefslogtreecommitdiff
path: root/sec.h
diff options
context:
space:
mode:
Diffstat (limited to 'sec.h')
-rwxr-xr-xsec.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sec.h b/sec.h
index 95a7551..d4e98ce 100755
--- a/sec.h
+++ b/sec.h
@@ -267,5 +267,20 @@ static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t
return clean_rx;
}
/*- End of function --------------------------------------------------------*/
+
+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_taps[pos] = val << 17;
+ ec->fir_taps_short[pos] = val << 1;
+ if (++pos >= ec->taps)
+ return 1;
+ return 0;
+}
+
/*- End of file ------------------------------------------------------------*/
#endif