summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-01-12 10:08:32 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-01-12 10:08:32 +0000
commit8cc84d7e8945eaad3fd3cc95d19a36b2dcd9fb1c (patch)
tree1b5374a5f566ff501d4457a1eb961efda5d0df7c
parent0a8e376a562d1d19101f6b84437b6c6f15a8f291 (diff)
xpp: xpd_fxo: two extra parameters regarding battery
Make module parameters out of two constants to allow further tweaking in the detection of battery. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7883 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/card_fxo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c
index 231d3d3..6173603 100644
--- a/drivers/dahdi/xpp/card_fxo.c
+++ b/drivers/dahdi/xpp/card_fxo.c
@@ -42,6 +42,8 @@ static DEF_PARM(int, ring_debounce, 50, 0644, "Number of ticks to debounce a fal
static DEF_PARM(int, caller_id_style, 0, 0444, "Caller-Id detection style: 0 - [BELL], 1 - [ETSI_FSK], 2 - [ETSI_DTMF]");
static DEF_PARM(int, power_denial_safezone, 650, 0644, "msec after offhook to ignore power-denial ( (0 - disable power-denial)");
static DEF_PARM(int, power_denial_minlen, 80, 0644, "Minimal detected power-denial length (msec) (0 - disable power-denial)");
+static DEF_PARM(uint, battery_threshold, 3, 0644, "Minimum voltage that shows there is battery");
+static DEF_PARM(uint, battery_debounce, 1000, 0644, "Minimum interval (msec) for detection of battery off");
enum cid_style {
CID_STYLE_BELL = 0, /* E.g: US (Bellcore) */
@@ -70,8 +72,6 @@ enum fxo_leds {
* fluctuation during ring won't trigger false detection.
*/
#define POLREV_THRESHOLD 200
-#define BAT_THRESHOLD 3
-#define BAT_DEBOUNCE 1000 /* compensate for battery voltage fluctuation (in ticks) */
#define POWER_DENIAL_CURRENT 3
#define POWER_DENIAL_DELAY 2500 /* ticks */
@@ -902,7 +902,7 @@ static void update_battery_voltage(xpd_t *xpd, byte data_low, xportno_t portno)
priv->battery_voltage[portno] = volts;
if(xpd->ringing[portno])
goto ignore_reading; /* ring voltage create false alarms */
- if(abs(volts) < BAT_THRESHOLD) {
+ if(abs(volts) < battery_threshold) {
/*
* Check for battery voltage fluctuations
*/
@@ -911,7 +911,7 @@ static void update_battery_voltage(xpd_t *xpd, byte data_low, xportno_t portno)
milliseconds = priv->nobattery_debounce[portno]++ *
poll_battery_interval;
- if(milliseconds > BAT_DEBOUNCE) {
+ if(milliseconds > battery_debounce) {
LINE_DBG(SIGNAL, xpd, portno, "BATTERY OFF voltage=%d\n", volts);
priv->battery[portno] = BATTERY_OFF;
dahdi_report_battery(xpd, portno);