summaryrefslogtreecommitdiff
path: root/wct4xxp.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-15 22:23:43 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-15 22:23:43 +0000
commit7003350768ed2f317fad1f1a81779294710df125 (patch)
tree09c91715826101e0672054b927a755d7a7b5d440 /wct4xxp.c
parentefd71623d3b0493f553c37b8046d4f034be0f45e (diff)
Debounce red alarm to prevent red alarm oscillation
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@365 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-xwct4xxp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index b19e27d..da87006 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -90,6 +90,7 @@ struct t4 {
int syncs[4]; /* sync sources */
int psyncs[4]; /* span-relative sync sources */
int alarmtimer[4]; /* Alarm timer */
+ int redalarms[4];
int blinktimer;
#ifdef FANCY_ALARM
int alarmpos;
@@ -1265,8 +1266,13 @@ static void __t4_check_alarms(struct t4 *wc, int span)
alarms |= ZT_ALARM_NOTOPEN;
}
- if (c & 0xa0)
- alarms |= ZT_ALARM_RED;
+ if (c & 0xa0) {
+ if (wc->redalarms[span] > 10)
+ alarms |= ZT_ALARM_RED;
+ else
+ wc->redalarms[span]++;
+ } else
+ wc->redalarms[span] = 0;
if (c & 0x4)
alarms |= ZT_ALARM_BLUE;
/* Keep track of recovering */