summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-19 01:45:04 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-19 01:45:04 +0000
commit44164783d8ee020f381ee14316a8c435a6c71a7d (patch)
treeccde8ab2c59324e8c265cf51c24e80a730ea75fc /wcfxs.c
parent5088ba4cc6cc1a20e97b047bdd8074ffe02f0edf (diff)
Check before doing battery detect
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@396 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 60237ca..431515d 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -1205,6 +1205,20 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card)
{
unsigned char res;
signed char b;
+ /* Try to track issues that plague slot one FXO's */
+ b = wcfxs_getreg(wc, card, 5);
+ if ((b & 0x2) || !(b & 0x8)) {
+ /* Not good -- don't look at anything else */
+ return;
+ }
+ b &= 0x9;
+ if (wc->mod.fxo.offhook[card]) {
+ if (b != 0x9)
+ wcfxs_setreg(wc, card, 5, 0x9);
+ } else {
+ if (b != 0x8)
+ wcfxs_setreg(wc, card, 5, 0x8);
+ }
#ifndef AUDIO_RINGCHECK
if (!wc->mod.fxo.offhook[card]) {
res = wcfxs_getreg(wc, card, 5);
@@ -1234,20 +1248,6 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card)
}
}
#endif
- /* Try to track issues that plague slot one FXO's */
- b = wcfxs_getreg(wc, card, 5);
- if ((b & 0x2) || !(b & 0x8)) {
- /* Not good -- don't look at anything else */
- return;
- }
- b &= 0x9;
- if (wc->mod.fxo.offhook[card]) {
- if (b != 0x9)
- wcfxs_setreg(wc, card, 5, 0x9);
- } else {
- if (b != 0x8)
- wcfxs_setreg(wc, card, 5, 0x8);
- }
b = wcfxs_getreg(wc, card, 29);
#if 0
{