mirror of
https://github.com/openocd-org/openocd.git
synced 2025-10-14 19:48:47 +08:00
jtag/drivers/cmsis_dap: fix build with cmsis_dap_tcp backend
For some hosts build fails after the recent cmsis_dap_tcp addition
(see commit fcff4b712c
("jtag/drivers/cmsis_dap: add new backend
cmsis_dap_tcp") or https://review.openocd.org/c/openocd/+/8973)
- Header 'hidapi.h' may not be available and should not be needed here.
- Global pointer variable is not guaranteed to be treated as a constant
expression even with const modifier. Use global array instead, to avoid
'error: initializer element is not constant', as address of a global
array is a constant expression.
Change-Id: I0c72ff52340f546a5f635663a8fde28c99176d1b
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9115
Tested-by: jenkins
Reviewed-by: Brian Kuschak <bkuschak@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:

committed by
Tomas Vanek

parent
c2cfeee471
commit
a6752a1671
@@ -20,7 +20,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <hidapi.h>
|
|
||||||
#ifdef HAVE_NETDB_H
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -90,7 +89,7 @@ struct cmsis_dap_backend_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *cmsis_dap_tcp_host;
|
static char *cmsis_dap_tcp_host;
|
||||||
static char *const cmsis_dap_tcp_port_default = STRINGIFY(CMSIS_DAP_TCP_PORT);
|
static char cmsis_dap_tcp_port_default[] = STRINGIFY(CMSIS_DAP_TCP_PORT);
|
||||||
static char *cmsis_dap_tcp_port = cmsis_dap_tcp_port_default;
|
static char *cmsis_dap_tcp_port = cmsis_dap_tcp_port_default;
|
||||||
static int cmsis_dap_tcp_min_timeout_ms = DEFAULT_MIN_TIMEOUT_MS;
|
static int cmsis_dap_tcp_min_timeout_ms = DEFAULT_MIN_TIMEOUT_MS;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user