[wpiutil,hal] Update image; init Rio Now() HMB with a FPGA session (#6016)

This commit is contained in:
Thad House
2023-12-08 23:22:59 -08:00
committed by GitHub
parent 7d4e515a6b
commit 54a55b8b53
9 changed files with 177 additions and 78 deletions

View File

@@ -8,15 +8,13 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#include <memory> // NOLINT
#endif
/**
* Initialize the on-Rio Now() implementation to use the FPGA timestamp.
* No effect on non-Rio platforms. This is called by HAL_Initialize() and
* thus should generally not be called by user code.
*/
void WPI_Impl_SetupNowRio(void);
#ifdef __cplusplus
extern "C" {
#endif
/**
* De-initialize the on-Rio Now() implementation. No effect on non-Rio
@@ -62,12 +60,32 @@ uint64_t WPI_GetSystemTime(void);
namespace wpi {
namespace impl {
/**
* Initialize the on-Rio Now() implementation to use the desktop timestamp.
* No effect on non-Rio platforms. This should only be used for testing
* purposes if the HAL is not available.
*/
void SetupNowDefaultOnRio();
/**
* Initialize the on-Rio Now() implementation to use the FPGA timestamp.
* No effect on non-Rio platforms. This is called by HAL_Initialize() and
* thus should generally not be called by user code.
*/
void SetupNowRio();
#ifdef __FRC_ROBORIO__
template <typename T>
void SetupNowRio(void* chipObjectLibrary, std::unique_ptr<T> hmbObject);
#else
template <typename T>
inline void SetupNowRio(void*, std::unique_ptr<T>) {}
#endif
/**
* Initialize the on-Rio Now() implementation to use the FPGA timestamp.
* No effect on non-Rio platforms. This take an FPGA session that has
* already been initialized, and is used from LabVIEW.
*/
void SetupNowRio(uint32_t session);
/**
* De-initialize the on-Rio Now() implementation. No effect on non-Rio