Skip to content

Commit 55c5e5d

Browse files
committed
use if rather than match for python 3.9
Signed-off-by: Mike Stitt <[email protected]>
1 parent 0adee5a commit 55c5e5d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

subprojects/robotpy-wpilib/wpilib/iterativerobotpy.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,23 @@ def _loopFunc(self) -> None:
403403
self._lastMode = self._mode
404404

405405
# Call the appropriate function depending upon the current robot mode
406+
if self._mode is IterativeRobotMode.kDisabled:
407+
observeUserProgramDisabled()
408+
self.disabledPeriodic()
409+
self.watchdog.addEpoch("disabledPeriodic()")
410+
elif self._mode is IterativeRobotMode.kAutonomous:
411+
observeUserProgramAutonomous()
412+
self.autonomousPeriodic()
413+
self.watchdog.addEpoch("autonomousPeriodic()")
414+
elif self._mode is IterativeRobotMode.kTeleop:
415+
observeUserProgramTeleop()
416+
self.teleopPeriodic()
417+
self.watchdog.addEpoch("teleopPeriodic()")
418+
elif self._mode is IterativeRobotMode.kTest:
419+
observeUserProgramTest()
420+
self.testPeriodic()
421+
self.watchdog.addEpoch("testPeriodic()")
422+
"""
406423
match self._mode:
407424
case IterativeRobotMode.kDisabled:
408425
observeUserProgramDisabled()
@@ -420,6 +437,7 @@ def _loopFunc(self) -> None:
420437
observeUserProgramTest()
421438
self.testPeriodic()
422439
self.watchdog.addEpoch("testPeriodic()")
440+
"""
423441

424442
self.robotPeriodic()
425443
self.watchdog.addEpoch("robotPeriodic()")

0 commit comments

Comments
 (0)