fix stlinkv2.py (for Windows)
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 Jul 2012 04:55:21 +0000 (13:55 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 Jul 2012 04:55:21 +0000 (13:55 +0900)
ChangeLog
tool/stlinkv2.py

index 7764e85..d9710d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-07-02  Niibe Yutaka  <gniibe@fsij.org>
+
+       * tool/stlinkv2.py (stlinkv2.__init__): Don't call setAltInterface.
+
 2012-06-30  Niibe Yutaka  <gniibe@fsij.org>
 
        * src/openpgp.c (s2k): New.
index 6ec6cd8..32e2f4c 100755 (executable)
@@ -144,7 +144,10 @@ class stlinkv2(object):
         except:
             pass
         self.__devhandle.claimInterface(intf)
-        self.__devhandle.setAltInterface(intf)
+        # self.__devhandle.setAltInterface(intf)  # This is not good for libusb-win32
+
+    def shutdown(self):
+        self.__devhandle.releaseInterface()
 
     def execute_get(self, cmd, res_len):
         self.__devhandle.bulkWrite(self.__bulkout, cmd, self.__timeout)
@@ -548,6 +551,7 @@ def main(show_help, erase_only, no_protect, reset_after_successful_write,
     else:
         stl.finish_gpio()
 
+    stl.shutdown()
     return 0
 
 if __name__ == '__main__':