Skip to content

Commit 9060533

Browse files
committed
DriftingOscillatorBase: Renamed currentTickLength to oldCurrentTickLength.
1 parent 8ca4ba2 commit 9060533

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/inet/clock/base/DriftingOscillatorBase.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ void DriftingOscillatorBase::setDriftRate(ppm newDriftRate)
7575
emit(preOscillatorStateChangedSignal, this);
7676
simtime_t currentSimTime = simTime();
7777
EV_INFO << "Setting oscillator drift rate from " << driftRate << " to " << newDriftRate << " at simtime " << currentSimTime << ".\n";
78-
simtime_t currentTickLength = getCurrentTickLength();
79-
simtime_t baseTickTime = origin + nextTickFromOrigin - currentTickLength;
80-
simtime_t elapsedTickTime = fmod(currentSimTime - baseTickTime, currentTickLength);
8178
if (elapsedTickTime == SIMTIME_ZERO)
8279
nextTickFromOrigin = 0;
8380
else {
8481
int64_t v = increaseWithDriftRate(currentTickLength.raw() - elapsedTickTime.raw());
8582
nextTickFromOrigin = SimTime::fromRaw(decreaseWithDriftRate(v, newInverseDriftRate));
8683
}
84+
simtime_t oldCurrentTickLength = getCurrentTickLength();
85+
simtime_t baseTickTime = origin + nextTickFromOrigin - oldCurrentTickLength;
86+
simtime_t elapsedTickTime = fmod(currentSimTime - baseTickTime, oldCurrentTickLength);
8787
SimTimeScale newDriftFactor = SimTimeScale::fromPpm(newDriftRate.get<ppm>());
8888
driftRate = newDriftRate;
8989
setDriftFactor(newDriftFactor);

0 commit comments

Comments
 (0)