[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

@@ -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;