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) {