[wpiutil] timestamp: Call FPGA functions directly (#5235)

This works around an exit race with wpi::Now() on Rio; it was overridden
to call HAL_GetFPGATime(), which calls chipobject, but on exit, because
there was not a library dependency, the chipobject could be destroyed
prior to wpiutil/wpinet being shut down.
This commit is contained in:
Peter Johnson
2023-07-24 23:03:28 -07:00
committed by GitHub
parent 2ba8fbb6f4
commit a95994fff6
11 changed files with 166 additions and 20 deletions

View File

@@ -4,10 +4,13 @@
#include <climits>
#include <wpi/timestamp.h>
#include "gmock/gmock.h"
#include "ntcore.h"
int main(int argc, char** argv) {
wpi::impl::SetupNowRio();
nt::AddLogger(nt::GetDefaultInstance(), 0, UINT_MAX, [](auto& event) {
if (auto msg = event.GetLogMessage()) {
std::fputs(msg->message.c_str(), stderr);