2017-05-09 20:29:29 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-02 09:20:21 -08:00
|
|
|
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
|
2017-05-09 20:29:29 -07:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
|
#include <limits>
|
|
|
|
|
|
|
|
|
|
namespace hal {
|
|
|
|
|
|
|
|
|
|
class fpga_clock {
|
|
|
|
|
public:
|
|
|
|
|
typedef std::chrono::microseconds::rep rep;
|
|
|
|
|
typedef std::chrono::microseconds::period period;
|
|
|
|
|
typedef std::chrono::microseconds duration;
|
|
|
|
|
typedef std::chrono::time_point<fpga_clock> time_point;
|
|
|
|
|
|
|
|
|
|
static fpga_clock::time_point now() noexcept;
|
|
|
|
|
static constexpr bool is_steady = true;
|
|
|
|
|
|
2017-08-19 22:56:58 -07:00
|
|
|
static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
|
2017-05-09 20:29:29 -07:00
|
|
|
|
2017-08-19 22:56:58 -07:00
|
|
|
static fpga_clock::duration zero() noexcept { return duration(0); }
|
2017-05-09 20:29:29 -07:00
|
|
|
|
2017-08-19 22:56:58 -07:00
|
|
|
static const time_point min_time;
|
2017-05-09 20:29:29 -07:00
|
|
|
};
|
|
|
|
|
} // namespace hal
|