jtag/mpsse: mpsse_flush should not treat LIBUSB_ERROR_INTERRUPTED as an error
[openocd.git] / src / jtag / drivers / ft232r.c
index e5d80559d16d8df2cad1eab7a7de1a54af483295..2d9d9ef34d029843b3b66db73749d9b194c0980d 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
+// SPDX-License-Identifier: GPL-2.0-or-later
 
 /***************************************************************************
  *   Copyright (C) 2010 Serge Vakulenko                                    *
@@ -235,7 +235,7 @@ static int ft232r_speed(int divisor)
 
        if (jtag_libusb_control_transfer(adapter,
                LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
-               SIO_SET_BAUD_RATE, divisor, 0, 0, 0, 1000) != 0) {
+               SIO_SET_BAUD_RATE, divisor, 0, NULL, 0, 1000, NULL) != ERROR_OK) {
                LOG_ERROR("cannot set baud rate");
                return ERROR_JTAG_DEVICE_ERROR;
        }
@@ -246,7 +246,7 @@ static int ft232r_init(void)
 {
        uint16_t avids[] = {ft232r_vid, 0};
        uint16_t apids[] = {ft232r_pid, 0};
-       if (jtag_libusb_open(avids, apids, &adapter, NULL)) {
+       if (jtag_libusb_open(avids, apids, NULL, &adapter, NULL)) {
                const char *ft232r_serial_desc = adapter_get_required_serial();
                LOG_ERROR("ft232r not found: vid=%04x, pid=%04x, serial=%s\n",
                        ft232r_vid, ft232r_pid, (!ft232r_serial_desc) ? "[any]" : ft232r_serial_desc);
@@ -266,7 +266,7 @@ static int ft232r_init(void)
        /* Reset the device. */
        if (jtag_libusb_control_transfer(adapter,
                LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
-               SIO_RESET, 0, 0, 0, 0, 1000) != 0) {
+               SIO_RESET, 0, 0, NULL, 0, 1000, NULL) != ERROR_OK) {
                LOG_ERROR("unable to reset device");
                return ERROR_JTAG_INIT_FAILED;
        }
@@ -275,7 +275,7 @@ static int ft232r_init(void)
        if (jtag_libusb_control_transfer(adapter,
                LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
                SIO_SET_BITMODE, (1<<tck_gpio) | (1<<tdi_gpio) | (1<<tms_gpio) | (1<<ntrst_gpio) | (1<<nsysrst_gpio) | 0x400,
-               0, 0, 0, 1000) != 0) {
+               0, NULL, 0, 1000, NULL) != ERROR_OK) {
                LOG_ERROR("cannot set sync bitbang mode");
                return ERROR_JTAG_INIT_FAILED;
        }
@@ -288,13 +288,13 @@ static int ft232r_init(void)
        if (jtag_libusb_control_transfer(adapter,
                LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
                SIO_SET_BAUD_RATE, divisor,
-               0, 0, 0, 1000) != 0) {
+               0, NULL, 0, 1000, NULL) != ERROR_OK) {
                LOG_ERROR("cannot set baud rate");
                return ERROR_JTAG_INIT_FAILED;
        }
        if (jtag_libusb_control_transfer(adapter,
                LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
-               SIO_SET_LATENCY_TIMER, latency_timer, 0, 0, 0, 1000) != 0) {
+               SIO_SET_LATENCY_TIMER, latency_timer, 0, NULL, 0, 1000, NULL) != ERROR_OK) {
                LOG_ERROR("unable to set latency timer");
                return ERROR_JTAG_INIT_FAILED;
        }
@@ -315,7 +315,7 @@ static int ft232r_quit(void)
                if (jtag_libusb_control_transfer(adapter,
                        LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
                        SIO_SET_BITMODE, ft232r_restore_bitmode,
-                       0, 0, 0, 1000) != 0) {
+                       0, NULL, 0, 1000, NULL) != ERROR_OK) {
                        LOG_ERROR("cannot set bitmode to restore serial port");
                }
        }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)