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):
|
def connect(self):
|
||||||
connected = False
|
connected = False
|
||||||
|
openmv.disconnect()
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
try:
|
try:
|
||||||
# opens CDC port.
|
# opens CDC port.
|
||||||
@ -512,6 +513,7 @@ class OMVGtk:
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
openmv.disconnect()
|
||||||
self.connected = False
|
self.connected = False
|
||||||
self._update_title()
|
self._update_title()
|
||||||
self.stop_button.set_sensitive(False)
|
self.stop_button.set_sensitive(False)
|
||||||
@ -524,6 +526,7 @@ class OMVGtk:
|
|||||||
def reset_clicked(self, widget):
|
def reset_clicked(self, widget):
|
||||||
if (self.connected):
|
if (self.connected):
|
||||||
openmv.reset()
|
openmv.reset()
|
||||||
|
openmv.disconnect()
|
||||||
|
|
||||||
def execute_clicked(self, widget):
|
def execute_clicked(self, widget):
|
||||||
buf = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter())
|
buf = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user