File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 77====================================================
88"""
99
10+ import time
11+
1012try :
1113 from typing import Optional , Type
1214 from types import TracebackType
@@ -150,7 +152,7 @@ def write_then_readinto(
150152
151153 def __enter__ (self ) -> "I2CDevice" :
152154 while not self .i2c .try_lock ():
153- pass
155+ time . sleep ( 0 )
154156 return self
155157
156158 def __exit__ (
@@ -169,7 +171,7 @@ def __probe_for_device(self) -> None:
169171 or that the device does not support these means of probing
170172 """
171173 while not self .i2c .try_lock ():
172- pass
174+ time . sleep ( 0 )
173175 try :
174176 self .i2c .writeto (self .device_address , b"" )
175177 except OSError :
Original file line number Diff line number Diff line change 99====================================================
1010"""
1111
12+ import time
13+
1214try :
1315 from typing import Optional , Type
1416 from types import TracebackType
@@ -89,7 +91,7 @@ def __init__(
8991
9092 def __enter__ (self ) -> SPI :
9193 while not self .spi .try_lock ():
92- pass
94+ time . sleep ( 0 )
9395 self .spi .configure (
9496 baudrate = self .baudrate , polarity = self .polarity , phase = self .phase
9597 )
You can’t perform that action at this time.
0 commit comments