mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal,wpilib] Rename FPGA clock to monotonic clock (#8672)
- Remove status return from HAL level (clock getting should never fail) - Remove 32-bit timestamp expand function - Make monotonic_clock.hpp (formerly fpga_clock.hpp) header-only and move to root hal include directory
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
#include "PortsInternal.hpp"
|
||||
#include "SmartIo.hpp"
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/hal/cpp/fpga_clock.hpp"
|
||||
#include "wpi/hal/handles/HandlesInternal.hpp"
|
||||
#include "wpi/hal/monotonic_clock.hpp"
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeAnalogInput() {}
|
||||
@@ -73,9 +73,9 @@ void HAL_FreeAnalogInputPort(HAL_AnalogInputHandle analogPortHandle) {
|
||||
smartIoHandles->Free(analogPortHandle, HAL_HandleEnum::AnalogInput);
|
||||
|
||||
// Wait for no other object to hold this handle.
|
||||
auto start = wpi::hal::fpga_clock::now();
|
||||
auto start = wpi::hal::monotonic_clock::now();
|
||||
while (port.use_count() != 1) {
|
||||
auto current = wpi::hal::fpga_clock::now();
|
||||
auto current = wpi::hal::monotonic_clock::now();
|
||||
if (start + std::chrono::seconds(1) < current) {
|
||||
std::puts("DIO handle free timeout");
|
||||
std::fflush(stdout);
|
||||
|
||||
Reference in New Issue
Block a user