1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

Adds the ability to query a TimedEventLoop for its input clock rate.

This commit is contained in:
Thomas Harte 2017-09-10 17:31:43 -04:00
parent ff6e65cca9
commit 6075064400
2 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,10 @@ unsigned int TimedEventLoop::get_cycles_until_next_event() {
return (unsigned int)std::max(cycles_until_event_, 0); return (unsigned int)std::max(cycles_until_event_, 0);
} }
unsigned int TimedEventLoop::get_input_clock_rate() {
return input_clock_rate_;
}
void TimedEventLoop::reset_timer() { void TimedEventLoop::reset_timer() {
subcycles_until_event_.set_zero(); subcycles_until_event_.set_zero();
cycles_until_event_ = 0; cycles_until_event_ = 0;

View File

@ -54,6 +54,11 @@ namespace Storage {
*/ */
unsigned int get_cycles_until_next_event(); unsigned int get_cycles_until_next_event();
/*!
@returns the input clock rate.
*/
unsigned int get_input_clock_rate();
protected: protected:
/*! /*!
Sets the time interval, as a proportion of a second, until the next event should be triggered. Sets the time interval, as a proportion of a second, until the next event should be triggered.