Skip to content

Commit dbd6b40

Browse files
zeldinzougloub
authored andcommitted
fx2lafw: Allow higher speeds for FX3
1 parent c4eb607 commit dbd6b40

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/hardware/fx2lafw/api.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,14 @@ static const uint64_t samplerates[] = {
164164
SR_MHZ(8),
165165
SR_MHZ(12),
166166
SR_MHZ(16),
167-
SR_MHZ(32),
168167
SR_MHZ(24),
168+
/* FX3 only rates below here */
169+
SR_MHZ(32),
170+
SR_MHZ(48),
171+
SR_MHZ(64),
172+
SR_MHZ(96),
173+
SR_MHZ(192),
174+
#define NUM_FX3_RATES 5
169175
};
170176

171177
static gboolean is_plausible(const struct libusb_device_descriptor *des)
@@ -345,6 +351,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
345351

346352
devc->samplerates = samplerates;
347353
devc->num_samplerates = ARRAY_SIZE(samplerates);
354+
if (!(prof->dev_caps & DEV_CAPS_FX3))
355+
devc->num_samplerates -= NUM_FX3_RATES;
348356
has_firmware = usb_match_manuf_prod(devlist[i],
349357
"sigrok", "fx2lafw");
350358

src/hardware/fx2lafw/protocol.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ static int command_start_acquisition(const struct sr_dev_inst *sdi)
123123
(cmd.flags & CMD_START_FLAGS_CLK_192MHZ? "192" :
124124
(cmd.flags & CMD_START_FLAGS_CLK_48MHZ) ? "48" : "30"));
125125

126-
if (delay < 0 || delay > MAX_SAMPLE_DELAY) {
126+
if (delay == 0 && samplerate == SR_MHZ(192) &&
127+
(cmd.flags & CMD_START_FLAGS_CLK_192MHZ)) {
128+
/* Delay == 0 is ok in this case... */
129+
}
130+
else if (delay < 0 || delay > MAX_SAMPLE_DELAY) {
127131
sr_err("Unable to sample at %" PRIu64 "Hz.", samplerate);
128132
return SR_ERR;
129133
}

0 commit comments

Comments
 (0)