mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Set serial to None after disconnecting.
This commit is contained in:
parent
26fc0e7b4a
commit
162228562f
@ -51,9 +51,11 @@ def init(port, baudrate=921600, timeout=0.3):
|
|||||||
__serial = serial.Serial(port, baudrate=baudrate, timeout=timeout)
|
__serial = serial.Serial(port, baudrate=baudrate, timeout=timeout)
|
||||||
|
|
||||||
def disconnect():
|
def disconnect():
|
||||||
|
global __serial
|
||||||
try:
|
try:
|
||||||
if (__serial):
|
if (__serial):
|
||||||
__serial.close()
|
__serial.close()
|
||||||
|
__serial = None
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user