[zaptel-commits] sruffell: branch 1.2 r4126 - /branches/1.2/wctdm.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Apr 3 15:04:10 CDT 2008


Author: sruffell
Date: Thu Apr  3 15:04:09 2008
New Revision: 4126

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4126
Log:
svn merge -r 3010:3011 https://origsvn.digium.com/svn/zaptel/branches/1.4

Modified:
    branches/1.2/wctdm.c

Modified: branches/1.2/wctdm.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm.c?view=diff&rev=4126&r1=4125&r2=4126
==============================================================================
--- branches/1.2/wctdm.c (original)
+++ branches/1.2/wctdm.c Thu Apr  3 15:04:09 2008
@@ -247,12 +247,13 @@
 #define FLAG_WRITE	1
 #define FLAG_READ	2
 
+#define DEFAULT_RING_DEBOUNCE	64		/* Ringer Debounce (64 ms) */
+
 /* the constants below control the 'debounce' periods enforced by the
    check_hook routines; these routines are called once every 4 interrupts
    (the interrupt cycles around the four modules), so the periods are
    specified in _4 millisecond_ increments
 */
-#define RING_DEBOUNCE		4		/* Ringer Debounce (64 ms) */
 #define DEFAULT_BATT_DEBOUNCE	4		/* Battery debounce (64 ms) */
 #define POLARITY_DEBOUNCE 	4		/* Polarity debounce (64 ms) */
 #define DEFAULT_BATT_THRESH	3		/* Anything under this is "no battery" */
@@ -364,6 +365,7 @@
 
 static int battdebounce = DEFAULT_BATT_DEBOUNCE;
 static int battthresh = DEFAULT_BATT_THRESH;
+static int ringdebounce = DEFAULT_RING_DEBOUNCE;
 static int debug = 0;
 static int robust = 0;
 static int timingonly = 0;
@@ -853,14 +855,14 @@
 		res = wc->reg0shadow[card];
 		if ((res & 0x60) && wc->mod[card].fxo.battery) {
 			wc->mod[card].fxo.ringdebounce += (ZT_CHUNKSIZE * 16);
-			if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * 64) {
+			if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
 				if (!wc->mod[card].fxo.wasringing) {
 					wc->mod[card].fxo.wasringing = 1;
 					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 					if (debug)
 						printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
 				}
-				wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * 64;
+				wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce;
 			}
 		} else {
 			wc->mod[card].fxo.ringdebounce -= ZT_CHUNKSIZE * 4;
@@ -2403,6 +2405,7 @@
 module_param(fxshonormode, int, 0600);
 module_param(battdebounce, int, 0600);
 module_param(battthresh, int, 0600);
+module_param(ringdebounce, int, 0600);
 module_param(alawoverride, int, 0600);
 #else
 MODULE_PARM(debug, "i");
@@ -2418,6 +2421,7 @@
 MODULE_PARM(fxshonormode, "i");
 MODULE_PARM(battdebounce, "i");
 MODULE_PARM(battthresh, "i");
+MODULE_PARM(ringdebounce, "i");
 MODULE_PARM(alawoverride, "i");
 #endif
 MODULE_DESCRIPTION("Wildcard TDM400P Zaptel Driver");




More information about the zaptel-commits mailing list