Remove an outdated FIXME
[fw/stlink] / src / stlink-usb.c
index 4f8debc949528f178e295c8f8e15fe919f3ef3c9..979ba9731bbeb1eee93213a0a8f1d81a756be5fa 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <time.h>
 #include <sys/types.h>
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
 
 #include "stlink-common.h"
 #include "stlink-usb.h"
@@ -203,7 +203,7 @@ uint32_t _stlink_usb_read_debug32(stlink_t *sl, uint32_t addr) {
     size = send_recv(slu, 1, cmd, slu->cmd_len, rdata, rep_len);
     if (size == -1) {
         printf("[!] send_recv\n");
-        return;
+        return 0;
     }
     return read_uint32(rdata, 4);
 }
@@ -636,7 +636,6 @@ stlink_t* stlink_open_usb(const int verbose) {
     
     slu->usb_handle = libusb_open_device_with_vid_pid(slu->libusb_ctx, USB_ST_VID, USB_STLINK_32L_PID);
     if (slu->usb_handle == NULL) {
-               // TODO - free usb context too...
                WLOG("Couldn't find any ST-Link/V2 devices");
         goto on_error;
     }
@@ -701,8 +700,9 @@ stlink_t* stlink_open_usb(const int verbose) {
       stlink_enter_swd_mode(sl);
     }
 
-    stlink_version(sl);
+    stlink_reset(sl);
     stlink_load_device_params(sl);
+    stlink_version(sl);
 
     error = 0;