File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 7
7
====================================================
8
8
"""
9
9
10
+ import time
11
+
10
12
try :
11
13
from typing import Optional , Type
12
14
from types import TracebackType
@@ -150,7 +152,7 @@ def write_then_readinto(
150
152
151
153
def __enter__ (self ) -> "I2CDevice" :
152
154
while not self .i2c .try_lock ():
153
- pass
155
+ time . sleep ( 0 )
154
156
return self
155
157
156
158
def __exit__ (
@@ -169,7 +171,7 @@ def __probe_for_device(self) -> None:
169
171
or that the device does not support these means of probing
170
172
"""
171
173
while not self .i2c .try_lock ():
172
- pass
174
+ time . sleep ( 0 )
173
175
try :
174
176
self .i2c .writeto (self .device_address , b"" )
175
177
except OSError :
Original file line number Diff line number Diff line change 9
9
====================================================
10
10
"""
11
11
12
+ import time
13
+
12
14
try :
13
15
from typing import Optional , Type
14
16
from types import TracebackType
@@ -89,7 +91,7 @@ def __init__(
89
91
90
92
def __enter__ (self ) -> SPI :
91
93
while not self .spi .try_lock ():
92
- pass
94
+ time . sleep ( 0 )
93
95
self .spi .configure (
94
96
baudrate = self .baudrate , polarity = self .polarity , phase = self .phase
95
97
)
You can’t perform that action at this time.
0 commit comments