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)
|
||||
|
||||
def disconnect():
|
||||
global __serial
|
||||
try:
|
||||
if (__serial):
|
||||
__serial.close()
|
||||
__serial = None
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user