[svn-commits] tzafrir: linux/trunk r4776 - /linux/trunk/drivers/dahdi/xpp/card_fxo.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Aug 14 04:50:15 CDT 2008
Author: tzafrir
Date: Thu Aug 14 04:50:14 2008
New Revision: 4776
URL: http://svn.digium.com/view/dahdi?view=rev&rev=4776
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.
Modified:
linux/trunk/drivers/dahdi/xpp/card_fxo.c
Modified: linux/trunk/drivers/dahdi/xpp/card_fxo.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxo.c?view=diff&rev=4776&r1=4775&r2=4776
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxo.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxo.c Thu Aug 14 04:50:14 2008
@@ -831,13 +831,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
*/
@@ -847,7 +848,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))
dahdi_report_battery(xpd, portno);
@@ -863,7 +864,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))
dahdi_report_battery(xpd, portno);
@@ -885,9 +886,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 svn-commits
mailing list