added test and comments
diff --git a/aos/common/time.h b/aos/common/time.h
index 418d087..cb6c24f 100644
--- a/aos/common/time.h
+++ b/aos/common/time.h
@@ -115,7 +115,6 @@
return ToNSec() / static_cast<int64_t>(kNSecInSec / sysClkRateGet());
}
// Constructs a Time representing ticks.
- // TODO(brians): test this one too
static Time InTicks(int ticks) {
return Time::InSeconds(static_cast<double>(ticks) / sysClkRateGet());
}
diff --git a/aos/common/time_test.cc b/aos/common/time_test.cc
index 678c013..e6b7bb0 100644
--- a/aos/common/time_test.cc
+++ b/aos/common/time_test.cc
@@ -116,6 +116,10 @@
EXPECT_EQ(sysClkRateGet() / 100,
MACRO_DARG(Time(0, Time::kNSecInSec / 100).ToTicks()));
}
+TEST(TimeTest, InTicks) {
+ EXPECT_EQ(MACRO_DARG(Time(2, Time::kNSecInSec)),
+ Time::InTicks(sysClkRateGet() * 2.5));
+}
#endif
TEST(TimeTest, InMS) {
diff --git a/aos/crio/controls/ControlsManager.h b/aos/crio/controls/ControlsManager.h
index 5971f46..d9e89b6 100644
--- a/aos/crio/controls/ControlsManager.h
+++ b/aos/crio/controls/ControlsManager.h
@@ -20,10 +20,11 @@
}
private:
- // Hooks that subclasses have to implement to do the correct things at the
- // correct times.
+ // Called when it is time to create anything that uses WPILib.
virtual void CreateObjects() = 0;
+ // Called when it is time to add controls loops to any CRIOControlLoopRunners.
virtual void RegisterControlLoops() = 0;
+ // Called when it is time to start any SensorBroadcasters.
virtual void StartSensorBroadcasters() = 0;
};