X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fjtag%2Fpresto.c;h=154e3e1758df1048df362e5ce96fb2a60bc1874b;hb=4a29f8e21d4932ddf6523ccf23463d8636ad05a9;hp=67b89988a1f74ec0a143cdb3b6b649090d4d3f5e;hpb=c97caebccd07be7e5bae61d6d40921e01786ba06;p=openocd.git diff --git a/src/jtag/presto.c b/src/jtag/presto.c index 67b89988a1..154e3e1758 100644 --- a/src/jtag/presto.c +++ b/src/jtag/presto.c @@ -46,7 +46,7 @@ static int presto_jtag_register_commands(struct command_context_s *cmd_ctx); static int presto_jtag_init(void); static int presto_jtag_quit(void); -jtag_interface_t presto_interface = +struct jtag_interface presto_interface = { .name = "presto", .execute_queue = bitq_execute_queue, @@ -65,7 +65,7 @@ static int presto_bitq_reset(int trst, int srst); static int presto_bitq_in_rdy(void); static int presto_bitq_in(void); -static bitq_interface_t presto_bitq = +static struct bitq_interface presto_bitq = { .out = presto_bitq_out, .flush = presto_bitq_flush, @@ -86,8 +86,7 @@ static bitq_interface_t presto_bitq = #define BUFFER_SIZE (64*62) -typedef struct presto_s -{ +struct presto { #if BUILD_PRESTO_FTD2XX == 1 FT_HANDLE handle; FT_STATUS status; @@ -117,11 +116,10 @@ typedef struct presto_s int jtag_tdi_count; int jtag_speed; +}; -} presto_t; - -static presto_t presto_state; -static presto_t *presto = &presto_state; +static struct presto presto_state; +static struct presto *presto = &presto_state; static uint8_t presto_init_seq[] = { @@ -239,7 +237,7 @@ static int presto_open_ftd2xx(char *req_serial) LOG_DEBUG("FT_Open failed: %i", (int)presto->status); continue; } - LOG_DEBUG("FTDI device %i open", i); + LOG_DEBUG("FTDI device %i open", (int)i); if ((presto->status = FT_GetDeviceInfo(presto->handle, &device, &vidpid, presto->serial, devname, NULL)) == FT_OK) @@ -251,7 +249,7 @@ static int presto_open_ftd2xx(char *req_serial) else LOG_DEBUG("FT_GetDeviceInfo failed: %lu", presto->status); - LOG_DEBUG("FTDI device %i does not match, closing", i); + LOG_DEBUG("FTDI device %i does not match, closing", (int)i); FT_Close(presto->handle); presto->handle = (FT_HANDLE)INVALID_HANDLE_VALUE; } @@ -752,7 +750,7 @@ static int presto_jtag_speed(int speed) static char *presto_serial; -static int presto_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(presto_handle_serial_command) { if (argc == 1) {