We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0b6832 commit e7f605dCopy full SHA for e7f605d
micropython/bluetooth/aioble/aioble/device.py
@@ -164,7 +164,7 @@ def __init__(self, device):
164
165
# This event is fired by the IRQ both for connection and disconnection
166
# and controls the device_task.
167
- self._event = None
+ self._event = asyncio.ThreadSafeFlag()
168
169
# If we're waiting for a pending MTU exchange.
170
self._mtu_event = None
@@ -207,9 +207,6 @@ async def device_task(self):
207
t._task.cancel()
208
209
def _run_task(self):
210
- # Event will be already created this if we initiated connection.
211
- self._event = self._event or asyncio.ThreadSafeFlag()
212
-
213
self._task = asyncio.create_task(self.device_task())
214
215
async def disconnect(self, timeout_ms=2000):
0 commit comments