From: Wolfram Sang Date: Wed, 2 Jan 2019 12:15:24 +0000 (+0100) Subject: pipistrello: rename registers to match actual function X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=ec26d9e1dfd416ed4735a1c57e11060b12bf16b8;p=libsigrok.git pipistrello: rename registers to match actual function Magnus (creator of the Pipistrello) confirmed that he mixed up the register names. The code was doing it correctly nonetheless but was confusing to read because of this. Fix it to make it easier to comprehend. Signed-off-by: Wolfram Sang --- diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index a7b43c4c..8f982966 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -557,13 +557,13 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) arg[1] = ((readcount - 1) & 0xff00) >> 8; arg[2] = ((readcount - 1) & 0xff0000) >> 16; arg[3] = ((readcount - 1) & 0xff000000) >> 24; - if (write_longcommand(devc, CMD_CAPTURE_DELAY, arg) != SR_OK) + if (write_longcommand(devc, CMD_CAPTURE_READCOUNT, arg) != SR_OK) return SR_ERR; arg[0] = ((delaycount - 1) & 0xff); arg[1] = ((delaycount - 1) & 0xff00) >> 8; arg[2] = ((delaycount - 1) & 0xff0000) >> 16; arg[3] = ((delaycount - 1) & 0xff000000) >> 24; - if (write_longcommand(devc, CMD_CAPTURE_COUNT, arg) != SR_OK) + if (write_longcommand(devc, CMD_CAPTURE_DELAYCOUNT, arg) != SR_OK) return SR_ERR; /* Flag register. */ diff --git a/src/hardware/pipistrello-ols/protocol.h b/src/hardware/pipistrello-ols/protocol.h index 1ac0d06d..2f024907 100644 --- a/src/hardware/pipistrello-ols/protocol.h +++ b/src/hardware/pipistrello-ols/protocol.h @@ -49,8 +49,8 @@ #define CMD_METADATA 0x04 #define CMD_SET_DIVIDER 0x80 #define CMD_SET_FLAGS 0x82 -#define CMD_CAPTURE_COUNT 0x83 -#define CMD_CAPTURE_DELAY 0x84 +#define CMD_CAPTURE_DELAYCOUNT 0x83 +#define CMD_CAPTURE_READCOUNT 0x84 #define CMD_SET_TRIGGER_MASK 0xc0 #define CMD_SET_TRIGGER_VALUE 0xc1 #define CMD_SET_TRIGGER_CONFIG 0xc2