From d6890e7912dae96563bf6eb6b5bbc258f8abfdd8 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 29 Apr 2016 20:35:52 +0200 Subject: [PATCH] Close serial port when connecting/disconnecting. --- usr/openmv-ide.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/openmv-ide.py b/usr/openmv-ide.py index e9fdf8565..618c70c0a 100755 --- a/usr/openmv-ide.py +++ b/usr/openmv-ide.py @@ -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())