mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Implement HAL_GetSystemTimeValid on SystemCore (#8051)
This commit is contained in:
@@ -66,6 +66,8 @@ struct SystemServerDriverStation {
|
||||
nt::BooleanPublisher hasUserCodePublisher;
|
||||
nt::BooleanPublisher hasUserCodeReadyPublisher;
|
||||
|
||||
nt::BooleanSubscriber hasSetWallClockSubscriber;
|
||||
|
||||
nt::ProtobufSubscriber<mrc::ControlData> controlDataSubscriber;
|
||||
nt::ProtobufSubscriber<mrc::MatchInfo> matchInfoSubscriber;
|
||||
nt::StringSubscriber gameSpecificMessageSubscriber;
|
||||
@@ -119,6 +121,10 @@ struct SystemServerDriverStation {
|
||||
consoleLinePublisher =
|
||||
ntInst.GetStringTopic(ROBOT_CONSOLE_LINE_PATH).Publish(options);
|
||||
|
||||
hasSetWallClockSubscriber =
|
||||
ntInst.GetBooleanTopic(ROBOT_HAS_SET_WALL_CLOCK_PATH)
|
||||
.Subscribe(false, options);
|
||||
|
||||
errorInfoPublisher =
|
||||
ntInst.GetProtobufTopic<mrc::ErrorInfo>(ROBOT_ERROR_INFO_PATH)
|
||||
.Publish(options);
|
||||
@@ -643,6 +649,10 @@ HAL_Bool HAL_GetOutputsEnabled(void) {
|
||||
return systemServerDs->controlDataSubscriber.Get().ControlWord.WatchdogActive;
|
||||
}
|
||||
|
||||
HAL_Bool HAL_GetSystemTimeValid(int32_t* status) {
|
||||
return systemServerDs->hasSetWallClockSubscriber.Get(false);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
namespace hal {
|
||||
|
||||
Reference in New Issue
Block a user