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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user