Skip to content

Commit 1edc579

Browse files
committed
NotifierDelay doesn't exit for 1 second, use PreciseDelay instead
- Temporary fix for now
1 parent c3b8de0 commit 1edc579

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

robotpy_ext/misc/precise_delay.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def _wait_unit_tests(self):
7777
# - TODO: should we just always use this in simulated mode?
7878

7979
wpilib.Timer.delay(self.delay_period)
80+
81+
def __enter__(self) -> 'PreciseDelay':
82+
return self
83+
84+
def __exit__(self, exc_type, exc_val, exc_tb):
85+
pass
8086

8187

8288
class NotifierDelay:
@@ -136,3 +142,6 @@ def wait(self) -> None:
136142

137143
def _update_alarm(self) -> None:
138144
hal.updateNotifierAlarm(self._notifier, self._expiry_time)
145+
146+
# HACK: NotifierDelay is broken, use PreciseDelay for the moment
147+
NotifierDelay = PreciseDelay

0 commit comments

Comments
 (0)