mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Close serial port when connecting/disconnecting.
This commit is contained in:
parent
6b581af1b1
commit
d6890e7912
@ -454,6 +454,7 @@ class OMVGtk:
|
||||
|
||||
def connect(self):
|
||||
connected = False
|
||||
openmv.disconnect()
|
||||
for i in range(10):
|
||||
try:
|
||||
# opens CDC port.
|
||||
@ -512,6 +513,7 @@ class OMVGtk:
|
||||
except:
|
||||
pass
|
||||
|
||||
openmv.disconnect()
|
||||
self.connected = False
|
||||
self._update_title()
|
||||
self.stop_button.set_sensitive(False)
|
||||
@ -524,6 +526,7 @@ class OMVGtk:
|
||||
def reset_clicked(self, widget):
|
||||
if (self.connected):
|
||||
openmv.reset()
|
||||
openmv.disconnect()
|
||||
|
||||
def execute_clicked(self, widget):
|
||||
buf = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user