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/y2023/wpilib_interface.cc b/y2023/wpilib_interface.cc
index cc911ab..978d6e5 100644
--- a/y2023/wpilib_interface.cc
+++ b/y2023/wpilib_interface.cc
@@ -297,7 +297,8 @@
timer_handler_->set_name("CANSensorReader Loop");
event_loop->OnRun([this]() {
- timer_handler_->Setup(event_loop_->monotonic_now(), 1 / kCANUpdateFreqHz);
+ timer_handler_->Schedule(event_loop_->monotonic_now(),
+ 1 / kCANUpdateFreqHz);
});
}
@@ -987,7 +988,7 @@
AddLoop(&sensor_reader_event_loop);
// Thread 5.
- // Setup CAN.
+ // Set up CAN.
if (!FLAGS_ctre_diag_server) {
c_Phoenix_Diagnostics_SetSecondsToStart(-1);
c_Phoenix_Diagnostics_Dispose();
@@ -1022,7 +1023,7 @@
AddLoop(&can_output_event_loop);
// Thread 6
- // Setup superstructure output
+ // Set up superstructure output.
::aos::ShmEventLoop output_event_loop(&config.message());
output_event_loop.set_name("PWMOutputWriter");
SuperstructureWriter superstructure_writer(&output_event_loop);
@@ -1039,7 +1040,7 @@
AddLoop(&output_event_loop);
// Thread 7
- // Setup led_indicator
+ // Set up led_indicator.
::aos::ShmEventLoop led_indicator_event_loop(&config.message());
led_indicator_event_loop.set_name("LedIndicator");
control_loops::superstructure::LedIndicator led_indicator(