1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

It makes sense to simplify these ahead of time.

This commit is contained in:
Thomas Harte 2016-12-25 12:32:25 -05:00
parent aceb7e3b6b
commit ec55a25620

View File

@ -179,8 +179,10 @@ void Controller::end_writing()
void Controller::set_expected_bit_length(Time bit_length) void Controller::set_expected_bit_length(Time bit_length)
{ {
bit_length_ = bit_length; bit_length_ = bit_length;
bit_length_.simplify();
cycles_per_bit_ = Storage::Time(8000000) * (bit_length * rotational_multiplier_); cycles_per_bit_ = Storage::Time(8000000) * (bit_length * rotational_multiplier_);
cycles_per_bit_.simplify();
// this conversion doesn't need to be exact because there's a lot of variation to be taken // this conversion doesn't need to be exact because there's a lot of variation to be taken
// account of in rotation speed, air turbulence, etc, so a direct conversion will do // account of in rotation speed, air turbulence, etc, so a direct conversion will do