1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-30 22:29:56 +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 auto &channel = channels_[int(rate_) - int(InterruptRate::ToneGenerator0)];
const int cycles_until_interrupt = channel.value + 1 + (!channel.level) * (channel.reload + 1); 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(
return Cycles(std::min(result, cycles_until_interrupt)); 250'000 - (two_second_counter_ % 250'000),
cycles_until_interrupt
));
} }
} }
} }