mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user