aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth McMullin2013-08-19 12:26:05 +1200
committerGareth McMullin2013-08-19 12:26:05 +1200
commitfce43bcd98ee419720795f4c384f58e65896e0c8 (patch)
tree9e658330ace3b072f56b9377e6da4ca1b0af2680
parenta30ef31018c6e4ea4cba69755f2fcdd0dbc17baa (diff)
Fixed upgrade tool to build against current libusb-win32.
-rw-r--r--upgrade/bindata.S2
-rw-r--r--upgrade/dfu.c6
-rw-r--r--upgrade/main.c6
-rw-r--r--upgrade/stm32mem.c3
-rw-r--r--upgrade/stm32mem.h6
5 files changed, 18 insertions, 5 deletions
diff --git a/upgrade/bindata.S b/upgrade/bindata.S
index 1d94da5..585a670 100644
--- a/upgrade/bindata.S
+++ b/upgrade/bindata.S
@@ -24,5 +24,5 @@ _bindata:
.incbin "../src/blackmagic.bin"
_bindatalen:
- .word . - _bindata
+ .long (. - _bindata)
diff --git a/upgrade/dfu.c b/upgrade/dfu.c
index 2ab16ed..598780a 100644
--- a/upgrade/dfu.c
+++ b/upgrade/dfu.c
@@ -18,7 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <usb.h>
+#ifdef WIN32
+# include <lusb0_usb.h>
+#else
+# include <usb.h>
+#endif
#include "dfu.h"
diff --git a/upgrade/main.c b/upgrade/main.c
index dd92a2e..f029545 100644
--- a/upgrade/main.c
+++ b/upgrade/main.c
@@ -18,8 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
-#include <usb.h>
#include <string.h>
+#ifdef WIN32
+# include <lusb0_usb.h>
+#else
+# include <usb.h>
+#endif
#include <assert.h>
diff --git a/upgrade/stm32mem.c b/upgrade/stm32mem.c
index 4731edc..53bbb5b 100644
--- a/upgrade/stm32mem.c
+++ b/upgrade/stm32mem.c
@@ -17,13 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <usb.h>
#include <string.h>
#ifdef WIN32
# include <windows.h>
+# include <lusb0_usb.h>
#else
# include <unistd.h>
+# include <usb.h>
#endif
#include "dfu.h"
diff --git a/upgrade/stm32mem.h b/upgrade/stm32mem.h
index 34cdfb1..fd99c65 100644
--- a/upgrade/stm32mem.h
+++ b/upgrade/stm32mem.h
@@ -20,7 +20,11 @@
#ifndef __STM32MEM_H
#define __STM32MEM_H
-#include <usb.h>
+#ifdef WIN32
+# include <lusb0_usb.h>
+#else
+# include <usb.h>
+#endif
int stm32_mem_erase(usb_dev_handle *dev, uint16_t iface, uint32_t addr);
int stm32_mem_write(usb_dev_handle *dev, uint16_t iface, void *data, int size);