mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 02:17:08 +00:00
Add capacity for enforcing a delay.
This commit is contained in:
@@ -17,6 +17,10 @@ using namespace Storage;
|
||||
TimedEventLoop::TimedEventLoop(Cycles::IntType input_clock_rate) :
|
||||
input_clock_rate_(input_clock_rate) {}
|
||||
|
||||
void TimedEventLoop::add_delay(const Cycles cycles) {
|
||||
cycles_until_event_ += cycles.get();
|
||||
}
|
||||
|
||||
void TimedEventLoop::run_for(const Cycles cycles) {
|
||||
auto remaining_cycles = cycles.get();
|
||||
#ifndef NDEBUG
|
||||
|
||||
@@ -46,7 +46,12 @@ public:
|
||||
/*!
|
||||
Advances the event loop by @c number_of_cycles cycles.
|
||||
*/
|
||||
void run_for(const Cycles);
|
||||
void run_for(Cycles);
|
||||
|
||||
/*!
|
||||
Extends the amount of time until the next event fires.
|
||||
*/
|
||||
void add_delay(Cycles);
|
||||
|
||||
/*!
|
||||
@returns the number of whole cycles remaining until the next event is triggered.
|
||||
|
||||
Reference in New Issue
Block a user