]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
fx2lafw: Support for querying REVID.
authorUwe Hermann <redacted>
Sun, 6 May 2012 17:47:04 +0000 (19:47 +0200)
committerUwe Hermann <redacted>
Sun, 6 May 2012 17:47:04 +0000 (19:47 +0200)
fx2lafw.c
include/command.h

index f0590b3fdc0ca4417b936d2f1b26707646207a1c..ef28431f13c6dff1dab1008fa82a1f32ff5c261e 100644 (file)
--- a/fx2lafw.c
+++ b/fx2lafw.c
@@ -107,6 +107,19 @@ static void send_fw_version(void)
        EP0BCL = sizeof(struct version_info);
 }
 
+static void send_revid_version(void)
+{
+       uint8_t *p;
+
+       /* Populate the buffer. */
+       p = (uint8_t *)EP0BUF;
+       *p = REVID;
+
+       /* Send the message. */
+       EP0BCH = 0;
+       EP0BCL = 1;
+}
+
 BOOL handle_vendorcommand(BYTE cmd)
 {
        /* Protocol implementation */
@@ -120,6 +133,10 @@ BOOL handle_vendorcommand(BYTE cmd)
                send_fw_version();
                return TRUE;
                break;
+       case CMD_GET_REVID_VERSION:
+               send_revid_version();
+               return TRUE;
+               break;
        }
 
        return FALSE;
index 11a0f856370446fb1c15552d2b985096b0bfa556..584b1ecd91295de6d03736a12bc4cd24f18b3e50 100644 (file)
@@ -23,6 +23,7 @@
 /* Protocol commands */
 #define CMD_GET_FW_VERSION             0xb0
 #define CMD_START                      0xb1
+#define CMD_GET_REVID_VERSION          0xb2
 
 #define CMD_START_FLAGS_CLK_SRC_POS    6