55
66from wpilib .iterativerobotpy import IterativeRobotPy
77
8- _getFPGATime = RobotController .getFPGATime ()
8+ _getFPGATime = RobotController .getFPGATime
99_kResourceType_Framework = tResourceType .kResourceType_Framework
1010_kFramework_Timed = tInstances .kFramework_Timed
1111
1212class _Callback :
1313 def __init__ (self , func , periodUs : int , expirationUs : int ):
1414 self .func = func
1515 self ._periodUs = periodUs
16- self ._expirationUs = expirationUs
16+ self .expirationUs = expirationUs
1717
1818 @classmethod
1919 def makeCallBack (cls ,
@@ -29,7 +29,7 @@ def makeCallBack(cls,
2929 )
3030
3131 currentTimeUs = _getFPGATime ()
32- callback ._expirationUs = offsetUs + callback .calcFutureExpirationUs (currentTimeUs )
32+ callback .expirationUs = offsetUs + callback .calcFutureExpirationUs (currentTimeUs )
3333 return callback
3434
3535 def calcFutureExpirationUs (self , currentTimeUs : int ) -> int :
@@ -39,14 +39,14 @@ def calcFutureExpirationUs(self, currentTimeUs: int) -> int:
3939 # callback wouldn't be running otherwise.
4040 # todo does this math work?
4141 # todo does the "// periodUs * periodUs" do the correct integer math?
42- return self ._expirationUs + self ._periodUs + \
43- ((currentTimeUs - self ._expirationUs ) // self ._periodUs ) * self ._periodUs
42+ return self .expirationUs + self ._periodUs + \
43+ ((currentTimeUs - self .expirationUs ) // self ._periodUs ) * self ._periodUs
4444
4545 def setNextStartTimeUs (self , currentTimeUs : int ):
46- self ._expirationUs = self .calcFutureExpirationUs (currentTimeUs )
46+ self .expirationUs = self .calcFutureExpirationUs (currentTimeUs )
4747
4848 def __lt__ (self , other ):
49- return self ._expirationUs < other ._expirationUs
49+ return self .expirationUs < other .expirationUs
5050
5151 def __bool__ (self ):
5252 return True
0 commit comments