Fixed a wrong sequence of starts in multicounter

Suppressed excessive connection messages from asynnet
This commit is contained in:
2016-11-10 14:41:38 +01:00
parent d0fe079b71
commit f2aa76b396
4 changed files with 34 additions and 7 deletions

View File

@ -100,9 +100,12 @@ static int MMCCStart(void *pData, SConnection * pCon)
return HWFault;
}
for (i = 0; i < self->nSlaves; i++) {
ReleaseCountLock(self->slaves[i]);
self->slaves[i]->SetCountParameters(self->slaveData[i],
/*
start slaves
*/
for (i = 1; i < self->nSlaves; i++) {
ReleaseCountLock(self->slaves[i]);
self->slaves[i]->SetCountParameters(self->slaveData[i],
pCount->pDriv->fPreset,
pCount->pDriv->eMode);
status = self->slaves[i]->StartCount(self->slaveData[i], pCon);
@ -112,6 +115,22 @@ static int MMCCStart(void *pData, SConnection * pCon)
return status;
}
}
/*
start master
*/
self->slaves[0]->SetCountParameters(self->slaveData[0],
pCount->pDriv->fPreset,
pCount->pDriv->eMode);
status = self->slaves[0]->StartCount(self->slaveData[0], pCon);
if (status != OKOK) {
MMCCHalt(pData);
ReleaseCountLock(pCount->pCountInt);
return status;
}
pCount->isUpToDate = 0;
pCount->tStart = time(NULL);
InvokeCallBack(pCount->pCall, COUNTSTART, pCon);