[zaptel-commits] kpfleming: branch 1.4 r3688 - in /branches/1.4: ./ wctdm24xxp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Mon Jan 14 12:33:13 CST 2008


Author: kpfleming
Date: Mon Jan 14 12:33:13 2008
New Revision: 3688

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3688
Log:
revert this change from issue #9624 for now, as it needs more testing before being put into a release branch

Modified:
    branches/1.4/wctdm.c
    branches/1.4/wctdm24xxp/base.c
    branches/1.4/wctdm24xxp/wctdm24xxp.h

Modified: branches/1.4/wctdm.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm.c?view=diff&rev=3688&r1=3687&r2=3688
==============================================================================
--- branches/1.4/wctdm.c (original)
+++ branches/1.4/wctdm.c Mon Jan 14 12:33:13 2008
@@ -1,5 +1,5 @@
 /*
- * Wildcard TDM400P TDM FXS/FXO Interface Driver for Zapata Telephony interface
+ * Wilcard TDM400P TDM FXS/FXO Interface Driver for Zapata Telephony interface
  *
  * Written by Mark Spencer <markster at digium.com>
  *            Matthew Fredrickson <creslin at digium.com>
@@ -312,7 +312,6 @@
 #else			
 			int wasringing;
 #endif			
-			int lastrdtx;
 			int ringdebounce;
 			int offhook;
 			int battdebounce;
@@ -858,28 +857,30 @@
 		return;
 #ifndef AUDIO_RINGCHECK
 	if (!wc->mod[card].fxo.offhook) {
-		res = wc->reg0shadow[card] & 0x60;
-		if (wc->mod[card].fxo.ringdebounce--) {
-			if (res && (res != wc->mod[card].fxo.lastrdtx) && wc->mod[card].fxo.battery) {
+		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 * 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);
-					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 				}
-				wc->mod[card].fxo.lastrdtx = res;
-				wc->mod[card].fxo.ringdebounce = 10;
-			} else if (!res) {
-				if ((wc->mod[card].fxo.ringdebounce == 0) && wc->mod[card].fxo.wasringing) {
+				wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce;
+			}
+		} else {
+			wc->mod[card].fxo.ringdebounce -= ZT_CHUNKSIZE * 4;
+			if (wc->mod[card].fxo.ringdebounce <= 0) {
+				if (wc->mod[card].fxo.wasringing) {
 					wc->mod[card].fxo.wasringing = 0;
+					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 					if (debug)
 						printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
-					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 				}
+				wc->mod[card].fxo.ringdebounce = 0;
 			}
-		} else if (res && wc->mod[card].fxo.battery) {
-			wc->mod[card].fxo.lastrdtx = res;
-			wc->mod[card].fxo.ringdebounce = 10;
+				
 		}
 	}
 #endif
@@ -1504,10 +1505,6 @@
 	reg16 |= (fxo_modes[_opermode].rz << 1);
 	reg16 |= (fxo_modes[_opermode].rt);
 	wctdm_setreg(wc, card, 16, reg16);
-
-	/* Enable ring detector full-wave rectifier mode */
-	wctdm_setreg(wc, card, 18, 2);
-	wctdm_setreg(wc, card, 24, 0);
 	
 	/* Set DC Termination:
 	   Tip/Ring voltage adjust, minimum operational current, current limitation */

Modified: branches/1.4/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/base.c?view=diff&rev=3688&r1=3687&r2=3688
==============================================================================
--- branches/1.4/wctdm24xxp/base.c (original)
+++ branches/1.4/wctdm24xxp/base.c Mon Jan 14 12:33:13 2008
@@ -1327,33 +1327,33 @@
 		if (b != 0x8)
 			wctdm_setreg_intr(wc, card, 5, 0x8);
 	}
-
 	if (!wc->mods[card].fxo.offhook) {
 		res = wc->cmdq[card].isrshadow[0];	/* Hook/Ring state */
-		if (wc->mods[card].fxo.ringdebounce--) {
-			if (res && (res != wc->mods[card].fxo.lastrdtx) && wc->mods[card].fxo.battery) {
+		if ((res & 0x60) && wc->mods[card].fxo.battery) {
+			wc->mods[card].fxo.ringdebounce += (ZT_CHUNKSIZE * 4);
+			if (wc->mods[card].fxo.ringdebounce >= ZT_CHUNKSIZE * ringdebounce) {
 				if (!wc->mods[card].fxo.wasringing) {
 					wc->mods[card].fxo.wasringing = 1;
-					if (debug)
+					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
+					if (debug & DEBUG_CARD)
 						printk("RING on %d/%d!\n", wc->span.spanno, card + 1);
-					zt_hooksig(&wc->chans[card], ZT_RXSIG_RING);
 				}
-				wc->mods[card].fxo.lastrdtx = res;
-				wc->mods[card].fxo.ringdebounce = 10;
-			} else if (!res) {
-				if ((wc->mods[card].fxo.ringdebounce == 0) && wc->mods[card].fxo.wasringing) {
+				wc->mods[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce;
+			}
+		} else {
+			wc->mods[card].fxo.ringdebounce -= ZT_CHUNKSIZE;
+			if (wc->mods[card].fxo.ringdebounce <= 0) {
+				if (wc->mods[card].fxo.wasringing) {
 					wc->mods[card].fxo.wasringing = 0;
-					if (debug)
+					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
+					if (debug & DEBUG_CARD)
 						printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1);
-					zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK);
 				}
+				wc->mods[card].fxo.ringdebounce = 0;
 			}
-		} else if (res && wc->mods[card].fxo.battery) {
-			wc->mods[card].fxo.lastrdtx = res;
-			wc->mods[card].fxo.ringdebounce = 10;
-		}
-	}
-
+				
+		}
+	}
 	b = wc->cmdq[card].isrshadow[1]; /* Voltage */
 
 	if (fxovoltage) {
@@ -2096,10 +2096,6 @@
 	reg16 |= (fxo_modes[_opermode].rz << 1);
 	reg16 |= (fxo_modes[_opermode].rt);
 	wctdm_setreg(wc, card, 16, reg16);
-	
-	/* Enable ring detector full-wave rectifier mode */
-	wctdm_setreg(wc, card, 18, 2);
-	wctdm_setreg(wc, card, 24, 0);
 	
 	/* Set DC Termination:
 	   Tip/Ring voltage adjust, minimum operational current, current limitation */

Modified: branches/1.4/wctdm24xxp/wctdm24xxp.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/wctdm24xxp.h?view=diff&rev=3688&r1=3687&r2=3688
==============================================================================
--- branches/1.4/wctdm24xxp/wctdm24xxp.h (original)
+++ branches/1.4/wctdm24xxp/wctdm24xxp.h Mon Jan 14 12:33:13 2008
@@ -225,7 +225,6 @@
 			int lastpol;
 			int polarity;
 			int polaritydebounce;
-			int lastrdtx;
 		} fxo;
 		struct {
 			int oldrxhook;




More information about the zaptel-commits mailing list