[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:
Peter Johnson
2026-03-15 15:08:41 -07:00
committed by GitHub
parent 1a5b023235
commit e944ae9aca
59 changed files with 233 additions and 358 deletions

View File

@@ -30,7 +30,7 @@ class DriveTime(commands2.Command):
def initialize(self) -> None:
"""Called when the command is initially scheduled."""
self.startTime = wpilib.Timer.getFPGATimestamp()
self.startTime = wpilib.Timer.getTimestamp()
self.drive.arcadeDrive(0, 0)
def execute(self) -> None:
@@ -43,4 +43,4 @@ class DriveTime(commands2.Command):
def isFinished(self) -> bool:
"""Returns true when the command should end"""
return wpilib.Timer.getFPGATimestamp() - self.startTime >= self.duration
return wpilib.Timer.getTimestamp() - self.startTime >= self.duration

View File

@@ -32,7 +32,7 @@ class TurnTime(commands2.Command):
def initialize(self) -> None:
"""Called when the command is initially scheduled."""
self.startTime = wpilib.Timer.getFPGATimestamp()
self.startTime = wpilib.Timer.getTimestamp()
self.drive.arcadeDrive(0, 0)
def execute(self) -> None:
@@ -45,4 +45,4 @@ class TurnTime(commands2.Command):
def isFinished(self) -> bool:
"""Returns true when the command should end"""
return wpilib.Timer.getFPGATimestamp() - self.startTime >= self.duration
return wpilib.Timer.getTimestamp() - self.startTime >= self.duration

View File

@@ -30,7 +30,7 @@ class DriveTime(commands2.Command):
def initialize(self) -> None:
"""Called when the command is initially scheduled."""
self.startTime = wpilib.Timer.getFPGATimestamp()
self.startTime = wpilib.Timer.getTimestamp()
self.drive.arcadeDrive(0, 0)
def execute(self) -> None:
@@ -43,4 +43,4 @@ class DriveTime(commands2.Command):
def isFinished(self) -> bool:
"""Returns true when the command should end"""
return wpilib.Timer.getFPGATimestamp() - self.startTime >= self.duration
return wpilib.Timer.getTimestamp() - self.startTime >= self.duration

View File

@@ -32,7 +32,7 @@ class TurnTime(commands2.Command):
def initialize(self) -> None:
"""Called when the command is initially scheduled."""
self.startTime = wpilib.Timer.getFPGATimestamp()
self.startTime = wpilib.Timer.getTimestamp()
self.drive.arcadeDrive(0, 0)
def execute(self) -> None:
@@ -45,4 +45,4 @@ class TurnTime(commands2.Command):
def isFinished(self) -> bool:
"""Returns true when the command should end"""
return wpilib.Timer.getFPGATimestamp() - self.startTime >= self.duration
return wpilib.Timer.getTimestamp() - self.startTime >= self.duration