summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-04 20:42:58 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-04 20:42:58 +0000
commitd73782fe0b78089fd9a4116e91fb2407d2e5aaa9 (patch)
tree3bb91aa101e49fec5d014fc05df95e7ce89f267f /wcfxs.c
parentc8ff8e5a48fe37cc15b10b4dd9c23e5f3bf5ee22 (diff)
Make threshold easier to find and more tolerant
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@386 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 4d29228..6178ae1 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -133,6 +133,7 @@ static alpha indirect_regs[] =
#define RING_DEBOUNCE 64 /* Ringer Debounce (in ms) */
#define BATT_DEBOUNCE 8 /* Battery debounce (in ms) */
+#define BATT_THRESH 3 /* Anything under this is "no battery" */
#define OHT_TIMER 6000 /* How long after RING to retain OHT */
@@ -1226,7 +1227,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card)
}
}
#endif
- if (abs(b) < 2) {
+ if (abs(b) < BATT_THRESH) {
wc->mod.fxo.nobatttimer[card]++;
#if 0
if (wc->mod.fxo.battery[card])
@@ -1251,7 +1252,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card)
wc->mod.fxo.battdebounce[card] = BATT_DEBOUNCE;
} else if (!wc->mod.fxo.battery[card])
wc->mod.fxo.battdebounce[card] = BATT_DEBOUNCE;
- } else if (abs(b) > 1) {
+ } else if (abs(b) > BATT_THRESH) {
if (!wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) {
if (debug)
printk("BATTERY!\n");