[zaptel-commits] tzafrir: branch 1.4 r4485 - in /branches/1.4: ./ kernel/xpp/card_fxo.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Aug 14 04:11:50 CDT 2008


Author: tzafrir
Date: Thu Aug 14 04:11:50 2008
New Revision: 4485

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4485
Log:
xpp: FXO: display signed voltage values (from xpp r6055)

This is only an issue with the displayed value. In case you wondered why
you have battery voltage of more than 220V.

Merged revisions 4484 via svnmerge from 
http://svn.digium.com/svn/zaptel/branches/1.2

Modified:
    branches/1.4/   (props changed)
    branches/1.4/kernel/xpp/card_fxo.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/kernel/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/xpp/card_fxo.c?view=diff&rev=4485&r1=4484&r2=4485
==============================================================================
--- branches/1.4/kernel/xpp/card_fxo.c (original)
+++ branches/1.4/kernel/xpp/card_fxo.c Thu Aug 14 04:11:50 2008
@@ -839,13 +839,14 @@
 	struct FXO_priv_data	*priv;
 	enum polarity_state	pol;
 	int			msec;
-
-	priv = xpd->priv;
-	BUG_ON(!priv);
-	priv->battery_voltage[portno] = data_low;
+	signed char		volts = (signed char)data_low;
+
+	priv = xpd->priv;
+	BUG_ON(!priv);
+	priv->battery_voltage[portno] = volts;
 	if(xpd->ringing[portno])
 		goto ignore_reading;	/* ring voltage create false alarms */
-	if(abs((signed char)data_low) < BAT_THRESHOLD) {
+	if(abs(volts) < BAT_THRESHOLD) {
 		/*
 		 * Check for battery voltage fluctuations
 		 */
@@ -855,7 +856,7 @@
 			milliseconds = priv->nobattery_debounce[portno]++ *
 				poll_battery_interval;
 			if(milliseconds > BAT_DEBOUNCE) {
-				LINE_DBG(SIGNAL, xpd, portno, "BATTERY OFF voltage=%d\n", data_low);
+				LINE_DBG(SIGNAL, xpd, portno, "BATTERY OFF voltage=%d\n", volts);
 				priv->battery[portno] = BATTERY_OFF;
 				if(SPAN_REGISTERED(xpd))
 					zap_report_battery(xpd, portno);
@@ -871,7 +872,7 @@
 	} else {
 		priv->nobattery_debounce[portno] = 0;
 		if(priv->battery[portno] != BATTERY_ON) {
-			LINE_DBG(SIGNAL, xpd, portno, "BATTERY ON voltage=%d\n", data_low);
+			LINE_DBG(SIGNAL, xpd, portno, "BATTERY ON voltage=%d\n", volts);
 			priv->battery[portno] = BATTERY_ON;
 			if(SPAN_REGISTERED(xpd))
 				zap_report_battery(xpd, portno);
@@ -893,9 +894,9 @@
 	/*
 	 * Handle reverse polarity
 	 */
-	if(data_low == 0)
+	if(volts == 0)
 		pol = POL_UNKNOWN;
-	else if(IS_SET(data_low, 7))
+	else if(volts < 0)
 		pol = POL_NEGATIVE;
 	else
 		pol = POL_POSITIVE;




More information about the zaptel-commits mailing list