Rename timer `Setup` function to `Schedule`
This patch was motivated by my desire to fix a typo in the function
name. The noun "setup" is 1 word. The verb "set up" is 2 words. All
other member functions are verbs, so this one should be a verb too.
That means that the function should be called `SetUp`. During the
discussion that resulted from the rename, James Kuszmaul pointed out
that "setting up" a timer can be confusing. It implies that you can
only "set up" a timer once. But the intent is to let users set up
timers as many times as they like. So we decided on renaming the
function to `Schedule`. That conveys the purpose and intent better.
I took this opportunity to fix some other typos involving the verb
"set up".
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I2f557d1f946960af82711f248820d5e2d385a5d3
diff --git a/frc971/wpilib/sensor_reader.cc b/frc971/wpilib/sensor_reader.cc
index f8bfb5a..bbcc3b5 100644
--- a/frc971/wpilib/sensor_reader.cc
+++ b/frc971/wpilib/sensor_reader.cc
@@ -99,7 +99,7 @@
}
// Now that we are configured, actually fill in the defaults.
- timer_handler_->Setup(
+ timer_handler_->Schedule(
event_loop_->monotonic_now() +
(pwm_trigger_ ? chrono::milliseconds(3) : chrono::milliseconds(4)),
period_);
@@ -153,7 +153,7 @@
// PWM pulse.
const auto next_time = last_tick_timepoint + period_;
- timer_handler_->Setup(next_time, period_);
+ timer_handler_->Schedule(next_time, period_);
}
}