if (p_ols_open(devc) != SR_OK) {
goto err_free_ftdic;
}
-
+
/* The discovery procedure is like this: first send the Reset
* command (0x00) 5 times, since the device could be anywhere
* in a 5-byte command. Then send the ID command (0x02).
(void)cg;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
switch (key) {
devc = sdi->priv;
- if (p_ols_open(devc) != SR_OK) {
- return SR_ERR;
- } else {
- sdi->status = SR_ST_ACTIVE;
- return SR_OK;
- }
+ return p_ols_open(devc);
}
static int dev_close(struct sr_dev_inst *sdi)
{
- int ret;
struct dev_context *devc;
- ret = SR_OK;
devc = sdi->priv;
- if (sdi->status == SR_ST_ACTIVE) {
- sr_dbg("Status ACTIVE, closing device.");
- ret = p_ols_close(devc);
- } else {
- sr_spew("Status not ACTIVE, nothing to do.");
- }
-
sdi->status = SR_ST_INACTIVE;
- return ret;
+ return p_ols_close(devc);
}
static int set_trigger(const struct sr_dev_inst *sdi, int stage)
int num_pols_changrp, samplespercount;
int ret, i;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
pols_channel_mask(sdi);
sr_dbg("flag_reg = %x", devc->flag_reg);
/*
- * In demux mode the OLS is processing two 8-bit or 16-bit samples
- * in parallel and for this to work the lower two bits of the four
+ * In demux mode the OLS is processing two 8-bit or 16-bit samples
+ * in parallel and for this to work the lower two bits of the four
* "channel_disable" bits must be replicated to the upper two bits.
*/
flag_tmp = devc->flag_reg;
devc = sdi->priv;
- sr_dbg("Stopping acquisition.");
write_shortcommand(devc, CMD_RESET);
write_shortcommand(devc, CMD_RESET);
write_shortcommand(devc, CMD_RESET);