]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
fx2lafw: Insert SYNCDELAYs where necessary according to TRM
authorStefan Brüns <redacted>
Sun, 31 Dec 2017 06:51:53 +0000 (07:51 +0100)
committerUwe Hermann <redacted>
Wed, 17 Jan 2018 16:49:53 +0000 (17:49 +0100)
fx2lafw.c

index b99d77f4b559ef671510fec309e9f4b3721f6d2d..629e28c00d2dd3d13a256591016fe58a057eb456 100644 (file)
--- a/fx2lafw.c
+++ b/fx2lafw.c
@@ -104,7 +104,9 @@ static void send_fw_version(void)
 
        /* Send the message. */
        EP0BCH = 0;
+       SYNCDELAY();
        EP0BCL = sizeof(struct version_info);
+       SYNCDELAY();
 }
 
 static void send_revid_version(void)
@@ -117,7 +119,9 @@ static void send_revid_version(void)
 
        /* Send the message. */
        EP0BCH = 0;
+       SYNCDELAY();
        EP0BCL = 1;
+       SYNCDELAY();
 }
 
 BOOL handle_vendorcommand(BYTE cmd)
@@ -128,6 +132,7 @@ BOOL handle_vendorcommand(BYTE cmd)
                /* Tell hardware we are ready to receive data. */
                vendor_command = cmd;
                EP0BCL = 0;
+               SYNCDELAY();
                return TRUE;
        case CMD_GET_FW_VERSION:
                send_fw_version();