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:
@@ -1333,8 +1333,7 @@ void FMSSimModel::Update() {
|
||||
|
||||
double matchTime = HALSIM_GetDriverStationMatchTime();
|
||||
if (!IsDSDisabled() && enabled) {
|
||||
int32_t status = 0;
|
||||
double curTime = HAL_GetFPGATime(&status) * 1.0e-6;
|
||||
double curTime = HAL_GetMonotonicTime() * 1.0e-6;
|
||||
if (m_startMatchTime == -1.0) {
|
||||
m_startMatchTime = matchTime + curTime;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@ class TimingModel : public wpi::glass::Model {
|
||||
} // namespace
|
||||
|
||||
static void DisplayTiming() {
|
||||
int32_t status = 0;
|
||||
uint64_t curTime = HAL_GetFPGATime(&status);
|
||||
uint64_t curTime = HAL_GetMonotonicTime();
|
||||
|
||||
if (ImGui::Button("Run")) {
|
||||
HALSIM_ResumeTiming();
|
||||
@@ -50,7 +49,7 @@ static void DisplayTiming() {
|
||||
}
|
||||
ImGui::PopButtonRepeat();
|
||||
ImGui::PushItemWidth(ImGui::GetFontSize() * 4);
|
||||
ImGui::LabelText("FPGA Time", "%.3f", curTime / 1000000.0);
|
||||
ImGui::LabelText("Time", "%.3f", curTime / 1000000.0);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
static std::vector<HALSIM_NotifierInfo> notifiers;
|
||||
|
||||
Reference in New Issue
Block a user