mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-27 06:35:04 +00:00
Avoid confusing temporary storage.
This commit is contained in:
parent
33e2a4b21c
commit
7a673a2448
@ -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
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user