mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Synchronization.h>
|
||||
#include <wpi/timestamp.h>
|
||||
|
||||
#include "ntcore.h"
|
||||
#include "ntcore_cpp.h"
|
||||
@@ -23,6 +24,8 @@ void bench2();
|
||||
void stress();
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
wpi::impl::SetupNowRio();
|
||||
|
||||
if (argc == 2 && std::string_view{argv[1]} == "bench") {
|
||||
bench();
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user