mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-19 02:22:39 +00:00
Deploys constexpr as a stricter const.
This commit is contained in:
@@ -122,7 +122,7 @@ bool Drive::get_tachometer() {
|
||||
// I have made a guess here that the tachometer is a symmetric square wave;
|
||||
// if that is correct then around 60 beats per rotation appears to be correct
|
||||
// to proceed beyond the speed checks I've so far uncovered.
|
||||
const float ticks_per_rotation = 60.0f; // 56 was too low; 64 too high.
|
||||
constexpr float ticks_per_rotation = 60.0f; // 56 was too low; 64 too high.
|
||||
return int(get_rotation() * 2.0f * ticks_per_rotation) & 1;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ void Drive::get_next_event(float duration_already_passed) {
|
||||
|
||||
// An interval greater than 15ms => adjust gain up the point where noise starts happening.
|
||||
// Seed that up and leave a 15ms gap until it starts.
|
||||
const float safe_gain_period = 15.0f / 1000000.0f;
|
||||
constexpr float safe_gain_period = 15.0f / 1000000.0f;
|
||||
if(interval >= safe_gain_period) {
|
||||
random_interval_ = interval - safe_gain_period;
|
||||
interval = safe_gain_period;
|
||||
|
||||
Reference in New Issue
Block a user