[Asterisk-cvs] zaptel wcfxs.c,1.54,1.55

markster at lists.digium.com markster at lists.digium.com
Tue May 4 16:34:39 CDT 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv30445

Modified Files:
	wcfxs.c 
Log Message:
Make threshold easier to find and more tolerant


Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- wcfxs.c	4 May 2004 01:40:06 -0000	1.54
+++ wcfxs.c	4 May 2004 20:42:58 -0000	1.55
@@ -133,6 +133,7 @@
 
 #define RING_DEBOUNCE	64		/* Ringer Debounce (in ms) */
 #define BATT_DEBOUNCE	8		/* Battery debounce (in ms) */
+#define BATT_THRESH	3		/* Anything under this is "no battery" */
 
 #define OHT_TIMER		6000	/* How long after RING to retain OHT */
 
@@ -1226,7 +1227,7 @@
 		}
 	}
 #endif	
-	if (abs(b) < 2) {
+	if (abs(b) < BATT_THRESH) {
 		wc->mod.fxo.nobatttimer[card]++;
 #if 0
 		if (wc->mod.fxo.battery[card])
@@ -1251,7 +1252,7 @@
 			wc->mod.fxo.battdebounce[card] = BATT_DEBOUNCE;
 		} else if (!wc->mod.fxo.battery[card])
 			wc->mod.fxo.battdebounce[card] = BATT_DEBOUNCE;
-	} else if (abs(b) > 1) {
+	} else if (abs(b) > BATT_THRESH) {
 		if (!wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) {
 			if (debug)
 				printk("BATTERY!\n");




More information about the svn-commits mailing list