mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Adds HAL calls for match data from DS (#691)
This commit is contained in:
committed by
Peter Johnson
parent
237b2df82f
commit
6af4940c22
@@ -14,6 +14,7 @@
|
||||
#include <condition_variable>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
@@ -153,6 +154,23 @@ double HAL_GetMatchTime(int32_t* status) {
|
||||
return SimDriverStationData.GetMatchTime();
|
||||
}
|
||||
|
||||
int HAL_GetMatchInfo(HAL_MatchInfo* info) {
|
||||
info->eventName = static_cast<char*>(std::malloc(1));
|
||||
info->eventName[0] = '\0';
|
||||
info->matchNumber = 0;
|
||||
info->replayNumber = 0;
|
||||
info->gameSpecificMessage = static_cast<char*>(std::malloc(1));
|
||||
info->gameSpecificMessage[0] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
void HAL_FreeMatchInfo(HAL_MatchInfo* info) {
|
||||
std::free(info->eventName);
|
||||
std::free(info->gameSpecificMessage);
|
||||
info->eventName = nullptr;
|
||||
info->gameSpecificMessage = nullptr;
|
||||
}
|
||||
|
||||
void HAL_ObserveUserProgramStarting(void) { HALSIM_SetProgramStarted(); }
|
||||
|
||||
void HAL_ObserveUserProgramDisabled(void) {
|
||||
|
||||
Reference in New Issue
Block a user