mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Rename TimedRobot constants to all caps
This commit is contained in:
@@ -93,7 +93,7 @@ public final class CommandScheduler implements Sendable, AutoCloseable {
|
||||
private final List<Optional<Command>> m_toCancelInterruptors = new ArrayList<>();
|
||||
private final Set<Command> m_endingCommands = new LinkedHashSet<>();
|
||||
|
||||
private final Watchdog m_watchdog = new Watchdog(TimedRobot.kDefaultPeriod, () -> {});
|
||||
private final Watchdog m_watchdog = new Watchdog(TimedRobot.DEFAULT_PERIOD, () -> {});
|
||||
|
||||
CommandScheduler() {
|
||||
HAL.reportUsage("CommandScheduler", "");
|
||||
|
||||
@@ -62,7 +62,7 @@ static bool ContainsKey(const TMap& map, TKey keyToCheck) {
|
||||
}
|
||||
|
||||
CommandScheduler::CommandScheduler()
|
||||
: m_impl(new Impl), m_watchdog(wpi::TimedRobot::kDefaultPeriod, [] {
|
||||
: m_impl(new Impl), m_watchdog(wpi::TimedRobot::DEFAULT_PERIOD, [] {
|
||||
std::puts("CommandScheduler loop time overrun.");
|
||||
}) {
|
||||
HAL_ReportUsage("CommandScheduler", "");
|
||||
|
||||
@@ -105,7 +105,7 @@ class CommandScheduler(Sendable):
|
||||
# self._toCancelInterruptors: List[Optional[Command]] = []
|
||||
self._endingCommands: Set[Command] = set()
|
||||
|
||||
self._watchdog = Watchdog(TimedRobot.kDefaultPeriod, lambda: None)
|
||||
self._watchdog = Watchdog(TimedRobot.DEFAULT_PERIOD, lambda: None)
|
||||
|
||||
hal.reportUsage("CommandScheduler", "")
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ seconds = float
|
||||
|
||||
|
||||
class TimedCommandRobot(TimedRobot):
|
||||
kSchedulerOffset = 0.005
|
||||
SCHEDULER_OFFSET = 0.005
|
||||
|
||||
def __init__(self, period: seconds = TimedRobot.kDefaultPeriod / 1000) -> None:
|
||||
def __init__(self, period: seconds = TimedRobot.DEFAULT_PERIOD / 1000) -> None:
|
||||
super().__init__(period)
|
||||
self.addPeriodic(
|
||||
CommandScheduler.getInstance().run, period, self.kSchedulerOffset
|
||||
CommandScheduler.getInstance().run, period, self.SCHEDULER_OFFSET
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user