Minor changes to allow a build for Windows hosts with libftdi.
This commit is contained in:
parent
c9ea16312b
commit
be91386c0a
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <alloca.h>
|
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <alloca.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <alloca.h>
|
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "gdb_if.h"
|
#include "gdb_if.h"
|
||||||
#include "gdb_packet.h"
|
#include "gdb_packet.h"
|
||||||
|
@ -28,8 +28,6 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <alloca.h>
|
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "jtagtap.h"
|
#include "jtagtap.h"
|
||||||
#include "jtag_scan.h"
|
#include "jtag_scan.h"
|
||||||
|
@ -1 +1 @@
|
|||||||
LDFLAGS += -lftdi
|
LDFLAGS += -lftdi -lusb
|
||||||
|
@ -23,10 +23,15 @@
|
|||||||
* uses a TCP server on port 2000.
|
* uses a TCP server on port 2000.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
#include <sys/select.h>
|
#ifndef WIN32
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# include <netinet/in.h>
|
||||||
|
# include <sys/select.h>
|
||||||
|
#else
|
||||||
|
# include <windows.h>
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -37,6 +42,10 @@ static int gdb_if_serv, gdb_if_conn;
|
|||||||
|
|
||||||
int gdb_if_init(void)
|
int gdb_if_init(void)
|
||||||
{
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
WSADATA wsaData;
|
||||||
|
WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||||
|
#endif
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
|
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <alloca.h>
|
|
||||||
|
|
||||||
#include <ftdi.h>
|
#include <ftdi.h>
|
||||||
|
|
||||||
|
@ -107,3 +107,17 @@ int platform_buffer_read(uint8_t *data, int size)
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#warning "This vasprintf() is dubious!"
|
||||||
|
int vasprintf(char **strp, const char *fmt, va_list ap)
|
||||||
|
{
|
||||||
|
int size = 128, ret = 0;
|
||||||
|
|
||||||
|
*strp = malloc(size);
|
||||||
|
while(*strp && ((ret = vsnprintf(*strp, size, fmt, ap)) == size))
|
||||||
|
*strp = realloc(*strp, size <<= 1);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@ -24,6 +24,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ftdi.h>
|
#include <ftdi.h>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
# include <alloca.h>
|
||||||
|
#else
|
||||||
|
# define alloca __builtin_alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FT2232_VID 0x0403
|
#define FT2232_VID 0x0403
|
||||||
#define FT2232_PID 0x6010
|
#define FT2232_PID 0x6010
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/gpio.h>
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
#include <alloca.h>
|
||||||
|
|
||||||
#include "gdb_packet.h"
|
#include "gdb_packet.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user