diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-05-04 20:42:58 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-05-04 20:42:58 +0000 |
commit | d73782fe0b78089fd9a4116e91fb2407d2e5aaa9 (patch) | |
tree | 3bb91aa101e49fec5d014fc05df95e7ce89f267f /wcfxs.c | |
parent | c8ff8e5a48fe37cc15b10b4dd9c23e5f3bf5ee22 (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-x | wcfxs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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"); |