Strategy::statusType Balancer::doStrategy() { if(balance == 0) { startBalacing(); } else { trySaveVon(); if(getBalanceTime() > maxBalanceTime) { setBalance(0); } } if((!isWorking()) && done) return Strategy::COMPLETE; return Strategy::RUNNING; }
Strategy::statusType Balancer::doStrategy() { LogDebug("minCell=", minCell, " balance=", balance, " conCells=", connectedCells); if(balance == 0) { startBalacing(); } else { trySaveVon(); if(getBalanceTime() > maxBalanceTime) { setBalance(0); } } if((!isWorking()) && done) return Strategy::COMPLETE; return Strategy::RUNNING; }
Strategy::statusType Balancer::doStrategy() { if(done_) return COMPLETE; if(isStable()) { if(balance_ == 0) { startBalacing(); } else { trySaveVon(); uint8_t balance = calculateBalance(); if((balance_ & (~balance)) || getBalanceTime() > maxBalanceTime) { setBalance(0); } } } return RUNNING; }