1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 00:29:34 +00:00

Avoid confusing temporary storage.

This commit is contained in:
Thomas Harte 2021-07-06 20:23:09 -04:00
parent 33e2a4b21c
commit 7a673a2448

View File

@ -323,8 +323,10 @@ Cycles TimedInterruptSource::get_next_sequence_point() const {
const auto &channel = channels_[int(rate_) - int(InterruptRate::ToneGenerator0)];
const int cycles_until_interrupt = channel.value + 1 + (!channel.level) * (channel.reload + 1);
int result = 250'000 - (two_second_counter_ % 250'000);
return Cycles(std::min(result, cycles_until_interrupt));
return Cycles(std::min(
250'000 - (two_second_counter_ % 250'000),
cycles_until_interrupt
));
}
}
}