From: Uwe Hermann Date: Sun, 6 May 2012 17:47:04 +0000 (+0200) Subject: fx2lafw: Support for querying REVID. X-Git-Tag: sigrok-firmware-fx2lafw-0.1.0~27 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c23ad6029b1a4262fa5ad07e962f693cd7cbea06;p=sigrok-firmware-fx2lafw.git fx2lafw: Support for querying REVID. --- diff --git a/fx2lafw.c b/fx2lafw.c index f0590b3f..ef28431f 100644 --- 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; diff --git a/include/command.h b/include/command.h index 11a0f856..584b1ecd 100644 --- a/include/command.h +++ b/include/command.h @@ -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