From 21a54358e6476192c8b60e94be427c4bcc9ab040 Mon Sep 17 00:00:00 2001 From: zolliker Date: Wed, 30 Mar 2005 13:22:15 +0000 Subject: [PATCH] - corrected Driving/Counting status --- devexec.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/devexec.c b/devexec.c index 876aa585..70950790 100644 --- a/devexec.c +++ b/devexec.c @@ -357,6 +357,7 @@ pICountable pCountInt = NULL; pIDrivable pDrivInt = NULL; int eCode; + int isCounting=0, isDriving=0; assert(self); @@ -449,17 +450,13 @@ } break; case HWBusy: - if(pCountInt != NULL && pDrivInt != NULL) + if(pCountInt != NULL) { - SetStatus(eCountDrive); + isDriving = 1; } - else if(pCountInt != NULL && pDrivInt == NULL) + if(pDrivInt == NULL) { - SetStatus(eCounting); - } - else if(pDrivInt != NULL && pCountInt == NULL) - { - SetStatus(eDriving); + isCounting = 1; } self->iStatus = DEVBUSY; break; @@ -483,6 +480,16 @@ iRet = LLDnodePtr2Next(self->iList); } + if (isCounting) { + if (isDriving) { + SetStatus(eCountDrive); + } else { + SetStatus(eCounting); + } + } else if (isDriving) { + SetStatus(eDriving); + } + iRet = LLDnodePtr2First(self->iList); if(LLDcheck(self->iList) == LIST_EMPTY) {